{"openapi":"3.1.0","info":{"title":"PropZolo API","version":"1.0.0","description":"REST API of the PropZolo workspace — used by the web app, the Android app and integrations (API keys).\n\n- **Envelope**: success `{ data, meta }`; failure `{ error: { code, message, fields?, request_id } }`.\n- **Money** is integer paise (₹1 = 100); instants are ISO 8601 UTC — convert to the company time zone for display.\n- **Lists** are keyset-paginated: pass `meta.next_cursor` back as `cursor` while `meta.has_more` is true. `sort` takes\n  allow-listed keys (`-received_at`), `filter` the filter DSL as JSON or base64url(JSON).\n- **Retries**: send an `Idempotency-Key` on writes that document it; a retry replays the first response.\n- **Tracing**: every response carries `X-Request-Id` (send your own to correlate)."},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","servers":[{"url":"https://app.propzolo.com"}],"tags":[{"name":"AI","description":"Copilot drafts and summaries, explain-this-lead, lead score, requirement proposals, listing copy, plain-words search and the inventory inbox — validated, metered on the AI wallet and audited."},{"name":"AI agents","description":"The WhatsApp AI agent: settings, the per-number switch off → shadow → live behind the agent check, approved facts, KPIs, inbox drafts and hand-offs."},{"name":"AI assistants","description":"Claude, ChatGPT and other assistants through MCP: consent, connections, drafts waiting for approval, the call log and the company policy with its kill switch."},{"name":"AI voice agent","description":"Calls from declared A2P numbers in Hindi, English or Hinglish (N-01): new-enquiry callbacks within 60 s, missed calls, visit confirmations and feedback, grounded on the lead and inventory, with live transfer to a member; settings, the live / recent monitor and transcripts."},{"name":"Account","description":"The signed-in person: profile, email and phone changes, password, two-step verification and sessions."},{"name":"Accountability","description":"Follow-up discipline scores (0–100) per member with explained components, trends, the team ranking and the optional rotation eligibility."},{"name":"Ad conversions","description":"Qualified leads, site visits and bookings of ad leads sent back to Meta and Google Ads: settings, test events, the delivery log and objections."},{"name":"Approvals","description":"Human approvals: workflow steps and approval chains of guarded actions (exports, deletes, discounts, rent below the floor, brokerage, stage gates) — levels, holds, bulk decisions, signed links, WhatsApp, the policies."},{"name":"Assignment","description":"Lead routing: rules and their simulator, routing profiles, the assignment log, pools, SLA, staff exit."},{"name":"Attendance","description":"Punch in / out with geofence and selfie (offline-safe, tamper signals), breaks, live location on duty with consent, the team view, corrections, the attendance register and field report, settings and sites."},{"name":"Automation tools","description":"Zapier, Make and Pabbly: REST-hook subscriptions and polling triggers for API keys."},{"name":"Automations","description":"Workflows (trigger → conditions → actions, delays, waits, goals), versions, dry runs, run logs and recipes."},{"name":"Bank reconciliation","description":"Bank statements (CSV / Excel, per bank) matched to rent UTR claims, deal receipts and booking payments by UTR, amount and date (N-10): clear matches confirmed by rule, near ones reviewed; never applied twice."},{"name":"Billing","description":"The PropZolo subscription (plans, seats, checkout, proration), GST invoices, prepaid wallets, the onboarding checklist and support-access grants."},{"name":"Bookings"},{"name":"Broker network","description":"The co-broking network (N-03): the network profile with RERA / KYC badges and trust signals, the directory, circles, masked shares of listings and requirements with availability checks, matches, co-broke deals with frozen split terms, deal rooms and client registration locks."},{"name":"Calendar sync","description":"Members’ own Google / Microsoft 365 calendars: PropZolo’s calendar with visits and meetings, free/busy blocks for the visit scheduler (times only), and disconnect."},{"name":"Call insights","description":"Call intelligence: summary, outcome and hot signal, objections with quotes, promised call-backs proposed as tasks, requirement fields proposed for review, QA scorecards on the company rubric, overrides, trends and the coaching queue."},{"name":"Call list","description":"Who to call today: the ranked list with reasons (call now, later today, done), skips and snoozes, a manager’s view of a member’s list, and the list’s settings."},{"name":"Calling queue","description":"Who to call next — the Autopilot dial brain with calling hours, cool-downs and caps."},{"name":"Calls","description":"The call log, call cards, outcomes, analytics, agent phones, daily targets and call-tracking settings."},{"name":"Campaign spend","description":"Spend entries per campaign and source per period, behind cost per lead / visit / deal and source ROI."},{"name":"Campaigns","description":"Follow-up plans (steps, business-day delays, enrolments, pause rules, step analytics) and broadcasts (audience snapshot, approval, throttled sending, stats)."},{"name":"Channel partners"},{"name":"Channel-partner brokerage"},{"name":"Collections","description":"Builder collections on bookings: construction stages, demand letters and reminders, receipts with 194-IA TDS, late interest, ledger, ageing, cancellation, refunds and transfers."},{"name":"Commissions","description":"Commission payouts to members and co-brokers (records; TDS and invoices in Phase 2)."},{"name":"Company","description":"Company profile, RERA & GST, branding, business hours & holidays and the security policy."},{"name":"Consent","description":"Consent ledger (DPDP / TRAI): grants, withdrawals, the contact consent panel and the suppression list."},{"name":"Contacts","description":"People behind leads, listings and deals — one per phone number; numbers masked with an audited reveal."},{"name":"Custom fields","description":"Extra fields of leads, contacts and listings: types, choices, required, per-role visibility."},{"name":"Customer portal","description":"The buyer / owner / tenant portal (OTP sign-in for contacts): the construction updates members publish for buyers and the referrals portal users send."},{"name":"Dashboard","description":"The adaptive dashboard: your day, KPI tiles with deltas, the pipeline and the live team board."},{"name":"Data & privacy","description":"DPDP: versioned privacy notices, rights requests with the 90-day clock (access reports, corrections, erasure), retention policies and legal holds, the audit log and the full company export."},{"name":"Deals","description":"Resale, new-booking and rental deals: stages, parties, values, documents, commission terms and splits."},{"name":"Email sync","description":"Members’ own Gmail and Outlook mailboxes (opt-in, read-only): emails with known contacts on the timelines, the company policy, private emails and the email viewer."},{"name":"Exports","description":"Lead exports with permission, row caps, watermark and an export log."},{"name":"Finance"},{"name":"Follow-up agent","description":"Goal-based follow-up on a lead (book a visit, collect documents, get a decision, revive): AI drafts each touch within the company’s rules, the owner approves, edits or rejects it (autopilot only where allowed), every send goes through the messaging gates and a reply, an opt-out or the goal being met hands the lead back."},{"name":"Forms","description":"Hosted and embeddable enquiry forms: fields, versioned consent, phone OTP, spam protection, embedding."},{"name":"Help","description":"Help articles for the in-app help sheet, “Was this helpful?” votes and the first-run tips you closed."},{"name":"Imports","description":"CSV / Excel imports of leads, contacts, listings, deals, notes and tasks: templates, dry run, rollback."},{"name":"Integrations","description":"Connector catalogue, connections and their health, Meta Lead Ads and Google Ads lead forms."},{"name":"Integrity","description":"Integrity alerts for managers (never shown to the agent concerned): review, dismiss, reopen."},{"name":"Inventory inbox","description":"WhatsApp-group inventory (I-06): chat-export uploads, pastes and shares, the review queue of listings and requirements clustered across groups (freshness, demand, price history), decisions and read-only group capture."},{"name":"Landing pages","description":"Project, listing and campaign pages from template blocks, with the RERA publish rules and SEO."},{"name":"Launch mode","description":"Project launches: EOIs with unit preferences, a verifiable commit-reveal draw, automatic or live allotment (B-01 holds for the booking desk), the launch-day queue and dynamic pricing rules that draft the next price list."},{"name":"Lead Push API","description":"Public per-source URL to push leads as JSON, form posts, XML or a GET query string."},{"name":"Lead sources","description":"Sources with cost, defaults, ingestion endpoints, health, logs with replay and the ingestion dashboard."},{"name":"Leads","description":"Leads with requirement, owners, the status sheet, duplicate check, merge and bulk actions."},{"name":"Linked WhatsApp","description":"Unofficial, opt-in: agents link their own WhatsApp by QR for 1:1 chats and replies they type — risk acceptances, company switch, devices."},{"name":"Listing freshness","description":"Owner “still available?” pings with a tracked link, stale listings, price-revision nudges and their settings."},{"name":"Listing verification","description":"The Verified badge: an agent’s visit with geotagged photos near the listing plus an ownership-document check, reviewed by someone else; expiry, invalidation and revocation."},{"name":"Loan desk","description":"Home-loan cases of leads and deals: eligibility (FOIR, EMI, RBI LTV slabs), the document checklist, hand-off to a lender with a document-pack link, sanction and disbursal tranches, lenders, DSAs and the commission ledger."},{"name":"Login devices","description":"Device binding and login approvals: sign-in rules (approvals for new devices, device limits), members’ devices and the approvals inbox for managers and admins."},{"name":"Marketing studio","description":"AI ad copy per placement and language grounded on CRM facts (RERA line and disclaimer attached), branded creatives from listing photos, social posts on a calendar, and ad audiences synced as hashed identifiers with booked-buyer suppression."},{"name":"Matching","description":"Explainable requirement ↔ listing matches for leads and listings."},{"name":"Media","description":"Photos, plans, videos and private documents of listings and projects."},{"name":"Messaging","description":"Compliance-gated sending (WhatsApp, DLT SMS, email), message status, inbox conversations and sending identities."},{"name":"Mobile","description":"The Android app: phone registration, push tokens, device tokens and the unknown-caller lookup."},{"name":"Notifications","description":"Badge counters, the member’s notifications and notification preferences."},{"name":"Owner reports","description":"Live listing performance for owners on a magic-link page (views, enquiries, visits, feedback, offers), the periodic report by email or WhatsApp, links (issue, renew, rotate, revoke) and lines curated for owners."},{"name":"Partner portal"},{"name":"Payment links","description":"Razorpay / Cashfree payment links for a deal’s token or brokerage, sent or copied, with automatic receipts."},{"name":"Pipelines","description":"Pipelines, statuses and sub-statuses: order, colours, categories, status-sheet requirements, SLAs."},{"name":"Portal syndication","description":"Listings published to property portals where a feed / API exists: per-portal rules in plain words, status, take-down, retries, the dashboard, accounts and defaults (N-06)."},{"name":"Post-sales"},{"name":"Predictive scoring","description":"The company’s own model of the chance of a site visit or booking within 14 days: whether it ranks the leads and why, data readiness, lift, calibration and feature importance, version history, the switch and retraining."},{"name":"Pricing & cost sheets"},{"name":"Process guard","description":"Per-pipeline stage gates: allowed next stages, entry requirements, checklists with parallel sub-steps, automatic moves, the next-steps view and hand-ticked items."},{"name":"Projects","description":"New-booking project catalogue: developers, RERA numbers, configurations and price ranges."},{"name":"Properties","description":"Resale and rental listings: fields, statuses, price history, key register, map search and saved views."},{"name":"QR codes","description":"Dynamic QR codes per placement (hoarding, newspaper, site board, brochure, event stall, CP flyer) with attribution, validity windows, scan analytics (unique devices, leads, visits, won) and print-ready images and sheets."},{"name":"Re-activation","description":"Database re-activation: dormant leads picked by preset and filter, reached only on a lawful channel (legal basis per lead), a hold-out group for the lift, the first batch’s approval, the AI agent re-qualifying replies and warm leads handed to people — funnel, lift, cost and the export."},{"name":"Realtime","description":"Server-Sent Events for notifications, inbox and live counters."},{"name":"Receipts","description":"Commission receipts with mode-specific references and per-financial-year numbers."},{"name":"Rent collection","description":"An agreement’s rent: the schedule (prorated, escalated, regenerated after amendments), UPI pay links to the landlord’s own UPI id with UTR capture, AutoPay / e-NACH mandates, payments, reversals and waivers, late fees with approval, HRA-ready receipts, the Rent board and the rent settings. Rent is never brokerage revenue."},{"name":"Rental agreement settings","description":"Agreement templates and the clause library, the stamp-duty table and company rules, e-sign status and e-stamp credits; inspection templates and the inspection & deposit settings."},{"name":"Rental agreements","description":"The agreement document: templates per state and kind, clauses, stamp duty, PDF preview, e-stamp + Aadhaar e-sign through the partner, registration."},{"name":"Rental deposits","description":"The deposit ledger: who holds it (landlord, escrow partner, the brokerage in trust), money received, paid to the landlord and refunded (append-only), deductions from the comparison with the tenant’s answers, the settlement and the statement — never brokerage revenue."},{"name":"Rental inspections","description":"Move-in / move-out inspections: room-by-room checklists, ratings, EXIF/GPS-free photo and video previews, meter readings, inventory and keys, captured offline-tolerant on the phone; signatures of both parties (typed name, drawing, one-time code) that lock the inspection; corrections; move-out compared side by side with move-in."},{"name":"Rental maintenance","description":"Maintenance tickets of managed rentals: WhatsApp intake with photos, AI triage the agent confirms, vendors with dispatch and update links, the owner’s approval above a threshold, SLA timers, the tenant’s confirmation."},{"name":"Rental offers","description":"Versioned offer terms on rental deals, asked vs offered vs the owner’s floor, and the owner-floor approval (the owner’s decision link and/or the approval chain)."},{"name":"Rentals","description":"Rental agreements, renewal reminders (T-60 / 45 / 30) and renewal deals."},{"name":"Report builder","description":"Reports you build: an entity, filters, a group-by and a split, measures (counts, totals, averages, conversion rates, cost per lead), charts, drill-down to records, private / team / company sharing and versions — always within the reader’s own report scope."},{"name":"Reports","description":"Owner dashboard, status matrices, speed to lead & SLA, agent scorecard, visits / shares / messaging reports, campaign costs and the daily owner digest — within your report scope."},{"name":"SLA policies","description":"First response, first call, first site visit, time in stage and overdue tasks on business-hours clocks, with the escalation ladder and the SLA dashboard."},{"name":"Saved views","description":"Private and team views of the CRM lists, and counts for their tabs."},{"name":"Scheduled reports","description":"Daily, weekly or monthly delivery of a report by email (table + CSV) and WhatsApp (summary), the delivery log, outside recipients with step-up and one-click unsubscribe, and the daily owner digest as a schedulable preset."},{"name":"Search","description":"Global search behind the command palette."},{"name":"Session","description":"The signed-in member and the workspace configuration clients load at start."},{"name":"Shares","description":"Tracked share links with views, reactions and hot signals."},{"name":"Site visits","description":"Tours with conflict warnings, the calendar, reminders, the client OTP, GPS check-in / out, feedback, no-shows."},{"name":"Status","description":"Live platform health with incidents and planned maintenance — the data behind /status."},{"name":"Support","description":"Tickets to PropZolo support: open one, follow the thread, reply with screenshots, mark it solved."},{"name":"System","description":"Health checks and this document."},{"name":"Tasks","description":"Tasks and follow-ups: due times, reminders, recurrence, snooze, overdue / today / upcoming and the calendar."},{"name":"Team","description":"Members, invitations, roles and the permission matrix, teams, branches and API keys (Settings → Team)."},{"name":"Telephony","description":"Cloud telephony (Exotel): the connection, virtual numbers per lead source with validity dates, A2P declarations, recording and missed-call settings."},{"name":"Templates","description":"SMS (DLT), email and WhatsApp templates with variables, previews, the seeded library and DLT import."},{"name":"Timeline","description":"The timeline of a lead or a contact: notes with @mentions, status changes, calls, visits and system events."},{"name":"Unit inventory"},{"name":"Voice debriefs","description":"Short spoken notes about a lead: upload, transcription (speech to text, metered), the AI’s proposed update with the words each part came from, review and apply (requirement, status, follow-up, tasks) — and the voice settings."},{"name":"Walk-ins","description":"Site-office kiosks (pairing, revoking, questions, branding), the walk-in policy (CP lock window, versioned consent notice) and the site-office queue with tokens, waiting times and site visits."},{"name":"Webhooks","description":"Signed outgoing webhooks: endpoints, events, secret rotation, test events, the delivery log and replays."},{"name":"WhatsApp","description":"WhatsApp Cloud API: connect with your own credentials or Embedded Signup, numbers with quality and tier, templates with Meta."},{"name":"White label","description":"Enterprise white label (N-09): brand name, accent colour, \"powered by\", email sender, workspace domains verified by DNS and the branded Android app’s build manifest."}],"paths":{"/api/health":{"get":{"operationId":"getHealth","summary":"Liveness and readiness","description":"Without parameters a liveness probe (no dependencies touched). With `ready=1` it also checks Postgres (as the app role) and Redis and answers 503 when either is down.","tags":["System"],"security":[],"parameters":[{"name":"ready","in":"query","required":false,"description":"Also probe the database and Redis.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Health"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"A dependency is unavailable.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Health"},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["data","meta"],"additionalProperties":false}}}}},"x-auth":"public"}},"/api/ingest/{token}":{"get":{"operationId":"pushLeadByQuery","summary":"Push a lead as a GET query string","description":"One lead per request: JSON object, `application/x-www-form-urlencoded`, `multipart/form-data`, XML, or query-string parameters. Common keys (name, phone / mobile, email, city, budget, bhk, locality, project, message, id …) are recognised; the rest is read for budget / BHK / locality mentions and kept in the message. Send your own `id` for idempotent retries; `is_test=true` keeps a lead in the sandbox. JSON bodies may carry an optional `consent` (one entry or an array of up to 10: `channel` or `channels` of whatsapp | sms | call | email | all, `purpose` promotional | service, `granted` boolean, `text` — required when granted —, `text_version`, `captured_at` ISO 8601, `source_url`, `dlt_consent_ref`); granted entries reach the consent ledger with proof, `granted: false` records nothing, an invalid `consent` is a 422 with field errors. 404 = unknown or rotated URL. Portals that can only call a URL (MagicBricks, JustDial style) use this form.","tags":["Lead Push API"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"description":"The source token from the Lead Push URL (secret).","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadPushAccepted"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"},"post":{"operationId":"pushLead","summary":"Push a lead (Lead Push API)","description":"One lead per request: JSON object, `application/x-www-form-urlencoded`, `multipart/form-data`, XML, or query-string parameters. Common keys (name, phone / mobile, email, city, budget, bhk, locality, project, message, id …) are recognised; the rest is read for budget / BHK / locality mentions and kept in the message. Send your own `id` for idempotent retries; `is_test=true` keeps a lead in the sandbox. JSON bodies may carry an optional `consent` (one entry or an array of up to 10: `channel` or `channels` of whatsapp | sms | call | email | all, `purpose` promotional | service, `granted` boolean, `text` — required when granted —, `text_version`, `captured_at` ISO 8601, `source_url`, `dlt_consent_ref`); granted entries reach the consent ledger with proof, `granted: false` records nothing, an invalid `consent` is a 422 with field errors. 404 = unknown or rotated URL.","tags":["Lead Push API"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"description":"The source token from the Lead Push URL (secret).","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadPushAccepted"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"}},"/api/sse":{"get":{"operationId":"streamEvents","summary":"Realtime event stream","description":"text/event-stream for the signed-in member: their own channel plus company-wide broadcasts, with heartbeat comments. Pub/sub keeps no history — after a reconnect, refetch instead of expecting a replay. The server closes long-lived streams periodically; EventSource reconnects (and re-authenticates) on its own.","tags":["Realtime"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"conversations","in":"query","required":false,"description":"Inbox conversations to follow as well (new messages, read receipts); ids the member may not see are skipped silently.","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}(?:,[A-Za-z0-9_-]{1,64}){0,49}$"}}],"responses":{"200":{"description":"An event stream; every `data:` line is one RealtimeEvent JSON object.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"text/event-stream":{"schema":{"type":"string"},"x-event-schema":{"$ref":"#/components/schemas/RealtimeEvent"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/accountability/members/{id}":{"get":{"operationId":"getMemberAccountability","summary":"A member’s accountability score","description":"Within the caller’s report scope (403 outside it).","tags":["Accountability"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberAccountability"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/accountability/recompute":{"post":{"operationId":"recomputeAccountability","summary":"Recompute today’s scores now","description":"Queues today’s recompute for every member (at most once per 10 minutes); the nightly run finalises it.","tags":["Accountability"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean","const":true},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["queued","day"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/accountability/team":{"get":{"operationId":"listTeamAccountability","summary":"Team accountability ranking","description":"Members in the caller’s report scope ranked by score. Agents see only themselves unless the company shares the ranking with agents — then their peers’ names and scores, without the components.","tags":["Accountability"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"default":"d30","type":"string","enum":["d7","d30"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TeamAccountability"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/actions/upsert_contact":{"post":{"operationId":"upsertContactForAutomation","summary":"Create or update a contact","description":"Finds the contact by phone, then by email, within the key’s scope and updates it (a new number is added, tags are added, an email is set only when the contact has none); otherwise creates it (a name is required). Needs `contacts:write`. Send an `Idempotency-Key`.","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"first_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"occupation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"kinds":{"maxItems":9,"type":"array","items":{"type":"string","enum":["buyer","tenant","owner","landlord","investor","broker","channel_partner","builder","vendor"]}},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AutomationContactUpsert"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.create","x-idempotent":true}},"/api/v1/actions/upsert_lead":{"post":{"operationId":"upsertLeadForAutomation","summary":"Create or update a lead","description":"An `external_id` seen before finds its lead (type, temperature and custom fields are updated). Otherwise the enquiry goes through the lead pipeline like any portal lead: a known phone / email follows the duplicate policy (a re-enquiry on the open lead or a reopened lead → `updated`; a new or labelled duplicate lead → `created`, never a silent merge), then routing and consent rules apply. Budgets are phrases or rupees (“75 L - 1 Cr”, “8500000”). Needs `leads:write`. Send an `Idempotency-Key`.","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"external_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"first_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"alt_phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"budget":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"budget_min":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"budget_max":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"bhk":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"property_type":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"locality":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"project":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"possession":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"purpose":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"campaign":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"sub_source":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"lead_type":{"anyOf":[{"type":"string","enum":["buy","rent","sell","let_out","invest"]},{"type":"null"}]},"temperature":{"anyOf":[{"type":"string","enum":["hot","warm","cold"]},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"utm":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":200}},"custom":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":"string","maxLength":500}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AutomationLeadUpsert"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.create","x-idempotent":true}},"/api/v1/activities":{"get":{"operationId":"listActivities","summary":"Timeline of a lead or a contact","description":"Name `lead_id` or `contact_id`. A contact’s timeline includes the entries of its leads you can see.","tags":["Timeline"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"contact_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"types","in":"query","required":false,"description":"Comma list of activity types, e.g. note,status_change.","schema":{"type":"string","maxLength":300}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}},"meta":{"type":"object","properties":{"next_cursor":{"description":"Opaque cursor of the next page; null on the last page.","type":["string","null"]},"has_more":{"type":"boolean"},"pinned":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}}},"required":["next_cursor","has_more"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"},"post":{"operationId":"createNote","summary":"Add a note","description":"On a lead or a contact; `mention_ids` are notified (never the author).","tags":["Timeline"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNoteInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Activity"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.edit","x-idempotent":true}},"/api/v1/activities/{id}":{"patch":{"operationId":"updateActivity","summary":"Edit a note / pin an entry","description":"Notes can be corrected by their author for 15 minutes (409 later); any entry can be pinned or unpinned.","tags":["Timeline"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateActivityInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Activity"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.edit"}},"/api/v1/ad-conversions":{"get":{"operationId":"getAdConversions","summary":"Ad conversions settings","description":"Milestone rules, the Meta and Google connections with their settings (no secrets) and 30-day counts, the WhatsApp Business Accounts, the platform windows and the privacy-notice line.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdConversionsOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]}},"/api/v1/ad-conversions/deliveries":{"get":{"operationId":"listAdConversionDeliveries","summary":"The conversion delivery log","description":"Newest first, keyset-paginated; filter by connection, platform, status, milestone or lead. A year is kept.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"connection_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["meta","google"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","sending","sent","failed","skipped"]}},{"name":"milestone","in":"query","required":false,"schema":{"type":"string","enum":["lead_created","qualified","visit_scheduled","visit_done","booked","test"]}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AdConversionDelivery"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]}},"/api/v1/ad-conversions/deliveries/{id}/retry":{"post":{"operationId":"retryAdConversionDelivery","summary":"Send a failed conversion again","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdConversionDelivery"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/google/oauth/callback":{"get":{"operationId":"completeGoogleAdsOAuth","summary":"Google sign-in callback","description":"Always redirects back to Settings → Integrations → Ad conversions with `google=connected` or an error.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":600}},{"name":"error","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","maxLength":2000}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{},"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/google/oauth/start":{"get":{"operationId":"startGoogleAdsOAuth","summary":"Start the Google sign-in for Ads","description":"Returns Google’s consent URL (or redirects to it with `?redirect=1`). 404 until PropZolo set it up.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"redirect","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/google/{id}":{"patch":{"operationId":"updateGoogleConversions","summary":"Change the Google Ads conversions settings","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"customer_id":{"type":["string","null"]},"customer_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"login_customer_id":{"type":["string","null"]},"mapping":{"type":"object","propertyNames":{"$ref":"#/components/schemas/AdMilestone"},"additionalProperties":{"type":"object","properties":{"action_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}}},"enhanced_conversions":{"type":"boolean"},"test_mode":{"type":"boolean"},"value":{"type":"string","enum":["commission","agreed_value","none"],"description":"What a booking is worth to the ads: the deal’s expected commission, its agreed value, or none."}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/google/{id}/accounts":{"get":{"operationId":"listGoogleAdsAccounts","summary":"Google Ads accounts and conversion actions","description":"The accounts the signed-in Google user reaches and, for `customer_id`, its enabled conversion actions. Needs PropZolo’s Google Ads developer token (409 without it — type the ids instead).","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"login_customer_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"customers":{"type":"array","items":{"type":"string"}},"conversion_actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"}},"required":["id","name","type","status"],"additionalProperties":false}}},"required":["customers","conversion_actions"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/meta":{"post":{"operationId":"connectMetaConversions","summary":"Connect the Meta Conversions API","description":"Checks the token against the dataset with Meta, then stores the connection — off until switched on. The token comes from Events Manager → the dataset → Settings → Conversions API → Generate access token.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dataset_id":{"type":"string","pattern":"^\\d{1,32}$"},"access_token":{"type":"string","minLength":20,"maxLength":2048},"test_event_code":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{4,40}$"},{"type":"null"}]}},"required":["dataset_id","access_token"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations","x-idempotent":true}},"/api/v1/ad-conversions/meta/{id}":{"patch":{"operationId":"updateMetaConversions","summary":"Change the Meta Conversions API settings","description":"Switch on / off, the milestone → event mapping, the test code, identifiers, value; a new token is checked.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"dataset_id":{"type":"string","pattern":"^\\d{1,32}$"},"test_event_code":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{4,40}$"},{"type":"null"}]},"mapping":{"type":"object","propertyNames":{"$ref":"#/components/schemas/AdMilestone"},"additionalProperties":{"type":"object","properties":{"crm":{"anyOf":[{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_-]{0,39}$"},{"type":"null"}]},"messaging":{"anyOf":[{"type":"string","enum":["LeadSubmitted","QualifiedLead","Purchase","InitiateCheckout","AddToCart","ViewContent","OrderCreated","OrderShipped","OrderDelivered","OrderCanceled","OrderReturned","CartAbandoned","RatingProvided","ReviewProvided"]},{"type":"null"}]}}}},"hashed_identifiers":{"type":"boolean"},"send_client_ip":{"type":"boolean"},"value":{"type":"string","enum":["commission","agreed_value","none"],"description":"What a booking is worth to the ads: the deal’s expected commission, its agreed value, or none."},"access_token":{"type":"string","minLength":20,"maxLength":2048}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/meta/{id}/whatsapp-datasets":{"post":{"operationId":"linkMetaWhatsappDatasets","summary":"Link the datasets of WhatsApp Business Accounts","description":"For Click-to-WhatsApp leads: asks Meta for the dataset of each WhatsApp Business Account (creating one when it has none) with the connection’s token, or stores the dataset ids given.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"waba_id":{"type":"string","pattern":"^\\d{1,32}$"},"dataset_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,32}$"},{"type":"null"}]}},"required":["waba_id"]}}},"required":["accounts"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/milestones":{"put":{"operationId":"updateAdMilestones","summary":"Set which statuses count as milestones","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdMilestoneRulesInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdMilestoneRules"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/{id}/retry-failed":{"post":{"operationId":"retryFailedConversions","summary":"Send failed conversions again","description":"Every failed conversion of the connection (up to 500) goes back to the queue with a fresh retry ladder.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["count"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ad-conversions/{id}/test":{"post":{"operationId":"sendTestConversion","summary":"Send a test conversion","description":"Meta: one CRM Lead event under the test event code (Events Manager → Test events). Google: one conversion validated for the action (nothing recorded). Logged as a test delivery.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"test_event_code":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{4,40}$"},{"type":"null"}]},"action_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string"},"delivery_id":{"$ref":"#/components/schemas/Id"}},"required":["ok","message","delivery_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/ai-assistants/drafts":{"get":{"operationId":"listMcpDrafts","summary":"Assistant requests waiting for approval","description":"`scope=all` (integrations managers): everyone’s; otherwise the caller’s own.","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string","enum":["mine","all"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","closed"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/McpDraft"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["ai.assistants","settings.integrations"]}},"/api/v1/ai-assistants/drafts/{id}/approve":{"post":{"operationId":"approveMcpDraft","summary":"Approve an assistant’s request","description":"Runs the API call the assistant asked for as the member, through the connection as it is now (its scopes and the member’s permissions apply). The draft’s member or an integrations manager.","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/McpDraft"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["ai.assistants","settings.integrations"]}},"/api/v1/ai-assistants/drafts/{id}/reject":{"post":{"operationId":"rejectMcpDraft","summary":"Reject an assistant’s request","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"}},"required":["id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["ai.assistants","settings.integrations"]}},"/api/v1/ai/agent-facts":{"get":{"operationId":"listAiAgentFacts","summary":"Approved fact sheets the agent may quote (per project or company-wide)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiAgentFact"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"},"post":{"operationId":"createAiAgentFact","summary":"Add an approved fact (offers count only from here)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAgentFactInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgentFact"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/agent-facts/{id}":{"patch":{"operationId":"updateAiAgentFact","summary":"Edit an approved fact (re-approved by the editor)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"topic":{"type":"string","enum":["pricing","payment_plan","possession","amenities","location","specs","rera","offers","process","other"]},"title":{"type":"string","minLength":2,"maxLength":120},"body":{"type":"string","minLength":2,"maxLength":1000},"as_of":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"valid_from":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"valid_until":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgentFact"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"},"delete":{"operationId":"archiveAiAgentFact","summary":"Archive a fact (the agent no longer sees it)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"archived":{"type":"boolean","const":true}},"required":["archived"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/agent/conversations":{"get":{"operationId":"listAiAgentChips","summary":"The agent’s status for the given conversations (only those the member can see)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","maxLength":3000}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiAgentChip"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.view"}},"/api/v1/ai/agent/conversations/{id}":{"get":{"operationId":"getAiAgentConversation","summary":"The agent in one conversation: status, what it noted, drafts to approve, recent turns","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgentConversation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.view"}},"/api/v1/ai/agent/conversations/{id}/release":{"post":{"operationId":"releaseAiAgentConversation","summary":"Hand the chat back to the agent (it answers the customer’s next message)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/AiAgentChip"},{"type":"null"}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"}},"/api/v1/ai/agent/conversations/{id}/reopen":{"post":{"operationId":"reopenAiAgentConversation","summary":"Reopen a conversation the agent closed as disqualified (never an opt-out)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/AiAgentChip"},{"type":"null"}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"}},"/api/v1/ai/agent/conversations/{id}/take-over":{"post":{"operationId":"takeOverAiAgentConversation","summary":"Take the chat from the agent (it stops replying and only drafts)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/AiAgentChip"},{"type":"null"}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"}},"/api/v1/ai/agent/drafts/{id}/approve":{"post":{"operationId":"approveAiAgentDraft","summary":"Send an agent draft — as written, or with your edits (sent as yours)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":3000}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"draft_status":{"type":"string","enum":["approved","edited"]},"message_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["draft_status","message_ids"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply","x-idempotent":true}},"/api/v1/ai/agent/drafts/{id}/reject":{"post":{"operationId":"rejectAiAgentDraft","summary":"Discard an agent draft","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rejected":{"type":"boolean","const":true}},"required":["rejected"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"}},"/api/v1/ai/agents":{"get":{"operationId":"listAiAgents","summary":"The company’s WhatsApp AI agents with their settings and numbers","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiAgent"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"},"post":{"operationId":"createAiAgent","summary":"Create a WhatsApp AI agent (every number starts off; shadow mode first)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAgentPatch"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/agents/options":{"get":{"operationId":"getAiAgentOptions","summary":"What an agent’s settings can point at: WhatsApp numbers, templates, sendable assets, projects","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgentOptions"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/agents/overview":{"get":{"operationId":"getAiAgentOverview","summary":"KPIs: first response, reply rate, qualified %, visits, hand-off and edit rates, opt-outs, credits","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"number"}},{"name":"agent_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgentOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/agents/{id}":{"get":{"operationId":"getAiAgent","summary":"One WhatsApp AI agent","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"},"patch":{"operationId":"updateAiAgent","summary":"Change an agent’s settings (bumps its settings version: the agent check must pass again to go live)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAgentPatch"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"},"delete":{"operationId":"archiveAiAgent","summary":"Archive an agent (its numbers are switched off; history stays)","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"archived":{"type":"boolean","const":true}},"required":["archived"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/agents/{id}/channels":{"put":{"operationId":"setAiAgentChannel","summary":"Put a WhatsApp number under the agent: off · shadow · live","description":"Live only from shadow, with the agent check passed for the current settings version, after 14 days in shadow and under 10 % corrected drafts over at least 20 (409 with `fields.mode` = shadow_first · eval_required · eval_stale · shadow_too_short · shadow_quality). One agent per number (409). Saving settings puts live numbers back in shadow.","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel_account_id":{"$ref":"#/components/schemas/Id"},"mode":{"type":"string","enum":["off","shadow","live"]}},"required":["channel_account_id","mode"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/agents/{id}/channels/{accountId}":{"delete":{"operationId":"removeAiAgentChannel","summary":"Take a WhatsApp number away from the agent","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"accountId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/agents/{id}/eval":{"post":{"operationId":"runAiAgentEval","summary":"Run the agent check: the offline eval gates on the agent’s current settings (no AI credits)","description":"Every case runs through the agent’s turn engine with ideal answers (correct replies are never blocked) and faulty ones (the safety net catches invented prices, missed opt-outs and hand-offs, off-topic answers). Gates: 0 unsourced numbers, opt-out detection ≥ 99 %, slot F1 ≥ 0.95, correct hand-offs ≥ 95 %, off-topic refusals ≥ 98 %. The result is stored against the settings version.","tags":["AI agents"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiAgentEvalReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/ai/ask":{"post":{"operationId":"askCopilot","summary":"Ask PropZolo: a question in plain words → a validated query, the result and a grounded answer","description":"The model sees the caller’s field catalogue only (no records) and returns a plan in the query language; the server validates it against the caller’s whitelist and field rules, runs it with their view scope, and the model writes the answer from the result alone (an unsourced figure replaces it with the server’s own answer).","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":500},"previous_id":{"description":"The previous question, for follow-ups.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["question"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AskAnswer"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/ask/catalogue":{"get":{"operationId":"getAskCatalogue","summary":"What the caller can ask about: entities, fields (with options) and reports, for the manual builder","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AskCatalogue"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/ask/history":{"get":{"operationId":"listAskQuestions","summary":"The caller’s questions, newest first","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AskQuestion"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/ask/history/{id}":{"get":{"operationId":"getAskQuestion","summary":"One of the caller’s questions, its result run again now","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"question":{"type":"string"},"status":{"type":"string","enum":["answered","clarify","cannot_answer","invalid","failed"]},"plan":{"anyOf":[{"$ref":"#/components/schemas/AskPlan"},{"type":"null"}]},"answer":{"type":["string","null"]},"answer_source":{"type":["string","null"]},"citations":{"type":"array","items":{"type":"string"}},"follow_ups":{"type":"array","items":{"type":"string"}},"summary":{"anyOf":[{"type":"object","properties":{"entity":{"type":"string"},"mode":{"type":"string"},"title":{"type":"string"},"matched":{"type":"number"}},"required":["entity","mode","title","matched"],"additionalProperties":false},{"type":"null"}]},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"result":{"anyOf":[{"$ref":"#/components/schemas/AskResult"},{"type":"null"}]},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"description":"Value labels the catalogue cannot give the chips (locality id → name)."},"error":{"type":["string","null"]}},"required":["id","question","status","plan","answer","answer_source","citations","follow_ups","summary","credits","created_at","result","labels","error"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/ask/run":{"post":{"operationId":"runAskPlan","summary":"Run an edited plan (the chips) without the model","description":"Validated and scoped exactly like a question; no AI credits. Works when AI is unavailable.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/AskPlanInput"}},"required":["plan"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/AskResult"},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"description":"Value labels the catalogue cannot give the chips (locality id → name)."},"query":{"anyOf":[{"$ref":"#/components/schemas/AggregateQuery"},{"type":"null"}]},"description":{"type":"string"}},"required":["result","labels","query","description"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/ask/smart-list":{"post":{"operationId":"saveAskSmartList","summary":"Save a lead or contact question as a smart list (a saved view; its period becomes fixed dates)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"$ref":"#/components/schemas/AggregateQuery"},"name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"visibility":{"type":"string","enum":["private","team"]},"question":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["query"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"entity":{"type":"string"},"name":{"type":"string"},"visibility":{"$ref":"#/components/schemas/SavedViewVisibility"},"filters":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"columns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Visible column ids in order; null = defaults."},"sort":{"description":"List sort, e.g. -received_at.","type":["string","null"]},"layout":{"$ref":"#/components/schemas/SavedViewLayout"},"is_pinned":{"type":"boolean"},"author":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"mine":{"type":"boolean","description":"The caller wrote it."},"editable":{"type":"boolean","description":"The caller may change, re-share or delete it."},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"fixed_range":{"description":"The period saved as fixed dates, when there was one.","type":["string","null"]}},"required":["id","entity","name","visibility","filters","columns","sort","layout","is_pinned","author","mine","editable","created_at","updated_at","fixed_range"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/conversation-summary":{"post":{"operationId":"summarizeConversation","summary":"Summarise a conversation: needs, facts, open questions, next steps, sentiment","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"$ref":"#/components/schemas/Id"},"output_language":{"default":"en","type":"string","enum":["en","hi"]}},"required":["conversation_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/AiConversationSummary"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["summary","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/feedback":{"post":{"operationId":"rateAiResult","summary":"Rate an AI result (helpful or not)","description":"Your own AI results of the last 7 days only (another member’s or company’s is a 404). A later rating of the same result replaces the earlier one; kept on the audit trail for AI admins.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiFeedbackInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"request_id":{"type":"string"},"rating":{"type":"string","enum":["up","down"]}},"required":["request_id","rating"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/history":{"get":{"operationId":"listAiHistory","summary":"Recent AI actions (the caller’s own; the whole company’s for AI admins)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","company"]}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AiHistoryItem"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"ai.copilot"}},"/api/v1/ai/inventory":{"get":{"operationId":"listInventoryPosts","summary":"The inventory inbox: parsed broker posts, newest first","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"new","type":"string","enum":["new","imported","ignored","all"]}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryPost"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"ai.inventory_inbox"},"post":{"operationId":"parseInventoryPost","summary":"Parse a pasted or forwarded broker message into review cards","description":"Third-party phone numbers stay private to the company and are masked like contact phones.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":20000},"source":{"default":"paste","type":"string","enum":["paste","whatsapp_forward","whatsapp_group","share","chat_export","email"]},"poster":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]}}},{"type":"null"}]},"default_city":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"required":["text"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/InventoryPost"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["post","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/ai/inventory/{id}":{"get":{"operationId":"getInventoryPost","summary":"One inventory post with its cards","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryPost"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"ai.inventory_inbox"}},"/api/v1/ai/inventory/{id}/cards/{index}":{"post":{"operationId":"reviewInventoryCard","summary":"Accept a card (creates a private listing or a lead; matching starts) or reject it","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["accept","reject"]},"edits":{"$ref":"#/components/schemas/InventoryCardEdits"}},"required":["action"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryPost"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/ai/leads/{id}/explain":{"post":{"operationId":"explainLead","summary":"\"Explain this lead\": why it is hot or cold, with evidence, and the next best action","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"explanation":{"$ref":"#/components/schemas/AiLeadExplanation"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["explanation","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/leads/{id}/requirement":{"post":{"operationId":"extractLeadRequirement","summary":"\"Fill from notes\": requirement proposals from the lead’s notes (or the given text)","description":"Nothing is written: accept proposals with `POST /api/v1/ai/leads/{id}/requirement/apply`.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"anyOf":[{"type":"string","minLength":1,"maxLength":20000},{"type":"null"}]},"source":{"default":"note","type":"string","enum":["note","chat","enquiry","call_note","portal_email","other"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"proposals":{"type":"array","items":{"$ref":"#/components/schemas/RequirementProposal"}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["proposals","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/leads/{id}/requirement/apply":{"post":{"operationId":"applyLeadRequirement","summary":"Apply the accepted proposals to the lead (an ordinary lead update plus an AI timeline entry)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_type":{"$ref":"#/components/schemas/LeadType"},"requirement":{"$ref":"#/components/schemas/RequirementInput"},"fields":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","maxLength":32}},"ai_request_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["fields"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"lead_type":{"$ref":"#/components/schemas/LeadType"}},"required":["lead_id","lead_type"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.edit"}},"/api/v1/ai/leads/{id}/score":{"get":{"operationId":"getLeadScore","summary":"A lead’s score with its reasons","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadScore"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"},"post":{"operationId":"recomputeLeadScore","summary":"Recompute a lead’s score now (scores also follow lead events and a nightly pass)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadScore"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"}},"/api/v1/ai/leads/{id}/summary":{"post":{"operationId":"summarizeLead","summary":"AI summary of a lead for the agent opening it","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/AiLeadSummary"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["summary","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/listing-copy":{"post":{"operationId":"writeListingCopy","summary":"Title, description, highlights and a WhatsApp caption from the listing’s own facts","description":"Nothing is saved: the agent edits the copy and saves it with the listing.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"},"language":{"default":"en","type":"string","enum":["en","hi"]},"audience":{"default":"portal","type":"string","enum":["portal","website","whatsapp"]},"tone":{"default":"professional","type":"string","enum":["professional","warm","premium"]}},"required":["property_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"copy":{"$ref":"#/components/schemas/AiListingCopy"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["copy","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/reply-draft":{"post":{"operationId":"draftAiReply","summary":"Draft the next reply in a conversation (English, Hindi or Hinglish; template-only when the window is closed)","description":"Never sends anything: the agent reviews and edits the draft in the composer.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"$ref":"#/components/schemas/Id"},"language":{"default":"auto","type":"string","enum":["auto","en","hi","hinglish"]},"tone":{"default":"friendly","type":"string","enum":["friendly","professional","concise","premium"]},"instruction":{"anyOf":[{"type":"string","minLength":1,"maxLength":1000},{"type":"null"}]}},"required":["conversation_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"draft":{"$ref":"#/components/schemas/AiReplyDraft"},"window":{"type":"object","properties":{"open":{"type":"boolean"},"closes_at":{"type":["string","null"]}},"required":["open","closes_at"],"additionalProperties":false},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["draft","window","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/reports":{"get":{"operationId":"listSavedReports","summary":"The caller’s saved reports and the team’s","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SavedReport"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"},"post":{"operationId":"createSavedReport","summary":"Save a question as a report definition (it must run for its author)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/AskPlan2"},"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"chart":{"type":"string","enum":["auto","table","bar","line"]},"visibility":{"type":"string","enum":["private","team"]},"question":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["definition"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SavedReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/reports/{id}":{"get":{"operationId":"getSavedReport","summary":"A saved report with its result, run now with the viewer’s scope","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"report":{"$ref":"#/components/schemas/SavedReport"},"result":{"anyOf":[{"$ref":"#/components/schemas/AskResult"},{"type":"null"}]},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"description":"Value labels the catalogue cannot give the chips (locality id → name)."},"description":{"type":"string"},"error":{"type":["string","null"]}},"required":["report","result","labels","description","error"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"},"patch":{"operationId":"updateSavedReport","summary":"Rename, pin, share or chart a saved report (its author; team reports also settings.company)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"chart":{"type":"string","enum":["auto","table","bar","line"]},"is_pinned":{"type":"boolean"},"visibility":{"type":"string","enum":["private","team"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SavedReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"},"delete":{"operationId":"deleteSavedReport","summary":"Delete a saved report","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/requirement-extract":{"post":{"operationId":"extractRequirement","summary":"A requirement from free text (an enquiry, a chat) with per-field confidence and evidence","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":20000},"source":{"default":"enquiry","type":"string","enum":["enquiry","note","chat","portal_email","call_note","other"]},"city":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"required":["text"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"requirement":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["requirement","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/search/leads":{"post":{"operationId":"searchLeadsInPlainWords","summary":"Plain-words lead search → a validated filter (editable chips) for the leads list","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":500}},"required":["query"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"filter":{"anyOf":[{},{"type":"null"}],"description":"Leads filter tree (shared filter DSL), null when nothing matched."},"chips":{"type":"array","items":{"$ref":"#/components/schemas/AiSearchChip"}},"unmatched":{"type":"array","items":{"type":"string"}},"dropped":{"type":"array","items":{"type":"string"}},"explanation":{"type":"string"},"locality_names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Locality id → name, for the filter chips."},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["filter","chips","unmatched","dropped","explanation","locality_names","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/segments":{"post":{"operationId":"proposeSegment","summary":"A natural-language audience → a proposed lead filter with its count (F-02 AI Segment)","description":"The model sees only the lead field catalogue and the company’s option lists, never lead data. The filter is checked like the plain-words lead search and counted over the leads you may see (before opt-outs, DND and duplicates are removed at build). Nothing is applied: you confirm or edit it in the broadcast audience or the workflow step.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":500},"purpose":{"default":"broadcast","type":"string","enum":["broadcast","workflow"]}},"required":["text"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"filter":{"anyOf":[{},{"type":"null"}],"description":"Leads filter tree (shared filter DSL), null for everyone."},"name":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"chips":{"type":"array","items":{"$ref":"#/components/schemas/AiSearchChip"}},"unmatched":{"type":"array","items":{"type":"string"}},"dropped":{"type":"array","items":{"type":"string"}},"explanation":{"type":"string"},"locality_names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean","description":"A blocking finding: a person must edit the output before it is used."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["filter","name","count","chips","unmatched","dropped","explanation","locality_names","findings","blocked","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/ai/settings":{"patch":{"operationId":"updateAiSettings","summary":"Change the company AI settings (switch, monthly credit cap, intent signals, voice)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiSettingsPatch"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"ai.agents_manage"}},"/api/v1/ai/status":{"get":{"operationId":"getAiStatus","summary":"Whether AI features can run for the caller, and why not","description":"For the friendly disabled state of every AI button: platform set-up, company switch, permission, credits.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiStatus"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal"}},"/api/v1/ai/usage":{"get":{"operationId":"getAiUsage","summary":"AI usage: credits this month, by feature and per day, the wallet and the settings","description":"Needs `billing.view` or `ai.agents_manage`.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiUsage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["billing.view","ai.agents_manage"]}},"/api/v1/announcements":{"get":{"operationId":"listAnnouncements","summary":"Live PropZolo announcements","description":"Banners from PropZolo (planned maintenance, product news) live right now for this workspace — every tenant, this company or its plan — newest first. Dismissing one is remembered on the device.","tags":["Notifications"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Announcement"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/api-keys":{"get":{"operationId":"listApiKeys","summary":"API keys","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"meta":{"type":"object","properties":{"allowed":{"type":"boolean","description":"The plan includes the API (Growth and above)."}},"required":["allowed"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"post":{"operationId":"createApiKey","summary":"Create an API key","description":"A key acts as you, limited to its scopes, and stops working if you are deactivated. The key is shown once. It expires after 90 days unless you pick another date (or, flagged in the audit log, never); you are reminded 7 days before. Owners and admins confirm their authenticator code first (step-up).","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApiKeyCreated"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/api-keys/{id}":{"delete":{"operationId":"revokeApiKey","summary":"Revoke an API key","description":"The next request with the key is refused.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/approvals":{"get":{"operationId":"listApprovals","summary":"Approval requests for me","description":"Requests the caller may decide — named, through their role, or through a permission they hold. `view`: pending (default), decided, all. Newest first; keyset pagination.","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"view","in":"query","required":false,"schema":{"default":"pending","type":"string","enum":["pending","decided","all"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalRequest"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/bulk-decide":{"post":{"operationId":"bulkDecideApprovals","summary":"Approve or reject many requests","description":"Each request the caller may decide, in order; the others are skipped with a reason (at most 100).","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"decision":{"type":"string","enum":["approve","reject"]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["ids","decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"decided":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string"}},"required":["id","reason"],"additionalProperties":false}}},"required":["decided","skipped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/by-token/{token}":{"get":{"operationId":"getApprovalByToken","summary":"An approval request by its signed link","description":"For the approver the link was sent to (single-use, 7 days). 404 for an unknown link.","tags":["Approvals"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":20,"maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalTokenView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"}},"/api/v1/approvals/by-token/{token}/decide":{"post":{"operationId":"decideApprovalByToken","summary":"Approve or reject by the signed link","description":"Once: the first decision uses the link up; later calls change nothing and say why.","tags":["Approvals"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":20,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"outcome":{"type":"string","enum":["decided","already_decided","used","expired","invalid","not_allowed","wrong_phone"]},"status":{"type":["string","null"]},"title":{"type":["string","null"]}},"required":["outcome","status","title"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"}},"/api/v1/approvals/requests":{"get":{"operationId":"listMyApprovalRequests","summary":"Approvals I asked for","description":"The caller’s own chains, newest first: where each stands and what became of its action.","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["open","settled","all"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalChain"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/requests/{id}":{"get":{"operationId":"getApprovalChain","summary":"An approval chain","description":"For its requester or an approver of one of its levels.","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalChain"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/requests/{id}/cancel":{"post":{"operationId":"cancelApprovalChain","summary":"Withdraw my request","description":"Only while it waits; its action is dropped.","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalChain"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/whatsapp":{"get":{"operationId":"getApprovalWhatsapp","summary":"My approval requests on WhatsApp","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalWhatsappOptIn"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"put":{"operationId":"setApprovalWhatsapp","summary":"Get approval requests on WhatsApp","description":"Sent from PropZolo’s number to the member’s verified phone, with Approve / Reject buttons.","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalWhatsappOptIn"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/{id}":{"get":{"operationId":"getApproval","summary":"An approval request","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/{id}/decide":{"post":{"operationId":"decideApproval","summary":"Approve, approve with edits or reject","description":"Once per request, before its SLA. A waiting workflow continues on the decision’s branch (with the edited text on \"edit\").","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","edit","reject"]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"edited_text":{"anyOf":[{"type":"string","minLength":1,"maxLength":4000},{"type":"null"}]},"channel":{"description":"push: decided from a notification on the phone (recorded on the decision).","type":"string","enum":["web","push"]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/{id}/hold":{"post":{"operationId":"holdApproval","summary":"Put a request on hold","description":"A chain level only, with the reason: its time stops until it is resumed (or decided).","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/approvals/{id}/resume":{"post":{"operationId":"resumeApproval","summary":"Resume a request on hold","description":"The level gets back the time it had left when it was put on hold.","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/assignment-logs":{"get":{"operationId":"listAssignmentLogs","summary":"The assignment log","description":"Newest first, within your lead scope. `via` takes a comma list.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"rule_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"via","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"description":"Instant in ISO 8601, e.g. 2026-10-03T04:30:00.000Z.","schema":{"$ref":"#/components/schemas/DateTime"}},{"name":"to","in":"query","required":false,"description":"Instant in ISO 8601, e.g. 2026-10-03T04:30:00.000Z.","schema":{"$ref":"#/components/schemas/DateTime"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentLogEntry"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"}},"/api/v1/assignment-rules":{"get":{"operationId":"listAssignmentRules","summary":"Assignment rules in evaluation order","description":"The first active rule whose conditions match a lead decides; a source can route to its own rule.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentRule"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"post":{"operationId":"createAssignmentRule","summary":"Create an assignment rule","description":"Added last in the order. Conditions use the assignment condition fields; members must be active.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssignmentRuleInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AssignmentRule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing","x-idempotent":true}},"/api/v1/assignment-rules/members":{"get":{"operationId":"listRoutingMembers","summary":"Members with their routing profile and today’s load","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RoutingMember"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"}},"/api/v1/assignment-rules/members/{id}":{"patch":{"operationId":"updateRoutingProfile","summary":"Change a member’s routing profile","description":"Shift (null = the company hours), open-lead capacity, languages, service localities, specialisations.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shift":{"anyOf":[{"$ref":"#/components/schemas/MemberShiftInput"},{"type":"null"}]},"lead_capacity":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"languages":{"maxItems":20,"type":"array","items":{"type":"string","minLength":2,"maxLength":8}},"service_locality_ids":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"specializations":{"maxItems":5,"type":"array","items":{"type":"string","enum":["resale","rentals","projects","commercial","plots"]}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RoutingMember"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/assignment-rules/options":{"get":{"operationId":"getAssignmentOptions","summary":"What the rule editor offers","description":"Condition fields with tenant values (sources, projects, branches, teams), methods and members.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AssignmentOptions"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"}},"/api/v1/assignment-rules/reorder":{"post":{"operationId":"reorderAssignmentRules","summary":"Change the order of the rules","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"},"description":"Every rule once, first = first."}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentRule"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/assignment-rules/settings":{"get":{"operationId":"getRoutingSettings","summary":"Company-wide routing settings","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RoutingSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"put":{"operationId":"saveRoutingSettings","summary":"Change the routing settings","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone_stale_minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"An owner whose phone has not synced for this long gets twice the rotation time."},"require_check_in":{"type":"boolean","description":"Only members punched in today receive automatic leads."},"rotation_warning_minutes":{"type":"integer","minimum":0,"maximum":240,"description":"Warn the owner this many shift minutes before a lead rotates (0 = off)."}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RoutingSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/assignment-rules/simulate":{"post":{"operationId":"simulateAssignment","summary":"Who would get this lead?","description":"Evaluates the rules for an existing or described lead and explains every step. Writes nothing.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead":{"anyOf":[{"$ref":"#/components/schemas/DescribedLead"},{"type":"null"}]},"at":{"description":"Simulate at another moment (default: now).","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AssignmentSimulation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"}},"/api/v1/assignment-rules/staff-exit/{memberId}":{"get":{"operationId":"getStaffExit","summary":"What a leaving member still holds","description":"Open leads, pre-sales slots, tasks, upcoming visits and open deals, with the hand-over progress.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"memberId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StaffExitSummary"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"post":{"operationId":"startStaffExit","summary":"Hand over a leaving member’s work","description":"Runs in the background in batches; poll the summary for progress. Needs `settings.users` or routing.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"memberId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"$ref":"#/components/schemas/StaffExitTarget"},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["target"]}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StaffExitState"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view","x-idempotent":true}},"/api/v1/assignment-rules/staff-exit/{memberId}/preview":{"post":{"operationId":"previewStaffExit","summary":"Preview a hand-over","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"memberId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"$ref":"#/components/schemas/StaffExitTarget"},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["target"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"counts":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"presales_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","presales_leads","tasks","visits","deals"],"additionalProperties":false},"plan":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["member_id","name","leads"],"additionalProperties":false}},"to_pool":{"type":"integer","minimum":0,"maximum":9007199254740991},"fallback":{"anyOf":[{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["member_id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["counts","plan","to_pool","fallback"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"}},"/api/v1/assignment-rules/{id}":{"get":{"operationId":"getAssignmentRule","summary":"An assignment rule","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AssignmentRule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"patch":{"operationId":"updateAssignmentRule","summary":"Change an assignment rule","description":"`members`, when sent, replaces the rule’s members. Every change is in the audit log.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRuleInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AssignmentRule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"},"delete":{"operationId":"deleteAssignmentRule","summary":"Delete an assignment rule","description":"Sources routed to it fall back to the ordered rules; its log rows stay.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/attendance/days":{"put":{"operationId":"correctAttendanceDay","summary":"Correct a member’s day","description":"Mark leave (or clear it), add a missed punch-in / punch-out (replacing an automatic punch-out), with a note. Audited; nobody corrects their own attendance.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"date":{"$ref":"#/components/schemas/LocalDate"},"status":{"anyOf":[{"type":"string","enum":["leave"]},{"type":"null"}]},"punch_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"punch_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":"string","minLength":3,"maxLength":1000}},"required":["member_id","date","note"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttendanceDay"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.manage"}},"/api/v1/attendance/export":{"get":{"operationId":"exportAttendance","summary":"Export the register or the field report as CSV","description":"Watermarked with your name and audited; needs attendance view scope too. Step-up for Owner/Admin roles.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"from","in":"query","required":true,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":true,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"branch_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"report","in":"query","required":true,"schema":{"type":"string","enum":["register","field"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.export"}},"/api/v1/attendance/field-report":{"get":{"operationId":"getFieldReport","summary":"Field report","description":"Per member and day: visits planned vs done with GPS evidence, distance and idle time.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"from","in":"query","required":true,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":true,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"branch_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FieldReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.view"}},"/api/v1/attendance/location-consent":{"post":{"operationId":"grantLocationConsent","summary":"Agree to share live location while on duty","description":"Send the version of the notice you read; a newer notice answers 409.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notice_version":{"type":"string","minLength":1,"maxLength":20},"device_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["notice_version"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LiveLocationState"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.punch"},"delete":{"operationId":"withdrawLocationConsent","summary":"Stop sharing live location","description":"Sharing stops at once and your stored positions are deleted.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"enabled":{"type":"boolean"},"interval_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"consented":{"type":"boolean"},"notice_version":{"type":"string"},"sharing":{"type":"boolean","description":"Positions are being shared now (consented, on duty, not on a break)."},"deleted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","interval_minutes","consented","notice_version","sharing","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.punch"}},"/api/v1/attendance/locations":{"post":{"operationId":"uploadAttendanceLocations","summary":"Upload live-location points","description":"Points outside your on-duty windows (punched in, not on a break) or your consent are dropped; a point sent twice is stored once. The answer says whether to keep sharing and at which interval.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"points":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracy_m":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]},"mock_location":{"type":["boolean","null"]}},"required":["at","lat","lng"]}}},"required":["points"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"object","properties":{"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"future":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"too_old":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"off_duty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_consent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invalid","future","too_old","off_duty","no_consent"],"additionalProperties":false},"live_location":{"$ref":"#/components/schemas/LiveLocationState"}},"required":["accepted","duplicates","rejected","live_location"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.punch"}},"/api/v1/attendance/members/{id}/days/{date}":{"get":{"operationId":"getMemberAttendanceDay","summary":"A member’s day with every punch","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"date","in":"path","required":true,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"day":{"anyOf":[{"$ref":"#/components/schemas/AttendanceDay"},{"type":"null"}]},"punches":{"type":"array","items":{"$ref":"#/components/schemas/AttendancePunch"}}},"required":["day","punches"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.view"}},"/api/v1/attendance/members/{id}/track":{"get":{"operationId":"getMemberTrack","summary":"A member’s on-duty route for a day","description":"Live-location points of one day with the filtered distance and idle spells. Nothing older than the retention period exists.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"date","in":"query","required":true,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"date":{"$ref":"#/components/schemas/LocalDate"},"points":{"type":"array","items":{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"lat":{"type":"number"},"lng":{"type":"number"},"accuracy_m":{"type":["number","null"]}},"required":["at","lat","lng","accuracy_m"],"additionalProperties":false}},"distance_m":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"idle_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"idle_spells":{"type":"array","items":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"lat":{"type":"number"},"lng":{"type":"number"},"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","to","lat","lng","minutes"],"additionalProperties":false}},"dropped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["member_id","date","points","distance_m","idle_minutes","idle_spells","dropped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.view"}},"/api/v1/attendance/punches":{"post":{"operationId":"punch","summary":"Punch in, out, or start / end a break","description":"Idempotent on `client_key`. Outside every office / site the company’s geofence rule applies to punching in (a reason may be asked, or the punch refused); a punch-out is never refused. Tamper signals are recorded, not refused.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PunchInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PunchResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.punch"}},"/api/v1/attendance/punches/{id}/selfie":{"get":{"operationId":"getAttendanceSelfie","summary":"A punch selfie (short-lived link)","description":"For members whose attendance you may see; each look is audited. 409 while it is being re-encoded.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.view"}},"/api/v1/attendance/register":{"get":{"operationId":"getAttendanceRegister","summary":"Attendance register","description":"Members × days (at most 62) with status, late and early-leave minutes, hours and exceptions, within your scope.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"from","in":"query","required":true,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":true,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"branch_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttendanceRegister"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.view"}},"/api/v1/attendance/selfies":{"post":{"operationId":"presignAttendanceSelfie","summary":"Upload a punch selfie","description":"A presigned PUT (private storage, at most 5 MB); send the key with the punch. The stored image is re-encoded without EXIF/GPS and deleted after the selfie retention period. Selfies are never used for face recognition.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","minLength":3,"maxLength":100},"size":{"type":"integer","minimum":1,"maximum":52428800}},"required":["filename","content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"},"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","url","method","headers","expires_at","max_bytes"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.punch"}},"/api/v1/attendance/settings":{"get":{"operationId":"getAttendanceSettings","summary":"Attendance settings","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttendanceSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["attendance.manage","settings.view"]},"put":{"operationId":"updateAttendanceSettings","summary":"Change the attendance settings","description":"Only the fields sent change. Audited.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"require_punch_in":{"type":"boolean"},"selfie":{"type":"string","enum":["off","optional","required"]},"geofence":{"type":"string","enum":["off","warn","reason","block"]},"max_accuracy_m":{"type":"integer","minimum":20,"maximum":500},"breaks":{"type":"boolean"},"web_punch":{"type":"boolean"},"grace_minutes":{"type":"integer","minimum":0,"maximum":120},"half_day_minutes":{"type":"integer","minimum":60,"maximum":720},"early_leave_grace_minutes":{"type":"integer","minimum":0,"maximum":120},"auto_punch_out":{"type":"object","properties":{"enabled":{"type":"boolean"},"after_minutes":{"type":"integer","minimum":15,"maximum":720},"fallback_hours":{"type":"integer","minimum":4,"maximum":20}},"required":["enabled","after_minutes","fallback_hours"]},"live_location":{"type":"object","properties":{"enabled":{"type":"boolean"},"interval_minutes":{"anyOf":[{"type":"number","const":5},{"type":"number","const":10},{"type":"number","const":15},{"type":"number","const":30}]}},"required":["enabled","interval_minutes"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttendanceSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.manage"}},"/api/v1/attendance/sites":{"get":{"operationId":"listAttendanceSites","summary":"Offices and sites members punch at","description":"Branch pins with their radius (edited in Settings → Branches) and the extra sites.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AttendanceSite"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.view"},"post":{"operationId":"createAttendanceSite","summary":"Add an attendance site","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"radius_m":{"type":"integer","minimum":25,"maximum":5000},"is_active":{"type":"boolean"}},"required":["name","latitude","longitude"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttendanceSite"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.manage"}},"/api/v1/attendance/sites/{id}":{"patch":{"operationId":"updateAttendanceSite","summary":"Change an attendance site","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"radius_m":{"type":"integer","minimum":25,"maximum":5000},"is_active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttendanceSite"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.manage"},"delete":{"operationId":"deleteAttendanceSite","summary":"Remove an attendance site","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.manage"}},"/api/v1/attendance/team":{"get":{"operationId":"getTeamAttendance","summary":"Who is in today","description":"Members in your attendance scope for a day (default today): status, punches, hours, flags — and, today, the latest on-duty position of members who share live location.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"date","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"branch_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TeamAttendance"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.view"}},"/api/v1/attendance/today":{"get":{"operationId":"getAttendanceToday","summary":"My attendance today","description":"The company’s rules, today’s day (or a night shift still open) with its punches, the plan of the day, my offices and sites, and whether my live location is being shared.","tags":["Attendance"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttendanceToday"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"attendance.view"}},"/api/v1/bank-statements":{"get":{"operationId":"listBankStatements","summary":"Imported statements","description":"Newest first, with their counts. Keyset pagination.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BankStatement"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.view"},"post":{"operationId":"importBankStatement","summary":"Import a bank statement","description":"A CSV or XLSX statement (base64, ≤ 5 MB) read with the bank’s column names; new lines are stored once, credits are matched to rent UTR claims and receipts — clear matches are confirmed when the rule allows, near ones queued. 409 for the same file twice; 422 for a file the format cannot read. Audited.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bank":{"type":"string","enum":["hdfc","icici","sbi","axis","kotak","generic"]},"file_name":{"type":"string","minLength":1,"maxLength":200},"content_base64":{"type":"string","minLength":4,"maxLength":7200000},"account_label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]}},"required":["bank","file_name","content_base64"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BankStatement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.import"}},"/api/v1/bank-statements/{id}/rematch":{"post":{"operationId":"rematchBankStatement","summary":"Match the open credits again","description":"After new UTR claims or receipts were recorded.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"auto":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["auto","review"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.confirm"}},"/api/v1/bank-transactions":{"get":{"operationId":"listBankTransactions","summary":"Bank lines and the review queue","description":"`suggested` is the review queue. Without a status every line except debits. Keyset pagination.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["unmatched","suggested","matched","ignored","debit"]}},{"name":"statement_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BankTransaction"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.view"}},"/api/v1/bank-transactions/{id}/ignore":{"post":{"operationId":"ignoreBankTransaction","summary":"Set a bank line aside","description":"A transfer between own accounts or an unrelated credit. Audited with the reason.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BankTransaction"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.confirm"}},"/api/v1/bank-transactions/{id}/match":{"post":{"operationId":"confirmBankMatch","summary":"Confirm or link a match","description":"Confirms the credit against a rent UTR claim (confirmed with its receipt) or a receipt (cleared on the bank date). Only an open record whose amount agrees; a record already matched is a 404; a decided line a 409. Audited.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["rent_payment","receipt"]},"record_id":{"$ref":"#/components/schemas/Id"}},"required":["kind","record_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BankTransaction"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.confirm"}},"/api/v1/billing":{"get":{"operationId":"getBillingOverview","summary":"Plan, seats and payment status","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"billing.view"}},"/api/v1/billing/checkout":{"post":{"operationId":"startBillingCheckout","summary":"Start a paid subscription","description":"Creates the Razorpay subscription and returns its hosted checkout link (cards, UPI AutoPay, e-mandate). During a trial the first charge is scheduled for the trial end. 409 when a paid subscription already runs (use change).","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCheckoutInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckoutResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"billing.manage","x-idempotent":true}},"/api/v1/billing/invoices":{"get":{"operationId":"listPlatformInvoices","summary":"GST invoices and credit notes","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlatformInvoice"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"billing.view"}},"/api/v1/billing/invoices/{id}/document":{"get":{"operationId":"getPlatformInvoiceDocument","summary":"Printable invoice (HTML)","description":"A print-ready HTML page (Print → Save as PDF). Another company’s invoice is 404.","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/html"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"billing.view"}},"/api/v1/billing/plans":{"get":{"operationId":"listBillingPlans","summary":"Plans on sale","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BillingPlan"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"billing.view"}},"/api/v1/billing/subscription/cancel":{"post":{"operationId":"cancelSubscription","summary":"Cancel at the period end","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SubscriptionSummary"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"billing.manage"}},"/api/v1/billing/subscription/change":{"post":{"operationId":"changeSubscription","summary":"Change plan, seats or billing cycle","description":"Upgrades and seat increases apply now; their prorated difference is added to the next charge. Decreases, downgrades and cycle switches apply at the period end. Seats cannot go below the active members.","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeSubscriptionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SubscriptionChangeResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"billing.manage","x-idempotent":true}},"/api/v1/billing/wallets":{"get":{"operationId":"listWallets","summary":"Wallet balances and rate card","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WalletsOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"billing.view"}},"/api/v1/billing/wallets/transactions":{"get":{"operationId":"listWalletTransactions","summary":"Wallet ledger","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["sms","whatsapp","ai","voice","email"]}},{"name":"reason","in":"query","required":false,"schema":{"type":"string","enum":["topup","message","ai","voice","refund","plan_grant","adjustment"]}},{"name":"from","in":"query","required":false,"description":"Instant in ISO 8601, e.g. 2026-10-03T04:30:00.000Z.","schema":{"$ref":"#/components/schemas/DateTime"}},{"name":"to","in":"query","required":false,"description":"Instant in ISO 8601, e.g. 2026-10-03T04:30:00.000Z.","schema":{"$ref":"#/components/schemas/DateTime"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WalletTransaction"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"billing.view"}},"/api/v1/billing/wallets/{kind}":{"patch":{"operationId":"updateWallet","summary":"Set the low-balance alert","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["sms","whatsapp","ai","voice","email"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWalletInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Wallet"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"billing.wallet"}},"/api/v1/billing/wallets/{kind}/top-up":{"post":{"operationId":"createWalletTopUp","summary":"Top up a wallet","description":"Returns a Razorpay payment link for the top-up plus 18 % GST; the wallet is credited when the payment arrives (webhook) and a tax invoice is issued. Credits are closed-loop: usable only for PropZolo services.","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["sms","whatsapp","ai","voice","email"]}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletTopUpInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WalletTopUpResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"billing.wallet","x-idempotent":true}},"/api/v1/booking-demands/{id}/cancel":{"post":{"operationId":"cancelBookingDemand","summary":"Cancel an open demand raised in error (its instalments can be demanded again)","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"cancelled"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.demand"}},"/api/v1/booking-demands/{id}/letter":{"get":{"operationId":"getBookingDemandLetter","summary":"The demand letter as PDF","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.view"}},"/api/v1/booking-instalments/{id}/pay-link":{"post":{"operationId":"getBookingPayLink","summary":"The buyer’s signed pay link of an open instalment (UPI to the collection account, then the UTR)","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.demand"}},"/api/v1/booking-interest/{id}/decide":{"post":{"operationId":"decideBookingInterest","summary":"Charge late interest (it joins the next demand) or waive it with a reason","description":"Needs a fresh second factor (BLD-19). Waiving above the company’s amount waits for the interest_waiver approval chain (409 approval_required; send request_approval to raise it).","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["charge","waive"]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["charged","waived","approval_pending"]},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["id","status","amount"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["receipts.demand","receipts.refund"]}},"/api/v1/booking-receipts/{id}/bounce":{"post":{"operationId":"bounceBookingReceipt","summary":"A payment bounced or was entered in error: its allocations are reversed","description":"Needs a fresh second factor (BLD-19). Cancelling as entered in error (not a bounce) is limited to payments recorded in the last 30 days and, above the company’s amount, waits for the receipt_cancellation approval chain (409 approval_required; send request_approval to raise it). On a cancelled booking the open refund voucher shrinks.","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500},"status":{"type":"string","enum":["bounced","cancelled"]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["bounced","cancelled","approval_pending"]}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.refund"}},"/api/v1/booking-receipts/{id}/claim":{"post":{"operationId":"decideBookingClaim","summary":"Confirm a UPI payment the buyer reported on the pay link (it is numbered and allocated) or reject it","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["confirm","reject"]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["cleared","rejected"]},"number":{"type":"string"}},"required":["id","status","number"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.record"}},"/api/v1/booking-receipts/{id}/clear":{"post":{"operationId":"clearBookingReceipt","summary":"A cheque / DD was realised","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cleared_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["cleared_on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"cleared"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.record"}},"/api/v1/booking-receipts/{id}/pdf":{"get":{"operationId":"getBookingReceiptPdf","summary":"The receipt or refund voucher as PDF","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.view"}},"/api/v1/booking-receipts/{id}/refund-paid":{"post":{"operationId":"markBookingRefundPaid","summary":"A refund voucher was paid out","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string","minLength":4,"maxLength":80},"paid_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["reference","paid_on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"cleared"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.refund"}},"/api/v1/booking-receipts/{id}/tds":{"post":{"operationId":"certifyBookingTds","summary":"Record the Form 16B for the TDS on a payment (the TDS then counts as paid)","description":"Needs a fresh second factor (BLD-19). The smaller of the TDS claimed on the receipt and the certificate’s amount counts (BLD-13); `difference` is certificate − claimed.","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"form16b_number":{"type":"string","minLength":4,"maxLength":40},"form16b_on":{"$ref":"#/components/schemas/LocalDate"},"form16b_amount":{"description":"The TDS amount on the Form 16B.","$ref":"#/components/schemas/PaiseInput"},"challan_ref":{"description":"Form 26QB acknowledgement.","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]}},"required":["form16b_number","form16b_on","form16b_amount"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"tds_status":{"type":"string","const":"certified"},"tds_amount":{"$ref":"#/components/schemas/Paise"},"difference":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Certificate − claimed, paise (0: they match)."}},"required":["id","tds_status","tds_amount","difference"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.record"}},"/api/v1/bookings":{"get":{"operationId":"listBookings","summary":"Bookings you can see, newest first","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"unit_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"approval","in":"query","required":false,"schema":{"type":"string","enum":["draft","pending","approved","rejected"]}},{"name":"collections_off","in":"query","required":false,"description":"BLD-24: only migrated bookings whose collections are still off.","schema":{"type":"string","enum":["true","false"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{1,9}$"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BookingSummary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.view"},"post":{"operationId":"createBooking","summary":"Book the unit of a cost sheet the customer accepted (the unit is booked at once)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cost_sheet_id":{"$ref":"#/components/schemas/Id"},"payment_plan_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"booking_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["cost_sheet_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.create"}},"/api/v1/bookings/receipts/by-token/{token}":{"get":{"operationId":"getBookingReceiptByToken","summary":"A booking receipt PDF by its signed portal link","description":"Minted by the customer portal for an applicant of the booking (10 minutes). Unknown, expired or tampered links answer 404.","tags":["Bookings"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":20,"maxLength":300}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"}},"/api/v1/bookings/{id}":{"get":{"operationId":"getBooking","summary":"One booking: the form, the frozen cost sheet, the schedule, the approval","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.view"},"patch":{"operationId":"updateBooking","summary":"Change a draft booking: payment plan, booking date, loan, notes","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payment_plan_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"booking_date":{"$ref":"#/components/schemas/LocalDate"},"loan_bank":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"loan_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"loan_status":{"anyOf":[{"type":"string","enum":["applied","sanctioned","disbursed","rejected","not_needed"]},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.create"}},"/api/v1/bookings/{id}/allotment-letter":{"get":{"operationId":"getAllotmentLetter","summary":"The allotment letter as PDF (a DRAFT preview until the booking is confirmed)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.view"}},"/api/v1/bookings/{id}/applicants":{"put":{"operationId":"setBookingApplicants","summary":"Replace the applicants (PAN stored encrypted, only the last four of Aadhaar kept)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"applicants":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string","minLength":2,"maxLength":120},"relation":{"type":"string","enum":["self","spouse","parent","child","sibling","other"]},"is_primary":{"type":"boolean"},"pan":{"description":"Send only to set or change it.","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"aadhaar":{"description":"The full number or its last four.","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"dob":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["name"]}}},"required":["applicants"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.create"}},"/api/v1/bookings/{id}/applicants/{applicantId}/reveal-pan":{"post":{"operationId":"revealBookingApplicantPan","summary":"An applicant’s full PAN (audited)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"applicantId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"pan":{"type":"string"}},"required":["pan"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.edit"}},"/api/v1/bookings/{id}/cancel":{"post":{"operationId":"cancelAllottedBooking","summary":"Cancel an allotted booking: forfeiture kept, the rest refunded, the unit back on sale, brokerage reversed","description":"Needs a fresh second factor. A waived or lowered forfeiture, or a refund above the company’s amount, waits for the booking_cancellation approval chain (409 approval_required; send request_approval to raise it).","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500},"waive_forfeit":{"type":"boolean"},"forfeit_override":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"refund_mode":{"anyOf":[{"type":"string","enum":["upi","neft","rtgs","imps","cheque","dd","cash","loan","gateway"]},{"type":"null"}]},"refund_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["cancelled","approval_pending"]},"forfeit":{"$ref":"#/components/schemas/Paise"},"refund":{"$ref":"#/components/schemas/Paise"},"tds_not_refunded":{"$ref":"#/components/schemas/Paise"},"refund_receipt":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"brokerage_reversed":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["id","status","forfeit","refund","tds_not_refunded","refund_receipt","brokerage_reversed"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.cancel"}},"/api/v1/bookings/{id}/collections":{"get":{"operationId":"getBookingCollections","summary":"A booking’s schedule, demands, receipts, interest, TDS, transfers and customer ledger","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCollections"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.view"}},"/api/v1/bookings/{id}/demands":{"post":{"operationId":"raiseBookingDemand","summary":"Raise a demand letter (default: every instalment due within 30 days and not demanded yet)","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"schedule_ids":{"anyOf":[{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}},{"type":"null"}]},"due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"interest":{"$ref":"#/components/schemas/Paise"},"due_on":{"$ref":"#/components/schemas/LocalDate"},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"description":"Why the message to the buyer was blocked (null: queued).","type":["string","null"]}},"required":["id","number","ref","amount","interest","due_on","rows","blocked"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.demand"}},"/api/v1/bookings/{id}/documents":{"get":{"operationId":"listBookingDocuments","summary":"KYC documents of a booking","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BookingDocument"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.view"},"post":{"operationId":"registerBookingDocument","summary":"Attach an uploaded KYC document","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":500},"kind":{"type":"string","enum":["pan","aadhaar","photo","address_proof","booking_cheque","loan_sanction","other"]},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","maxLength":120},"size":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"applicant_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["key","kind","filename","content_type","size"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingDocument"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.create"}},"/api/v1/bookings/{id}/documents/upload":{"post":{"operationId":"presignBookingDocument","summary":"A presigned private upload for a KYC document","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","maxLength":120},"size":{"type":"integer","exclusiveMinimum":0,"maximum":26214400}},"required":["filename","content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"type":"string"},"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","url","method","headers","expires_at","max_bytes"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.create"}},"/api/v1/bookings/{id}/documents/{documentId}":{"get":{"operationId":"getBookingDocumentUrl","summary":"A 60-second signed download link (audited)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.view"},"delete":{"operationId":"removeBookingDocument","summary":"Remove a KYC document from a draft booking","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.create"}},"/api/v1/bookings/{id}/milestone-dates":{"post":{"operationId":"setBookingMilestoneDate","summary":"The agreement was signed / possession offered: its instalments fall due and are demanded","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"milestone":{"type":"string","enum":["agreement","possession"]},"on":{"$ref":"#/components/schemas/LocalDate"}},"required":["milestone","on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"demand":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"interest":{"$ref":"#/components/schemas/Paise"},"due_on":{"$ref":"#/components/schemas/LocalDate"},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"description":"Why the message to the buyer was blocked (null: queued).","type":["string","null"]}},"required":["id","number","ref","amount","interest","due_on","rows","blocked"],"additionalProperties":false},{"type":"null"}]}},"required":["demand"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.demand"}},"/api/v1/bookings/{id}/partner":{"put":{"operationId":"setBookingPartner","summary":"Credit a booking not yet confirmed to a channel partner, change or remove the credit (audited, with a reason)","description":"A booking is credited at creation to the partner whose registration lock is live; a partner manager corrects it before confirmation. Brokerage follows at once.","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"partner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["partner_id","reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.approve"}},"/api/v1/bookings/{id}/receipts":{"post":{"operationId":"recordBookingReceipt","summary":"Record a buyer’s payment (and the TDS they deducted); it settles the oldest demanded instalments first","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"description":"What reached the account (net of TDS).","$ref":"#/components/schemas/PaiseInput"},"tds_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"mode":{"type":"string","enum":["upi","neft","rtgs","imps","cheque","dd","cash","loan"]},"reference":{"description":"UTR / cheque number (not for cash).","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"bank":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"received_on":{"$ref":"#/components/schemas/LocalDate"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["amount","mode","received_on"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"},"advance":{"$ref":"#/components/schemas/Paise"},"expected_tds":{"$ref":"#/components/schemas/Paise"},"tds_short":{"$ref":"#/components/schemas/Paise"}},"required":["id","number","advance","expected_tds","tds_short"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.record"}},"/api/v1/bookings/{id}/stamp-value":{"put":{"operationId":"setBookingStampValue","summary":"Record the registered stamp-duty value (194-IA tests the higher of it and the consideration)","description":"BLD-09: from 1 Apr 2022 TDS u/s 194-IA applies when the higher of the consideration and the stamp-duty value is ₹50 L or more. null clears it. The answer is the section that now applies to the booking’s payments.","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stamp_duty_value":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}},"required":["stamp_duty_value"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"booking_id":{"$ref":"#/components/schemas/Id"},"stamp_duty_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"tds_section":{"description":"e.g. 194-IA; null when no TDS applies.","type":["string","null"]}},"required":["booking_id","stamp_duty_value","tds_section"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.record"}},"/api/v1/bookings/{id}/submit":{"post":{"operationId":"submitBooking","summary":"Send a complete booking to its approval chain (the company owner confirms at once)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.create"}},"/api/v1/bookings/{id}/transfer":{"post":{"operationId":"transferBooking","summary":"Transfer an allotted booking to new buyers (endorsement), with an optional transfer fee","description":"With the company setting transfer_fee_blocks (BLD-15) a fee is billed to the current buyers first: the answer is status fee_pending (id null) until that fee is paid, then the same call completes the transfer.","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"applicants":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"relation":{"type":"string","enum":["self","spouse","parent","child","sibling","other"]},"is_primary":{"type":"boolean"},"pan":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"aadhaar":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"dob":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["name"]}},"fee":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"transferred_on":{"$ref":"#/components/schemas/LocalDate"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["applicants","transferred_on"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"The transfer (null while the fee is pending)."},"status":{"type":"string","enum":["transferred","fee_pending"]},"booking_id":{"$ref":"#/components/schemas/Id"},"fee":{"$ref":"#/components/schemas/Paise"},"fee_demand_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"The demand raised for the transfer fee (with GST)."}},"required":["id","status","booking_id","fee","fee_demand_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.cancel"}},"/api/v1/bookings/{id}/withdraw":{"post":{"operationId":"withdrawBooking","summary":"Withdraw a booking not yet confirmed (the unit returns to sale)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"bookings.create"}},"/api/v1/bootstrap":{"get":{"operationId":"getBootstrap","summary":"Workspace configuration","description":"Pipelines with statuses and sub-statuses, lead sources, custom fields, branding, client settings and plan features. Send the ETag back in If-None-Match: an unchanged configuration answers 304 without a body.","tags":["Session"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Bootstrap"},"meta":{"type":"object","properties":{"server_time":{"description":"Clock of the server — clients correct their offset from it.","$ref":"#/components/schemas/DateTime"},"timezone":{"type":"string","minLength":1,"maxLength":64,"description":"IANA time zone, e.g. Asia/Kolkata.","examples":["Asia/Kolkata"]},"etag":{"type":"string","description":"Same as the ETag header; send it back in If-None-Match."}},"required":["server_time","timezone","etag"],"additionalProperties":false}},"required":["data","meta"]}}}},"304":{"description":"Not modified — the configuration matches If-None-Match.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal"}},"/api/v1/branches":{"get":{"operationId":"listBranches","summary":"Branches","description":"Offices with address, registrations and member counts. Needs `settings.company`, `settings.users` or `settings.view`.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Branch"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.company","settings.users","settings.view"]},"post":{"operationId":"createBranch","summary":"Add a branch","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Branch"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/branches/{id}":{"patch":{"operationId":"updateBranch","summary":"Edit a branch","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBranchInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Branch"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"},"delete":{"operationId":"deleteBranch","summary":"Remove a branch","description":"Only once no active member belongs to it; records keep their history.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/broadcasts":{"get":{"operationId":"listBroadcasts","summary":"Broadcasts","description":"Newest first, with live stats; keyset pagination.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","pending","scheduled","running","paused","completed","cancelled"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Broadcast"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"},"post":{"operationId":"createBroadcast","summary":"Draft a broadcast","description":"Provider channels only (official WhatsApp, DLT SMS, email); OTP / transactional templates are refused.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBroadcastInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.create","x-idempotent":true}},"/api/v1/broadcasts/senders":{"get":{"operationId":"listBroadcastSenders","summary":"Senders a broadcast can use","description":"Connected provider identities of the channel, default first — for WhatsApp with a template, only the numbers of that template’s WhatsApp Business Account. Pass the id as channel_account_id when drafting.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["whatsapp_cloud","sms","email"]}},{"name":"template_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BroadcastSender"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/broadcasts/{id}":{"get":{"operationId":"getBroadcast","summary":"A broadcast","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"},"patch":{"operationId":"updateBroadcast","summary":"Edit a broadcast draft","description":"Changing the audience, template or channel drops the audience snapshot (build it again).","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBroadcastInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"},"delete":{"operationId":"deleteBroadcast","summary":"Delete a broadcast draft","description":"Drafts and broadcasts waiting for approval only — cancel the others.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.delete"}},"/api/v1/broadcasts/{id}/approve":{"post":{"operationId":"approveBroadcast","summary":"Approve and launch","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"scheduled_at":{"description":"Later; omit to send now.","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"tier_override":{"description":"WhatsApp: send to more people than the number’s messaging tier anyway (409 `tier_exceeded` without it); the reason is audited.","anyOf":[{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"]},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/broadcasts/{id}/build":{"post":{"operationId":"buildBroadcast","summary":"Build the audience snapshot","description":"Deduped by contact, within your lead / contact scope, at most 10,000 people; the people a send would refuse are skipped with a reason (opted_out, dnd, no_consent, recent, invalid, duplicate). Returns the cost estimate.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/broadcasts/{id}/cancel":{"post":{"operationId":"cancelBroadcast","summary":"Cancel a broadcast","description":"Recipients not reached yet are cancelled; messages already queued still go out.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/broadcasts/{id}/compliance":{"post":{"operationId":"checkBroadcastCompliance","summary":"Run the AI Compliance Check","description":"Mandatory before launch or approval: the template with its values (and the AI instructions) through the company’s RERA / claims rules, the template category and RERA numbers; the AI reviews what the rules cannot judge (when AI is on). The result is tied to the message — any change needs a new check.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/broadcasts/{id}/compliance/override":{"post":{"operationId":"overrideBroadcastCompliance","summary":"Override an AI-review failure","description":"Only a failure raised by the AI review (never a rule’s block — fix the message or switch the rule off in Settings → AI); needs `ai.agents_manage` and a reason; audited.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/broadcasts/{id}/export":{"get":{"operationId":"exportBroadcastRecipients","summary":"Export the recipients as CSV","description":"Addresses masked by your role; formula-safe; audited.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/broadcasts/{id}/launch":{"post":{"operationId":"launchBroadcast","summary":"Send now or schedule","description":"Needs a built audience, an approved template, a current passing AI Compliance Check (POST …/compliance) and enough wallet credit for the estimate (409 otherwise). The worker sends in per-minute batches inside the send window — with send_mode best_time, each recipient at their own best hour.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"scheduled_at":{"description":"Later; omit to send now.","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"tier_override":{"description":"WhatsApp: send to more people than the number’s messaging tier anyway (409 `tier_exceeded` without it); the reason is audited.","anyOf":[{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"]},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/broadcasts/{id}/pause":{"post":{"operationId":"pauseBroadcast","summary":"Pause a broadcast","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/broadcasts/{id}/personalize":{"post":{"operationId":"personalizeBroadcast","summary":"Write the AI personal values","description":"For a built broadcast with AI personalisation on: every queued recipient’s values are written in the background (live for small audiences, the Batch API from 200 recipients at half price) and checked; failed checks and anyone not ready when it sends get the template’s normal values. 409 when the AI wallet does not cover the estimate.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/broadcasts/{id}/personalize/preview":{"post":{"operationId":"previewBroadcastPersonalization","summary":"Preview AI personal values for a few recipients","description":"Live AI calls for up to 5 recipients of the built audience (uses AI credits); nothing is stored.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{"count":3},"type":"object","properties":{"count":{"default":3,"type":"integer","minimum":1,"maximum":5}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BroadcastPersonalizationPreview"}},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["items","credits"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/broadcasts/{id}/recipients":{"get":{"operationId":"listBroadcastRecipients","summary":"Recipients of a broadcast","description":"Per person: status, skip reason, delivery, reply, click and opt-out; keyset pagination.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","sent","skipped","cancelled"]}},{"name":"reason","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":48}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BroadcastRecipient"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/broadcasts/{id}/reject":{"post":{"operationId":"rejectBroadcast","summary":"Send back for changes","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/broadcasts/{id}/resume":{"post":{"operationId":"resumeBroadcast","summary":"Resume a broadcast","description":"Checks the template and the wallet again (409 when Meta still pauses the template or credit is short).","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/broadcasts/{id}/submit":{"post":{"operationId":"submitBroadcast","summary":"Ask for approval","description":"For members without `campaigns.send`: someone who has it approves (and launches) or sends it back.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/calendar":{"get":{"operationId":"getMyCalendar","summary":"My calendar sync","description":"Your connection (or none), the providers PropZolo offers and the text you agree to before connecting.","tags":["Calendar sync"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalendarOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"patch":{"operationId":"updateMyCalendar","summary":"What goes into my calendar","tags":["Calendar sync"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visits":{"type":"boolean","description":"Site visits where you are the agent."},"meetings":{"type":"boolean","description":"Meetings and other tasks with a time."},"follow_ups":{"type":"boolean","description":"Follow-ups and call tasks."}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalendarConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"delete":{"operationId":"disconnectMyCalendar","summary":"Disconnect my calendar","description":"Stops at once; PropZolo’s calendar is then deleted from your account and your busy times forgotten.","tags":["Calendar sync"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"}},"required":["id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/calendar/busy":{"get":{"operationId":"getMemberBusy","summary":"A member’s busy times","description":"For yourself, or for a member you may book visits for (`site_visits.create`): start and end of each busy block from their connected calendar, at most 31 days.","tags":["Calendar sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"member_id","in":"query","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"from","in":"query","required":true,"description":"Instant in ISO 8601, e.g. 2026-10-03T04:30:00.000Z.","schema":{"$ref":"#/components/schemas/DateTime"}},{"name":"to","in":"query","required":true,"description":"Instant in ISO 8601, e.g. 2026-10-03T04:30:00.000Z.","schema":{"$ref":"#/components/schemas/DateTime"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberBusy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"site_visits.view"}},"/api/v1/calendar/sync":{"post":{"operationId":"syncMyCalendarNow","summary":"Sync my calendar now","tags":["Calendar sync"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalendarConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/calendar/{provider}/oauth/callback":{"get":{"operationId":"completeCalendarOAuth","summary":"Calendar sign-in callback","description":"Always redirects back to Settings → My account → Calendar with `connected=<provider>` or `error=…`.","tags":["Calendar sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["google","microsoft"]}},{"name":"code","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":600}},{"name":"error","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"error_description","in":"query","required":false,"schema":{"type":"string","maxLength":8000}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","maxLength":2000}},{"name":"session_state","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{},"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/calendar/{provider}/oauth/start":{"get":{"operationId":"startCalendarOAuth","summary":"Connect my calendar: the provider’s sign-in","description":"Needs the consent text version you agreed to (`consent`). Returns the provider’s consent URL (or redirects with `?redirect=1`). 404 until PropZolo set the provider up.","tags":["Calendar sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["google","microsoft"]}},{"name":"consent","in":"query","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},{"name":"redirect","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/call-list/members/{id}":{"get":{"operationId":"getMemberCallList","summary":"A member’s call list today","description":"For managers: a member their lead scope reaches (no dial numbers). 403 outside the scope.","tags":["Call list"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallList"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/call-qa/coaching":{"get":{"operationId":"callCoachingQueue","summary":"The coaching queue","description":"Unreviewed scorecards with a critical miss or a score under the company’s coaching threshold — critical misses first, then the lowest scores (at most 100).","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"from","in":"query","required":true,"description":"First day (company calendar).","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":true,"description":"Last day (company calendar), at most a year after `from`.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"member_id","in":"query","required":false,"description":"Only these agents (repeat the parameter); default: everyone in your `calls.qa` scope.","schema":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}}]}},{"name":"objection","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{2,39}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CallScorecardRow"}},"meta":{"type":"object","properties":{"threshold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"truncated":{"type":"boolean"}},"required":["threshold","truncated"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.qa"}},"/api/v1/call-qa/scorecards":{"get":{"operationId":"listCallScorecards","summary":"QA scorecards","description":"Scored calls of the agents in your `calls.qa` scope, newest day first; keyset pagination.","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"from","in":"query","required":true,"description":"First day (company calendar).","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":true,"description":"Last day (company calendar), at most a year after `from`.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"member_id","in":"query","required":false,"description":"Only these agents (repeat the parameter); default: everyone in your `calls.qa` scope.","schema":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}}]}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","to_review","reviewed"]}},{"name":"band","in":"query","required":false,"schema":{"type":"string","enum":["good","fair","poor"]}},{"name":"critical","in":"query","required":false,"description":"Only cards with a critical criterion missed.","schema":{"type":"string"}},{"name":"objection","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{2,39}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CallScorecardRow"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.qa"}},"/api/v1/call-qa/trends":{"get":{"operationId":"callQaTrends","summary":"QA trends","description":"Per-agent average scores with the change against the previous period, the team line, criteria hit rates and the most frequent objections.","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"from","in":"query","required":true,"description":"First day (company calendar).","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":true,"description":"Last day (company calendar), at most a year after `from`.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"member_id","in":"query","required":false,"description":"Only these agents (repeat the parameter); default: everyone in your `calls.qa` scope.","schema":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}}]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallQaTrends"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.qa"}},"/api/v1/calls":{"get":{"operationId":"listCalls","summary":"The call log","description":"Newest first, keyset-paginated, within your `calls.view` scope (a lead’s history: every member).","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["calls:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default today); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"member_id","in":"query","required":false,"description":"Comma list of member ids (within your scope).","schema":{"type":"string","maxLength":4000}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["outgoing","incoming","missed"]}},{"name":"result","in":"query","required":false,"description":"Comma list of results.","schema":{"type":"string","maxLength":4000}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["lead","client","contact","saved_contact","unknown","crm","other"]}},{"name":"lead_id","in":"query","required":false,"description":"A lead’s whole call history (every member; others redacted).","schema":{"$ref":"#/components/schemas/Id"}},{"name":"contact_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"first_call","in":"query","required":false,"schema":{"type":"string"}},{"name":"sim_slot","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":3}},{"name":"min_duration","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":86400}},{"name":"max_duration","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":86400}},{"name":"outcome","in":"query","required":false,"description":"`not_logged`: lead calls without an outcome.","schema":{"type":"string","maxLength":120}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"calls.view"}},"/api/v1/calls/analytics":{"get":{"operationId":"getCallAnalytics","summary":"Call analytics","description":"KPIs with the previous period, calls per day / hour and the weekday × hour heatmap on the company calendar, the call mix, failures, first-call speed, top and shared numbers and the agent table — within `calls.analytics`. A member with only `calls.view` gets the analytics of their own calls (D-UD11; another member_id: 403).","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["calls:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default today); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"member_id","in":"query","required":false,"schema":{"type":"string","maxLength":4000}},{"name":"branch_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallAnalytics"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["calls.analytics","calls.view"]}},"/api/v1/calls/analytics/agents/{memberId}":{"get":{"operationId":"getAgentCallAnalytics","summary":"One agent’s calls (agent drawer)","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"memberId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default today); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentCallAnalytics"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"calls.analytics"}},"/api/v1/calls/click-to-call":{"post":{"operationId":"clickToCall","summary":"Call a lead through cloud telephony","description":"Your verified phone rings first; when you answer, the customer is called and both see the company’s virtual number — never your own. Refused (409, `fields.call` says why) for blocked contacts, opt-outs, promotional calls without consent or outside the 7-day enquiry window or 09:00–21:00, DND numbers, and software-initiated dialling from a number without an A2P declaration. Send an Idempotency-Key: a retried request never dials twice.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"phone_id":{"description":"One of the contact’s numbers (default: the primary one).","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"purpose":{"default":"service","description":"A request the server may tighten: `promotional` is always honoured, `service` only when the contact has a live relationship (a recent enquiry, call, visit or deal) — otherwise the call is treated as promotional.","type":"string","enum":["service","promotional"]},"origin":{"default":"click_to_call","type":"string","enum":["click_to_call","dialer","voice_agent"]}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CloudCall"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.cloud_call","x-idempotent":true}},"/api/v1/calls/cloud":{"get":{"operationId":"getCloudCallAvailability","summary":"Can I call through cloud telephony?","description":"What the call buttons show: enabled, or why not (not connected, not in the plan, no permission, no verified phone).","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CloudCallAvailability"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.view"}},"/api/v1/calls/devices":{"get":{"operationId":"listAgentPhones","summary":"Agent phones","description":"Every member in your `calls.devices` scope with their phones: SIMs (last four digits only), permissions, app version, last sync and the issues that stop calls from arriving. Remove a phone with DELETE /api/v1/mobile/devices/{id}.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MemberPhones"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"calls.devices"}},"/api/v1/calls/devices/{memberId}/tracking":{"put":{"operationId":"setMemberCallTracking","summary":"Switch call tracking for a member","description":"Off: the member’s phone keeps syncing, the server acknowledges and stores nothing. Audited.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"memberId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"tracking_enabled":{"type":"boolean"}},"required":["member_id","tracking_enabled"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.mobile_app"}},"/api/v1/calls/manual":{"post":{"operationId":"createManualCall","summary":"Record a call placed without call tracking","description":"For phones that cannot read the call log (iOS): records your own outgoing call with source `manual`, linked to the lead (or matched by number), counted and announced like a synced call. Then tag it with `POST /api/v1/calls/{id}/outcome`. Idempotent on `client_key`.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManualCallInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateManualCallResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.view","x-idempotent":true}},"/api/v1/calls/members":{"get":{"operationId":"listCallMembers","summary":"Members for the agent filter","description":"The members whose calls you reach with `scope` (view, analytics or integrity), A → Z.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"view","type":"string","enum":["view","analytics","integrity"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CallMemberOption"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal"}},"/api/v1/calls/pending":{"get":{"operationId":"getPendingCalls","summary":"My calls waiting for their outcome","description":"The caller’s own work-SIM calls since the call rule started that still need an outcome (newest first, at most 30). The app opens this list before the next dial while `count` > 0.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PendingCalls"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/calls/phones/{id}/work-sims":{"put":{"operationId":"setPhoneWorkSimLock","summary":"Lock the work SIMs of a phone","description":"CALL-10: fixes which SIMs of the phone are work SIMs (keys from its SIM list) so the member’s toggle no longer decides which calls are stored; `keys: null` hands the choice back to the member. Audited.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"anyOf":[{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},{"type":"null"}]}},"required":["keys"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"work_sims_locked":{"type":"boolean"},"sims":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"slot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"carrier":{"type":["string","null"]},"number_last4":{"type":["string","null"]},"is_work":{"type":"boolean"}},"required":["key","slot","carrier","number_last4","is_work"],"additionalProperties":false}}},"required":["id","work_sims_locked","sims"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.mobile_app"}},"/api/v1/calls/settings":{"get":{"operationId":"getCallTrackingSettings","summary":"Call-tracking settings","description":"Readable with `settings.mobile_app` or `settings.view`; the app gets the same keys in the bootstrap.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallTrackingSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"patch":{"operationId":"updateCallTrackingSettings","summary":"Change call-tracking settings","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCallTrackingSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallTrackingSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.mobile_app"}},"/api/v1/calls/targets":{"get":{"operationId":"getMyCallTargets","summary":"My daily targets, streak and rank","description":"The app’s Today ring: goals (member → team → company → built-in), today’s calls, the streak, today’s rank.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallTargetsView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"put":{"operationId":"setCallTargets","summary":"Set daily call targets","description":"For a member in your analytics scope, or the company default (needs a view of everyone).","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCallTargetsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DailyCallTargets"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.targets"}},"/api/v1/calls/targets/board":{"get":{"operationId":"getCallTargetsBoard","summary":"Today’s leaderboard","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CallTargetsBoardRow"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"calls.analytics"}},"/api/v1/calls/{id}":{"get":{"operationId":"getCall","summary":"One call","description":"The call card: what the phone saw (network snapshot), the phone, and who else called the number.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["calls:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"calls.view"}},"/api/v1/calls/{id}/assist":{"post":{"operationId":"getCallAssist","summary":"Live call assist","description":"The live transcript of a cloud call and — when the customer asked something or raised an objection since the last suggestion — the next line and objection handling, grounded on the lead and matching inventory. Uses AI credits.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"last_suggested_at_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallAssist"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/calls/{id}/insights":{"get":{"operationId":"getCallInsights","summary":"A call’s insights","description":"The call drawer’s Insights tab: the analysis state, summary, outcome, hot signal, objections with quotes, proposed commitments and requirement fields, and the QA scorecard when you may see it.","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallInsights"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.view"}},"/api/v1/calls/{id}/insights/analyse":{"post":{"operationId":"analyseCall","summary":"Analyse a call now","description":"Queues the call ahead of the nightly batch (AI credits, within the day’s budget). Idempotent while it waits; a call already analysed is refused (409).","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallInsights"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/calls/{id}/insights/commitments":{"post":{"operationId":"confirmCallCommitments","summary":"Turn promised call-backs into tasks","description":"Creates a task for each confirmed commitment (title, due time and type may be edited) and sets aside the dismissed ones. Each commitment is handled once.","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"create":{"default":[],"maxItems":6,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}]},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"type":{"anyOf":[{"type":"string","enum":["call","follow_up","whatsapp","site_visit","meeting","document","other"]},{"type":"null"}]}},"required":["key"]}},"dismiss":{"default":[],"maxItems":6,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallInsights"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.view"}},"/api/v1/calls/{id}/insights/proposal":{"post":{"operationId":"applyCallProposal","summary":"Apply or dismiss the requirement fields heard on a call","description":"The accepted fields are recomputed from the stored extraction against the lead as it is now and applied as one lead update (needs `leads.edit` on the lead). A newer proposal than the one reviewed is refused (409).","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"proposal_version":{"type":"integer","minimum":0,"maximum":9007199254740991},"keys":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"dismiss":{"type":"boolean"}},"required":["proposal_version"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallInsights"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.view"}},"/api/v1/calls/{id}/insights/review":{"post":{"operationId":"reviewCallScorecard","summary":"Review a call’s QA scorecard","description":"Your verdicts and notes over the model’s, re-scored with the rubric the card was scored with. Never on your own call. Audited.","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"default":[],"maxItems":12,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"verdict":{"type":"string","enum":["met","partial","missed","not_applicable"]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["key","verdict"]}},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"score":{"type":["number","null"]},"model_score":{"type":["number","null"]},"changed":{"type":"array","items":{"type":"string"}}},"required":["score","model_score","changed"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.qa"}},"/api/v1/calls/{id}/lead":{"post":{"operationId":"addCallAsLead","summary":"Add an unknown caller as a lead","description":"Creates the lead through the enquiry path (channel `call`: duplicate policy, routing and events as for any enquiry), owned by the member whose call it was, and links every call with the number.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCallAsLeadInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AddCallAsLeadResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.create","x-idempotent":true}},"/api/v1/calls/{id}/outcome":{"post":{"operationId":"logCallOutcome","summary":"Tag what happened on a call","description":"Your own call (or a lead you may edit). With `lead_status` the lead’s status sheet runs (validation, follow-up, visit, timeline) and the call carries the outcome; otherwise a disposition is stored on the call.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogCallOutcomeInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LogCallOutcomeResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.view","x-idempotent":true}},"/api/v1/calls/{id}/recording":{"get":{"operationId":"getCallRecording","summary":"Play a call recording","description":"A short-lived URL (5 minutes) after the `calls.recordings` scope check; audited.","tags":["Calls"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallRecording"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.recordings"}},"/api/v1/calls/{id}/voice-agent":{"get":{"operationId":"getCallVoiceTranscript","summary":"The AI conversation of a call","description":"For an AI voice call (source ai_voice) in the call drawer: the transcript and outcome. 404 for other calls and leads you cannot see.","tags":["AI voice agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceCallDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["ai.voice_agent","calls.view","leads.view"]}},"/api/v1/campaigns":{"get":{"operationId":"listCampaigns","summary":"Campaigns and their spend","description":"Spend entries per campaign and source with their periods and attributed leads (at most 500).","tags":["Campaign spend"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"source_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":120}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MarketingCampaign"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"marketing.view"},"post":{"operationId":"createCampaign","summary":"Record campaign spend","description":"A spend for a period needs its first day; names and campaign ids are unique per source (409).","tags":["Campaign spend"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"source_id":{"$ref":"#/components/schemas/Id"},"external_id":{"description":"The ad platform’s campaign id; incoming leads with it are attributed to this campaign.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"spend":{"description":"Spend over the period, in paise.","$ref":"#/components/schemas/PaiseInput"},"starts_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"ends_on":{"description":"Inclusive; default: the first day.","anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["name","source_id","spend"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingCampaign"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit","x-idempotent":true}},"/api/v1/campaigns/{id}":{"patch":{"operationId":"updateCampaign","summary":"Change a campaign’s spend or period","tags":["Campaign spend"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"source_id":{"$ref":"#/components/schemas/Id"},"external_id":{"description":"The ad platform’s campaign id; incoming leads with it are attributed to this campaign.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"spend":{"description":"Spend over the period, in paise.","$ref":"#/components/schemas/PaiseInput"},"starts_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"ends_on":{"description":"Inclusive; default: the first day.","anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingCampaign"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"},"delete":{"operationId":"deleteCampaign","summary":"Delete a campaign no lead came from","description":"A campaign with attributed leads answers 409 — set its spend to 0 instead.","tags":["Campaign spend"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"}},"/api/v1/charge-templates/{id}":{"patch":{"operationId":"updateChargeTemplate","summary":"Change a charge template (published price lists keep the config frozen with them)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"config":{"$ref":"#/components/schemas/ChargeTemplateConfig2"},"is_default":{"type":"boolean"},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChargeTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/collections":{"get":{"operationId":"getCollectionsBoard","summary":"Ageing of booking instalments, bookings with money outstanding and payments awaiting Form 16B","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"only_overdue","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{1,9}$"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"queue_limit","in":"query","required":false,"description":"Entries of the Form 16B and claim queues to return (default 50).","schema":{"type":"integer","minimum":1,"maximum":500}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CollectionsBoard"},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.view"}},"/api/v1/collections/settings":{"get":{"operationId":"getCollectionsSettings","summary":"Demand days, reminder days, late interest, forfeiture and buyer messages","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CollectionsPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["projects.pricing","receipts.view"]},"put":{"operationId":"updateCollectionsSettings","summary":"Change the collections settings (audited)","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"demand_days":{"type":"integer","minimum":0,"maximum":90,"description":"Days between a stage certificate (or the agreement / possession date) and the due date."},"reminder_days":{"maxItems":5,"type":"array","items":{"type":"integer","minimum":1,"maximum":30},"description":"Default 7, 3, 1."},"interest_bps":{"type":"integer","minimum":0,"maximum":3600,"description":"Late interest, basis points a year (0: none)."},"interest_grace_days":{"type":"integer","minimum":0,"maximum":60},"forfeit_bps":{"type":"integer","minimum":0,"maximum":5000,"description":"Forfeited of the agreement value."},"send_demands":{"type":"boolean"},"send_receipts":{"type":"boolean"},"demand_footer":{"type":"string","maxLength":1000},"upi_vpa":{"anyOf":[{"type":"string","const":""},{"type":"string","pattern":"^[A-Za-z0-9._-]{2,256}@[A-Za-z][A-Za-z0-9]{1,63}$"}],"description":"The collection account’s UPI id for the buyer’s pay link (empty: none)."},"payee_name":{"type":"string","maxLength":80},"gst_after_cc":{"type":"string","enum":["keep","drop"],"description":"Instalments demanded after the completion / occupancy certificate keep or drop their GST (BLD-10)."},"transfer_fee_blocks":{"type":"boolean","description":"A transfer with a fee completes only once the fee is paid (BLD-15)."},"booking_backdate_days":{"type":"integer","minimum":0,"maximum":90,"description":"Days a booking may be dated before its cost sheet was accepted (BLD-37)."}},"required":["demand_days","reminder_days","interest_bps","interest_grace_days","forfeit_bps","send_demands","send_receipts","demand_footer","upi_vpa","payee_name"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CollectionsPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/commission-payouts":{"get":{"operationId":"listCommissionPayouts","summary":"List commission payouts","description":"Within the caller’s commissions scope (the payee), with what is releasable now under each rule.","tags":["Commissions"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"deal_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PayoutStatus"}},{"name":"payee_id","in":"query","required":false,"description":"A member id, or `me`.","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CommissionPayout"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"commissions.view"},"post":{"operationId":"createCommissionPayout","summary":"Record a payout","tags":["Commissions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommissionPayoutInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CommissionPayout"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout","x-idempotent":true}},"/api/v1/commission-payouts/{id}":{"patch":{"operationId":"updateCommissionPayout","summary":"Edit, approve, hold or cancel a payout","description":"Amount and release rule while pending or on hold; approved runs the payout approval policy; on hold and cancelled need a reason. Paying is POST /commission-payouts/{id}/pay. Paid and cancelled payouts are final.","tags":["Commissions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCommissionPayoutInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CommissionPayout"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/commission-payouts/{id}/approve":{"post":{"operationId":"approvePayout","summary":"Approve a payout","description":"Above the company’s payout approval amount it waits for the approval chain (409 approval_required; send request_approval=1 to raise it).","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"request_approval","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CommissionPayout"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/commission-payouts/{id}/pay":{"post":{"operationId":"payPayout","summary":"Record a payout’s payment","description":"With the mode and reference (UTR, cheque number); a part leaves the rest as its own approved payout. Takes the TDS (data-driven section, yearly threshold, no-PAN rate) and writes the TDS register. Needs a fresh second factor.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"paid_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"mode":{"type":"string","enum":["neft","rtgs","imps","upi","cheque","cash"]},"reference":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"override_release":{"default":false,"type":"boolean"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["mode"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"paid":{"$ref":"#/components/schemas/CommissionPayout"},"rest":{"anyOf":[{"$ref":"#/components/schemas/CommissionPayout"},{"type":"null"}]}},"required":["paid","rest"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout","x-idempotent":true}},"/api/v1/commission-payouts/{id}/tds-preview":{"get":{"operationId":"previewPayoutTds","summary":"What paying a payout would deduct","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"amount","in":"query","required":false,"description":"Paise; default the whole payout.","schema":{"type":"string","pattern":"^\\d{1,18}$"}},{"name":"paid_on","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TdsPreview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/company":{"get":{"operationId":"getCompanyProfile","summary":"Company profile","description":"Profile, registrations, locale and branding of the caller’s company. Needs `settings.company` or `settings.view`.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.company","settings.view"]},"patch":{"operationId":"updateCompanyProfile","summary":"Update the company profile","description":"Profile fields, GSTIN, PAN, RERA registrations, time zone, locale and financial-year start. A GSTIN must carry the company’s PAN. Status, slug and company type are platform-only.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCompanyInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/company/branding":{"patch":{"operationId":"updateCompanyBranding","summary":"Set the brand colour","description":"One brand colour drives buttons, links and the focus ring for everyone in the workspace; null resets it.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBrandingInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/company/branding/{asset}":{"post":{"operationId":"startCompanyBrandingUpload","summary":"Start a logo or wordmark upload","description":"Returns a presigned URL for a private upload. After the PUT, attach the key with PUT on the same path: the image is checked, stripped of metadata (EXIF/GPS) and published.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"asset","in":"path","required":true,"schema":{"type":"string","enum":["logo","wordmark","favicon","app_icon"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageUploadInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImageUploadTicket"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"},"put":{"operationId":"attachCompanyBrandingAsset","summary":"Publish an uploaded logo or wordmark","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"asset","in":"path","required":true,"schema":{"type":"string","enum":["logo","wordmark","favicon","app_icon"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachImageInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"},"delete":{"operationId":"removeCompanyBrandingAsset","summary":"Remove the logo or wordmark","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"asset","in":"path","required":true,"schema":{"type":"string","enum":["logo","wordmark","favicon","app_icon"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/company/business-hours":{"get":{"operationId":"getBusinessHours","summary":"Business hours and holidays","description":"The working week and the holiday calendar on the company clock — the business-hours SLAs, routing shifts and automation delays count only this time.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BusinessHours"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.company","settings.view"]},"put":{"operationId":"updateBusinessHours","summary":"Replace business hours and holidays","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessHoursInput2"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BusinessHours"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/company/security":{"get":{"operationId":"getSecurityPolicy","summary":"Security policy","description":"Which roles must use two-step verification, the session lifetimes and the IP allow-list status.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SecurityPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.security","settings.view"]},"put":{"operationId":"updateSecurityPolicy","summary":"Require two-step verification by role","description":"Members of these roles who have not set up an authenticator are asked to on their next request. Owner and Admin stay required.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecurityPolicyInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SecurityPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.security"}},"/api/v1/consents":{"get":{"operationId":"listConsents","summary":"Consent ledger of a contact","description":"Newest first; includes suppressions.","tags":["Consent"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:read"]}],"parameters":[{"name":"contact_id","in":"query","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Consent"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.view"},"post":{"operationId":"captureConsent","summary":"Record a consent","description":"Enquiry-based consent expires 7 days after the enquiry (TRAI TCCCPR, 18 Sep 2026). Members and API keys record sources manual, call, form or import (API keys also api); basis consent / legacy_registered needs proof.ref. A DLT consent ref, or a grant after the person opted out themselves (STOP, unsubscribe), needs privacy.consents, step-up and a reason — and, for the re-opt-in, proof of the person’s new request.","tags":["Consent"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"channel":{"$ref":"#/components/schemas/ConsentChannel"},"purpose":{"$ref":"#/components/schemas/ConsentPurpose"},"basis":{"$ref":"#/components/schemas/ConsentBasis"},"source":{"$ref":"#/components/schemas/ConsentSource"},"proof":{"$ref":"#/components/schemas/ConsentProof"},"dlt_consent_ref":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"captured_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reason":{"description":"Required for a DLT ref or an opt-out override.","anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["contact_id","channel","purpose","basis","source"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Consent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.edit"}},"/api/v1/consents/contacts/{contactId}":{"get":{"operationId":"getConsentPanel","summary":"Consent panel of a contact","tags":["Consent"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:read"]}],"parameters":[{"name":"contactId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ConsentPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.view"}},"/api/v1/consents/export":{"post":{"operationId":"exportConsents","summary":"Export a person’s consent records (DPDP)","description":"Unmasked, for data-principal requests; audited.","tags":["Consent"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"phone":{"type":"string","maxLength":32},"email":{"type":"string","maxLength":254}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Consent"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"}},"/api/v1/consents/suppressions":{"get":{"operationId":"listSuppressions","summary":"Suppression list","description":"Addresses nothing is sent to on a channel (bounces, complaints, invalid numbers, manual).","tags":["Consent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"channel","in":"query","required":false,"schema":{"type":"string","enum":["whatsapp","sms","email","all"]}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"},"post":{"operationId":"addSuppression","summary":"Suppress an address","tags":["Consent"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","sms","email","all"]},"address":{"type":"string","minLength":3,"maxLength":254,"description":"Phone (any format) or email."},"reason":{"default":"manual","type":"string","enum":["hard_bounce","complaint","invalid_number","blocked_by_recipient","manual"]},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["channel","address"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Suppression"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/consents/suppressions/lift":{"post":{"operationId":"liftSuppression","summary":"Lift a suppression","description":"A DPDP erasure block cannot be lifted (403). Complaint and blocked-by-recipient blocks need a note (why) and step-up.","tags":["Consent"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","sms","email","all"]},"address":{"type":"string","minLength":3,"maxLength":254,"description":"Phone (any format) or email."},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["channel","address"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Suppression"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/consents/withdraw":{"post":{"operationId":"withdrawConsent","summary":"Record a withdrawal (opt-out)","description":"Defaults to every channel and every non-transactional purpose, like STOP.","tags":["Consent"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"channel":{"default":"all","$ref":"#/components/schemas/ConsentChannel"},"purpose":{"default":"all","$ref":"#/components/schemas/ConsentPurpose"},"source":{"default":"manual","$ref":"#/components/schemas/ConsentSource"},"proof":{"$ref":"#/components/schemas/ConsentProof"}},"required":["contact_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Consent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.view"}},"/api/v1/contacts":{"get":{"operationId":"listContacts","summary":"List contacts","description":"Keyset-paginated contacts the caller can see (their own, and the people behind leads they can see). `q` matches the name, a phone suffix (4+ digits) or the email. Sort keys: created_at, updated_at, name.","tags":["Contacts"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"filter","in":"query","required":false,"description":"Filter tree ({ all | any | not | field/op/value }) as JSON or base64url(JSON).","schema":{"type":"string","maxLength":20000}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"archived","in":"query","required":false,"description":"Include archived contacts (default false).","schema":{"type":"string","enum":["true","false","only"]}},{"name":"kind","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ContactKind"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactSummary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.view"},"post":{"operationId":"createContact","summary":"Create a contact","description":"A number that already belongs to another contact is a 409 (one contact per phone per company).","tags":["Contacts"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ContactDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.create","x-idempotent":true}},"/api/v1/contacts/{id}":{"get":{"operationId":"getContact","summary":"A contact","description":"Details, numbers, consent badges, counts of linked records and the leads the caller can see.","tags":["Contacts"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ContactDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.view"},"patch":{"operationId":"updateContact","summary":"Update a contact","tags":["Contacts"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ContactDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.edit"},"delete":{"operationId":"archiveContact","summary":"Archive a contact","description":"Soft delete (recoverable); its leads stay. A new enquiry from the same number restores the contact.","tags":["Contacts"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ContactDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"contacts.delete"}},"/api/v1/contacts/{id}/ads-measurement":{"get":{"operationId":"getContactAdsMeasurement","summary":"Whether the person’s ad conversions may be shared","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdsMeasurement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"contacts.view"},"put":{"operationId":"setContactAdsMeasurement","summary":"Record or lift an objection to ad measurement","description":"Appends to the consent ledger (purpose `ads_measurement`). An objection stops every conversion still waiting.","tags":["Ad conversions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"objected":{"type":"boolean"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["objected"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdsMeasurement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"contacts.edit"}},"/api/v1/contacts/{id}/owner-report":{"get":{"operationId":"getContactOwnerReport","summary":"An owner’s reports","description":"Their listings, report links (URLs for what the caller manages), the periodic report choice and sends.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ContactOwnerReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"contacts.view"}},"/api/v1/contacts/{id}/owner-report/digest":{"put":{"operationId":"setContactOwnerReportDigest","summary":"Stop or resume an owner’s periodic report","description":"Records the owner’s wish (told to their agent). Audited.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stopped":{"type":"boolean"}},"required":["stopped"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ContactOwnerReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"contacts.edit"}},"/api/v1/contacts/{id}/restore":{"post":{"operationId":"restoreContact","summary":"Restore an archived contact","tags":["Contacts"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ContactDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"contacts.delete"}},"/api/v1/contacts/{id}/reveal-phone":{"post":{"operationId":"revealContactPhone","summary":"Reveal a contact’s numbers","description":"Audited; counted against the daily quota (company setting contacts.reveal_daily_limit, default 50) — 429 when it is used up. Members who see numbers anyway get them without a quota.","tags":["Contacts"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RevealedPhones"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"contacts.reveal"}},"/api/v1/conversations":{"get":{"operationId":"listConversations","summary":"Conversations","description":"Most recent first (or oldest first with `sort=oldest`), within the caller’s inbox scope.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["inbox:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"view","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","unassigned","all"]}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","enum":["whatsapp_cloud","whatsapp_web","sms","email","voice","in_app"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":12}},{"name":"contact_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"A phone suffix (4+ digits), the contact’s name or words of the last message.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"unread","in":"query","required":false,"description":"Only conversations with unread messages.","schema":{"type":"string"}},{"name":"snoozed","in":"query","required":false,"description":"true: only snoozed until later · false: only awake ones · absent: both.","schema":{"type":"string"}},{"name":"label","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":32}},{"name":"ai_label","in":"query","required":false,"description":"Only chats showing this AI signal.","schema":{"type":"string","enum":["needs_attention","site_visit","qualified","price_enquiry"]}},{"name":"unreplied","in":"query","required":false,"description":"Only conversations whose latest message is the customer’s (waiting for a reply).","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"newest: latest activity first · oldest: the longest-quiet first.","schema":{"default":"newest","type":"string","enum":["newest","oldest"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"inbox.view"}},"/api/v1/conversations/options":{"get":{"operationId":"getInboxOptions","summary":"Inbox options","description":"Sending identities, team members and labels for the composer, filters and the details panel.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InboxOptions"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.view"}},"/api/v1/conversations/uploads":{"post":{"operationId":"startInboxUpload","summary":"Upload URL for an attachment","description":"A presigned PUT for one file (content type and exact size are signed): photos 5 MB, voice notes, audio and video 16 MB, PDFs 25 MB — WhatsApp’s media limits.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxUploadInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InboxUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"}},"/api/v1/conversations/{id}":{"get":{"operationId":"getConversation","summary":"A conversation","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["inbox:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"inbox.view"},"patch":{"operationId":"updateConversation","summary":"Label, snooze or close a conversation","description":"For anyone who sees the conversation and may reply in it. Labels replace the current set.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["messages:send"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConversationInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"inbox.reply"}},"/api/v1/conversations/{id}/assign":{"post":{"operationId":"assignConversation","summary":"Assign a conversation","description":"`assignee_id: null` unassigns.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assignee_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["assignee_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"inbox.assign"}},"/api/v1/conversations/{id}/messages":{"get":{"operationId":"listConversationMessages","summary":"Messages of a conversation","description":"Newest first.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["inbox:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"inbox.view"}},"/api/v1/conversations/{id}/read":{"post":{"operationId":"markConversationRead","summary":"Mark a conversation read","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.view"}},"/api/v1/conversations/{id}/typing":{"post":{"operationId":"showConversationTyping","summary":"Show “typing…” to a WhatsApp customer","description":"WhatsApp Cloud threads inside the 24-hour window (INT-40): the customer sees “typing…” for up to 25 seconds or until the reply. It marks their latest message read, so nothing is sent while the company turned read receipts off. Queued, at most once per 20 seconds per conversation; other channels answer `sent: false`.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sent":{"type":"boolean","description":"True when the indicator was queued."},"reason":{"anyOf":[{"type":"string","enum":["not_whatsapp_cloud","disabled","window_closed","no_inbound"]},{"type":"null"}]}},"required":["sent","reason"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"}},"/api/v1/cost-sheets":{"get":{"operationId":"listCostSheets","summary":"Cost sheets (quotes), newest first — by project, unit, lead, status or your own","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"unit_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","issued","accepted","expired","cancelled"]}},{"name":"mine","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{1,9}$"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CostSheet"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["projects.pricing","units.cost_sheet"]},"post":{"operationId":"createCostSheet","summary":"Draft a cost sheet for a unit (available or on hold)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unit_id":{"$ref":"#/components/schemas/Id"},"price_list_id":{"description":"Default: the version in force today.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"discounts":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/CostSheetDiscountInput"}},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["unit_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CostSheet"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.cost_sheet"}},"/api/v1/cost-sheets/preview":{"post":{"operationId":"previewCostSheet","summary":"Compute a unit’s cost sheet without saving it (the builder’s live preview)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unit_id":{"$ref":"#/components/schemas/Id"},"price_list_id":{"description":"Default: the version in force today.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"discounts":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/CostSheetDiscountInput"}}},"required":["unit_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sheet":{"anyOf":[{"$ref":"#/components/schemas/ComputedCostSheet"},{"type":"null"}]},"error":{"type":["string","null"]},"cap":{"type":"object","properties":{"cap_bp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"null: not capped."},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"above_cap":{"type":"boolean"}},"required":["cap_bp","discount_bp","above_cap"],"additionalProperties":false},"price_list":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}},"required":["sheet","error","cap","price_list"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.cost_sheet"}},"/api/v1/cost-sheets/{id}":{"get":{"operationId":"getCostSheet","summary":"One cost sheet with its sheet, acceptance and pending approval","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CostSheet"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["projects.pricing","units.cost_sheet"]},"patch":{"operationId":"updateCostSheet","summary":"Change a draft: discounts, lead, note or the price-list version","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"discounts":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/CostSheetDiscountInput"}},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"price_list_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CostSheet"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.cost_sheet"}},"/api/v1/cost-sheets/{id}/cancel":{"post":{"operationId":"cancelCostSheet","summary":"Cancel a draft or an issued sheet (an accepted one stays for the booking)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CostSheet"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.cost_sheet"}},"/api/v1/cost-sheets/{id}/issue":{"post":{"operationId":"issueCostSheet","summary":"Issue (freeze) a draft","description":"A discount above your role cap answers 409 approval_required; with `request_approval` the chain is raised (data null, the chain in meta.approval) and the sheet is issued once approved.","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/CostSheet"},{"type":"null"}]},"meta":{"$ref":"#/components/schemas/ApprovalRequestedMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.cost_sheet"}},"/api/v1/cost-sheets/{id}/pdf":{"get":{"operationId":"getCostSheetPdf","summary":"The cost sheet as PDF (a draft prints with a DRAFT watermark)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["projects.pricing","units.cost_sheet"]}},"/api/v1/cost-sheets/{id}/send":{"post":{"operationId":"sendCostSheet","summary":"Send an issued sheet to the lead’s contact (a signed link minted at delivery)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["sent","blocked"]},"reason":{"type":["string","null"]},"cost_sheet":{"$ref":"#/components/schemas/CostSheet"}},"required":["status","reason","cost_sheet"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.cost_sheet"}},"/api/v1/cp-brokerage/accruals":{"get":{"operationId":"listBrokerageAccruals","summary":"Brokerage per partner booking, with the collection gate","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"partner_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["accrued","eligible","invoiced","paid","reversed"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"booking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unit_no":{"type":["string","null"]}},"required":["id","number","unit_no"],"additionalProperties":false},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"period_key":{"type":"string"},"booking_date":{"$ref":"#/components/schemas/LocalDate"},"agreement_value":{"$ref":"#/components/schemas/Paise"},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/Paise"},"bonus":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"collected":{"$ref":"#/components/schemas/Paise"},"collected_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["accrued","eligible","invoiced","paid","reversed"]},"eligible_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"invoice_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"paid_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reversed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reversal_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","booking","project","period_key","booking_date","agreement_value","rate_bps","amount","bonus","total","collected","collected_bps","gate_bps","status","eligible_at","invoice_id","paid_at","reversed_at","reversal_note","created_at"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/cp-brokerage/invoices":{"get":{"operationId":"listCpInvoices","summary":"Partners’ brokerage invoices and their payouts","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"partner_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["submitted","paid","cancelled"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"number":{"type":"string"},"invoice_date":{"$ref":"#/components/schemas/LocalDate"},"document_type":{"type":"string","enum":["tax_invoice","bill_of_supply"]},"gstin":{"type":["string","null"]},"place_of_supply":{"type":["string","null"]},"brokerage":{"$ref":"#/components/schemas/Paise"},"incentive":{"$ref":"#/components/schemas/Paise"},"taxable":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["submitted","paid","cancelled"]},"payout":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"tds":{"$ref":"#/components/schemas/Paise"},"net":{"$ref":"#/components/schemas/Paise"},"paid_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","status","tds","net","paid_on"],"additionalProperties":false},{"type":"null"}]},"cancel_reason":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","partner","number","invoice_date","document_type","gstin","place_of_supply","brokerage","incentive","taxable","cgst","sgst","igst","total","status","payout","cancel_reason","created_at"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/cp-brokerage/invoices/{id}/cancel":{"post":{"operationId":"cancelCpInvoice","summary":"Cancel an unpaid partner invoice (its payout too; brokerage back to eligible)","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"number":{"type":"string"},"invoice_date":{"$ref":"#/components/schemas/LocalDate"},"document_type":{"type":"string","enum":["tax_invoice","bill_of_supply"]},"gstin":{"type":["string","null"]},"place_of_supply":{"type":["string","null"]},"brokerage":{"$ref":"#/components/schemas/Paise"},"incentive":{"$ref":"#/components/schemas/Paise"},"taxable":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["submitted","paid","cancelled"]},"payout":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"tds":{"$ref":"#/components/schemas/Paise"},"net":{"$ref":"#/components/schemas/Paise"},"paid_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","status","tds","net","paid_on"],"additionalProperties":false},{"type":"null"}]},"cancel_reason":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","partner","number","invoice_date","document_type","gstin","place_of_supply","brokerage","incentive","taxable","cgst","sgst","igst","total","status","payout","cancel_reason","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/cp-brokerage/invoices/{id}/download":{"get":{"operationId":"downloadCpInvoice","summary":"A short-lived link to the invoice PDF (finance, or the partner who raised it)","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["commissions.view","partner_portal.invoice"]}},"/api/v1/cp-brokerage/recalculate":{"post":{"operationId":"recalculateBrokerage","summary":"Bring every partner booking’s brokerage up to date (slabs, collections, cancellations)","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/cp-brokerage/schemes":{"get":{"operationId":"listBrokerageSchemes","summary":"Brokerage schemes (active first)","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"kind":{"type":"string","enum":["flat","slab"]},"base_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"slabs":{"type":"array","items":{"type":"object","properties":{"min_bookings":{"type":"integer","minimum":2,"maximum":10000},"rate_bps":{"type":"integer","minimum":0,"maximum":1000}},"required":["min_bookings","rate_bps"],"additionalProperties":false}},"period":{"type":"string","enum":["month","quarter","fy","lifetime"]},"collection_gate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bonus":{"anyOf":[{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"}},"required":["amount","from","to"],"additionalProperties":false},{"type":"null"}]},"visit_incentive":{"$ref":"#/components/schemas/Paise"},"incentive_cap_month":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"valid_from":{"$ref":"#/components/schemas/LocalDate"},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string","enum":["active","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","project","kind","base_rate_bps","slabs","period","collection_gate_bps","bonus","visit_incentive","incentive_cap_month","valid_from","valid_to","status","created_at"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"},"post":{"operationId":"createBrokerageScheme","summary":"Add a brokerage scheme (a project’s, or the company default)","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"kind":{"type":"string","enum":["flat","slab"]},"base_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"slabs":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"min_bookings":{"type":"integer","minimum":2,"maximum":10000},"rate_bps":{"type":"integer","minimum":0,"maximum":1000}},"required":["min_bookings","rate_bps"]}},"period":{"type":"string","enum":["month","quarter","fy","lifetime"]},"collection_gate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bonus":{"anyOf":[{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PaiseInput"},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"}},"required":["amount","from","to"]},{"type":"null"}]},"visit_incentive":{"$ref":"#/components/schemas/PaiseInput"},"incentive_cap_month":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"valid_from":{"$ref":"#/components/schemas/LocalDate"},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["name","kind","base_rate_bps","valid_from"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"kind":{"type":"string","enum":["flat","slab"]},"base_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"slabs":{"type":"array","items":{"type":"object","properties":{"min_bookings":{"type":"integer","minimum":2,"maximum":10000},"rate_bps":{"type":"integer","minimum":0,"maximum":1000}},"required":["min_bookings","rate_bps"],"additionalProperties":false}},"period":{"type":"string","enum":["month","quarter","fy","lifetime"]},"collection_gate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bonus":{"anyOf":[{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"}},"required":["amount","from","to"],"additionalProperties":false},{"type":"null"}]},"visit_incentive":{"$ref":"#/components/schemas/Paise"},"incentive_cap_month":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"valid_from":{"$ref":"#/components/schemas/LocalDate"},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string","enum":["active","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","project","kind","base_rate_bps","slabs","period","collection_gate_bps","bonus","visit_incentive","incentive_cap_month","valid_from","valid_to","status","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.configure"}},"/api/v1/cp-brokerage/schemes/{id}":{"patch":{"operationId":"updateBrokerageScheme","summary":"Change or archive a scheme (invoiced and paid brokerage never changes)","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"kind":{"type":"string","enum":["flat","slab"]},"base_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"slabs":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"min_bookings":{"type":"integer","minimum":2,"maximum":10000},"rate_bps":{"type":"integer","minimum":0,"maximum":1000}},"required":["min_bookings","rate_bps"]}},"period":{"type":"string","enum":["month","quarter","fy","lifetime"]},"collection_gate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bonus":{"anyOf":[{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PaiseInput"},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"}},"required":["amount","from","to"]},{"type":"null"}]},"visit_incentive":{"$ref":"#/components/schemas/PaiseInput"},"incentive_cap_month":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"valid_from":{"$ref":"#/components/schemas/LocalDate"},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string","enum":["active","archived"]}},"required":["name","kind","base_rate_bps","valid_from"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"kind":{"type":"string","enum":["flat","slab"]},"base_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"slabs":{"type":"array","items":{"type":"object","properties":{"min_bookings":{"type":"integer","minimum":2,"maximum":10000},"rate_bps":{"type":"integer","minimum":0,"maximum":1000}},"required":["min_bookings","rate_bps"],"additionalProperties":false}},"period":{"type":"string","enum":["month","quarter","fy","lifetime"]},"collection_gate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bonus":{"anyOf":[{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"}},"required":["amount","from","to"],"additionalProperties":false},{"type":"null"}]},"visit_incentive":{"$ref":"#/components/schemas/Paise"},"incentive_cap_month":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"valid_from":{"$ref":"#/components/schemas/LocalDate"},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string","enum":["active","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","project","kind","base_rate_bps","slabs","period","collection_gate_bps","bonus","visit_incentive","incentive_cap_month","valid_from","valid_to","status","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.configure"}},"/api/v1/cp-disputes":{"get":{"operationId":"listCpDisputes","summary":"The dispute queue: open first, oldest first","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","decided","withdrawn"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["open","decided","withdrawn"]},"reason":{"type":"string","enum":["other_partner","direct_enquiry"]},"client":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","phone"],"additionalProperties":false},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"registration_id":{"$ref":"#/components/schemas/Id"},"claimant":{"type":"object","properties":{"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}]},"registered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["partner","registered_at","verified_visit_at"],"additionalProperties":false},"holder":{"type":"object","properties":{"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}]},"registered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kind":{"type":"string","enum":["partner","direct"]}},"required":["partner","registered_at","verified_visit_at","kind"],"additionalProperties":false},"suggestion":{"type":"object","properties":{"winner":{"type":"string","enum":["claimant","holder"]},"strength":{"type":"string","enum":["strong","weak"]},"text":{"type":"string"}},"required":["winner","strength","text"],"additionalProperties":false},"evidence":{"type":"array","items":{"type":"object","properties":{"by":{"type":"string","enum":["partner","member"]},"name":{"type":["string","null"]},"note":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["by","name","note","at"],"additionalProperties":false}},"decision":{"anyOf":[{"type":"string","enum":["award_claimant","keep_holder"]},{"type":"null"}]},"decision_note":{"type":["string","null"]},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","reason","client","project","lead","registration_id","claimant","holder","suggestion","evidence","decision","decision_note","decided_by","decided_at","created_at"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.view"}},"/api/v1/cp-disputes/{id}":{"get":{"operationId":"getCpDispute","summary":"A dispute with both sides’ evidence and the suggested outcome","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["open","decided","withdrawn"]},"reason":{"type":"string","enum":["other_partner","direct_enquiry"]},"client":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","phone"],"additionalProperties":false},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"registration_id":{"$ref":"#/components/schemas/Id"},"claimant":{"type":"object","properties":{"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}]},"registered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["partner","registered_at","verified_visit_at"],"additionalProperties":false},"holder":{"type":"object","properties":{"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}]},"registered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kind":{"type":"string","enum":["partner","direct"]}},"required":["partner","registered_at","verified_visit_at","kind"],"additionalProperties":false},"suggestion":{"type":"object","properties":{"winner":{"type":"string","enum":["claimant","holder"]},"strength":{"type":"string","enum":["strong","weak"]},"text":{"type":"string"}},"required":["winner","strength","text"],"additionalProperties":false},"evidence":{"type":"array","items":{"type":"object","properties":{"by":{"type":"string","enum":["partner","member"]},"name":{"type":["string","null"]},"note":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["by","name","note","at"],"additionalProperties":false}},"decision":{"anyOf":[{"type":"string","enum":["award_claimant","keep_holder"]},{"type":"null"}]},"decision_note":{"type":["string","null"]},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","reason","client","project","lead","registration_id","claimant","holder","suggestion","evidence","decision","decision_note","decided_by","decided_at","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.view"}},"/api/v1/cp-disputes/{id}/decision":{"post":{"operationId":"decideCpDispute","summary":"Decide a dispute (final; the reason is kept in the audit trail)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["award_claimant","keep_holder"]},"note":{"type":"string","minLength":10,"maxLength":1000}},"required":["decision","note"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["open","decided","withdrawn"]},"reason":{"type":"string","enum":["other_partner","direct_enquiry"]},"client":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","phone"],"additionalProperties":false},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"registration_id":{"$ref":"#/components/schemas/Id"},"claimant":{"type":"object","properties":{"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}]},"registered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["partner","registered_at","verified_visit_at"],"additionalProperties":false},"holder":{"type":"object","properties":{"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}]},"registered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kind":{"type":"string","enum":["partner","direct"]}},"required":["partner","registered_at","verified_visit_at","kind"],"additionalProperties":false},"suggestion":{"type":"object","properties":{"winner":{"type":"string","enum":["claimant","holder"]},"strength":{"type":"string","enum":["strong","weak"]},"text":{"type":"string"}},"required":["winner","strength","text"],"additionalProperties":false},"evidence":{"type":"array","items":{"type":"object","properties":{"by":{"type":"string","enum":["partner","member"]},"name":{"type":["string","null"]},"note":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["by","name","note","at"],"additionalProperties":false}},"decision":{"anyOf":[{"type":"string","enum":["award_claimant","keep_holder"]},{"type":"null"}]},"decision_note":{"type":["string","null"]},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","reason","client","project","lead","registration_id","claimant","holder","suggestion","evidence","decision","decision_note","decided_by","decided_at","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.approve"}},"/api/v1/cp-disputes/{id}/evidence":{"post":{"operationId":"addCpDisputeEvidence","summary":"Add a note to a dispute’s evidence (a member)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","minLength":3,"maxLength":1000}},"required":["note"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["open","decided","withdrawn"]},"reason":{"type":"string","enum":["other_partner","direct_enquiry"]},"client":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","phone"],"additionalProperties":false},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"registration_id":{"$ref":"#/components/schemas/Id"},"claimant":{"type":"object","properties":{"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}]},"registered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["partner","registered_at","verified_visit_at"],"additionalProperties":false},"holder":{"type":"object","properties":{"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}]},"registered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kind":{"type":"string","enum":["partner","direct"]}},"required":["partner","registered_at","verified_visit_at","kind"],"additionalProperties":false},"suggestion":{"type":"object","properties":{"winner":{"type":"string","enum":["claimant","holder"]},"strength":{"type":"string","enum":["strong","weak"]},"text":{"type":"string"}},"required":["winner","strength","text"],"additionalProperties":false},"evidence":{"type":"array","items":{"type":"object","properties":{"by":{"type":"string","enum":["partner","member"]},"name":{"type":["string","null"]},"note":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["by","name","note","at"],"additionalProperties":false}},"decision":{"anyOf":[{"type":"string","enum":["award_claimant","keep_holder"]},{"type":"null"}]},"decision_note":{"type":["string","null"]},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","reason","client","project","lead","registration_id","claimant","holder","suggestion","evidence","decision","decision_note","decided_by","decided_at","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.approve"}},"/api/v1/cp-registrations":{"get":{"operationId":"listCpRegistrations","summary":"Client registrations by partners (portal and walk-in), newest first","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["pending","active","expiring","expired","disputed","rejected"]}},{"name":"partner_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"client_name":{"type":["string","null"]},"phone":{"type":"string","description":"Follows the contact.phone field rule."},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"source":{"type":"string","enum":["walk_in","portal"]},"status":{"type":"string"},"state":{"type":"string","enum":["pending","active","expiring","expired","disputed","rejected"]},"note":{"type":"string"},"lock_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"days_left":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"dispute_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","partner","client_name","phone","project","source","status","state","note","lock_days","expires_at","days_left","lead","dispute_id","verified_visit_at","created_at"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.view"}},"/api/v1/cp-registrations/{id}/decision":{"post":{"operationId":"decideCpRegistration","summary":"Accept or reject a pending registration (not one in dispute — decide the dispute)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accept":{"type":"boolean"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["accept"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"client_name":{"type":["string","null"]},"phone":{"type":"string","description":"Follows the contact.phone field rule."},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"source":{"type":"string","enum":["walk_in","portal"]},"status":{"type":"string"},"state":{"type":"string","enum":["pending","active","expiring","expired","disputed","rejected"]},"note":{"type":"string"},"lock_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"days_left":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"dispute_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","partner","client_name","phone","project","source","status","state","note","lock_days","expires_at","days_left","lead","dispute_id","verified_visit_at","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.approve"}},"/api/v1/cp/collateral":{"get":{"operationId":"listPartnerPortalCollateral","summary":"Published collateral with the partner’s co-brand line","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"kind":{"type":"string","enum":["brochure","floor_plan","price_sheet","creative","video","other"]},"title":{"type":"string"},"description":{"type":["string","null"]},"file_name":{"type":["string","null"]},"content_type":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"link_url":{"type":["string","null"]},"cobrand":{"type":"boolean"},"status":{"type":"string","enum":["published","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"cobrand_line":{"description":"Portal only: the partner’s share line.","type":["string","null"]}},"required":["id","project","kind","title","description","file_name","content_type","size_bytes","link_url","cobrand","status","created_at","cobrand_line"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/earnings":{"get":{"operationId":"getPartnerPortalEarnings","summary":"The partner’s brokerage by booking, balances and ledger","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"balances":{"type":"object","properties":{"brokerage":{"description":"Still owed to the partner (negative: a clawback they owe).","$ref":"#/components/schemas/Paise"},"incentive":{"description":"The visit-incentive wallet.","$ref":"#/components/schemas/Paise"}},"required":["brokerage","incentive"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"account":{"type":"string","enum":["brokerage","incentive"]},"kind":{"type":"string"},"label":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"booking_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"invoice_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","account","kind","label","amount","booking_id","invoice_id","note","created_at"],"additionalProperties":false}},"accruals":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"booking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unit_no":{"type":["string","null"]}},"required":["id","number","unit_no"],"additionalProperties":false},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"period_key":{"type":"string"},"booking_date":{"$ref":"#/components/schemas/LocalDate"},"agreement_value":{"$ref":"#/components/schemas/Paise"},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/Paise"},"bonus":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"collected":{"$ref":"#/components/schemas/Paise"},"collected_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["accrued","eligible","invoiced","paid","reversed"]},"eligible_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"invoice_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"paid_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reversed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reversal_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","booking","project","period_key","booking_date","agreement_value","rate_bps","amount","bonus","total","collected","collected_bps","gate_bps","status","eligible_at","invoice_id","paid_at","reversed_at","reversal_note","created_at"],"additionalProperties":false}}},"required":["balances","lines","accruals"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.invoice"}},"/api/v1/cp/inventory":{"get":{"operationId":"getPartnerPortalInventory","summary":"Projects with released inventory and their availability","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"show_prices":{"type":"boolean"},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"city":{"type":["string","null"]},"rera_number":{"type":["string","null"]},"lock_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"counts":{"type":"object","properties":{"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_hold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["available","on_hold","unavailable"],"additionalProperties":false}},"required":["id","name","city","rera_number","lock_days","counts"],"additionalProperties":false}}},"required":["show_prices","projects"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/inventory/{id}":{"get":{"operationId":"getPartnerPortalProjectInventory","summary":"The released units of a project, tower by tower (availability only)","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"rera_number":{"type":["string","null"]}},"required":["id","name","rera_number"],"additionalProperties":false},"show_prices":{"type":"boolean"},"counts":{"type":"object","properties":{"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_hold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["available","on_hold","unavailable"],"additionalProperties":false},"towers":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"units":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"},"floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bhk":{"type":["number","null"]},"property_type":{"type":["string","null"]},"carpet_area":{"type":["number","null"]},"super_area":{"type":["number","null"]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"facing":{"type":["string","null"]},"availability":{"type":"string","enum":["available","on_hold","unavailable"]},"price":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise; null unless the builder shows prices to partners."}},"required":["id","unit_no","floor","bhk","property_type","carpet_area","super_area","area_unit","facing","availability","price"],"additionalProperties":false}}},"required":["id","name","units"],"additionalProperties":false}}},"required":["project","show_prices","counts","towers"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/invoices":{"get":{"operationId":"listPartnerPortalInvoices","summary":"The partner’s invoices and their payment","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"number":{"type":"string"},"invoice_date":{"$ref":"#/components/schemas/LocalDate"},"document_type":{"type":"string","enum":["tax_invoice","bill_of_supply"]},"gstin":{"type":["string","null"]},"place_of_supply":{"type":["string","null"]},"brokerage":{"$ref":"#/components/schemas/Paise"},"incentive":{"$ref":"#/components/schemas/Paise"},"taxable":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["submitted","paid","cancelled"]},"payout":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"tds":{"$ref":"#/components/schemas/Paise"},"net":{"$ref":"#/components/schemas/Paise"},"paid_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","status","tds","net","paid_on"],"additionalProperties":false},{"type":"null"}]},"cancel_reason":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","partner","number","invoice_date","document_type","gstin","place_of_supply","brokerage","incentive","taxable","cgst","sgst","igst","total","status","payout","cancel_reason","created_at"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.invoice"},"post":{"operationId":"createPartnerPortalInvoice","summary":"Raise a GST invoice for eligible brokerage (and redeem the incentive wallet)","description":"GST per the place of supply of brokerage on property (CGST + SGST in the partner’s state, IGST across states, none for an unregistered partner). Creates a pending commission payout; TDS is deducted when Finance pays it.","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","minLength":1,"maxLength":30},"invoice_date":{"$ref":"#/components/schemas/LocalDate"},"accrual_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"include_incentive":{"default":false,"type":"boolean"}},"required":["number","invoice_date","accrual_ids"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"number":{"type":"string"},"invoice_date":{"$ref":"#/components/schemas/LocalDate"},"document_type":{"type":"string","enum":["tax_invoice","bill_of_supply"]},"gstin":{"type":["string","null"]},"place_of_supply":{"type":["string","null"]},"brokerage":{"$ref":"#/components/schemas/Paise"},"incentive":{"$ref":"#/components/schemas/Paise"},"taxable":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["submitted","paid","cancelled"]},"payout":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"tds":{"$ref":"#/components/schemas/Paise"},"net":{"$ref":"#/components/schemas/Paise"},"paid_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","status","tds","net","paid_on"],"additionalProperties":false},{"type":"null"}]},"cancel_reason":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","partner","number","invoice_date","document_type","gstin","place_of_supply","brokerage","incentive","taxable","cgst","sgst","igst","total","status","payout","cancel_reason","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.invoice","x-idempotent":true}},"/api/v1/cp/invoices/draft":{"get":{"operationId":"getPartnerPortalInvoiceDraft","summary":"What the partner can invoice now: eligible bookings and the incentive balance","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"accruals":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"booking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unit_no":{"type":["string","null"]}},"required":["id","number","unit_no"],"additionalProperties":false},"partner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"period_key":{"type":"string"},"booking_date":{"$ref":"#/components/schemas/LocalDate"},"agreement_value":{"$ref":"#/components/schemas/Paise"},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/Paise"},"bonus":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"collected":{"$ref":"#/components/schemas/Paise"},"collected_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["accrued","eligible","invoiced","paid","reversed"]},"eligible_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"invoice_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"paid_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reversed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reversal_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","booking","project","period_key","booking_date","agreement_value","rate_bps","amount","bonus","total","collected","collected_bps","gate_bps","status","eligible_at","invoice_id","paid_at","reversed_at","reversal_note","created_at"],"additionalProperties":false}},"incentive_balance":{"$ref":"#/components/schemas/Paise"},"gstin":{"type":["string","null"]},"gst_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["accruals","incentive_balance","gstin","gst_rate_bps"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.invoice"}},"/api/v1/cp/kyc-reuse":{"get":{"operationId":"getPortalKycReuse","summary":"KYC verified by other builders, and what was shared here","description":"Only the firms the signed-in partner user belongs to; never another builder’s files.","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PartnerPortalKycReuse"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"},"post":{"operationId":"sharePortalKyc","summary":"Share KYC verified by other builders (with consent)","description":"`consent` must be true and `consent_version` the current one (409 when the text changed). Every document must be the caller’s own verified document at another builder.","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"document_ids":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"consent":{"type":"boolean"},"consent_version":{"type":"string","minLength":1,"maxLength":16}},"required":["document_ids","consent","consent_version"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PartnerPortalKycReuse"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/me":{"get":{"operationId":"getPartnerPortalProfile","summary":"The partner’s own profile, onboarding checklist, agreement and counts","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"linked":{"type":"boolean","description":"false: this member is not a partner (an owner previewing the portal)."},"company":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"},"type":{"type":"string"},"contact_name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected","suspended"]},"status_reason":{"type":["string","null"]},"rera_agent_number":{"type":["string","null"]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_state":{"type":["string","null"]},"rera_status":{"type":"string","enum":["missing","valid","expiring","expired"]},"kyc":{"type":"object","properties":{"pan":{"description":"Masked PAN (XXXXXX234F); null when missing or hidden.","type":["string","null"]},"gstin":{"type":["string","null"]},"bank":{"description":"IFSC and masked account (HDFC0001234 · ••••5678).","type":["string","null"]}},"required":["pan","gstin","bank"],"additionalProperties":false},"kyc_submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","firm_name","type","contact_name","phone","email","status","status_reason","rera_agent_number","rera_expires_on","rera_state","rera_status","kyc","kyc_submitted_at"],"additionalProperties":false},{"type":"null"}]},"checklist":{"anyOf":[{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"done":{"type":"boolean"},"required":{"type":"boolean"}},"required":["key","label","done","required"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"can_approve":{"type":"boolean"}},"required":["steps","missing","can_approve"],"additionalProperties":false},{"type":"null"}]},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false}},"agreement":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","sent","signed","declined","expired","cancelled","failed"]},"signer_name":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"can_sign":{"type":"boolean"}},"required":["id","status","signer_name","sent_at","signed_at","expires_at","last_error","created_at","can_sign"],"additionalProperties":false},{"type":"null"}]},"counts":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiring":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upcoming_visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","expiring","disputed","upcoming_visits"],"additionalProperties":false},"lock_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visit_extension_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registration_client_otp":{"type":"boolean","description":"Registering a client needs the code sent to them."}},"required":["linked","company","partner","checklist","documents","agreement","counts","lock_days","visit_extension_days","registration_client_otp"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"},"patch":{"operationId":"updatePartnerPortalProfile","summary":"Fill in or correct the partner’s own KYC details","description":"Changing PAN, GSTIN, bank or RERA details of an approved partner sends it back for review.","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firm_name":{"type":"string","minLength":2,"maxLength":160},"contact_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]},"rera_agent_number":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_state":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"pan":{"description":"Stored encrypted; returned masked.","anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"gstin":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"bank":{"anyOf":[{"type":"object","properties":{"account_number":{"type":"string","maxLength":24},"ifsc":{"type":"string","maxLength":11},"holder_name":{"type":"string","minLength":2,"maxLength":120},"bank_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["account_number","ifsc","holder_name"]},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"linked":{"type":"boolean","description":"false: this member is not a partner (an owner previewing the portal)."},"company":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"},"type":{"type":"string"},"contact_name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected","suspended"]},"status_reason":{"type":["string","null"]},"rera_agent_number":{"type":["string","null"]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_state":{"type":["string","null"]},"rera_status":{"type":"string","enum":["missing","valid","expiring","expired"]},"kyc":{"type":"object","properties":{"pan":{"description":"Masked PAN (XXXXXX234F); null when missing or hidden.","type":["string","null"]},"gstin":{"type":["string","null"]},"bank":{"description":"IFSC and masked account (HDFC0001234 · ••••5678).","type":["string","null"]}},"required":["pan","gstin","bank"],"additionalProperties":false},"kyc_submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","firm_name","type","contact_name","phone","email","status","status_reason","rera_agent_number","rera_expires_on","rera_state","rera_status","kyc","kyc_submitted_at"],"additionalProperties":false},{"type":"null"}]},"checklist":{"anyOf":[{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"done":{"type":"boolean"},"required":{"type":"boolean"}},"required":["key","label","done","required"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"can_approve":{"type":"boolean"}},"required":["steps","missing","can_approve"],"additionalProperties":false},{"type":"null"}]},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false}},"agreement":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","sent","signed","declined","expired","cancelled","failed"]},"signer_name":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"can_sign":{"type":"boolean"}},"required":["id","status","signer_name","sent_at","signed_at","expires_at","last_error","created_at","can_sign"],"additionalProperties":false},{"type":"null"}]},"counts":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiring":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upcoming_visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","expiring","disputed","upcoming_visits"],"additionalProperties":false},"lock_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visit_extension_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registration_client_otp":{"type":"boolean","description":"Registering a client needs the code sent to them."}},"required":["linked","company","partner","checklist","documents","agreement","counts","lock_days","visit_extension_days","registration_client_otp"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/me/agreement/sign":{"post":{"operationId":"signPartnerPortalAgreement","summary":"Open the e-sign partner’s signing page for the partner’s agreement","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/me/documents":{"post":{"operationId":"addPartnerPortalDocument","summary":"Register an uploaded KYC document (a member verifies it)","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"key":{"type":"string","minLength":1,"maxLength":300},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"file_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["kind","key","content_type","size"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/me/documents/uploads":{"post":{"operationId":"presignPartnerPortalDocument","summary":"Upload one of the partner’s own KYC documents","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["key","url","method","headers","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/registrations":{"get":{"operationId":"listPartnerPortalRegistrations","summary":"The partner’s registered clients with their lock status","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["pending","active","expiring","expired","disputed","rejected"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"client_name":{"type":["string","null"]},"phone":{"type":"string"},"email":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"state":{"type":"string","enum":["pending","active","expiring","expired","disputed","rejected"]},"note":{"type":"string"},"lock_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"days_left":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dispute":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["open","decided","withdrawn"]}},"required":["id","status"],"additionalProperties":false},{"type":"null"}]},"visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"can_schedule_visit":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","client_name","phone","email","project","state","note","lock_days","expires_at","days_left","dispute","visits","verified_visit_at","can_schedule_visit","created_at"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"},"post":{"operationId":"registerPartnerPortalClient","summary":"Register a client (lock window; a conflict goes to the builder as a dispute)","description":"The number is normalised (NRI numbers keep their country code). Registering the same client again returns the live registration. Who else holds a conflicting client is never revealed.","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"phone":{"type":"string","minLength":6,"maxLength":20},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"consent":{"type":"boolean","const":true,"description":"The partner confirms the client agreed to be introduced."},"otp_code":{"description":"The code sent to the client; required when the company asks for the client’s consent.","anyOf":[{"type":"string","maxLength":12},{"type":"null"}]}},"required":["name","phone","consent"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"client_name":{"type":["string","null"]},"phone":{"type":"string"},"email":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"state":{"type":"string","enum":["pending","active","expiring","expired","disputed","rejected"]},"note":{"type":"string"},"lock_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"days_left":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dispute":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["open","decided","withdrawn"]}},"required":["id","status"],"additionalProperties":false},{"type":"null"}]},"visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"can_schedule_visit":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"duplicate":{"type":"boolean"}},"required":["id","client_name","phone","email","project","state","note","lock_days","expires_at","days_left","dispute","visits","verified_visit_at","can_schedule_visit","created_at","duplicate"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.register","x-idempotent":true}},"/api/v1/cp/registrations/otp":{"post":{"operationId":"sendPartnerPortalRegistrationOtp","summary":"Send the client a one-time code that confirms their consent to the registration","description":"The code goes to the client’s phone; the partner enters it with the registration. Counts against the daily registration limit and the per-phone code limits.","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":6,"maxLength":20}},"required":["phone"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"phone":{"type":"string"},"expires_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resend_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["phone","expires_in_sec","resend_in_sec"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.register"}},"/api/v1/cp/registrations/{id}/evidence":{"post":{"operationId":"addPartnerPortalEvidence","summary":"Add a note to the evidence of the partner’s disputed registration","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","minLength":3,"maxLength":1000}},"required":["note"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"client_name":{"type":["string","null"]},"phone":{"type":"string"},"email":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"state":{"type":"string","enum":["pending","active","expiring","expired","disputed","rejected"]},"note":{"type":"string"},"lock_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"days_left":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dispute":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["open","decided","withdrawn"]}},"required":["id","status"],"additionalProperties":false},{"type":"null"}]},"visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified_visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"can_schedule_visit":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","client_name","phone","email","project","state","note","lock_days","expires_at","days_left","dispute","visits","verified_visit_at","can_schedule_visit","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.register"}},"/api/v1/cp/registrations/{id}/visits":{"post":{"operationId":"schedulePartnerPortalVisit","summary":"Book a site visit for a registered client (active registrations only)","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["scheduled_at"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"registration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"client_name":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"status":{"type":"string"},"otp_verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"check_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"proof_available":{"type":"boolean"}},"required":["id","registration_id","client_name","project","scheduled_at","status","otp_verified_at","check_in_at","completed_at","proof_available"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.visits"}},"/api/v1/cp/visits":{"get":{"operationId":"listPartnerPortalVisits","summary":"Site visits of the partner’s clients, upcoming first","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"registration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"client_name":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"status":{"type":"string"},"otp_verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"check_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"proof_available":{"type":"boolean"}},"required":["id","registration_id","client_name","project","scheduled_at","status","otp_verified_at","check_in_at","completed_at","proof_available"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.access"}},"/api/v1/cp/visits/{id}/check-in":{"post":{"operationId":"checkInPartnerPortalVisit","summary":"GPS check-in at the site (optional photo and code); offline-safe with client_key","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVisitCheckInInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"visit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"registration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"client_name":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"status":{"type":"string"},"otp_verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"check_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"proof_available":{"type":"boolean"}},"required":["id","registration_id","client_name","project","scheduled_at","status","otp_verified_at","check_in_at","completed_at","proof_available"],"additionalProperties":false},"warnings":{"type":"array","items":{"type":"string","enum":["far_from_site","mock_location","low_accuracy","no_site_location","early","late"]}},"distance_m":{"type":["number","null"]},"replayed":{"type":"boolean"},"otp":{"anyOf":[{"$ref":"#/components/schemas/VisitOtpVerdict"},{"type":"null"}]}},"required":["visit","warnings","distance_m","replayed","otp"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.visits","x-idempotent":true}},"/api/v1/cp/visits/{id}/otp":{"post":{"operationId":"sendPartnerPortalVisitOtp","summary":"Send the visit code to the partner’s client","description":"Through the send pipeline (30-second resend gap, 5 codes per visit). When no channel reaches the client the request fails — the code is never shown to the partner.","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"visit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"registration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"client_name":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"status":{"type":"string"},"otp_verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"check_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"proof_available":{"type":"boolean"}},"required":["id","registration_id","client_name","project","scheduled_at","status","otp_verified_at","check_in_at","completed_at","proof_available"],"additionalProperties":false},"channel":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"resend_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["visit","channel","expires_at","resend_in_sec"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.visits"}},"/api/v1/cp/visits/{id}/otp/verify":{"post":{"operationId":"verifyPartnerPortalVisitOtp","summary":"Check the code the client read out at the site","description":"A wrong code answers `verified: false` with the attempts left; the third locks the code.","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifySiteVisitOtpInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/VisitOtpVerdict"},"visit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"registration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"client_name":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"status":{"type":"string"},"otp_verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"check_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"proof_available":{"type":"boolean"}},"required":["id","registration_id","client_name","project","scheduled_at","status","otp_verified_at","check_in_at","completed_at","proof_available"],"additionalProperties":false}},"required":["result","visit"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.visits"}},"/api/v1/cp/visits/{id}/photos":{"post":{"operationId":"presignPartnerPortalVisitPhoto","summary":"Upload URL for the partner’s check-in photo","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVisitPhotoInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VisitPhotoUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partner_portal.visits"}},"/api/v1/cp/visits/{id}/proof":{"get":{"operationId":"getVisitProofPack","summary":"The visit proof pack (PDF): OTP verification, check-in time and place, photo, timestamps","description":"For the partner who brought the client, or a member who sees partners. Audited.","tags":["Partner portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf."}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["partner_portal.visits","partners.view"]}},"/api/v1/custom-fields":{"get":{"operationId":"listCustomFields","summary":"Custom field definitions","description":"Every definition of an entity in order, switched-off ones included, with the roles to pick from.","tags":["Custom fields"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"entity","in":"query","required":true,"schema":{"$ref":"#/components/schemas/CustomFieldEntity"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldAdmin"}},"meta":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"reserved_keys":{"type":"array","items":{"type":"string"},"description":"Keys the built-in fields use."},"can_edit":{"type":"boolean"}},"required":["roles","reserved_keys","can_edit"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"post":{"operationId":"createCustomField","summary":"Add a custom field","tags":["Custom fields"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomFieldInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomFieldAdmin"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/custom-fields/reorder":{"post":{"operationId":"reorderCustomFields","summary":"Reorder custom fields","tags":["Custom fields"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderCustomFieldsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldAdmin"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/custom-fields/{id}":{"patch":{"operationId":"updateCustomField","summary":"Change a custom field","tags":["Custom fields"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomFieldInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomFieldAdmin"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"},"delete":{"operationId":"deleteCustomField","summary":"Delete a custom field","description":"Only a field no record has a value for (409 otherwise — switch it off instead).","tags":["Custom fields"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/dashboard/overview":{"get":{"operationId":"getDashboardOverview","summary":"Dashboard overview","description":"Your day (today, your own: calls, follow-ups due and overdue, visits, new and unassigned leads), the KPI tiles of the lens with the previous period and a daily series (new leads, calls, connected %, talk time, first response median, visits done, deals closed, revenue — masked without commission access), the sections the plan and your permissions allow, and how many members the lens covers. \"Call next\" and its counts: GET /me/call-list.","tags":["Dashboard"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"period","in":"query","required":false,"description":"Company calendar; compared with the period of the same length before it.","schema":{"default":"7d","type":"string","enum":["today","7d","30d","this_month","last_month"]}},{"name":"scope","in":"query","required":false,"description":"`team`: everyone your report scope reaches; `me`: your own; `member`: one member of your scope (with `member_id`; outside your scope → 404). Without it: your whole report scope.","schema":{"type":"string","enum":["team","me","member"]}},{"name":"member_id","in":"query","required":false,"description":"The member of `scope=member`.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DashboardOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/dashboard/pipeline":{"get":{"operationId":"getDashboardPipeline","summary":"Dashboard pipeline","description":"The pipelines you can pick; for one pipeline the leads per status now in pipeline order (count, share, deal value, stuck for 7+ days) and the stage funnel of the leads received in the period (leads → contacted → qualified → visit → deal) with conversion and the previous period. 404 for a pipeline of another company.","tags":["Dashboard"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"period","in":"query","required":false,"description":"Company calendar; compared with the period of the same length before it.","schema":{"default":"7d","type":"string","enum":["today","7d","30d","this_month","last_month"]}},{"name":"scope","in":"query","required":false,"description":"`team`: everyone your report scope reaches; `me`: your own; `member`: one member of your scope (with `member_id`; outside your scope → 404). Without it: your whole report scope.","schema":{"type":"string","enum":["team","me","member"]}},{"name":"member_id","in":"query","required":false,"description":"The member of `scope=member`.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"pipeline_id","in":"query","required":false,"description":"Default: the company’s default pipeline.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DashboardPipeline"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/dashboard/team":{"get":{"operationId":"getDashboardTeam","summary":"Dashboard team board","description":"One row per member of the lens: live status, first and last call today, calls, connected and talk time in the period, follow-ups done / overdue, visits, deals won, the accountability score and the phone’s call-tracking health — and who needs attention and why. `scope=team` or `member` (403 for `me` or an own-only scope).","tags":["Dashboard"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"period","in":"query","required":false,"description":"Company calendar; compared with the period of the same length before it.","schema":{"default":"7d","type":"string","enum":["today","7d","30d","this_month","last_month"]}},{"name":"scope","in":"query","required":false,"description":"`team`: everyone your report scope reaches; `me`: your own; `member`: one member of your scope (with `member_id`; outside your scope → 404). Without it: your whole report scope.","schema":{"type":"string","enum":["team","me","member"]}},{"name":"member_id","in":"query","required":false,"description":"The member of `scope=member`.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DashboardTeam"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/deals":{"get":{"operationId":"listDeals","summary":"List deals","description":"Keyset-paginated deals within the caller’s scope (owner). `filter` takes DEAL_FILTER_FIELDS; `q` matches the title or a D- reference. Sort keys: created_at (default, descending), updated_at, agreed_value, token_date, closed_at, number.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"filter","in":"query","required":false,"description":"Filter tree ({ all | any | not | field/op/value }) as JSON or base64url(JSON).","schema":{"type":"string","maxLength":20000}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"view","in":"query","required":false,"description":"open (default), won, lost or all.","schema":{"type":"string","enum":["open","won","lost","all"]}},{"name":"stage","in":"query","required":false,"description":"offer_made, owner_review, accepted and move_in belong to rental deals only (R-01).","schema":{"$ref":"#/components/schemas/DealStage"}},{"name":"type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/DealType"}},{"name":"kind","in":"query","required":false,"description":"sale, or rental (rent and lease together: the rental pipeline).","schema":{"type":"string","enum":["sale","rental"]}},{"name":"owner_id","in":"query","required":false,"description":"A member id, or `me`.","schema":{"type":"string","maxLength":64}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"property_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DealSummary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"},"post":{"operationId":"createDeal","summary":"Open a deal","description":"From a lead (`lead_id`: contact, listing / project, owner and type default from the lead; an open deal of the lead is returned instead of a second one) or by hand (`type` + a client). Writes D- reference, timeline, audit and `deal.created`.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDealInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.create","x-idempotent":true}},"/api/v1/deals/commission-summary":{"get":{"operationId":"getCommissionSummary","summary":"Commission tiles","description":"Expected, received and outstanding commission this month or quarter (company time zone) over the deals in scope. A deal counts in the period of its latest milestone (closed, registration, agreement, token, created). Needs the deal.commission field rule in clear.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["month","quarter"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CommissionSummary"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"deals.view"}},"/api/v1/deals/members":{"get":{"operationId":"listDealMembers","summary":"Members for owners and splits","description":"Active members the caller may hand deals to (their deals.edit scope), A → Z.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MemberRef"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"}},"/api/v1/deals/summary":{"get":{"operationId":"getDealStageSummary","summary":"Deals per stage","description":"Count and value per stage (the board’s column headers), with the same filters as the list.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"filter","in":"query","required":false,"description":"Filter tree ({ all | any | not | field/op/value }) as JSON or base64url(JSON).","schema":{"type":"string","maxLength":20000}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/DealType"}},{"name":"kind","in":"query","required":false,"description":"sale, or rental (rent and lease together: the rental pipeline).","schema":{"type":"string","enum":["sale","rental"]}},{"name":"owner_id","in":"query","required":false,"description":"A member id, or `me`.","schema":{"type":"string","maxLength":64}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"property_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealStageSummary"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"}},"/api/v1/deals/{id}":{"get":{"operationId":"getDeal","summary":"A deal","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"},"patch":{"operationId":"updateDeal","summary":"Update a deal","description":"Values, dates, parties, links and notes; commission terms need deal.commission in clear.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDealInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"},"delete":{"operationId":"deleteDeal","summary":"Delete a deal","description":"Soft delete; a deal with receipts cannot be deleted (mark it lost instead). When the company’s delete policy asks for approval: 409 approval_required, or — with `request_approval=1` — the chain in meta.approval (deleted false).","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"request_approval","in":"query","required":false,"schema":{"type":"string","enum":["1","true"]}},{"name":"approval_note","in":"query","required":false,"schema":{"type":"string","maxLength":1000}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean"}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.delete"}},"/api/v1/deals/{id}/activity":{"get":{"operationId":"listDealActivity","summary":"The deal’s history","description":"Stage moves, receipts, documents and renewals of this deal, newest first (up to 100).","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"}},"/api/v1/deals/{id}/checklist":{"post":{"operationId":"tickDealChecklist","summary":"Tick a checklist item of the deal’s stage","tags":["Process guard"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"item":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"done":{"type":"boolean"}},"required":["item","done"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealNextSteps"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/deals/{id}/documents":{"post":{"operationId":"registerDealDocument","summary":"Attach an uploaded document","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDealDocumentInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealDocument"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/deals/{id}/documents/presign":{"post":{"operationId":"presignDealDocument","summary":"Start a document upload","description":"A presigned PUT into the private bucket (type and exact size signed); register it afterwards.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealDocumentPresignInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PresignedUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/deals/{id}/documents/{documentId}":{"get":{"operationId":"downloadDealDocument","summary":"Download a document","description":"A 60-second signed URL; every open is audited.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"},"delete":{"operationId":"deleteDealDocument","summary":"Remove a document","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/deals/{id}/finance":{"get":{"operationId":"getDealFinance","summary":"A deal’s finance timeline","description":"Commission → invoices → credit notes → receipts → payouts, with what each side still has to bill.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealFinance"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/deals/{id}/next-steps":{"get":{"operationId":"getDealNextSteps","summary":"Valid next stages of a deal","tags":["Process guard"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealNextSteps"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"}},"/api/v1/deals/{id}/offers":{"get":{"operationId":"getRentalOffers","summary":"The offer panel of a rental deal","description":"Every version newest first (with what changed), the live and the accepted offer, asked vs offered vs the owner’s floor, the approval state of the live offer, the owner’s links and the agreement hand-off.","tags":["Rental offers"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalOfferPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"},"post":{"operationId":"makeRentalOffer","summary":"Make an offer or a counter-offer","description":"A new version: the live offer is closed as countered (the other side answers) or superseded (its own side revises). Terms are checked against the owner’s floor; the deal moves to Offer made. With the company’s `auto_send_to_owner`, a tenant’s below-floor offer goes to the owner at once (meta.sent).","tags":["Rental offers"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MakeRentalOfferInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalOfferPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/deals/{id}/offers/{offerId}/accept":{"post":{"operationId":"acceptRentalOffer","summary":"Accept the live offer","description":"Sets the agreed rent and move-in date and opens a draft agreement. Below the owner’s floor: 409 with `fields.owner_approval` until the owner approved (or `owner_consent` from a member holding deals.approve), and 409 `approval_required` when the company’s chain must approve (`request_approval` raises it).","tags":["Rental offers"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"offerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptRentalOfferInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalOfferPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/deals/{id}/offers/{offerId}/reject":{"post":{"operationId":"rejectRentalOffer","summary":"The other side declined the offer","tags":["Rental offers"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"offerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseRentalOfferInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalOfferPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/deals/{id}/offers/{offerId}/send-to-owner":{"post":{"operationId":"sendRentalOfferToOwner","summary":"Send the offer to the owner for a decision","description":"Queues the owner’s message through the compliance-gated pipeline (consent, DND, quiet hours deferred) with a single-use decision link minted at delivery. A blocked send says why. With the chain-then-owner setting a below-floor offer needs the chain first (409 approval_required, or `request_approval`).","tags":["Rental offers"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"offerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRentalOfferToOwnerInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SendRentalOfferToOwnerResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"deals.edit"}},"/api/v1/deals/{id}/offers/{offerId}/withdraw":{"post":{"operationId":"withdrawRentalOffer","summary":"The offer’s own side withdrew it","tags":["Rental offers"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"offerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseRentalOfferInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalOfferPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/deals/{id}/payment-links":{"get":{"operationId":"listDealPaymentLinks","summary":"A deal’s payment links","description":"Newest first, with payments and their receipts. Brokerage links only for roles that see commission.","tags":["Payment links"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentLink"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"},"post":{"operationId":"createPaymentLink","summary":"Create a payment link","description":"For the deal’s token (at most the agreed token) or brokerage (at most the commission still due, minus open links). Expires in 7 days by default (15 minutes to 180 days). `send` also sends it to the payer through the messaging pipeline (`payment_link` template).","tags":["Payment links"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","enum":["token","brokerage"]},"invoice_id":{"description":"Brokerage only: the invoice it collects — at most its balance; payments settle it (I-01).","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"amount":{"$ref":"#/components/schemas/PaiseInput"},"description":{"anyOf":[{"type":"string","maxLength":250},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"accept_partial":{"default":false,"type":"boolean"},"min_partial_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"payer_contact_id":{"description":"Default: the deal’s client.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"connection_id":{"description":"Default: the most recently connected gateway.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"send":{"anyOf":[{"type":"object","properties":{"channel":{"default":"auto","type":"string","enum":["auto","whatsapp_cloud","sms","email"]}}},{"type":"null"}]}},"required":["purpose","amount"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/PaymentLink"},"sent":{"anyOf":[{"$ref":"#/components/schemas/PaymentLinkSendResult"},{"type":"null"}]}},"required":["link","sent"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit","x-idempotent":true}},"/api/v1/deals/{id}/payouts":{"post":{"operationId":"generateDealPayouts","summary":"Payouts from the splits","description":"Creates a pending payout per split member (their share of the net commission) and the co-broker; payees that already have a payout on this deal are skipped.","tags":["Commissions"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"created":{"type":"array","items":{"$ref":"#/components/schemas/CommissionPayout"}},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["created","skipped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/deals/{id}/splits":{"put":{"operationId":"setDealSplits","summary":"Set the internal commission splits","description":"Replaces the splits; shares must total 100 %. Amounts divide the net commission to the paisa.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealSplitsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"deals.approve"}},"/api/v1/deals/{id}/stage":{"post":{"operationId":"changeDealStage","summary":"Move a deal to another stage","description":"Token needs an amount and date, agreement and registration their dates, won the agreed value, lost a reason. Reopening a closed deal needs deals.approve. The process guard of the deal stages applies (F-04: 422 with the reasons, override_guard for members who may); terms that need approval answer 409 approval_required. Emits `deal.stage_changed`.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeDealStageInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/email-sync":{"get":{"operationId":"getEmailSync","summary":"My email sync: policy, consent text and my mailboxes","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmailSyncOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/email-sync/mailboxes/{id}":{"patch":{"operationId":"updateMailbox","summary":"Pause / resume my mailbox, or change my exclusions","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paused":{"type":"boolean"},"excluded":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":260}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Mailbox"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"delete":{"operationId":"disconnectMailbox","summary":"Disconnect a mailbox","description":"The caller’s own mailbox, or any for settings.integrations (the member is told). Syncing stops at once; the grant is revoked and wiped in the background, and with `delete_emails=1` the emails only this mailbox brought in are deleted too.","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"delete_emails","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Mailbox"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/email-sync/mailboxes/{id}/sync":{"post":{"operationId":"syncMailboxNow","summary":"Sync my mailbox now","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Mailbox"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/email-sync/{provider}/oauth/callback":{"get":{"operationId":"completeEmailSyncOAuth","summary":"Mailbox sign-in callback","description":"Always redirects back to Settings → My account → Email sync with `connected=<provider>` or `error=…`.","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"provider","in":"path","required":true,"description":"google (Gmail) or microsoft (Microsoft 365 / Outlook).","schema":{"$ref":"#/components/schemas/EmailSyncProvider"}},{"name":"code","in":"query","required":false,"schema":{"type":"string","maxLength":4096}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":600}},{"name":"error","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"error_description","in":"query","required":false,"schema":{"type":"string","maxLength":8000}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","maxLength":2000}},{"name":"session_state","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{},"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.sync_email"}},"/api/v1/email-sync/{provider}/oauth/start":{"get":{"operationId":"startEmailSyncOAuth","summary":"Connect my mailbox: the provider’s sign-in","description":"Needs the consent text version the member agreed to (`consent`). Returns the provider’s consent URL (or redirects to it with `?redirect=1`). 409 while the company policy is off for the provider; 404 until PropZolo set it up.","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"provider","in":"path","required":true,"description":"google (Gmail) or microsoft (Microsoft 365 / Outlook).","schema":{"$ref":"#/components/schemas/EmailSyncProvider"}},{"name":"consent","in":"query","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},{"name":"redirect","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.sync_email"}},"/api/v1/emails/{id}":{"get":{"operationId":"getSyncedEmail","summary":"A synced email with its thread","description":"Readable on a lead or contact the caller may see; a private email only by the members whose mailboxes hold it.","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"email":{"$ref":"#/components/schemas/SyncedEmail"},"thread":{"type":"array","items":{"$ref":"#/components/schemas/SyncedEmailSummary"}}},"required":["email","thread"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.view","contacts.view"]},"patch":{"operationId":"updateSyncedEmail","summary":"Mark a synced email private, or share it again","description":"Only the members whose mailboxes hold it; colleagues then see a “Private email” line on the timeline.","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"is_private":{"type":"boolean"}},"required":["is_private"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SyncedEmail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.view","contacts.view"]}},"/api/v1/exports":{"get":{"operationId":"listExports","summary":"Export jobs","description":"Your exports (and the log your role covers), newest first.","tags":["Exports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ImportJob"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.export"},"post":{"operationId":"requestExport","summary":"Export leads to CSV","description":"More rows than the cap is a 422 — narrow the filter. The job runs in the background. Above the company’s approval threshold: 409 approval_required, or — with `request_approval` — null and the chain in meta.approval (the file is made once approved).","tags":["Exports"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestExportInput"}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/ImportJob"},{"type":"null"}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.export"}},"/api/v1/exports/{id}":{"get":{"operationId":"getExport","summary":"An export job","tags":["Exports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportJob"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.export"}},"/api/v1/exports/{id}/download":{"get":{"operationId":"downloadExport","summary":"Download an export","description":"Redirects (302) to a short-lived download URL while the export is younger than 24 hours; with `Accept: application/json` the URL comes back in the envelope instead.","tags":["Exports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"302":{"description":"Redirect to the file (valid for 5 minutes).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.export"}},"/api/v1/finance/credit-notes":{"get":{"operationId":"listCreditNotes","summary":"List credit notes","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"invoice_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"contact_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"fy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CreditNote"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"},"post":{"operationId":"issueCreditNote","summary":"Issue a credit note","description":"Against an issued invoice, all or part of what is still creditable; GST reduced until 30 November after the invoice’s financial year (CGST s.34(2)), a commercial credit after. Own series. Needs a fresh second factor.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoice_id":{"$ref":"#/components/schemas/Id"},"taxable":{"description":"Taxable value to credit; default all that is left.","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"reason":{"type":"string","enum":["deficiency","discount","excess_billed","deal_cancelled","other"]},"reason_note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"issued_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["invoice_id","reason"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditNote"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.invoice","x-idempotent":true}},"/api/v1/finance/credit-notes/{id}/document":{"get":{"operationId":"getCreditNoteDocument","summary":"The credit note as PDF or print-ready HTML","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"format","in":"query","required":false,"schema":{"default":"pdf","type":"string","enum":["pdf","html"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf or text/html"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/finance/dashboard":{"get":{"operationId":"getFinanceDashboard","summary":"The finance dashboard","description":"Invoiced, GST output, collected, receivables ageing, payouts and TDS for the month, quarter or year.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["month","quarter","fy"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FinanceDashboard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/finance/documents/by-token/{token}":{"get":{"operationId":"getFinanceDocumentByToken","summary":"An invoice or credit note by its signed link","description":"The customer’s link from the message that delivered it (30 days). Unknown or expired links answer 404.","tags":["Finance"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":20,"maxLength":300}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"}},"/api/v1/finance/exports/{kind}":{"get":{"operationId":"exportFinance","summary":"Export finance data as CSV","description":"invoices (GST register), credit_notes, sac_summary, payouts, tds (the quarterly statement’s columns, PANs from the payee master), receivables, customer_statement (contact_id), payee_statement (payee_type, payee_id). Watermarked, at most 50,000 rows, audited; needs a fresh second factor.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["invoices","credit_notes","sac_summary","payouts","tds","receivables","customer_statement","payee_statement"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"fy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"quarter","in":"query","required":false,"schema":{"type":"string","enum":["Q1","Q2","Q3","Q4"]}},{"name":"contact_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"payee_type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PayeeType"}},{"name":"payee_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.export"}},"/api/v1/finance/invoices":{"get":{"operationId":"listInvoices","summary":"List brokerage invoices","description":"Newest first; overdue = open and past its due date. Within the caller’s deals.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","issued","part_paid","paid","cancelled","overdue","open"]}},{"name":"deal_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"contact_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"fy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"},"post":{"operationId":"createInvoice","summary":"Draft an invoice","description":"From a deal’s commission sides (what each still owes) or free lines; priced on the finance settings: GST by the place of supply (the property’s state), the SAC of the deal type. A draft has no number.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.invoice","x-idempotent":true}},"/api/v1/finance/invoices/{id}":{"get":{"operationId":"getInvoice","summary":"An invoice with its receipts, credit notes and payment links","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"},"patch":{"operationId":"updateInvoice","summary":"Change a draft invoice","description":"Drafts only — an issued invoice is changed by a credit note.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.invoice"},"delete":{"operationId":"deleteInvoice","summary":"Discard a draft invoice","description":"Drafts only — an issued invoice is never deleted.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.invoice"}},"/api/v1/finance/invoices/{id}/cancel":{"post":{"operationId":"cancelInvoice","summary":"Cancel an issued invoice","description":"Only before anything settled it and until its GSTR-1 is due (the 11th of the next month); it keeps its number. Otherwise issue a credit note. Needs a fresh second factor.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.invoice"}},"/api/v1/finance/invoices/{id}/document":{"get":{"operationId":"getInvoiceDocument","summary":"The invoice as PDF or print-ready HTML","description":"From the snapshots frozen at issue (a draft prints under a DRAFT banner).","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"format","in":"query","required":false,"schema":{"default":"pdf","type":"string","enum":["pdf","html"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf or text/html"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/finance/invoices/{id}/issue":{"post":{"operationId":"issueInvoice","summary":"Issue a draft invoice","description":"Takes the next number of the financial year’s series (gap-free) and freezes the parties and amounts. Not dated in the future or before the series’ latest invoice. Needs a fresh second factor.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issued_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.invoice","x-idempotent":true}},"/api/v1/finance/invoices/{id}/send":{"post":{"operationId":"sendInvoice","summary":"Send an invoice to the customer","description":"Through the compliance-gated pipeline (consent, quiet hours, WhatsApp window) with a sign-in-free link to the PDF, minted at delivery; answers why when it is blocked.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"default":"auto","type":"string","enum":["auto","whatsapp_cloud","email"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"queued"},"channel":{"type":"string"},"message_id":{"$ref":"#/components/schemas/Id"}},"required":["status","channel","message_id"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"blocked"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["status","reasons"],"additionalProperties":false}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.invoice"}},"/api/v1/finance/payees":{"get":{"operationId":"listPayees","summary":"List payees","description":"Company-wide finance viewers see every payee; others only themselves.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PayeeType"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Payee"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"},"post":{"operationId":"openPayee","summary":"The payee of a member, partner or contact","description":"Creates the master row on first use (name and contact details from the record).","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/PayeeType"},"ref_id":{"$ref":"#/components/schemas/Id"}},"required":["kind","ref_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Payee"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/finance/payees/{id}":{"patch":{"operationId":"updatePayee","summary":"Change a payee’s KYC, TDS facts or bank details","description":"PAN and bank details are stored encrypted. Needs a fresh second factor.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pan":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"gstin":{"anyOf":[{"description":"15-character GSTIN (validated with its check character).","type":"string","maxLength":32},{"type":"null"}]},"gst_registered":{"type":"boolean"},"employee":{"type":"boolean"},"tds_exempt_reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"certificate":{"anyOf":[{"type":"object","properties":{"rate_bps":{"type":"integer","minimum":0,"maximum":10000},"number":{"type":"string","minLength":3,"maxLength":40},"valid_from":{"$ref":"#/components/schemas/LocalDate"},"valid_to":{"$ref":"#/components/schemas/LocalDate"},"limit":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}},"required":["rate_bps","number","valid_from","valid_to"]},{"type":"null"}]},"bank":{"anyOf":[{"type":"object","properties":{"account_name":{"type":"string","minLength":2,"maxLength":120},"account_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"ifsc":{"anyOf":[{"type":"string","maxLength":11},{"type":"null"}]},"bank_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"upi_vpa":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["account_name"]},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"state":{"anyOf":[{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN state code, e.g. KA."},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Payee"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/finance/receipts/{id}/allocation":{"put":{"operationId":"allocateReceipt","summary":"Settle an invoice with a receipt (or unlink it)","description":"An open invoice of the receipt’s deal, with the TDS the payer deducted; null unlinks it.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoice_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tds_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}},"required":["invoice_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Receipt"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.invoice"}},"/api/v1/finance/receivables":{"get":{"operationId":"listReceivables","summary":"Open balances per customer with ageing","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Receivable"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/finance/settings":{"get":{"operationId":"getFinanceSettings","summary":"Finance settings","description":"GST registration and rate, SAC codes, series, terms, signatory, bank, UPI, payouts, TDS, reminders.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FinanceSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.view","commissions.invoice","commissions.payout"]},"put":{"operationId":"updateFinanceSettings","summary":"Change the finance settings","description":"Needs settings.company and a fresh second factor (the bank details are printed on every invoice).","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFinanceSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FinanceSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/finance/statements/customers/{id}":{"get":{"operationId":"getCustomerStatement","summary":"A customer’s statement","description":"Invoices, receipts, TDS they deducted and credit notes with opening and closing balances.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomerStatement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/finance/statements/payees/{type}/{id}":{"get":{"operationId":"getPayeeStatement","summary":"A payee’s statement for a financial year","description":"Earned, TDS, paid and due with the payouts; members read their own.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PayeeType"}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"fy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayeeStatement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/finance/tds/deposits":{"post":{"operationId":"recordTdsDeposit","summary":"Record the challan that paid TDS","description":"Each register row once. Needs a fresh second factor.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entry_ids":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"challan_number":{"type":"string","maxLength":10},"bsr_code":{"type":"string","maxLength":10},"deposited_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["entry_ids","challan_number","bsr_code","deposited_on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["updated"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/finance/tds/entries":{"get":{"operationId":"listTdsEntries","summary":"The TDS register","description":"Newest first; deposited=false lists the TDS still to deposit.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"fy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"quarter","in":"query","required":false,"schema":{"type":"string","enum":["Q1","Q2","Q3","Q4"]}},{"name":"payee_type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PayeeType"}},{"name":"payee_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"deposited","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TdsEntry"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/finance/tds/sections":{"get":{"operationId":"listTdsSections","summary":"The TDS section table","description":"Platform rows (Income-tax Act 1961 and 2025 numbering, with sources) and the company’s overrides.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TdsSection"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/finance/tds/sections/{id}/override":{"put":{"operationId":"overrideTdsSection","summary":"Override a TDS section for the company","description":"Rate, yearly threshold and no-PAN rate with a reason (audited). Needs a fresh second factor.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rate_bps":{"type":"integer","minimum":0,"maximum":10000},"threshold_fy":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"no_pan_rate_bps":{"type":"integer","minimum":0,"maximum":10000},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["rate_bps","threshold_fy","no_pan_rate_bps","reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TdsSection"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"},"delete":{"operationId":"removeTdsOverride","summary":"Remove the company’s override of a TDS section","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TdsSection"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.payout"}},"/api/v1/finance/tds/summary":{"get":{"operationId":"getTdsSummary","summary":"TDS of a quarter or financial year","description":"Totals by section, payee and month of deduction, with the deposit and return due dates.","tags":["Finance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"fy","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"quarter","in":"query","required":false,"schema":{"type":"string","enum":["Q1","Q2","Q3","Q4"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TdsSummary"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/followup-approvals":{"get":{"operationId":"listFollowupApprovals","summary":"Drafts waiting for approval","description":"`mine`: drafts of your goals; `all` (reviewers): every draft of the leads you can see. Oldest first; keyset pagination.","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"cursor","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FollowupApproval"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.followups"}},"/api/v1/followup-approvals/{id}/approve":{"post":{"operationId":"approveFollowupStep","summary":"Approve (or edit and approve) a draft","description":"Sent through the messaging pipeline at once (its gates apply again; outside quiet hours it waits in the queue). The goal’s owner or a reviewer decides; an expired draft cannot be approved (409).","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":2000}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FollowupApproval"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.followups"}},"/api/v1/followup-approvals/{id}/reject":{"post":{"operationId":"rejectFollowupStep","summary":"Reject a draft","description":"The agent drafts again after the cool-down, told what was wrong.","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":300}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FollowupApproval"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.followups"}},"/api/v1/followup-goals/{id}":{"get":{"operationId":"getFollowupGoal","summary":"A follow-up goal","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FollowupGoal"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.followups"}},"/api/v1/followup-goals/{id}/actions":{"post":{"operationId":"actOnFollowupGoal","summary":"Pause, resume, stop or mark a goal met","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["pause","resume","stop","met"]},"note":{"type":"string","maxLength":200}},"required":["action"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FollowupGoal"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.followups"}},"/api/v1/followup-goals/{id}/documents":{"post":{"operationId":"receiveFollowupDocuments","summary":"Mark documents received","description":"A documents goal is met when the last pending document is received.","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"received":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["received"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FollowupGoal"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.followups"}},"/api/v1/forms":{"get":{"operationId":"listForms","summary":"Enquiry forms","description":"Hosted and embeddable forms, active ones first.","tags":["Forms"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnquiryForm"}},"meta":{"type":"object","properties":{"turnstile_available":{"type":"boolean","description":"Turnstile keys are configured."}},"required":["turnstile_available"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"},"post":{"operationId":"createForm","summary":"Create an enquiry form","description":"Starts with name, mobile, email and message unless `fields` is given. Active forms need marketing.publish.","tags":["Forms"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnquiryForm"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EnquiryForm"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit","x-idempotent":true}},"/api/v1/forms/{id}":{"get":{"operationId":"getForm","summary":"An enquiry form","tags":["Forms"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EnquiryForm"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"},"patch":{"operationId":"updateForm","summary":"Update an enquiry form","description":"Changing the consent text bumps its version; switching a form on or off needs marketing.publish.","tags":["Forms"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnquiryForm"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EnquiryForm"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"},"delete":{"operationId":"deleteForm","summary":"Delete an unused enquiry form","description":"A form with submissions or on a landing page answers 409 — switch it off instead.","tags":["Forms"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"}},"/api/v1/help/articles/{slug}":{"get":{"operationId":"getHelpArticle","summary":"A help article","description":"The article the help sheet shows in the app; the same text is public at /help/<slug>.","tags":["Help"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Article slug, as in /help/<slug>.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,79}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/HelpArticle"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/help/feedback/{slug}":{"get":{"operationId":"getHelpFeedback","summary":"Your vote on an article","tags":["Help"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Article slug, as in /help/<slug>.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,79}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/HelpFeedback"},{"type":"null"}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"put":{"operationId":"putHelpFeedback","summary":"Was this article helpful?","description":"One vote per member and article — voting again changes it. Audited.","tags":["Help"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Article slug, as in /help/<slug>.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,79}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HelpFeedbackInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/HelpFeedback"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/help/tips":{"get":{"operationId":"listHelpTips","summary":"Tips you closed","tags":["Help"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/HelpTips"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"delete":{"operationId":"resetHelpTips","summary":"Show tips again","tags":["Help"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reset":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["reset"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/help/tips/{key}":{"put":{"operationId":"dismissHelpTip","summary":"Close a tip","description":"It stays closed on every device.","tags":["Help"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"key","in":"path","required":true,"description":"Tip key, e.g. leads.list.","schema":{"type":"string","pattern":"^[a-z][a-z0-9_.-]{1,47}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/HelpTips"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/hooks":{"get":{"operationId":"listRestHooks","summary":"The API key’s REST hooks","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["webhooks:manage"]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"settings.integrations"},"post":{"operationId":"subscribeRestHook","summary":"Subscribe a REST hook (Zapier, Make, Pabbly)","description":"Each matching event POSTs the trigger’s record (the same shape as GET /api/v1/triggers/{trigger}) to `target_url`, signed with the X-PropZolo-Signature scheme. Needs an API key with `webhooks:manage` and the trigger’s read scope. Subscribing the same URL again returns the existing subscription. A 410 answer removes it.","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["webhooks:manage"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_url":{"type":"string","minLength":8,"maxLength":500},"trigger":{"$ref":"#/components/schemas/AutomationTriggerKey"},"app":{"anyOf":[{"type":"string","enum":["zapier","make","pabbly","other"]},{"type":"null"}]}},"required":["target_url","trigger"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"settings.integrations"}},"/api/v1/hooks/{id}":{"delete":{"operationId":"unsubscribeRestHook","summary":"Unsubscribe a REST hook","description":"Only hooks created with the calling API key.","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["webhooks:manage"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"settings.integrations"}},"/api/v1/imports":{"get":{"operationId":"listImports","summary":"Import jobs","description":"Your imports (and the log your role covers), newest first.","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ImportJob"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]},"post":{"operationId":"createImport","summary":"Upload a file to import","description":"multipart/form-data with `file` (≤ 10 MB) and optional `entity` uploads directly and starts reading the file; a JSON body `{ file_name, size, entity }` returns a presigned PUT (≤ 80 MB) to upload to before asking for the preview.","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateImportResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/imports/templates":{"get":{"operationId":"listImportTemplates","summary":"Source templates","description":"The export formats imports recognise, with how to export from each; `verify` marks formats to confirm.","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ImportTemplate"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/imports/{id}":{"get":{"operationId":"getImport","summary":"An import job (status, progress, totals, dry-run summary)","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportJob"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/imports/{id}/mapping":{"post":{"operationId":"saveImportMapping","summary":"Save the mapping and queue the dry run","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveImportMappingInput"}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportJob"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/imports/{id}/preview":{"get":{"operationId":"previewImport","summary":"Profile, templates, mapping and value suggestions","description":"After a presigned upload, the first call starts reading the file (profile null until it is done). `template` previews the suggestions of another source template (nothing is saved).","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"template","in":"query","required":false,"schema":{"type":"string","maxLength":32}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportPreview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/imports/{id}/report":{"get":{"operationId":"getImportReport","summary":"Download link for the dry-run report","description":"A CSV of every row with an error or a warning, with the original columns; valid for 5 minutes.","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/imports/{id}/rollback":{"get":{"operationId":"checkImportRollback","summary":"What a rollback would undo, and what blocks it","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"keep_blocked","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportRollbackCheck"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]},"post":{"operationId":"rollbackImport","summary":"Roll back an import","description":"Archives or deletes everything the import created and reverts what it filled, within 7 days, when nothing was changed since — or, with `keep_blocked`, everything except the changed records. Runs in the background; audited.","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackImportInput"}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportJob"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/imports/{id}/skipped-rows":{"get":{"operationId":"getImportSkippedRows","summary":"Download link for the skipped rows","description":"A CSV of every row the import left out, with its reason; the link is valid for 5 minutes.","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/imports/{id}/start":{"post":{"operationId":"startImport","summary":"Start the import","description":"Needs a dry run of the saved mapping. Queues the job; poll it for progress. The admin is notified.","tags":["Imports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportJob"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.import","contacts.import","properties.import"]}},"/api/v1/inbound-emails":{"get":{"operationId":"listInboundEmails","summary":"Inbound lead emails","description":"Newest first (keyset pagination); `status=review` is the review queue.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"review","anyOf":[{"type":"string","enum":["received","ingested","review","rejected","ignored","failed"]},{"type":"string","const":"all"}]}},{"name":"source_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":400}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InboundEmail"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/inbound-emails/summary":{"get":{"operationId":"inboundEmailSummary","summary":"Emails waiting for review","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_received_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["pending","last_received_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/inbound-emails/{id}":{"get":{"operationId":"getInboundEmail","summary":"An inbound lead email with its suggestion and authentication verdicts","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InboundEmail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/inbound-emails/{id}/approve":{"post":{"operationId":"approveInboundEmail","summary":"Approve an email in review","description":"Applies the edits and runs the lead pipeline (dedupe, the TRAI enquiry window, assignment) like any source.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["name","phone","alt_phone","email","city","locality","project","budget","bhk","property_type","lead_type","message"]},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"email":{"$ref":"#/components/schemas/InboundEmail"},"event_id":{"$ref":"#/components/schemas/Id"},"duplicate":{"type":"boolean"}},"required":["email","event_id","duplicate"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/inbound-emails/{id}/dismiss":{"post":{"operationId":"dismissForwardingConfirmation","summary":"Mark a forwarding confirmation as handled","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InboundEmail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/inbound-emails/{id}/raw":{"get":{"operationId":"downloadInboundEmail","summary":"The raw email (.eml) — TRAI enquiry evidence","description":"A presigned link valid for a few minutes.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/inbound-emails/{id}/reject":{"post":{"operationId":"rejectInboundEmail","summary":"Reject an email in review","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InboundEmail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/integrations":{"get":{"operationId":"listIntegrations","summary":"Connector catalogue and connections","description":"Every connector by category (built and planned) with the workspace’s connections and their health.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationsOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]}},"/api/v1/integrations/connections":{"post":{"operationId":"createIntegrationConnection","summary":"Connect an integration","description":"For connectors without OAuth. Google Ads lead forms: returns the webhook URL (`connection.inbound_url`) and the `google_key` (in `revealed_secrets`, shown once). Meta connects through the OAuth endpoints or `/meta/own-app`.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connector":{"type":"string","minLength":3,"maxLength":64,"description":"Connector key, e.g. google.ads_lead_forms."},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["connector"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnectionCreated"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations","x-idempotent":true}},"/api/v1/integrations/connections/{id}":{"get":{"operationId":"getIntegrationConnection","summary":"An integration connection","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]},"patch":{"operationId":"updateIntegrationConnection","summary":"Rename an integration connection or change its default source","description":"Google Ads lead forms also take `allowed_ips`: the IPv4 / IPv6 addresses or CIDR blocks that may call the webhook URL (empty = any caller); other callers get 403.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"default_source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"allowed_ips":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"delete":{"operationId":"disconnectIntegrationConnection","summary":"Disconnect an integration","description":"Wipes its secrets and routing; the connection stays for history and can be connected again.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/connections/{id}/google/forms/{formId}":{"put":{"operationId":"saveGoogleForm","summary":"Configure a Google Ads lead form","description":"Routes one form to its own lead source with its project, lead type, field mapping and consent questions (column id → consent ledger).","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"formId","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"mapping":{"$ref":"#/components/schemas/FieldMapping"},"consents":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/LeadFormConsentMappingInput"}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GoogleFormConfig"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/connections/{id}/meta/forms":{"get":{"operationId":"listMetaForms","summary":"Lead forms of the connected Pages","description":"Forms per Page (from Meta) with their saved configuration and mapping suggestions per question.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subscribed":{"type":"boolean"},"conflict":{"type":"boolean"},"error":{"type":["string","null"]},"forms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"questions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":["string","null"]},"suggested":{"type":["string","null"]},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["key","label","type","suggested","confidence"],"additionalProperties":false}},"config":{"anyOf":[{"$ref":"#/components/schemas/MetaFormConfig"},{"type":"null"}]}},"required":["id","name","status","questions","config"],"additionalProperties":false}}},"required":["id","name","subscribed","conflict","error","forms"],"additionalProperties":false}}},"required":["pages"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/connections/{id}/meta/forms/{formId}":{"put":{"operationId":"saveMetaForm","summary":"Configure a Meta lead form","description":"Lead source, project, lead type, field mapping, consent checkboxes (custom disclaimer → consent ledger) and on/off for one form.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"formId","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string","pattern":"^\\d{1,32}$"},"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"mapping":{"$ref":"#/components/schemas/FieldMapping"},"consents":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/LeadFormConsentMappingInput"}},"enabled":{"type":"boolean"}},"required":["page_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MetaFormConfig"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/connections/{id}/rotate":{"post":{"operationId":"rotateIntegrationConnection","summary":"Rotate a generated secret","description":"Google Ads: issues a new google_key (shown once); the old key stops working at once.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnectionCreated"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/connections/{id}/test":{"post":{"operationId":"testIntegrationConnection","summary":"Test an integration connection","description":"Checks the credentials with the provider and records the result on the connection.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string"},"checked_at":{"$ref":"#/components/schemas/DateTime"}},"required":["ok","message","checked_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/health":{"get":{"operationId":"getIntegrationHealth","summary":"Integration health","description":"Every connection, automatic lead source and messaging channel with its state (ok, degraded, broken, silent, paused, setup), last success and error, 24 h / 7 d volume, held webhook items, token expiry and portal package end, most urgent first, each with one fix link. Read-only; `filter=attention` keeps the rows that are not ok.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"filter","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","attention"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationHealthRow"}},"meta":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attention":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"generated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["total","attention","generated_at"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]}},"/api/v1/integrations/meta/oauth/callback":{"get":{"operationId":"completeMetaOAuth","summary":"Facebook Login callback","description":"Exchanges the code for a long-lived token, subscribes the granted Pages to leadgen, stores the connection and redirects to Settings → Integrations → Meta (`?connected=<id>` or `?error=<reason>`).","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","maxLength":2000}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":600}},{"name":"error","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"error_reason","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false,"description":"Always a redirect."}}}},"302":{"description":"Back to Settings → Integrations → Meta.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/meta/oauth/start":{"get":{"operationId":"startMetaOAuth","summary":"Start connecting Meta Lead Ads","description":"The Facebook Login for Business URL (state bound to the signed-in member, valid 10 minutes). With `redirect=true` the browser is redirected there directly. 404 until PropZolo’s Meta app is configured in the super-admin console (own-app mode works without it).","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"redirect","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"302":{"description":"Redirect to Facebook (redirect=true).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/meta/own-app":{"post":{"operationId":"connectMetaOwnApp","summary":"Connect Meta Lead Ads with your own Meta app","description":"Own-app mode, no PropZolo Meta app needed: checks the token with your app (debug_token), subscribes your app to each Page’s leadgen field and stores the connection (secrets in the vault). Point your app’s Page webhook at `revealed_secrets.callback_url` with `revealed_secrets.verify_token` (shown once). Connecting the same app again refreshes its connection.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"app_id":{"type":"string","pattern":"^\\d{1,32}$"},"app_secret":{"type":"string","minLength":16,"maxLength":256},"access_token":{"type":"string","minLength":20,"maxLength":2048,"description":"A system-user token of your business (recommended — it does not expire) or a Page token."},"verify_token":{"description":"Webhook verify token; generated when omitted.","anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["app_id","app_secret","access_token"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnectionCreated"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations","x-idempotent":true}},"/api/v1/integrations/parked-items":{"get":{"operationId":"listParkedWebhookItems","summary":"Held webhook items","description":"Provider webhook items that could not be applied yet (an unknown number, a status before its message, a file Meta did not hand over), newest first. Retried automatically; `meta.parked_count` counts the waiting ones.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"parked","type":"string","enum":["parked","replayed","discarded"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ParkedWebhookItem"}},"meta":{"type":"object","properties":{"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"},"parked_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["next_cursor","has_more","parked_count"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/parked-items/{id}/discard":{"post":{"operationId":"discardParkedWebhookItem","summary":"Discard a held webhook item","description":"Stops the automatic tries of a waiting item; it can still be replayed later.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ParkedWebhookItem"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/parked-items/{id}/replay":{"post":{"operationId":"replayParkedWebhookItem","summary":"Replay a held webhook item","description":"Queues the item for a new try within a minute, with a fresh retry schedule.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ParkedWebhookItem"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/payments":{"post":{"operationId":"connectPaymentGateway","summary":"Connect Razorpay or Cashfree","description":"Razorpay: key id, key secret and the webhook secret you set in the Razorpay dashboard (add the returned `inbound_url` there with the payment_link events). Cashfree: app id and secret key (production or sandbox).","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["razorpay","cashfree"]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"key_id":{"type":"string","maxLength":64},"key_secret":{"type":"string","maxLength":128},"webhook_secret":{"type":"string","maxLength":128},"client_id":{"type":"string","maxLength":80},"client_secret":{"type":"string","maxLength":160},"environment":{"type":"string","enum":["production","sandbox"]}},"required":["provider"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/payments/{id}":{"patch":{"operationId":"updatePaymentGateway","summary":"Change a payment gateway’s keys or name","description":"Only the keys sent are replaced.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"key_id":{"type":"string","maxLength":64},"key_secret":{"type":"string","maxLength":128},"webhook_secret":{"type":"string","maxLength":128},"client_id":{"type":"string","maxLength":80},"client_secret":{"type":"string","maxLength":160},"environment":{"type":"string","enum":["production","sandbox"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/payments/{id}/test":{"post":{"operationId":"testPaymentGateway","summary":"Test a payment gateway connection","description":"Probes the keys with the provider and records the result on the connection.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string"},"checked_at":{"$ref":"#/components/schemas/DateTime"},"webhook_url":{"type":["string","null"]}},"required":["ok","message","checked_at","webhook_url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/portals/{portal}":{"get":{"operationId":"getPortalSetup","summary":"A portal’s onboarding guide and connections","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"portal","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PortalKey"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalSetup"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]},"post":{"operationId":"connectPortal","summary":"Connect a portal account","description":"Creates the push URL and binds a lead source (the given one, the portal’s source, or a new one).","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","justdial","sulekha","commonfloor"]}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations","x-idempotent":true}},"/api/v1/integrations/portals/{portal}/{id}":{"patch":{"operationId":"updatePortal","summary":"Change a portal connection: source, pull settings, pull credentials, activation, project map, package end","description":"Credentials are write-only: a value replaces, null removes, an absent key keeps the stored one.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","justdial","sulekha","commonfloor"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"source_id":{"$ref":"#/components/schemas/Id"},"pull":{"type":"object","properties":{"enabled":{"type":"boolean"},"interval_minutes":{"type":"integer","minimum":5,"maximum":360},"overlap_minutes":{"type":"integer","minimum":0,"maximum":240},"endpoint":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]}}},"secrets":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]}},"activation":{"type":"string","enum":["requested","waiting_for_portal"]},"project_map":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"portal_project_id":{"type":"string","minLength":1,"maxLength":64},"project_id":{"$ref":"#/components/schemas/Id"}},"required":["portal_project_id","project_id"]}},"package_ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"allowed_ips":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"delete":{"operationId":"disconnectPortal","summary":"Disconnect a portal account","description":"The push URL stops working and stored credentials are wiped; received leads stay.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","justdial","sulekha","commonfloor"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/portals/{portal}/{id}/rotate":{"post":{"operationId":"rotatePortalUrl","summary":"Issue a new push URL","description":"The old URL stops working at once — send the new one to the portal’s team.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","justdial","sulekha","commonfloor"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/portals/{portal}/{id}/test":{"post":{"operationId":"testPortalPull","summary":"Test a portal pull","description":"Asks the portal for the last 24 hours with the stored credentials; nothing is stored.","tags":["Integrations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","justdial","sulekha","commonfloor"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"fetched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"message":{"type":"string"},"window":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"}},"required":["from","to"],"additionalProperties":false}},"required":["ok","fetched","message","window"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/telephony":{"post":{"operationId":"connectTelephony","summary":"Connect Exotel","description":"Your Exotel account SID, API key and API token (Exotel → API settings) and the cluster the account lives on (`in`: api.in.exotel.com, `sg`: api.exotel.com). The answer carries the webhook URLs to paste in Exotel.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["exotel"]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"account_sid":{"type":"string","minLength":2,"maxLength":64},"api_key":{"type":"string","minLength":8,"maxLength":128},"api_token":{"type":"string","minLength":8,"maxLength":128},"region":{"default":"in","type":"string","enum":["in","sg"]}},"required":["provider","account_sid","api_key","api_token"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonyConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/telephony/{id}":{"patch":{"operationId":"updateTelephony","summary":"Change the telephony keys, SID, cluster or name","description":"Only the fields sent change.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"account_sid":{"type":"string","minLength":2,"maxLength":64},"api_key":{"type":"string","maxLength":128},"api_token":{"type":"string","maxLength":128},"region":{"type":"string","enum":["in","sg"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonyConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/telephony/{id}/sync-numbers":{"post":{"operationId":"syncTelephonyNumbers","summary":"Fetch the ExoPhones","description":"New numbers are added, known ones refreshed, numbers gone from the account released.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"released":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["added","updated","released"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrations/telephony/{id}/test":{"post":{"operationId":"testTelephony","summary":"Test the telephony connection","description":"Lists the account’s numbers with the keys and records the result on the connection.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string"},"numbers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"checked_at":{"$ref":"#/components/schemas/DateTime"},"hooks":{"anyOf":[{"$ref":"#/components/schemas/TelephonyHooks"},{"type":"null"}]}},"required":["ok","message","numbers","checked_at","hooks"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/integrity/alerts":{"get":{"operationId":"listIntegrityAlerts","summary":"Integrity alerts","description":"Newest day first, within your `calls.integrity` scope — never your own alerts.","tags":["Integrity"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"open","type":"string","enum":["open","reviewed","dismissed","cleared","all"]}},{"name":"severity","in":"query","required":false,"schema":{"type":"string","enum":["high","medium","low"]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IntegrityAlert"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.integrity"}},"/api/v1/integrity/alerts/{id}":{"get":{"operationId":"getIntegrityAlert","summary":"One integrity alert with its evidence","tags":["Integrity"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrityAlertDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.integrity"}},"/api/v1/integrity/alerts/{id}/review":{"post":{"operationId":"reviewIntegrityAlert","summary":"Review, dismiss or reopen an alert","description":"reviewed · dismissed (a note is required) · open (look again). Audited.","tags":["Integrity"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["reviewed","dismissed","open"]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IntegrityAlertDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.integrity","x-idempotent":true}},"/api/v1/integrity/summary":{"get":{"operationId":"getIntegritySummary","summary":"Open integrity alerts in numbers","tags":["Integrity"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"open":{"type":"integer","minimum":0,"maximum":9007199254740991},"high":{"type":"integer","minimum":0,"maximum":9007199254740991},"by_kind":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["open","high","by_kind"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"calls.integrity"}},"/api/v1/inventory-inbox/capture":{"get":{"operationId":"getInventoryCapture","summary":"Read-only group capture on my linked phone: my groups and the ones I chose","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryCapture"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.link_whatsapp"},"put":{"operationId":"updateInventoryCapture","summary":"Choose the groups my linked phone captures (read-only; nothing is ever sent to a group)","description":"Adding a group needs the consent notice’s `version` and `hash` as shown with GET.","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"link_id":{"$ref":"#/components/schemas/Id"},"groups":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"jid":{"type":"string","minLength":1,"maxLength":100},"name":{"type":"string","maxLength":200}},"required":["jid","name"]}},"consent":{"anyOf":[{"type":"object","properties":{"version":{"type":"string","maxLength":16},"hash":{"type":"string","maxLength":64}},"required":["version","hash"]},{"type":"null"}]}},"required":["link_id","groups"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryCapture"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.link_whatsapp"}},"/api/v1/inventory-inbox/clusters":{"get":{"operationId":"listInventoryClusters","summary":"The review queue: listings and requirements seen in WhatsApp groups, latest first","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"pending","type":"string","enum":["pending","accepted","rejected","all"]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["listing","requirement"]}},{"name":"ready","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"freshness","in":"query","required":false,"schema":{"type":"string","enum":["fresh","recent","aging","stale"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryCluster"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/clusters/bulk-accept":{"post":{"operationId":"bulkAcceptInventoryClusters","summary":"Accept cards that are ready (every field ≥ 0.9, no flag, nothing missing, no look-alike), 25 at a time","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/Id"}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"accepted":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"created_type":{"type":"string","enum":["property","lead"]},"created_id":{"$ref":"#/components/schemas/Id"},"matches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","created_type","created_id","matches"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"reason":{"type":"string"}},"required":["id","reason"],"additionalProperties":false}}},"required":["accepted","skipped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox","x-idempotent":true}},"/api/v1/inventory-inbox/clusters/{id}":{"get":{"operationId":"getInventoryCluster","summary":"One review card: the posts it was seen in, price history and fitting demand","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryClusterDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"},"patch":{"operationId":"updateInventoryCluster","summary":"Correct a card’s fields before deciding (kept as a draft until accepted)","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryCardEdits"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryClusterDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/clusters/{id}/accept":{"post":{"operationId":"acceptInventoryCluster","summary":"Accept a card: a private listing or a lead; matching runs at once","description":"A card that looks like an existing listing answers 409 until `duplicate` says `link` (no new listing) or `create`. Requirements can be accepted only by a member who imported one of their posts (the number is private to them).","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"edits":{"$ref":"#/components/schemas/InventoryCardEdits"},"duplicate":{"type":"string","enum":["link","create"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"cluster":{"$ref":"#/components/schemas/InventoryClusterDetail"},"created":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["property","lead"]},"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":["string","null"]},"status":{"type":["string","null"]}},"required":["type","id","ref","status"],"additionalProperties":false},{"type":"null"}]},"matches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cluster","created","matches"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox","x-idempotent":true}},"/api/v1/inventory-inbox/clusters/{id}/duplicate":{"put":{"operationId":"setInventoryClusterDuplicate","summary":"Say which listing this card is (or that it is not a duplicate)","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["property_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryClusterDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/clusters/{id}/merge":{"post":{"operationId":"mergeInventoryClusters","summary":"Merge other cards into this one (the same listing)","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cluster_ids":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["cluster_ids"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryClusterDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/clusters/{id}/reject":{"post":{"operationId":"rejectInventoryCluster","summary":"Reject a card (noise teaches the parser)","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","enum":["noise","sold","not_relevant","duplicate"]}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryClusterDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/clusters/{id}/split":{"post":{"operationId":"splitInventoryCluster","summary":"Split posts off a card (they are another listing)","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"card_ids":{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["card_ids"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"cluster":{"$ref":"#/components/schemas/InventoryClusterDetail"},"created":{"$ref":"#/components/schemas/InventoryClusterDetail"}},"required":["cluster","created"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/ingests":{"get":{"operationId":"listInventoryIngests","summary":"Imports into the inventory inbox, newest first","description":"Members see their own imports; members who manage AI settings see everyone’s.","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryIngest"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"},"post":{"operationId":"createInventoryIngest","summary":"Import a WhatsApp chat export or paste broker posts","description":"multipart/form-data with `file` (the .txt or .zip of WhatsApp “Export chat”, ≤ 10 MB) and optional `group_name` starts reading at once; JSON `{ kind: \"upload\", file_name, size }` returns a presigned PUT (≤ 80 MB) — then POST …/start; JSON `{ kind: \"paste\", text }` stores the post (or lines copied from an export) for the parser.","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ingest":{"$ref":"#/components/schemas/InventoryIngest"},"upload":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","method","headers","expires_at"],"additionalProperties":false},{"type":"null"}]}},"required":["ingest","upload"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/ingests/{id}":{"get":{"operationId":"getInventoryIngest","summary":"An import and its progress","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryIngest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/ingests/{id}/cancel":{"post":{"operationId":"cancelInventoryIngest","summary":"Stop an import (posts not read yet are never sent to the AI)","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryIngest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/ingests/{id}/start":{"post":{"operationId":"startInventoryIngest","summary":"Start reading an export uploaded with a presigned PUT","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryIngest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/settings":{"get":{"operationId":"getInventoryInboxSettings","summary":"Inventory inbox settings: forwards to the company number, how far back exports are read","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryInboxSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"},"patch":{"operationId":"updateInventoryInboxSettings","summary":"Change the inventory inbox settings","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"forwards":{"type":"boolean"},"export_since_days":{"type":"integer","minimum":1,"maximum":365}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryInboxSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/inventory-inbox/share":{"post":{"operationId":"shareToInventoryInbox","summary":"Android share target: a post shared from WhatsApp into the inbox","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":200000},"group_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"sender":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]}}},{"type":"null"}]}},"required":["text"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryIngest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/inventory-inbox/summary":{"get":{"operationId":"inventoryInboxSummary","summary":"Counts for the queue: waiting for review, ready to bulk-accept, posts still being read","tags":["Inventory inbox"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ready":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parsing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["pending","ready","parsing"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.inventory_inbox"}},"/api/v1/invitations":{"get":{"operationId":"listInvitations","summary":"Pending invitations","description":"Invitations not yet accepted, newest first; expired ones are flagged so they can be sent again.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}},"meta":{"type":"object","properties":{"seats":{"$ref":"#/components/schemas/SeatUsage"}},"required":["seats"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.users","settings.view"]},"post":{"operationId":"createInvitation","summary":"Invite someone","description":"Invite by mobile number or email with a role (never one with more access than yours), branch and manager. Replaces an earlier pending invitation for the same person. Needs a free seat.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvitationCreated"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.users"}},"/api/v1/invitations/{id}":{"delete":{"operationId":"revokeInvitation","summary":"Withdraw an invitation","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.users"}},"/api/v1/invitations/{id}/resend":{"post":{"operationId":"resendInvitation","summary":"Send an invitation again","description":"Issues a fresh link valid for another 7 days; the old link stops working.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvitationCreated"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.users"}},"/api/v1/kiosks":{"get":{"operationId":"listKiosks","summary":"Site-office kiosks","description":"Enrolled tablets with their project, letter, status, last contact and today’s walk-ins.","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Kiosk"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.lead_routing","settings.view"]},"post":{"operationId":"createKiosk","summary":"Enrol a kiosk","description":"Creates the kiosk (pending until a tablet pairs) and its first one-time pairing code (30 minutes, shown once — so the request is not replayable). Owners and admins confirm their authenticator code first (step-up).","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKiosk"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KioskEnrolment"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/kiosks/policy":{"get":{"operationId":"getWalkInPolicy","summary":"The walk-in policy","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WalkInPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.lead_routing","settings.view"]},"put":{"operationId":"updateWalkInPolicy","summary":"Update the walk-in policy","description":"A changed consent text is a new version; walk-ins keep the version they saw.","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWalkInPolicy"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WalkInPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/kiosks/{id}":{"get":{"operationId":"getKiosk","summary":"A kiosk","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Kiosk"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.lead_routing","settings.view"]},"patch":{"operationId":"updateKiosk","summary":"Update a kiosk","description":"Names, project lock, lead source, branding, questions and who is notified.","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKiosk"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Kiosk"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/kiosks/{id}/pairing":{"post":{"operationId":"newKioskPairing","summary":"A new pairing code for a kiosk","description":"For a replaced tablet or a reset browser; the paired tablet keeps working until another one pairs. Step-up for owners and admins.","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KioskEnrolment"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/kiosks/{id}/revoke":{"post":{"operationId":"revokeKiosk","summary":"Revoke a kiosk","description":"The device token and any pairing code stop working at once; its site-office QR codes are paused.","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Kiosk"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/landing-pages":{"get":{"operationId":"listLandingPages","summary":"Landing pages","description":"Draft and published pages and microsites (archived ones are hidden), most recently changed first.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LandingPage"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"},"post":{"operationId":"createLandingPage","summary":"Create a landing page","description":"A draft from the template of a project, a listing, a campaign or an agent; the slug follows the title.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLandingPage"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LandingPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit","x-idempotent":true}},"/api/v1/landing-pages/microsites":{"post":{"operationId":"createMicrosite","summary":"Create a listing microsite or an agent card","description":"Generated from the listing (photos, specs, price, map, agent, enquiry form) or the member (photo, RERA number, call / WhatsApp, live listings). Asking again returns the existing page; `publish` puts it live when it is ready.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMicrosite"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"page":{"$ref":"#/components/schemas/LandingPage"},"created":{"type":"boolean"},"published":{"type":"boolean"}},"required":["page","created","published"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit","x-idempotent":true}},"/api/v1/landing-pages/{id}":{"get":{"operationId":"getLandingPage","summary":"A landing page","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LandingPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"},"patch":{"operationId":"updateLandingPage","summary":"Update a landing page’s draft","description":"Blocks, theme, price policy, form, slug, domain, SEO, tracking and the A/B test of the draft.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLandingPage"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LandingPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"},"delete":{"operationId":"deleteLandingPage","summary":"Delete or archive a landing page","description":"An unused draft is deleted; a page with views, enquiries or versions is archived. Unpublish first.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"archived":{"type":"boolean"}},"required":["id","archived"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"}},"/api/v1/landing-pages/{id}/analytics":{"get":{"operationId":"getLandingAnalytics","summary":"Landing page analytics","description":"Views, visitors, enquiries and contact taps per company day (bots filtered), and the A/B test’s results with a significance hint.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":7,"maximum":366}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LandingAnalytics"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"}},"/api/v1/landing-pages/{id}/experiment/winner":{"post":{"operationId":"pickLandingWinner","summary":"End an A/B test with a winner","description":"The winner becomes the page and the test ends; a live page is republished at once.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variant":{"$ref":"#/components/schemas/LandingVariantKey"}},"required":["variant"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LandingPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.publish"}},"/api/v1/landing-pages/{id}/preview-link":{"post":{"operationId":"createLandingPreviewLink","summary":"A preview link of the draft","description":"Shows the draft exactly as visitors would for two hours; nothing on it counts or tracks.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"}},"/api/v1/landing-pages/{id}/publish":{"post":{"operationId":"publishLandingPage","summary":"Publish a landing page","description":"Puts the draft live as a new version; 422 with the first issue while the draft is not ready, 402 when the plan has no room for another live page.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LandingPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.publish"}},"/api/v1/landing-pages/{id}/unpublish":{"post":{"operationId":"unpublishLandingPage","summary":"Unpublish a landing page","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LandingPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.publish"}},"/api/v1/landing-pages/{id}/versions":{"get":{"operationId":"listLandingVersions","summary":"Published versions of a landing page","description":"The last 50, newest first.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LandingVersion"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"}},"/api/v1/landing-pages/{id}/versions/{number}/restore":{"post":{"operationId":"restoreLandingVersion","summary":"Restore a version (rollback)","description":"Copies the version into the draft; with `publish` it goes live at once as a new version (needs marketing.publish).","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"publish":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LandingPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"}},"/api/v1/launch-eois/{id}":{"patch":{"operationId":"updateLaunchEoi","summary":"Change an EOI’s preferences","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"floor_min":{"anyOf":[{"type":"integer","minimum":-5,"maximum":200},{"type":"null"}]},"floor_max":{"anyOf":[{"type":"integer","minimum":-5,"maximum":200},{"type":"null"}]},"max_price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}}}}},"required":["preferences"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchEoi"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.eoi"}},"/api/v1/launch-eois/{id}/allot":{"post":{"operationId":"allotLaunchEoi","summary":"Allot the unit the holder picked (live)","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unit_id":{"$ref":"#/components/schemas/Id"}},"required":["unit_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchEoi"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launch-eois/{id}/cancel":{"post":{"operationId":"cancelLaunchEoi","summary":"Cancel an EOI (an allotted unit is released)","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchEoi"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launch-eois/{id}/check-in":{"post":{"operationId":"checkInLaunchEoi","summary":"Check an EOI holder in at the launch","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchEoi"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.eoi"}},"/api/v1/launch-eois/{id}/refund":{"post":{"operationId":"refundLaunchEoi","summary":"Record the refund of a cancelled EOI","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"refund_ref":{"type":"string","minLength":1,"maxLength":80}},"required":["refund_ref"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchEoi"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launch-eois/{id}/verify":{"post":{"operationId":"verifyLaunchEoi","summary":"Verify an EOI payment","description":"After the draw a verified EOI joins the end of the order (a walk-in).","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payment_mode":{"type":"string","enum":["upi","neft","rtgs","cheque","card","cash"]},"payment_ref":{"type":"string","minLength":1,"maxLength":80}},"required":["payment_mode","payment_ref"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchEoi"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launch-price-rules/{id}/apply":{"post":{"operationId":"applyLaunchPriceRule","summary":"Apply a triggered rule: draft the next price list with the scope’s BSP stepped","description":"Needs `projects.pricing` too (it drafts a B-02 price-list version, which is published there).","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rule":{"$ref":"#/components/schemas/LaunchPriceRule"},"price_list":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"}},"required":["id","version","name"],"additionalProperties":false}},"required":["rule","price_list"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launch-price-rules/{id}/dismiss":{"post":{"operationId":"dismissLaunchPriceRule","summary":"Dismiss a pricing rule","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchPriceRule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launches":{"get":{"operationId":"listLaunches","summary":"Launches, newest first","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Launch"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"},"post":{"operationId":"createLaunch","summary":"Create a launch for a project","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string","minLength":1,"maxLength":120},"method":{"default":"lottery","type":"string","enum":["lottery","first_come"]},"eoi_amount":{"$ref":"#/components/schemas/PaiseInput"},"eoi_opens_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"eoi_closes_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"launch_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"hold_hours":{"default":72,"type":"integer","minimum":1,"maximum":720},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"beacon_round":{"description":"A future drand round whose randomness is mixed into the draw (fixed once EOIs close).","anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["project_id","name","eoi_amount"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Launch"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launches/{id}":{"get":{"operationId":"getLaunch","summary":"A launch","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Launch"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"},"patch":{"operationId":"updateLaunch","summary":"Change a launch","description":"The draw method and the EOI amount are fixed once EOIs open (409).","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"method":{"default":"lottery","type":"string","enum":["lottery","first_come"]},"eoi_amount":{"$ref":"#/components/schemas/PaiseInput"},"eoi_opens_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"eoi_closes_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"launch_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"hold_hours":{"default":72,"type":"integer","minimum":1,"maximum":720},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"beacon_round":{"description":"A future drand round whose randomness is mixed into the draw (fixed once EOIs close).","anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Launch"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launches/{id}/allot":{"post":{"operationId":"autoAllotLaunch","summary":"Allot units automatically in priority order","description":"Each EOI gets the best free unit of its preferences as a B-01 hold; the rest are waitlisted.","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"allotted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitlisted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rules_triggered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["allotted","waitlisted","rules_triggered"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launches/{id}/board":{"get":{"operationId":"getLaunchBoard","summary":"The live launch board","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchBoard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"}},"/api/v1/launches/{id}/call-next":{"post":{"operationId":"callNextEois","summary":"Call the next checked-in holders in priority order","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"default":1,"type":"integer","minimum":1,"maximum":20}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LaunchEoi"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launches/{id}/draw":{"post":{"operationId":"drawLaunch","summary":"Run the draw","description":"Verified EOIs get priorities 1…n (lottery: ascending SHA-256(draw seed:eoi_id), the draw seed mixing in the announced beacon round’s randomness; first-come: verification time). The seed is revealed so anyone can check the order against the commitment and the participant fingerprint.","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"beacon_value":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{32,128}$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"launch":{"$ref":"#/components/schemas/Launch"},"entries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unverified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["launch","entries","unverified"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launches/{id}/eois":{"get":{"operationId":"listLaunchEois","summary":"EOIs of a launch, in priority order","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["submitted","verified","checked_in","called","allotted","waitlisted","cancelled","refunded"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LaunchEoi"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"},"post":{"operationId":"createLaunchEoi","summary":"Record an EOI","description":"For a lead (or a contact) with up to 5 preferences, best first. Numbered per launch.","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"payment_mode":{"anyOf":[{"type":"string","enum":["upi","neft","rtgs","cheque","card","cash"]},{"type":"null"}]},"payment_ref":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"preferences":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"floor_min":{"anyOf":[{"type":"integer","minimum":-5,"maximum":200},{"type":"null"}]},"floor_max":{"anyOf":[{"type":"integer","minimum":-5,"maximum":200},{"type":"null"}]},"max_price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}}}}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchEoi"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.eoi"}},"/api/v1/launches/{id}/price-rules":{"get":{"operationId":"listLaunchPriceRules","summary":"Dynamic pricing rules of a launch","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LaunchPriceRule"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"},"post":{"operationId":"createLaunchPriceRule","summary":"Add a dynamic pricing rule","description":"When the taken share of the scope reaches the threshold, the rule is triggered for a manager to apply.","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"threshold_pct":{"type":"integer","minimum":1,"maximum":100},"increase_per_area":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"increase_bps":{"anyOf":[{"type":"integer","minimum":1,"maximum":2500},{"type":"null"}]}},"required":["name","threshold_pct"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LaunchPriceRule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/launches/{id}/status":{"post":{"operationId":"moveLaunch","summary":"Open or close the EOI window, go live, or close the launch","description":"Opening the EOI window picks the secret draw seed and publishes its SHA-256 commitment; closing it freezes the participant list and publishes its fingerprint.","tags":["Launch mode"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","enum":["eoi_open","eoi_closed","live","closed"]}},"required":["to"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Launch"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.launch"}},"/api/v1/leads":{"get":{"operationId":"listLeads","summary":"List leads","description":"Keyset-paginated leads within the caller’s view scope. `filter` takes the shared filter DSL over the lead fields (requirement and contact fields included), `view` a smart-list preset, `q` a name, phone suffix (4+ digits) or reference (L-10234). Sort keys: received_at, created_at, next_follow_up_at, last_activity_at, status_changed_at, number, expected_value, score, probability (- for descending).","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"filter","in":"query","required":false,"description":"Filter tree ({ all | any | not | field/op/value }) as JSON or base64url(JSON).","schema":{"type":"string","maxLength":20000}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"view","in":"query","required":false,"description":"Smart-list presets.","schema":{"$ref":"#/components/schemas/LeadView"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadSummary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"},"post":{"operationId":"createLead","summary":"Create a lead","description":"Manual entry through the same pipeline as every enquiry: a known number follows the duplicate policy (re-enquiry on the open lead, a labelled duplicate, or a reopened lead) — see `outcome`.","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateLeadResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.create","x-idempotent":true}},"/api/v1/leads/bulk":{"post":{"operationId":"bulkLeads","summary":"Bulk actions on leads","description":"Selected ids, or \"all matching\" a filter / view / search — always within your scope, at most 10,000 leads. Assign (one member or a round-robin split), status (only statuses that ask for no details), tags (on the contacts), delete (soft).","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLeadsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BulkLeadsResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.bulk"}},"/api/v1/leads/deleted":{"get":{"operationId":"listDeletedLeads","summary":"Recycle bin","description":"Soft-deleted leads that can be restored (deleted by a person — one lead or a bulk delete), within the caller’s `leads.delete` scope, newest deletion first. Merged-away leads, erased people and import rollbacks are final and never listed. `filter` takes the lead filter DSL (deleted_at, deleted_by_id included).","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"filter","in":"query","required":false,"description":"Filter tree ({ all | any | not | field/op/value }) as JSON or base64url(JSON).","schema":{"type":"string","maxLength":20000}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeletedLead"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.delete"}},"/api/v1/leads/duplicates":{"get":{"operationId":"checkLeadDuplicates","summary":"Live duplicate check","description":"Who already has this number or email, and their leads (records outside your scope carry no id).","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"phone","in":"query","required":false,"schema":{"type":"string","maxLength":32}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":160}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadDuplicateCheck"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.create"}},"/api/v1/leads/merge":{"post":{"operationId":"mergeLeads","summary":"Merge two leads","description":"Explicit merge (never automatic): enquiries, timeline, tasks, calls and visits move to the kept lead; the merged lead stays as a soft-deleted record labelled `merged`. Needs leads.merge, leads.edit on both and leads.delete on the merged one.","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeLeadsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MergeLeadsResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.merge"}},"/api/v1/leads/restore":{"post":{"operationId":"restoreLeads","summary":"Restore leads from the recycle bin","description":"Brings leads back (audited, `lead.restored` per lead). Ids outside the caller’s recycle bin are returned in `not_found`. Tasks cancelled by the delete stay cancelled.","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"restored":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"labelled":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"duplicate_of_id":{"$ref":"#/components/schemas/Id"}},"required":["id","duplicate_of_id"],"additionalProperties":false}},"not_found":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["restored","labelled","not_found"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.delete"}},"/api/v1/leads/{id}":{"get":{"operationId":"getLead","summary":"A lead","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"},"patch":{"operationId":"updateLead","summary":"Update a lead","description":"`requirement` and `custom` are partial: only the keys sent change. Send an `Idempotency-Key` to make a retry (the mobile offline queue) safe.","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLeadInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.edit","x-idempotent":true},"delete":{"operationId":"deleteLead","summary":"Delete a lead","description":"Soft delete (recoverable, audited); open tasks of the lead are cancelled. When the company’s delete policy asks for approval: 409 approval_required, or — with `request_approval=1` — the chain in meta.approval (deleted false).","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"request_approval","in":"query","required":false,"schema":{"type":"string","enum":["1","true"]}},{"name":"approval_note","in":"query","required":false,"schema":{"type":"string","maxLength":1000}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean"}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.delete"}},"/api/v1/leads/{id}/assign":{"post":{"operationId":"assignLead","summary":"Assign a lead","description":"Closing owner and / or pre-sales owner; open tasks follow the lead to its new owner.","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignLeadInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.assign"}},"/api/v1/leads/{id}/checklist":{"post":{"operationId":"tickLeadChecklist","summary":"Tick a checklist item of the lead’s stage","tags":["Process guard"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"item":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"done":{"type":"boolean"}},"required":["item","done"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadNextSteps"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.edit"}},"/api/v1/leads/{id}/documents":{"get":{"operationId":"listLeadDocuments","summary":"Documents of a lead’s deals","description":"KYC, agreements, token receipts and payment proofs on the deals of this lead the caller can see, newest first (the lead’s Files tab). Download each through its deal.","tags":["Deals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadDocument"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"}},"/api/v1/leads/{id}/enquiries":{"get":{"operationId":"listLeadEnquiries","summary":"Every enquiry of a lead","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadEnquiry"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"}},"/api/v1/leads/{id}/flags":{"get":{"operationId":"getLeadFlags","summary":"The lead’s quick flags and co-agent","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadFlags"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"},"post":{"operationId":"setLeadFlag","summary":"Turn a quick flag on or off","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"flag":{"type":"string","enum":["escalate","about_to_convert","highlight"]},"on":{"type":"boolean"}},"required":["flag","on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadFlags"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.edit"}},"/api/v1/leads/{id}/followup-goals":{"get":{"operationId":"listLeadFollowupGoals","summary":"Follow-up goals of a lead","description":"Newest first, with every touch (drafts, approvals, sends, call tasks).","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FollowupGoal"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.followups"},"post":{"operationId":"createLeadFollowupGoal","summary":"Set a follow-up goal on a lead","description":"One live goal per lead (409 otherwise). Channels and touches are kept within the company’s rules; autopilot only where the company allows it for this kind of goal. Needs edit access to the lead.","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["site_visit","documents","decision","revive"]},"mode":{"default":"cowork","type":"string","enum":["cowork","autopilot"]},"channels":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]}},"max_touches":{"type":"integer","minimum":1,"maximum":10},"deadline_days":{"type":"integer","minimum":1,"maximum":60},"instructions":{"description":"Your brief to the agent; never a price the CRM lacks.","type":"string","maxLength":500},"documents":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["kind"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FollowupGoal"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.followups"}},"/api/v1/leads/{id}/next-steps":{"get":{"operationId":"getLeadNextSteps","summary":"Valid next statuses of a lead","description":"Every status of the lead’s pipeline with whether it may move there now and why not; the stage checklist.","tags":["Process guard"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadNextSteps"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"}},"/api/v1/leads/{id}/secondary-owner":{"put":{"operationId":"setLeadSecondaryOwner","summary":"Set or clear the lead’s co-agent","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["member_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadFlags"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.assign"}},"/api/v1/leads/{id}/status":{"post":{"operationId":"changeLeadStatus","summary":"Change a lead’s status","description":"The status sheet: the target status / sub-status decides what is required (follow-up time, visit slot, note, deal, named fields — 422 names the missing input). Creates the follow-up (or the sub-status’s automatic retry on working hours), links your latest call, records the time spent in the previous status. A replay with the same `Idempotency-Key` returns the first answer instead of changing the status twice.","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeLeadStatusInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChangeLeadStatusResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.edit","x-idempotent":true}},"/api/v1/listing-freshness/listings":{"get":{"operationId":"listStaleListings","summary":"Stale listings","description":"`stale`: flagged stale, longest first · `due`: not confirmed within the ping interval · `price`: nudged for a price revision. Within the caller’s listing scope; keyset-paginated.","tags":["Listing freshness"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"view","in":"query","required":false,"schema":{"default":"stale","type":"string","enum":["stale","due","price"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StaleListing"}},"meta":{"type":"object","properties":{"next_cursor":{"description":"Opaque cursor of the next page; null on the last page.","type":["string","null"]},"has_more":{"type":"boolean"},"mode":{"type":"string","enum":["off","built_in","automation"]},"stale_after_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["next_cursor","has_more","mode","stale_after_days"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"}},"/api/v1/listing-freshness/settings":{"get":{"operationId":"getListingFreshnessSettings","summary":"Listing freshness settings","tags":["Listing freshness"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingFreshnessSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.inventory","settings.view"]},"patch":{"operationId":"updateListingFreshnessSettings","summary":"Change listing freshness settings","description":"stale_after_days must exceed ping_interval_days; price nudges after at least 15 days (or 0 for none).","tags":["Listing freshness"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["off","built_in","automation"],"description":"off · built_in (PropZolo pings owners) · automation (workflows ask, on property.reconfirm_due)"},"ping_interval_days":{"type":"integer","minimum":7,"maximum":90},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]},"max_pings_per_day":{"type":"integer","minimum":1,"maximum":500},"stale_after_days":{"type":"integer","minimum":7,"maximum":180},"hide_stale_from_matching":{"type":"boolean"},"hide_stale_from_shares":{"type":"boolean"},"notify_agent":{"type":"boolean"},"price_nudge_days":{"type":"integer","minimum":0,"maximum":365,"description":"0 = no price-revision nudges."},"price_nudge_max_enquiries":{"type":"integer","minimum":0,"maximum":100},"mandate_notice":{"type":"boolean","description":"Emit property.mandate_expiring for the mandate-renewal recipe."}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingFreshnessSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.inventory"}},"/api/v1/listing-verification-documents/{id}":{"delete":{"operationId":"removeVerificationDocument","summary":"Remove a pending or rejected document","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["properties.verify","properties.verify_review"]}},"/api/v1/listing-verification-documents/{id}/download":{"get":{"operationId":"verificationDocumentDownload","summary":"Open an ownership document (60-second signed URL)","description":"Needs the owner details in clear; every open is audited; a quarantined file is refused.","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["properties.verify","properties.verify_review"]}},"/api/v1/listing-verification-documents/{id}/review":{"post":{"operationId":"reviewVerificationDocument","summary":"Approve or reject an ownership document","description":"Approving needs the name and address recorded as matching (or partly); rejecting needs a note.","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewVerificationDocumentInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify_review"}},"/api/v1/listing-verification-photos/{id}":{"delete":{"operationId":"removeVerificationPhoto","summary":"Remove a visit photo (kept as the trail)","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify"}},"/api/v1/listing-verifications":{"get":{"operationId":"listListingVerifications","summary":"Verification queue","description":"`submitted`: waiting for review · `draft`: visits in progress · `decided`: recent outcomes. Keyset-paginated; `meta.counts` carries the verification figures (to review, in progress, verified, expiring, lapsed).","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"view","in":"query","required":false,"schema":{"default":"submitted","type":"string","enum":["submitted","draft","decided"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ListingVerificationQueueItem"}},"meta":{"type":"object","properties":{"next_cursor":{"description":"Opaque cursor of the next page; null on the last page.","type":["string","null"]},"has_more":{"type":"boolean"},"counts":{"$ref":"#/components/schemas/ListingVerificationCounts"}},"required":["next_cursor","has_more","counts"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify_review"}},"/api/v1/listing-verifications/{id}":{"get":{"operationId":"getListingVerificationDetail","summary":"One verification with its photos, documents and verdict","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["properties.verify","properties.verify_review"]}},"/api/v1/listing-verifications/{id}/cancel":{"post":{"operationId":"cancelListingVerification","summary":"Cancel an open verification","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["properties.verify","properties.verify_review"]}},"/api/v1/listing-verifications/{id}/decision":{"post":{"operationId":"decideListingVerification","summary":"Grant the Verified badge or reject the verification","description":"Never by a member who captured the visit’s photos (unless the company allows self-review).","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationDecisionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify_review"}},"/api/v1/listing-verifications/{id}/documents":{"post":{"operationId":"registerVerificationDocument","summary":"Attach an ownership document","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterVerificationDocumentInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify"}},"/api/v1/listing-verifications/{id}/documents/uploads":{"post":{"operationId":"presignVerificationDocument","summary":"Presigned upload for an ownership document","description":"PDF (25 MB) or a photo of the document (15 MB), into the private bucket.","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationDocumentUploadInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PresignedUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify"}},"/api/v1/listing-verifications/{id}/location":{"post":{"operationId":"confirmVerificationLocation","summary":"Use the visit’s position as the listing’s map pin","description":"Only for a listing without a pin; needs edit rights on the listing.","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify_review"}},"/api/v1/listing-verifications/{id}/photos":{"post":{"operationId":"registerVerificationPhoto","summary":"Register a visit photo with the phone’s location fix","description":"Replaces the item’s previous photo. The capture time is reconciled with the run’s monotonic clock when given; the photo is then checked in the background (EXIF, hashes, EXIF-free preview).","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterVerificationPhotoInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify"}},"/api/v1/listing-verifications/{id}/photos/uploads":{"post":{"operationId":"presignVerificationPhoto","summary":"Presigned upload for a visit photo","description":"Into the private bucket (type and exact size signed, 15 MB). Photos only: JPEG, PNG, WebP.","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationPhotoUploadInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PresignedUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify"}},"/api/v1/listing-verifications/{id}/return":{"post":{"operationId":"returnListingVerification","summary":"Send a submitted visit back for retakes","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","minLength":3,"maxLength":1000}},"required":["note"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify_review"}},"/api/v1/listing-verifications/{id}/submit":{"post":{"operationId":"submitListingVerification","summary":"Submit the visit for review","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify"}},"/api/v1/loan-cases":{"get":{"operationId":"listLoanCases","summary":"The loan desk queue","description":"Open cases by default, most recently changed first; filter by stage, lender, lead, deal or “mine”.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","all","logged","submitted","sanctioned","part_disbursed","disbursed","closed","rejected","withdrawn"]}},{"name":"lender_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"deal_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","enum":["me"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LoanCase"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.view"},"post":{"operationId":"createLoanCase","summary":"Open a loan case","description":"For a lead you can see (and optionally its deal). The checklist is seeded from the applicants’ employment and the loan type; without applicants the lead’s contact is the primary applicant.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"loan_type":{"type":"string","enum":["home_purchase","construction","plot","plot_construction","balance_transfer","top_up","lap"]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lender_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"agent_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_value":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"requested_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"tenure_months":{"anyOf":[{"type":"integer","minimum":12,"maximum":360},{"type":"null"}]},"rate_bps":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"applicants":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"relation":{"type":"string","enum":["self","spouse","parent","child","sibling","other"]},"employment":{"type":"string","enum":["salaried","self_employed","professional","other"]},"employer":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"monthly_income":{"$ref":"#/components/schemas/PaiseInput"},"monthly_obligations":{"$ref":"#/components/schemas/PaiseInput"},"age":{"anyOf":[{"type":"integer","minimum":18,"maximum":80},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["name","employment","monthly_income","monthly_obligations"]}}},"required":["lead_id","loan_type"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCaseDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.create"}},"/api/v1/loan-cases/{id}":{"get":{"operationId":"getLoanCase","summary":"A loan case","description":"Applicants, checklist, hand-offs, disbursals and (with commission figures in clear) the commissions.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCaseDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.view"},"patch":{"operationId":"updateLoanCase","summary":"Edit a loan case","description":"Amounts, terms, handler, notes; lender and DSA until the sanction.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"loan_type":{"type":"string","enum":["home_purchase","construction","plot","plot_construction","balance_transfer","top_up","lap"]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lender_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"agent_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_value":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"requested_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"tenure_months":{"anyOf":[{"type":"integer","minimum":12,"maximum":360},{"type":"null"}]},"rate_bps":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"bank_reference":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCaseDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/applicants":{"put":{"operationId":"setLoanApplicants","summary":"Set the applicants","description":"The first is the primary applicant; up to three co-applicants. New employment types extend the checklist.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"applicants":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"relation":{"type":"string","enum":["self","spouse","parent","child","sibling","other"]},"employment":{"type":"string","enum":["salaried","self_employed","professional","other"]},"employer":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"monthly_income":{"$ref":"#/components/schemas/PaiseInput"},"monthly_obligations":{"$ref":"#/components/schemas/PaiseInput"},"age":{"anyOf":[{"type":"integer","minimum":18,"maximum":80},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["name","employment","monthly_income","monthly_obligations"]}}},"required":["applicants"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCaseDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/consents":{"post":{"operationId":"requestLoanConsent","summary":"Ask for (or record) the applicant’s consent to share papers with lenders","description":"otp: the applicant gets the notice and a one-time code to read back; written: records a signed consent form (say where it is kept). A hand-off needs a given consent naming the lender.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lender_ids":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"purpose":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"method":{"type":"string","enum":["otp","written"]},"evidence":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["lender_ids","method"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"lender_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"lender_names":{"type":"array","items":{"type":"string"}},"purpose":{"type":"string"},"notice_version":{"type":"string"},"method":{"type":"string","enum":["otp","written"]},"status":{"type":"string","enum":["pending","given","withdrawn"]},"evidence":{"type":["string","null"]},"given_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"withdrawn_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"blocked_reason":{"type":["string","null"]}},"required":["id","lender_ids","lender_names","purpose","notice_version","method","status","evidence","given_at","withdrawn_at","created_at","blocked_reason"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/consents/{consentId}/confirm":{"post":{"operationId":"confirmLoanConsent","summary":"Enter the code the applicant read back","description":"A wrong code is an answer with the attempts left (5 lock it).","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"consentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":4,"maxLength":12}},"required":["code"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["given","invalid","locked"]},"attempts_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"consent":{"$ref":"#/components/schemas/LoanConsent"}},"required":["status","attempts_left","consent"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/consents/{consentId}/withdraw":{"post":{"operationId":"withdrawLoanConsent","summary":"Record that the applicant withdrew consent","description":"Lender links handed off under this consent stop working at once.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"consentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanConsent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/disbursals":{"post":{"operationId":"recordLoanDisbursal","summary":"Record a disbursal","description":"A tranche on a sanctioned case (never above the sanction). Moves the stage and accrues the commission (rate × amount up to the cap) as a receivable.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PaiseInput"},"disbursed_on":{"$ref":"#/components/schemas/LocalDate"},"reference":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"final":{"type":"boolean"}},"required":["amount","disbursed_on"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCaseDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/disbursals/{disbursalId}/reverse":{"post":{"operationId":"reverseLoanDisbursal","summary":"Reverse a disbursal entered wrongly","description":"Adds a reversal entry (the negative amount, with the reason) for a tranche, once; its commission is written off and the stage follows the remaining total. Needs a recent second-factor check.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"disbursalId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":450}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCaseDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/documents":{"post":{"operationId":"addLoanDocument","summary":"Add a checklist line","description":"A document the lender asked for beyond the default checklist.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["pan","aadhaar","photo","address_proof","bank_statements","salary_slips","form16","employment_proof","itr","financials","business_proof","qualification_proof","sale_agreement","allotment_letter","title_documents","approved_plan","construction_estimate","existing_loan_statement","foreclosure_letter","own_contribution_receipt","other"]},"label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["kind"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","aadhaar","photo","address_proof","bank_statements","salary_slips","form16","employment_proof","itr","financials","business_proof","qualification_proof","sale_agreement","allotment_letter","title_documents","approved_plan","construction_estimate","existing_loan_statement","foreclosure_letter","own_contribution_receipt","other"]},"label":{"type":["string","null"]},"status":{"type":"string","enum":["pending","received","verified","waived"]},"file_name":{"type":["string","null"]},"content_type":{"type":["string","null"]},"size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"uploaded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["id","kind","label","status","file_name","content_type","size","note"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/documents/{documentId}":{"patch":{"operationId":"setLoanDocumentStatus","summary":"Verify, waive or reset a checklist line","description":"Verified and received need a file.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","received","verified","waived"]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","aadhaar","photo","address_proof","bank_statements","salary_slips","form16","employment_proof","itr","financials","business_proof","qualification_proof","sale_agreement","allotment_letter","title_documents","approved_plan","construction_estimate","existing_loan_statement","foreclosure_letter","own_contribution_receipt","other"]},"label":{"type":["string","null"]},"status":{"type":"string","enum":["pending","received","verified","waived"]},"file_name":{"type":["string","null"]},"content_type":{"type":["string","null"]},"size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"uploaded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["id","kind","label","status","file_name","content_type","size","note"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"},"delete":{"operationId":"removeLoanDocument","summary":"Remove a checklist line","description":"The stored file is kept for the audit trail.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/documents/{documentId}/download":{"get":{"operationId":"loanDocumentDownload","summary":"Open a document","description":"A 60-second signed link (audited); a quarantined file is never handed out.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.view"}},"/api/v1/loan-cases/{id}/documents/{documentId}/file":{"post":{"operationId":"attachLoanDocument","summary":"Attach the uploaded file","description":"Replaces an earlier file and marks the line received; documents are scanned for malware.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":10,"maxLength":300},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["key","filename","content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","aadhaar","photo","address_proof","bank_statements","salary_slips","form16","employment_proof","itr","financials","business_proof","qualification_proof","sale_agreement","allotment_letter","title_documents","approved_plan","construction_estimate","existing_loan_statement","foreclosure_letter","own_contribution_receipt","other"]},"label":{"type":["string","null"]},"status":{"type":"string","enum":["pending","received","verified","waived"]},"file_name":{"type":["string","null"]},"content_type":{"type":["string","null"]},"size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"uploaded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["id","kind","label","status","file_name","content_type","size","note"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/documents/{documentId}/upload":{"post":{"operationId":"presignLoanDocument","summary":"Upload a document","description":"A presigned PUT into private storage (type and exact size signed); attach it afterwards.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["filename","content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"},"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","url","method","headers","expires_at","max_bytes"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/eligibility":{"post":{"operationId":"runLoanCaseEligibility","summary":"Check the case’s eligibility","description":"On the applicants, the case’s amounts and terms and the lender’s FOIR / LTV ceiling; kept on the case.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanEligibility"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/handoffs":{"post":{"operationId":"handOffLoanCase","summary":"Hand the case off to a lender","description":"A sign-in-free document-pack link (received documents by default) sent to the lender’s contact by email or WhatsApp through the compliance-gated pipeline, or returned to share yourself. A logged case becomes submitted.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lender_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel":{"type":"string","enum":["email","whatsapp","link"]},"document_ids":{"minItems":1,"maxItems":60,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["channel"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["sent","blocked","link"]},"reason":{"type":["string","null"]},"url":{"type":["string","null"]},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","reason","url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/handoffs/{handoffId}/revoke":{"post":{"operationId":"revokeLoanHandoff","summary":"Revoke a lender’s link","description":"The document-pack link stops working at once.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"handoffId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"revoked"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/sanction":{"post":{"operationId":"recordLoanSanction","summary":"Record the sanction","description":"Amount, rate, date and validity. Freezes the commission terms: the slab rate for the sanctioned amount from the DSA’s, the lender’s or the default rule, the cap and who pays. Correctable until the first disbursal.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PaiseInput"},"rate_bps":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"sanctioned_on":{"$ref":"#/components/schemas/LocalDate"},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"bank_reference":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}},"required":["amount","sanctioned_on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCaseDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-cases/{id}/status":{"post":{"operationId":"moveLoanCase","summary":"Move a loan case","description":"Submitted (needs a lender), rejected (needs a reason), withdrawn (before any disbursal), back to logged, disbursed (the lender’s final tranche), closed. A sanction uses its own endpoint.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["logged","submitted","disbursed","closed","rejected","withdrawn"]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCaseDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.edit"}},"/api/v1/loan-commission-rules":{"get":{"operationId":"listLoanCommissionRules","summary":"Loan commission rules","description":"One per lender or DSA plus the company default.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LoanCommissionRule"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["loans.configure","loans.commissions"]},"put":{"operationId":"saveLoanCommissionRule","summary":"Save a commission rule","description":"Slabs by the sanctioned amount (ascending, the last open-ended), rates 0–5 % in bps, an optional cap per case. Replaces the partner’s (or the default) rule; cases sanctioned earlier keep their frozen terms.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"partner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"slabs":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"up_to":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"rate_bps":{"type":"integer","minimum":0,"maximum":500}},"required":["up_to","rate_bps"]}},"cap":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["partner_id","slabs"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCommissionRule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.configure"}},"/api/v1/loan-commission-rules/{id}":{"delete":{"operationId":"deleteLoanCommissionRule","summary":"Remove a commission rule","description":"The partner falls back to the default rule for future sanctions.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.configure"}},"/api/v1/loan-commissions":{"get":{"operationId":"listLoanCommissions","summary":"The loan commission ledger","description":"Receivables from lenders and DSAs per tranche with totals (accrued, received, pending, written off).","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","received","written_off","all"]}},{"name":"payer_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LoanCommission"}},"meta":{"type":"object","properties":{"totals":{"type":"object","properties":{"accrued":{"$ref":"#/components/schemas/Paise"},"received":{"$ref":"#/components/schemas/Paise"},"pending":{"$ref":"#/components/schemas/Paise"},"writtenOff":{"$ref":"#/components/schemas/Paise"}},"required":["accrued","received","pending","writtenOff"],"additionalProperties":false}},"required":["totals"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.view"}},"/api/v1/loan-commissions/{id}/receipts":{"post":{"operationId":"recordLoanCommissionReceipt","summary":"Record commission received","description":"Part payments add up; the full amount marks it received (audited).","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PaiseInput"},"received_on":{"$ref":"#/components/schemas/LocalDate"},"reference":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["amount","received_on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCommission"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.commissions"}},"/api/v1/loan-commissions/{id}/write-off":{"post":{"operationId":"writeOffLoanCommission","summary":"Write off a commission","description":"The outstanding part will not be collected (a reason is required; audited).","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","minLength":3,"maxLength":500}},"required":["note"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanCommission"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.commissions"}},"/api/v1/loan-exports":{"post":{"operationId":"requestLoanExport","summary":"Export loan cases (CSV)","description":"Within your loans.export scope, capped like lead exports. The worker writes a watermarked CSV (no phones, emails, PAN or documents; commission columns only with commission figures in clear) and notifies you. Needs a fresh second factor.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","all","logged","submitted","sanctioned","part_disbursed","disbursed","closed","rejected","withdrawn"]},"lender_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanExport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.export"}},"/api/v1/loan-exports/{id}":{"get":{"operationId":"getLoanExport","summary":"A loan case export","description":"Its status (queued, running, done, failed) and row count; the requester’s own (or the owner).","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanExport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.export"}},"/api/v1/loan-exports/{id}/download":{"get":{"operationId":"loanExportDownload","summary":"Download a loan case export","description":"A 5-minute link to the CSV for 24 hours after it was written (audited).","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.export"}},"/api/v1/loan-partners":{"get":{"operationId":"listLoanPartners","summary":"Lenders and DSAs","description":"Active ones by default; `status=archived|all` for the rest.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["bank","nbfc","hfc","dsa"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived","all"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LoanPartner"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["loans.view","loans.configure"]},"post":{"operationId":"createLoanPartner","summary":"Add a lender or DSA","description":"With a phone or email the partner is messaged through a contact (that number’s, or a new one).","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["bank","nbfc","hfc","dsa"]},"name":{"type":"string","minLength":2,"maxLength":120},"branch":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"contact_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"rate_bps":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"foir_bps":{"anyOf":[{"type":"integer","minimum":1000,"maximum":8000},{"type":"null"}]},"ltv_cap_bps":{"anyOf":[{"type":"integer","minimum":1000,"maximum":9000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["kind","name"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanPartner"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.configure"}},"/api/v1/loan-partners/{id}":{"put":{"operationId":"updateLoanPartner","summary":"Edit a lender or DSA","description":"Name, branch, contact person, phone, email, indicative rate, FOIR and LTV ceiling.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["bank","nbfc","hfc","dsa"]},"name":{"type":"string","minLength":2,"maxLength":120},"branch":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"contact_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"rate_bps":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"foir_bps":{"anyOf":[{"type":"integer","minimum":1000,"maximum":8000},{"type":"null"}]},"ltv_cap_bps":{"anyOf":[{"type":"integer","minimum":1000,"maximum":9000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["kind","name"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanPartner"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.configure"}},"/api/v1/loan-partners/{id}/status":{"post":{"operationId":"setLoanPartnerStatus","summary":"Archive or restore a lender or DSA","description":"An archived partner cannot be chosen for new work; cases keep it.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["active","archived"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanPartner"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.configure"}},"/api/v1/loans/eligibility":{"post":{"operationId":"calculateLoanEligibility","summary":"Eligibility calculator","description":"Income and existing EMIs (FOIR), rate and tenure (EMI, capped at retirement) and the property value (RBI LTV slabs: 90 % to ₹30 L, 80 % to ₹75 L, 75 % above) → the likely loan, its EMI and what limits it. Nothing is stored.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"applicants":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"monthly_income":{"$ref":"#/components/schemas/PaiseInput"},"monthly_obligations":{"$ref":"#/components/schemas/PaiseInput"},"employment":{"type":"string","enum":["salaried","self_employed","professional","other"]},"age":{"anyOf":[{"type":"integer","minimum":18,"maximum":80},{"type":"null"}]}},"required":["monthly_income","monthly_obligations","employment"]}},"rate_bps":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"tenure_months":{"anyOf":[{"type":"integer","minimum":12,"maximum":360},{"type":"null"}]},"foir_bps":{"anyOf":[{"type":"integer","minimum":1000,"maximum":8000},{"type":"null"}]},"property_value":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"lender_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["applicants"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanEligibility"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.view"}},"/api/v1/login-approvals":{"get":{"operationId":"listLoginApprovals","summary":"Sign-ins waiting for my approval","description":"Admins see every request, managers those of their reporting tree that are not admin-only.","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","decided"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LoginApproval"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/login-approvals/{id}":{"get":{"operationId":"getLoginApproval","summary":"A sign-in request","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoginApproval"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/login-approvals/{id}/decision":{"post":{"operationId":"decideLoginApproval","summary":"Approve or reject a sign-in","description":"Approving a device over the member’s limit can remove one of their devices (`replace_device_id`, admins only). Nobody decides their own request. Audited.","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]},"replace_device_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoginApproval"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/maintenance-media/{id}/download":{"get":{"operationId":"maintenanceMediaDownload","summary":"Open a ticket’s file","description":"A 60-second link: photos and videos as their EXIF-free copy, documents after a clean malware scan.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.view"}},"/api/v1/maintenance-tickets":{"get":{"operationId":"listMaintenanceTickets","summary":"The maintenance queue","description":"Tickets of the agreements you may see, newest first: open by default; filter by status, urgency, category, agreement, vendor, SLA breached or MT number / title. Keyset pagination.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","all","new","triaged","assigned","scheduled","in_progress","resolved","closed","cancelled"]}},{"name":"urgency","in":"query","required":false,"schema":{"type":"string","enum":["emergency","high","normal","low"]}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["plumbing","electrical","appliance","carpentry","pest","painting","society","other"]}},{"name":"agreement_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"vendor_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"breached","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MaintenanceTicket"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.view"},"post":{"operationId":"createMaintenanceTicket","summary":"Record a repair request","description":"An agent records a request (a call, a visit) on a live agreement. Category and urgency as set count as the confirmed triage; the SLA starts now.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agreement_id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string","minLength":3,"maxLength":160},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"category":{"anyOf":[{"type":"string","enum":["plumbing","electrical","appliance","carpentry","pest","painting","society","other"]},{"type":"null"}]},"urgency":{"default":"normal","type":"string","enum":["emergency","high","normal","low"]}},"required":["agreement_id","title"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceTicket"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-tickets/{id}":{"get":{"operationId":"getMaintenanceTicket","summary":"A ticket with its timeline and photos","description":"The drawer: the ticket, its timeline, its media (EXIF-free copies as short-lived URLs) and its links.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceTicketDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.view"}},"/api/v1/maintenance-tickets/{id}/approval":{"post":{"operationId":"recordMaintenanceApproval","summary":"Record the owner’s decision","description":"The owner decided by phone: approve, reject or a question. The open approval link is withdrawn; audited. Also needs deals.approve (403).","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject","ask"]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceTicket"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-tickets/{id}/assign":{"post":{"operationId":"assignMaintenanceVendor","summary":"Assign a vendor","description":"A vendor takes the ticket. With `dispatch` (default) the vendor gets the job on WhatsApp / SMS with their update link, through the compliance-gated pipeline; the tenant is told.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vendor_id":{"$ref":"#/components/schemas/Id"},"dispatch":{"default":true,"type":"boolean"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["vendor_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ticket":{"$ref":"#/components/schemas/MaintenanceTicket"},"dispatch":{"type":"object","properties":{"status":{"type":"string","enum":["queued","blocked","skipped"]},"reason":{"type":["string","null"]}},"required":["status","reason"],"additionalProperties":false}},"required":["ticket","dispatch"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-tickets/{id}/estimate":{"post":{"operationId":"setMaintenanceEstimate","summary":"Record the estimate and who pays","description":"Above the owner’s threshold (owner or deposit pays) the estimate goes to the owner for approval on a single-use link; at or below it the work proceeds. A higher estimate after an approval asks again.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PaiseInput"},"payer":{"type":"string","enum":["owner","tenant","deposit","company"]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["amount","payer"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ticket":{"$ref":"#/components/schemas/MaintenanceTicket"},"approval":{"type":"object","properties":{"needed":{"type":"boolean"},"status":{"type":"string"},"reason":{"type":["string","null"]}},"required":["needed","status","reason"],"additionalProperties":false}},"required":["ticket","approval"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-tickets/{id}/media":{"post":{"operationId":"registerMaintenanceMedia","summary":"Register an uploaded file","description":"Adds the uploaded file to the ticket; the worker writes its EXIF/GPS-free copies (documents are scanned).","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":300},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"role":{"default":"issue","type":"string","enum":["issue","work_done","invoice"]}},"required":["key","content_type","size"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"}},"required":["id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-tickets/{id}/media/uploads":{"post":{"operationId":"presignMaintenanceUpload","summary":"Upload a photo, video or invoice","description":"A presigned PUT into private storage (type and exact size signed). Register the file afterwards.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["key","url","method","headers","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-tickets/{id}/notes":{"post":{"operationId":"addMaintenanceNote","summary":"Add a note to the timeline","description":"An internal note on the ticket’s timeline (never sent to the tenant, vendor or owner).","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":2000}},"required":["body"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-tickets/{id}/status":{"post":{"operationId":"moveMaintenanceTicket","summary":"Move a ticket","description":"Schedule the visit, start the work, resolve (the tenant is asked to confirm), close, reopen (within the window) or cancel. Work cannot start while the owner’s approval is pending or was refused (409). A final cost above what the owner approved (or the threshold) for owner- or deposit-paid work is refused (409): save it as the estimate first. Resolving a resolved ticket with a final cost confirms the cost (a vendor’s figure is only a quote).","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"to":{"type":"string","const":"scheduled"},"scheduled_for":{"type":"string","format":"date-time"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["to","scheduled_for"]},{"type":"object","properties":{"to":{"type":"string","const":"in_progress"}},"required":["to"]},{"type":"object","properties":{"to":{"type":"string","const":"resolved"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"final_cost":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}},"required":["to"]},{"type":"object","properties":{"to":{"type":"string","const":"closed"}},"required":["to"]},{"type":"object","properties":{"to":{"type":"string","const":"reopened"},"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["to"]},{"type":"object","properties":{"to":{"type":"string","const":"cancelled"},"reason":{"type":"string","minLength":2,"maxLength":300}},"required":["to","reason"]}]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceTicket"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-tickets/{id}/triage":{"post":{"operationId":"triageMaintenanceTicket","summary":"Confirm or correct the triage","description":"Sets category, urgency and trade (a new urgency recomputes the SLA deadlines). A new ticket becomes triaged.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["plumbing","electrical","appliance","carpentry","pest","painting","society","other"]},"urgency":{"type":"string","enum":["emergency","high","normal","low"]},"vendor_trade":{"anyOf":[{"type":"string","enum":["plumber","electrician","appliance_repair","carpenter","pest_control","painter","society_office","handyman"]},{"type":"null"}]},"title":{"anyOf":[{"type":"string","minLength":3,"maxLength":160},{"type":"null"}]}},"required":["category","urgency"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceTicket"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/maintenance-vendors":{"get":{"operationId":"listMaintenanceVendors","summary":"The vendor directory","description":"Active vendors by rating, filterable by trade; archived ones with `status=archived|all`.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"trade","in":"query","required":false,"schema":{"type":"string","enum":["plumber","electrician","appliance_repair","carpenter","pest_control","painter","society_office","handyman"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived","all"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MaintenanceVendor"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["rentals.view","settings.pipelines"]},"post":{"operationId":"createMaintenanceVendor","summary":"Add a vendor","description":"The phone is normalised (one vendor per number); the vendor is messaged through that number’s contact.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"phone":{"type":"string","minLength":6,"maxLength":30},"trades":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","enum":["plumber","electrician","appliance_repair","carpenter","pest_control","painter","society_office","handyman"]}},"areas":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"rates_note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"rating":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]}},"required":["name","phone","trades"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceVendor"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/maintenance-vendors/{id}":{"put":{"operationId":"updateMaintenanceVendor","summary":"Edit a vendor","description":"Name, phone, trades, areas, rates note, notes and rating.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"phone":{"type":"string","minLength":6,"maxLength":30},"trades":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","enum":["plumber","electrician","appliance_repair","carpenter","pest_control","painter","society_office","handyman"]}},"areas":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"rates_note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"rating":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]}},"required":["name","phone","trades"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceVendor"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/maintenance-vendors/{id}/status":{"post":{"operationId":"setMaintenanceVendorStatus","summary":"Archive or restore a vendor","description":"An archived vendor cannot be assigned; their tickets keep them.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["active","archived"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceVendor"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/marketing/ad-copy":{"get":{"operationId":"listAdCopySets","summary":"Studio sessions, newest first","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"subject_type","in":"query","required":false,"schema":{"type":"string","enum":["property","project"]}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AdCopySetSummary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"},"post":{"operationId":"generateAdCopy","summary":"Write ad copy for a listing or project with AI","description":"One variant per placement × language (English, Hindi, Hinglish), grounded on the record’s saved facts: numbers not in the facts and forbidden claims are flagged and block approval; the RERA line and the company disclaimer are attached. Metered on the AI wallet.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","enum":["property","project"]},"subject_id":{"$ref":"#/components/schemas/Id"},"platforms":{"anyOf":[{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["meta_feed","instagram","google_search","google_display","whatsapp_status","portal"]}},{"type":"null"}]},"languages":{"anyOf":[{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["en","hi","hinglish"]}},{"type":"null"}]},"objective":{"default":"leads","type":"string","enum":["leads","site_visits","awareness"]},"tone":{"default":"professional","type":"string","enum":["professional","warm","premium"]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["subject","subject_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"set":{"$ref":"#/components/schemas/AdCopySet"},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["set","credits","request_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"marketing.studio"}},"/api/v1/marketing/ad-copy/{id}":{"get":{"operationId":"getAdCopySet","summary":"A studio session with its variants","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdCopySet"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"}},"/api/v1/marketing/ad-copy/{id}/archive":{"post":{"operationId":"archiveAdCopySet","summary":"Archive a studio session","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"archived_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","archived_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"}},"/api/v1/marketing/ad-copy/{id}/creatives":{"get":{"operationId":"listMarketingCreatives","summary":"Creatives of a studio session","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MarketingCreative"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"},"post":{"operationId":"createMarketingCreative","summary":"Render a branded creative from a photo","description":"Queued for rendering: poll the session’s creatives until it is `ready` (or `failed`).","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"media_id":{"$ref":"#/components/schemas/Id"},"template":{"anyOf":[{"type":"string","enum":["classic","bold_band","minimal"]},{"type":"null"}]},"format":{"default":"square","type":"string","enum":["square","portrait","story","landscape"]},"variant_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["media_id"]}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingCreative"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"}},"/api/v1/marketing/ad-copy/{id}/photos":{"get":{"operationId":"listStudioPhotos","summary":"Photos of the session’s listing or project that can become creatives","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StudioPhoto"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"}},"/api/v1/marketing/ad-variants/{id}":{"patch":{"operationId":"updateAdVariant","summary":"Edit an ad variant","description":"The rules, grounding and compliance checks run again on the new text; an approved variant becomes a draft.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"headline":{"type":"string","minLength":1,"maxLength":200},"primary_text":{"type":"string","minLength":1,"maxLength":2200},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"cta":{"type":"string","enum":["learn_more","call_now","book_visit","whatsapp","get_quote","sign_up"]},"hashtags":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":60}},"disclaimer":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"rera_line":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdVariant"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"}},"/api/v1/marketing/ad-variants/{id}/approve":{"post":{"operationId":"approveAdVariant","summary":"Approve an ad variant","description":"409 while the variant has a blocking finding. Approved variants can be scheduled as posts.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdVariant"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"}},"/api/v1/marketing/ad-variants/{id}/archive":{"post":{"operationId":"archiveAdVariant","summary":"Archive an ad variant","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdVariant"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.studio"}},"/api/v1/marketing/audiences":{"get":{"operationId":"listMarketingAudiences","summary":"Ad audiences","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MarketingAudience"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["marketing.audiences","marketing.view"]},"post":{"operationId":"createMarketingAudience","summary":"Create an ad audience from a CRM segment","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"segment":{"$ref":"#/components/schemas/AudienceSegmentInput"},"destinations":{"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["meta","google"]}},"schedule":{"default":"manual","type":"string","enum":["manual","daily","weekly"]}},"required":["name","segment","destinations"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingAudience"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.audiences"}},"/api/v1/marketing/audiences/preview":{"post":{"operationId":"previewMarketingAudience","summary":"Who a segment would upload","description":"Counts only: the segment, the people eligible and those left out by reason (booked buyers always).","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"segment":{"$ref":"#/components/schemas/AudienceSegmentInput"}},"required":["segment"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"segment":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"eligible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"excluded":{"type":"object","propertyNames":{"type":"string","enum":["deleted","booked_buyer","consent_withdrawn","suppressed","no_lawful_basis","no_identifier","ads_objection"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"allowed_bases":{"type":"array","items":{"type":"string","enum":["consent","contract","legitimate_use"]}},"servable":{"type":"boolean"},"min_servable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["segment","eligible","excluded","allowed_bases","servable","min_servable"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.audiences"}},"/api/v1/marketing/audiences/{id}":{"get":{"operationId":"getMarketingAudience","summary":"An ad audience with its recent sync runs","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingAudienceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["marketing.audiences","marketing.view"]},"patch":{"operationId":"updateMarketingAudience","summary":"Change, pause or resume an ad audience","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"segment":{"$ref":"#/components/schemas/AudienceSegmentInput"},"destinations":{"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["meta","google"]}},"schedule":{"default":"manual","type":"string","enum":["manual","daily","weekly"]},"status":{"type":"string","enum":["active","paused"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingAudience"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.audiences"}},"/api/v1/marketing/audiences/{id}/archive":{"post":{"operationId":"archiveMarketingAudience","summary":"Archive an ad audience","description":"One last run per platform removes everyone it uploaded.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"archived"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.audiences"}},"/api/v1/marketing/audiences/{id}/sync":{"post":{"operationId":"syncMarketingAudience","summary":"Sync an ad audience now","description":"One run per platform (hashed phones and emails; never booked buyers or people without a lawful basis). Shares personal data with an ad platform: privileged sessions need a fresh step-up.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingAudienceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.audiences"}},"/api/v1/marketing/connections":{"get":{"operationId":"getMarketingConnections","summary":"Live social and ad accounts","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingConnections"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view","marketing.social","marketing.view"]}},"/api/v1/marketing/connections/meta":{"put":{"operationId":"connectMarketingMeta","summary":"Connect or update Meta ads audiences & posts","description":"Meta is asked for the ad account, Page and Instagram names first; nothing is saved when it refuses (422 with the field). Tokens left out keep the stored ones. The Page and Instagram account become live social accounts.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":20,"maxLength":2048},"page_access_token":{"type":"string","minLength":20,"maxLength":2048},"ad_account_id":{"type":"string","pattern":"^(act_)?\\d{1,32}$"},"page_id":{"anyOf":[{"type":"string","pattern":"^(act_)?\\d{1,32}$"},{"type":"null"}]},"instagram_user_id":{"anyOf":[{"type":"string","pattern":"^(act_)?\\d{1,32}$"},{"type":"null"}]}},"required":["ad_account_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingConnections"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"delete":{"operationId":"disconnectMarketingMeta","summary":"Disconnect Meta ads audiences & posts","description":"Tokens wiped; the live accounts are disconnected and their scheduled posts cancelled.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingConnections"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/marketing/connections/meta/check":{"post":{"operationId":"checkMarketingMeta","summary":"Check the Meta tokens again","description":"A revoked token marks the connection broken and its live accounts “reconnect needed”.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingConnections"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/marketing/social-accounts":{"get":{"operationId":"listSocialAccounts","summary":"Connected social accounts","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SocialAccount"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["marketing.social","marketing.view"]},"post":{"operationId":"connectSocialAccount","summary":"Connect a social account (demo mode until the provider apps are approved)","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["facebook_page","instagram_business","google_business"]},"name":{"type":"string","minLength":1,"maxLength":160}},"required":["provider","name"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SocialAccount"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.social"}},"/api/v1/marketing/social-accounts/{id}/disconnect":{"post":{"operationId":"disconnectSocialAccount","summary":"Disconnect a social account","description":"Its drafts and scheduled posts are cancelled.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SocialAccount"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.social"}},"/api/v1/marketing/social-posts":{"get":{"operationId":"listSocialPosts","summary":"Posts for the calendar","description":"A company-local month (`month=2026-10`) by scheduled time; without a month, the latest 500.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","scheduled","publishing","published","failed","cancelled"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SocialPost"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["marketing.social","marketing.view"]},"post":{"operationId":"createSocialPost","summary":"Draft, schedule or publish a post","description":"From an approved ad variant (its text with the RERA line and disclaimer) or typed text (compliance-checked). No `scheduled_at`: a draft; `publish_now`: the next worker pick-up.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"$ref":"#/components/schemas/Id"},"variant_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"creative_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"text":{"anyOf":[{"type":"string","maxLength":2200},{"type":"null"}]},"link_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"publish_now":{"default":false,"type":"boolean"}},"required":["account_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SocialPost"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.social"}},"/api/v1/marketing/social-posts/{id}":{"get":{"operationId":"getSocialPost","summary":"A post","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SocialPost"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["marketing.social","marketing.view"]},"patch":{"operationId":"updateSocialPost","summary":"Edit or reschedule a post that has not gone out","description":"409 once publishing started (statuses only move forward).","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variant_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"creative_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"text":{"anyOf":[{"type":"string","maxLength":2200},{"type":"null"}]},"link_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"publish_now":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SocialPost"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.social"}},"/api/v1/marketing/social-posts/{id}/cancel":{"post":{"operationId":"cancelSocialPost","summary":"Cancel a draft or scheduled post","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SocialPost"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.social"}},"/api/v1/matches/leads/{leadId}":{"get":{"operationId":"getLeadMatches","summary":"Matching listings (and projects) for a lead","description":"Stored listing matches, best first, with explainable reasons. `include_projects=true` also scores project configurations (buyers and investors). The lead must be visible to the caller.","tags":["Matching"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"leadId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"min_score","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MatchStatus"}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"include_projects","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"matches":{"type":"array","items":{"$ref":"#/components/schemas/PropertyMatch"}},"projects":{"type":"array","items":{"$ref":"#/components/schemas/ProjectMatch"}},"computed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["matches","projects","computed_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"}},"/api/v1/matches/properties/{propertyId}":{"get":{"operationId":"getPropertyMatches","summary":"Matching leads for a listing","description":"Open buyer / tenant leads whose requirement fits, limited to the leads the caller may see.","tags":["Matching"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"propertyId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"min_score","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MatchStatus"}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"matches":{"type":"array","items":{"$ref":"#/components/schemas/LeadMatch"}},"hidden":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["matches","hidden"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"}},"/api/v1/matches/recompute":{"post":{"operationId":"recomputeMatches","summary":"Recompute matches now","description":"Matches are recomputed automatically on lead and listing changes; this refreshes one at once.","tags":["Matching"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecomputeMatchesInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecomputeResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"}},"/api/v1/matches/{id}":{"patch":{"operationId":"updateMatch","summary":"Dismiss or restore a match","tags":["Matching"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["dismissed","suggested"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/MatchStatus"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.edit"}},"/api/v1/me":{"get":{"operationId":"getMe","summary":"The signed-in member","description":"User, membership, company, workspaces, effective permissions and plan features of the session.","tags":["Session"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Me"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/accountability":{"get":{"operationId":"getMyAccountability","summary":"My accountability score","description":"The caller’s follow-up discipline score (0–100) over 7 and 30 days with each component explained, the trend, the history and whether they currently receive new leads from rotation.","tags":["Accountability"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberAccountability"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.view","reports.view"]}},"/api/v1/me/ai-assistants":{"get":{"operationId":"listMyMcpConnections","summary":"The assistants the caller connected","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/McpConnection"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/ai-assistants/activity":{"get":{"operationId":"listMyMcpActivity","summary":"What the caller’s assistants did","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"connection_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/McpCallLog"}},"meta":{"type":"object","properties":{"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["next_cursor","has_more"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/ai-assistants/{id}":{"delete":{"operationId":"revokeMyMcpConnection","summary":"Disconnect one of the caller’s assistants","description":"Every token ends at once and open drafts are cancelled.","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/briefing":{"get":{"operationId":"getMyBriefing","summary":"The caller’s briefing for today (built on first open, refreshed when half an hour old)","description":"Agents: who to call and why, overdue follow-ups, today’s visits. Managers: SLA breaches and records at risk, stuck deals, visits without feedback, the team against the day before. Scoped to what the member may see.","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"refresh","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DailyBriefing"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/briefing/ack":{"post":{"operationId":"acknowledgeMyBriefing","summary":"“Start my day”: the briefing modal stays closed for the rest of the day","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DailyBriefing"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/briefing/summary":{"post":{"operationId":"summarizeMyBriefing","summary":"The briefing’s AI lines (grounded in its facts, cached once made)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"day":{"type":"string"},"role":{"type":"string","enum":["agent","manager"]},"content":{"type":"object","properties":{"version":{"type":"number","const":1},"role":{"type":"string","enum":["agent","manager"]},"day":{"type":"string"},"day_label":{"type":"string"},"headline":{"type":"string"},"stats":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value":{"type":"string"},"tone":{"anyOf":[{"type":"string","enum":["danger","warning","success","info"]},{"type":"null"}]},"hint":{"type":["string","null"]}},"required":["key","label","value","tone","hint"],"additionalProperties":false}},"sections":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ref":{"type":["string","null"]},"title":{"type":"string"},"detail":{"type":"string"},"link":{"type":"string"},"tone":{"anyOf":[{"type":"string","enum":["danger","warning","success","info"]},{"type":"null"}]}},"required":["id","ref","title","detail","link","tone"],"additionalProperties":false}},"more":{"type":"integer","minimum":0,"maximum":9007199254740991},"link":{"type":["string","null"]}},"required":["key","title","items","more","link"],"additionalProperties":false}}},"required":["version","role","day","day_label","headline","stats","sections"],"additionalProperties":false},"summary":{"anyOf":[{"type":"object","properties":{"summary":{"type":"string"},"focus":{"type":"string"},"source":{"type":"string","enum":["ai","fallback"]}},"required":["summary","focus","source"],"additionalProperties":false},{"type":"null"}]},"summary_status":{"type":"string","enum":["none","ready","fallback","unavailable","off"]},"ai_summary":{"type":"boolean"},"generated_at":{"$ref":"#/components/schemas/DateTime"},"acknowledged_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"show":{"type":"boolean","description":"Open the “your day” modal: not started from yet today, something to show."},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","day","role","content","summary","summary_status","ai_summary","generated_at","acknowledged_at","show","credits"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"402":{"description":"CREDITS_EXHAUSTED — the AI wallet is empty or the monthly AI limit is reached.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"NOT_CONFIGURED — AI is not set up on this PropZolo deployment (ask your PropZolo admin).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}},"x-auth":"member","x-permission":"ai.copilot"}},"/api/v1/me/call-list":{"get":{"operationId":"getMyCallList","summary":"Who to call today","description":"The caller’s ranked call list for today with the reasons in plain words: call now, later today, done. Callable leads only (consent / TRAI window, calling hours, cool-downs, the colleague guard, skips and snoozes); at most the company’s daily cap, promises first, no single source filling the day. For the web and the Android app.","tags":["Call list"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallList"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/me/call-list/actions":{"post":{"operationId":"actOnCallList","summary":"Skip or snooze a lead on my call list","description":"Skip: off the list until tomorrow, with a reason. Snooze: off the list for 15 minutes to 7 days. The caller’s own leads only.","tags":["Call list"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"skip"},"lead_id":{"$ref":"#/components/schemas/Id"},"reason":{"type":"string","enum":["not_reachable","wrong_number","spoke_elsewhere","asked_later","not_interested","other"]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["kind","lead_id","reason"]},{"type":"object","properties":{"kind":{"type":"string","const":"snooze"},"lead_id":{"$ref":"#/components/schemas/Id"},"minutes":{"type":"integer","minimum":15,"maximum":10080},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["kind","lead_id","minutes"]}]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallListAction"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/me/call-list/actions/{id}":{"delete":{"operationId":"clearCallListAction","summary":"Undo a skip or snooze","tags":["Call list"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"}},"required":["id","lead_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/me/counters":{"get":{"operationId":"getMyCounters","summary":"Badge counters","description":"Nav badges and the bell. Load on start, after every realtime (re)connect and on each poll while the stream is down; between loads, `counter.updated` events on /api/sse carry new values.","tags":["Notifications"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberCounters"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/devices":{"get":{"operationId":"listMyDevices","summary":"My devices in this workspace","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MemberDevice"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/devices/{id}":{"delete":{"operationId":"revokeMyDevice","summary":"Remove one of my devices","description":"A lost phone or an old browser: signed out at once; signing in on it again needs an admin’s approval.","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberDevice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/notification-preferences":{"get":{"operationId":"getNotificationPreferences","summary":"My notification preferences","description":"The member’s choices, the company’s switches (read-only) and what applies as a result.","tags":["Notifications"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NotificationPreferencesView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"put":{"operationId":"updateNotificationPreferences","summary":"Replace my notification preferences","description":"Replaces the member’s choices; an omitted key goes back to the company setting and the defaults.","tags":["Notifications"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferencesInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NotificationPreferencesView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/profile":{"get":{"operationId":"getAccountProfile","summary":"My profile","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"patch":{"operationId":"updateAccountProfile","summary":"Update my name or languages","description":"The name is shown in every workspace; languages belong to this workspace (language-based routing).","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountProfileInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/profile/email":{"post":{"operationId":"requestEmailChange","summary":"Change my email","description":"Sends a verification link to the new address (valid 24 hours); the email changes once it is opened.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"current_password":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"code":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["email"]}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"pending_email":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["pending_email","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/profile/email/confirm":{"post":{"operationId":"confirmEmailChange","summary":"Confirm a new email","description":"The token from the verification link; only the person who asked for the change can use it.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":128}},"required":["token"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/profile/phone":{"post":{"operationId":"requestPhoneChange","summary":"Change my mobile number","description":"Sends a 6-digit code to the new number (WhatsApp, SMS fallback); NRI numbers keep their country code.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":6,"maxLength":32},"current_password":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}]},"code":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["phone"]}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"pending_phone":{"type":"string"},"expires_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resend_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["pending_phone","expires_in_sec","resend_in_sec"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/profile/phone/verify":{"post":{"operationId":"verifyPhoneChange","summary":"Confirm a new mobile number","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":6,"maxLength":32},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["phone","code"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/profile/photo":{"post":{"operationId":"startAccountPhotoUpload","summary":"Start a profile photo upload","description":"A presigned private upload; attach it with PUT on the same path (metadata such as GPS is removed).","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageUploadInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImageUploadTicket"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"put":{"operationId":"attachAccountPhoto","summary":"Use an uploaded photo","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachImageInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"delete":{"operationId":"removeAccountPhoto","summary":"Remove my photo","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/security":{"get":{"operationId":"getAccountSecurity","summary":"My sign-in security","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountSecurity"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/security/backup-codes":{"post":{"operationId":"regenerateBackupCodes","summary":"New backup codes","description":"Needs a current authenticator code. The old codes stop working; the new ones are shown once.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"backup_codes":{"type":"array","items":{"type":"string"}}},"required":["backup_codes"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/security/password":{"post":{"operationId":"changePassword","summary":"Set or change my password","description":"Needs the current password when one is set. Setting a first password needs a sign-in within the last 30 minutes or an authenticator code. Signs out every other session.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"current_password":{"type":"string","maxLength":256},"new_password":{"type":"string","minLength":1,"maxLength":256},"code":{"description":"Authenticator code (first password only).","type":"string","maxLength":10}},"required":["new_password"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sessions_revoked":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["sessions_revoked"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/security/two-factor/disable":{"post":{"operationId":"disableTwoFactor","summary":"Turn off two-step verification","description":"Only when no role you hold requires it. Needs an authenticator code or a backup code.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","maxLength":10},"backup_code":{"type":"string","maxLength":24}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountSecurity"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/sessions":{"get":{"operationId":"listMySessions","summary":"Where I’m signed in","description":"Browsers and phones with a live session, most recently used first.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AccountSession"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/sessions/revoke-others":{"post":{"operationId":"revokeMyOtherSessions","summary":"Sign out everywhere else","description":"Every browser and phone except this one.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"revoked":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["revoked"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/sessions/{id}":{"delete":{"operationId":"revokeMySession","summary":"Sign out one session","description":"Revoking the current session signs you out here.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revoked":{"type":"boolean","const":true},"current":{"type":"boolean"}},"required":["id","revoked","current"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/me/step-up":{"post":{"operationId":"stepUp","summary":"Confirm it’s me","description":"Owners and admins re-enter their authenticator code (or one backup code) before full or data exports, role and permission changes, security-policy changes, creating an API key and granting support access — those answer 403 STEP_UP_REQUIRED otherwise. The proof counts for 15 minutes, for this session only.","tags":["Account"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"},"backup_code":{"type":"string","minLength":1,"maxLength":24}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StepUpResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/media":{"get":{"operationId":"listMedia","summary":"Media of a listing or project","description":"In display order. Private documents are listed only for callers who may open them.","tags":["Media"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read","projects:read"]}],"parameters":[{"name":"property_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["properties.view","projects.view"]},"post":{"operationId":"createMedia","summary":"Register an uploaded file or an external link","description":"Files are checked and processed in the background (status processing → ready or failed).","tags":["Media"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write","projects:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteUploadInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Media"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["properties.edit","projects.edit"],"x-idempotent":true}},"/api/v1/media/reorder":{"post":{"operationId":"reorderMedia","summary":"Reorder media","tags":["Media"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write","projects:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderMediaInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["properties.edit","projects.edit"]}},"/api/v1/media/uploads":{"post":{"operationId":"presignMediaUpload","summary":"Get an upload URL","description":"A presigned PUT for one file (content type and exact size are signed). Limits per kind: photos 15 MB, plans 15 MB, brochures and documents 25 MB, videos 200 MB.","tags":["Media"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write","projects:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignUploadInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PresignedUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["properties.edit","projects.edit"]}},"/api/v1/media/{id}":{"patch":{"operationId":"updateMedia","summary":"Caption, room tag or cover","tags":["Media"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write","projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMediaInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Media"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["properties.edit","projects.edit"]},"delete":{"operationId":"deleteMedia","summary":"Remove a file","tags":["Media"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write","projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["properties.edit","projects.edit"]}},"/api/v1/media/{id}/download":{"get":{"operationId":"downloadMedia","summary":"Signed download URL","description":"A URL valid for 60 seconds to the original file. Private documents need permission to open the listing’s documents (edit access and the owner field visible).","tags":["Media"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read","projects:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["properties.view","projects.view"]}},"/api/v1/member-devices":{"get":{"operationId":"listMemberDevices","summary":"Members’ devices","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["approved","pending","rejected","revoked"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MemberDevice"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.users"}},"/api/v1/member-devices/{id}":{"delete":{"operationId":"revokeMemberDevice","summary":"Remove a member’s device","description":"Signs it out at once; a phone also stops call tracking. It needs an admin’s approval to sign in again.","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberDevice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.users"}},"/api/v1/members":{"get":{"operationId":"listMembers","summary":"Team members","description":"Everyone in the workspace with role, branch, manager, status, 2FA and devices, plus seat usage. Needs `settings.users`, `settings.company` or `settings.view`.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["active","inactive","all"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"meta":{"type":"object","properties":{"seats":{"$ref":"#/components/schemas/SeatUsage"},"counts":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inactive":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","inactive"],"additionalProperties":false}},"required":["seats","counts"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.users","settings.company","settings.view"]}},"/api/v1/members/localities":{"get":{"operationId":"listMemberLocalities","summary":"Localities for service areas","description":"Search the locality master (global + the company’s own) by name, or resolve ids.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"ids","in":"query","required":false,"description":"Comma-separated ids to resolve.","schema":{"type":"string","maxLength":3000}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"}},"required":["id","name","city","state"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.users","settings.company","settings.view"]}},"/api/v1/members/options":{"get":{"operationId":"listMemberOptions","summary":"Members for pickers","description":"The members you work with, A → Z: `view` — whose leads you see (deactivated members included, for filters); `assign` — the active members you may give leads to. Names only (no phone or email).","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"view","type":"string","enum":["view","assign"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MemberOption"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/members/{id}":{"get":{"operationId":"getMember","summary":"A team member","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.users","settings.company","settings.view"]},"patch":{"operationId":"updateMember","summary":"Edit a team member","description":"Role (never one with more access than yours), branch, manager (the reporting paths of everyone below are recomputed), designation, languages, specialisations, localities, lead capacity and shift.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.users"}},"/api/v1/members/{id}/deactivate":{"post":{"operationId":"deactivateMember","summary":"Deactivate a team member","description":"Signs them out of this workspace everywhere, disables API keys they created and frees their seat. The last active owner cannot be deactivated, nor can you deactivate yourself.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeactivateMemberInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberDeactivated"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.users"}},"/api/v1/members/{id}/reactivate":{"post":{"operationId":"reactivateMember","summary":"Reactivate a team member","description":"Needs a free seat on the plan.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.users"}},"/api/v1/messages":{"post":{"operationId":"sendMessage","summary":"Send a message","description":"Runs the compliance gates, renders and queues one message (202), or answers 200 with `status: blocked` and the reasons. Never re-sends: the same `idempotency_key` returns the first result.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["messages:send"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageInput"}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SendMessageResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"inbox.reply","x-idempotent":true}},"/api/v1/messages/channels":{"get":{"operationId":"listChannelAccounts","summary":"Sending identities","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["whatsapp_cloud","whatsapp_web","sms","email"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChannelAccount"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","settings.view"]}},"/api/v1/messages/channels/dlt":{"get":{"operationId":"getDltSetup","summary":"DLT setup (SMS)","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DltSetup"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","settings.view"]},"put":{"operationId":"configureDlt","summary":"Save the DLT setup","description":"`auth_key`: a string stores the tenant’s MSG91 key (encrypted), null removes it, omitted keeps it.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","minLength":1,"maxLength":32},"entity_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"auth_key":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"api":{"type":"string","enum":["flow","sendsms"]}},"required":["entity_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DltSetup"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/channels/dlt/headers":{"post":{"operationId":"addSmsHeader","summary":"Add an SMS header","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"header":{"type":"string","minLength":3,"maxLength":11},"category":{"type":"string","enum":["transactional","service_implicit","service_explicit","promotional"]},"label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"is_default":{"type":"boolean"}},"required":["header","category"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChannelAccount"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/channels/dlt/webhook":{"post":{"operationId":"rotateDltWebhook","summary":"New delivery-report webhook URL","description":"Shown once: paste it into MSG91’s webhook settings. The previous URL stops working.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"inbound_url":{"type":"string"}},"required":["url","inbound_url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/channels/email":{"post":{"operationId":"createEmailIdentity","summary":"Add an email sender","description":"Generates a DKIM key; publish the DNS records, then verify the domain.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from_name":{"type":"string","minLength":1,"maxLength":120},"from_email":{"type":"string","minLength":3,"maxLength":254},"reply_to":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"is_default":{"type":"boolean"}},"required":["from_name","from_email"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChannelAccount"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/channels/{id}":{"patch":{"operationId":"updateChannelAccount","summary":"Update an email sender","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from_name":{"type":"string","minLength":1,"maxLength":120},"reply_to":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"is_default":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChannelAccount"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"},"delete":{"operationId":"disconnectChannelAccount","summary":"Disconnect a sender","description":"Kept for history; it stops sending.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChannelAccount"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/channels/{id}/dns":{"get":{"operationId":"getChannelDnsRecords","summary":"DNS records of an email sender’s domain","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DnsRecord"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/channels/{id}/verify":{"post":{"operationId":"verifyChannelDomain","summary":"Check an email sender’s DNS records","description":"With PropZolo’s email service (Resend) the check runs in the background: the answer carries the last known state, and the sender’s `details.resend.status` updates within minutes.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ChannelAccount"},"checks":{"type":"array","items":{"type":"object","properties":{"record":{"$ref":"#/components/schemas/DnsRecord"},"ok":{"type":"boolean"},"found":{"type":"array","items":{"type":"string"}}},"required":["record","ok","found"],"additionalProperties":false}}},"required":["account","checks"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/check":{"post":{"operationId":"checkMessage","summary":"Check a message before sending","description":"The same gates and rendering as sending, without sending or recording anything.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["messages:send"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckMessageInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckMessageResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"inbox.reply"}},"/api/v1/messages/email/replies":{"patch":{"operationId":"updateEmailReplySettings","summary":"Email reply capture settings","description":"Whether a copy of each reply captured into the inbox also goes to the agent’s own email (audited).","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"forward_to_agent":{"type":"boolean"}},"required":["forward_to_agent"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmailReplySettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/email/reputation":{"get":{"operationId":"getEmailReputation","summary":"Email sending health","description":"The last 7 days’ bounce and complaint rates, and whether promotional email is paused.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmailReputation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/email/reputation/resume":{"post":{"operationId":"resumeEmailSending","summary":"Resume promotional email","description":"Lifts a pause set by the reputation check (audited). The next check counts from now.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmailReputation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/rules":{"get":{"operationId":"getMessagingRules","summary":"Messaging rules","description":"The compliance rules every send follows: pause, quiet hours, promotional SMS window, frequency caps.","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessagingRules"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","settings.view"]},"patch":{"operationId":"updateMessagingRules","summary":"Change messaging rules","description":"Only the fields sent change (audited). Quiet hours may be longer than 21:00–09:00, never shorter; the promotional SMS window may be narrower than 10:00–21:00, never wider (422 otherwise).","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quiet_hours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"quiet_hours_service":{"type":"boolean"},"sms_promotional_window":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"frequency_caps":{"type":"object","properties":{"promotional":{"anyOf":[{"type":"object","properties":{"per_day":{"type":"integer","minimum":1,"maximum":50},"per_week":{"type":"integer","minimum":1,"maximum":200}},"required":["per_day","per_week"]},{"type":"null"}]},"service":{"anyOf":[{"type":"object","properties":{"per_day":{"type":"integer","minimum":1,"maximum":50},"per_week":{"type":"integer","minimum":1,"maximum":200}},"required":["per_day","per_week"]},{"type":"null"}]}},"required":["promotional","service"]},"channel_priority":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email"]}},"rera_footer":{"type":"boolean"},"email_tracking":{"type":"object","properties":{"opens":{"type":"boolean"},"clicks":{"type":"boolean"}},"required":["opens","clicks"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessagingRules"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/rules/pause":{"put":{"operationId":"setMessagingPause","summary":"Pause or resume customer messaging","description":"Stops every customer message (or the listed channels) until resumed; a reason is required to pause. Needs step-up. A billing hold cannot be lifted here (403).","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paused":{"type":"boolean"},"channels":{"default":[],"maxItems":4,"type":"array","items":{"type":"string","enum":["whatsapp_cloud","whatsapp_web","sms","email"]}},"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["paused"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessagingRules"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/messages/{id}":{"get":{"operationId":"getMessage","summary":"A message and its delivery status","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["inbox:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Message"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"inbox.view"}},"/api/v1/mobile/calls/sync":{"post":{"operationId":"syncPhoneCalls","summary":"Upload calls from the phone","description":"Batches of the phone’s call log (≤ 500), idempotent on the phone and its CallLog id — the app re-sends an overlap every time. Only calls provably on a work SIM are kept (unknown SIMs follow the company policy); dates before the backfill floor or in the future are refused; with `mobile.tracking_scope = crm_only` only CRM numbers land. Accepts the member’s app session or the phone’s device token. 401 = the phone was removed (drop the credentials) · 409 = register the phone again.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncCallsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SyncCallsResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/contacts":{"get":{"operationId":"syncMobileLeadContacts","summary":"The leads this phone keeps as contacts","description":"The member’s own open leads (closing owner or pre-sales, inside their view scope) as phone contacts — one per person, newest given first, capped (`mobile.lead_contacts_max`, default 1500). Numbers leave the CRM only when the member’s `contact.phone` field rule is \"visible\"; otherwise (or when the company switched the feature off) `enabled` is false and the phone removes what it holds. Without parameters it answers the snapshot the built native tracker reconciles against (ETag / If-None-Match → 304). With `updated_since` it answers a delta — changed contacts and the keys to remove — in pages of `limit` (`cursor` / `meta.next_cursor`), for clients that do not want the whole list again. A lead reassigned away is found through its `prior_owner_ids`; a run of deltas should still be closed by a snapshot now and then. Accepts the member’s session or the phone’s device token.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"updated_since","in":"query","required":false,"description":"Delta mode: only contacts that changed after this instant (the `sync_token` of the previous run). Omit for the snapshot: every contact the phone should hold.","schema":{"$ref":"#/components/schemas/DateTime"}},{"name":"cursor","in":"query","required":false,"description":"Delta mode: `meta.next_cursor` of the previous page of this run.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Delta page size (default 500); lowers the snapshot cap.","schema":{"type":"integer","minimum":1,"maximum":5000}},{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MobileLeadContacts"},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"304":{"description":"Snapshot unchanged since the ETag in `If-None-Match`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/mobile/devices":{"post":{"operationId":"registerMobileDevice","summary":"Register this phone","description":"Registers the app install of the signed-in member (an upsert: the app also calls it as its heartbeat) and answers with the company’s rules for the app. The first registration — and one made after sign-out, or 60 days after the last token — also returns a `device_token`. A phone removed by an admin stays removed (403, `fields.device = \"revoked\"`); a phone still signed in by another member of the company is a 409. The login session must have been opened for the same installation id.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDeviceBody"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RegisteredDevice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/devices/{id}":{"delete":{"operationId":"revokeMobileDevice","summary":"Remove a phone","description":"Marks the phone removed for good: its device token stops working, its push token is cleared and every login session of that installation is revoked. A member removes their own phone; removing someone else’s needs `settings.users`. Repeating the call changes nothing.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RevokedDevice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/devices/{id}/push-token":{"put":{"operationId":"setMobilePushToken","summary":"Rotate or clear the push token","description":"Stores the FCM token the phone now has (the app calls it when Firebase rotates the token); `null` stops push to this phone. Only the member the phone belongs to may call it.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPushTokenBody"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PushTokenState"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/devices/{id}/sign-out":{"post":{"operationId":"signOutMobileDevice","summary":"Sign this phone out","description":"Called by the app before it ends its login session: revokes the device token and clears the push token, so nothing of this member reaches the phone afterwards. The phone stays registered (signing in again re-issues the token); to remove it for good use DELETE.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SignedOutDevice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/diagnostics":{"post":{"operationId":"reportMobileDiagnostics","summary":"Crash and health reports of the app","description":"Crash / error reports of the Android app (JS and native). Always answers 200 once the body is readable, so the phone forgets what it sent even when a report was unusable; each report is clipped to fixed field lengths, stored once per `rid`, capped at 60 reports per member and hour, logged as `mobile app error report` and kept in a capped per-company list (the latest 500, 30 days) for the admin view. Accepts the member’s session or the phone’s device token.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileDiagnosticsBody"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MobileDiagnosticsResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/lookup":{"get":{"operationId":"lookupMobileNumber","summary":"Is this number already in the CRM?","description":"Behind the “add unknown caller as lead” notification and the dial pad: whether the company has a contact with the number — never who. A member session also learns which colleagues are working the number (names only); the phone’s device token gets yes or no. Rate-limited per member.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"phone","in":"query","required":true,"description":"Any phone format; E.164 is best (+919812345678).","schema":{"type":"string","minLength":5,"maxLength":32}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NumberLookup"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/notifications":{"get":{"operationId":"pollMobileNotifications","summary":"Notifications this phone has not shown yet","description":"What the native call tracker polls while the app is closed (at most once a minute): the member’s unread notifications that no push reached (`pushed_at` empty), created since this phone last asked, at most 20 oldest first. Each is handed out once per phone — the hand-out position is kept in Redis, nothing is written to the notifications table — and none while the member’s quiet hours apply, or for events they muted or the company switched off for push. Accepts the member’s session or the phone’s device token. Rate-limited per member.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MobileNotificationBatch"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/queue":{"get":{"operationId":"getCallingQueue","summary":"Who to call next (Autopilot)","description":"The member’s open leads in the dial brain’s order — they called us, due follow-ups, fresh leads, then the best chance to answer now — with the company’s calling hours, cool-downs, daily caps and colleague guard.","tags":["Calling queue"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"mode","in":"query","required":false,"schema":{"default":"autopilot","type":"string","enum":["autopilot","followups","fresh","hot","retry","custom","smart"]}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"exclude","in":"query","required":false,"description":"Lead ids already done in this session.","schema":{"type":"string","maxLength":4000}},{"name":"statuses","in":"query","required":false,"description":"custom: dial stages (new, attempted, callback, interested) or status keys.","schema":{"type":"string","maxLength":4000}},{"name":"sources","in":"query","required":false,"description":"custom: lead source ids.","schema":{"type":"string","maxLength":4000}},{"name":"campaigns","in":"query","required":false,"schema":{"type":"string","maxLength":4000}},{"name":"max_attempts","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100}},{"name":"created_within_days","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":3650}},{"name":"never_called","in":"query","required":false,"schema":{"type":"string"}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallingQueue"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/queue/skip":{"post":{"operationId":"skipQueueLead","summary":"Not now: skip a lead for a while","tags":["Calling queue"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"minutes":{"default":60,"type":"integer","minimum":1,"maximum":1440}},"required":["lead_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"until":{"$ref":"#/components/schemas/DateTime"}},"required":["lead_id","until"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/recordings":{"post":{"operationId":"confirmPhoneRecording","summary":"Confirm an uploaded call recording","description":"After the PUT: the recording is claimed on its call and checked by the worker (exists, size, audio by its bytes, the real hash) before it is stored like a cloud recording — playable with `calls.recordings`, kept for the `call_recordings` retention, transcribed when the company asks. A replay answers the same.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneRecordingConfirmInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PhoneRecordingConfirmation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/recordings/status":{"post":{"operationId":"reportRecordingSync","summary":"Report the phone’s recording sync","description":"Opt-in, access, last scan, pending, uploaded, errors — shown on the devices page. Answers the company’s switch, the recording disclosure and the retention period. Accepts the member’s app session or the device token.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingSyncReport"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecordingSyncConfig"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/recordings/uploads":{"post":{"operationId":"claimPhoneRecording","summary":"Ask to upload a call recording from the phone","description":"The phone found a recording of a call its tracker synced (work SIMs only). The server checks the company switch (`mobile.recordings_enabled`), the call, the match (number in the file name with the shared phone helpers, times, length) and the content hash, then answers a presigned PUT or why not. Accepts the member’s app session or the phone’s device token.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneRecordingClaimInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PhoneRecordingClaim"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/mobile/updates/latest":{"get":{"operationId":"getLatestAppBuild","summary":"The newest app build this phone may install","description":"The newest published build of the phone’s flavour on its channel — `null` when nothing is published, the enterprise APK is not offered, or (Play builds) no Play Store listing is set. OTA updates of the JavaScript need no new build; this is for native changes and new phones.","tags":["Mobile"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"flavor","in":"query","required":false,"description":"The build asking; default: the flavour this login’s phone registered with, else enterprise.","schema":{"$ref":"#/components/schemas/BuildFlavor"}},{"name":"channel","in":"query","required":false,"description":"Release channel of the build (default production).","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,31}$"}},{"name":"version_code","in":"query","required":false,"description":"The asking build’s versionCode; default: what its phone last reported.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/InstallableAppBuild"},{"type":"null"}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/network/availability-checks":{"get":{"operationId":"listNetworkAvailabilityChecks","summary":"Availability checks","description":"Pings to answer (inbound, pending first) and pings sent.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["inbound","outbound"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NetworkAvailabilityCheck"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"}},"/api/v1/network/availability-checks/{id}/answer":{"post":{"operationId":"answerNetworkAvailability","summary":"Answer an availability check","description":"Available re-confirms the share (15-day clock); not available closes it.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["available"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkAvailabilityCheck"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.share"}},"/api/v1/network/circle-memberships/{id}":{"post":{"operationId":"respondNetworkMembership","summary":"Answer an invitation or a join request, leave or remove","description":"Invitee: accept / decline; owner: approve / reject a request, remove a member; member: leave. Leaving hides the circle’s shares.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["accept","decline","approve","reject","leave","remove"]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkCircle"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.manage"}},"/api/v1/network/circles":{"get":{"operationId":"listNetworkCircles","summary":"Circles","description":"Circles the company runs or belongs to, invitations, and discoverable circles it may ask to join.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NetworkCircle"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"},"post":{"operationId":"createNetworkCircle","summary":"Start a circle","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":80},"kind":{"default":"custom","type":"string","enum":["micro_market","association","custom"]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"discoverable":{"default":true,"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkCircle"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.manage"}},"/api/v1/network/circles/{id}/members":{"post":{"operationId":"inviteToNetworkCircle","summary":"Invite a company, or ask to join","description":"The owner invites a listed company (`profile_id`); any other company asks to join a discoverable circle (no body fields).","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"profile_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkCircle"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.manage"}},"/api/v1/network/co-brokes":{"get":{"operationId":"listCoBrokes","summary":"Co-broke deals","description":"Requests sent and received; open ones (requested, negotiating, agreed) by default. Latest activity first.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","closed","all"]}},{"name":"side","in":"query","required":false,"schema":{"type":"string","enum":["requester","owner"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CoBroke"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"},"post":{"operationId":"requestCoBroke","summary":"Ask to co-broke a shared item","description":"One open request per shared item. The sharer has 7 days to answer.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"share_id":{"$ref":"#/components/schemas/Id"},"message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["share_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBroke"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}":{"get":{"operationId":"getCoBroke","summary":"A deal room","description":"The co-broke with its thread, documents and client registrations.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"}},"/api/v1/network/co-brokes/{id}/actions":{"post":{"operationId":"actOnCoBroke","summary":"Move a co-broke","description":"Owner: accept / decline; requester: withdraw; either: propose terms (`terms`), accept the other side’s terms (both accepted = agreed; the terms are then frozen), close an agreed co-broke as won or lost.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["accept","decline","withdraw","propose_terms","accept_terms","close_won","close_lost"]},"terms":{"anyOf":[{"type":"object","properties":{"basis":{"type":"string","enum":["pooled","own_client"]},"requester_share_bps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["basis"]},{"type":"null"}]},"terms_version":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}/dispute":{"post":{"operationId":"disputeCoBroke","summary":"Raise or settle a dispute","description":"Either side raises a dispute on an agreed or closed co-broke; either side records the settlement.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["open","resolve"]},"text":{"type":"string","minLength":5,"maxLength":1000}},"required":["action","text"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}/documents":{"post":{"operationId":"addCoBrokeDocument","summary":"Add an uploaded document to the deal room","description":"Both sides can download it unless the malware scan quarantines it.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storage_key":{"type":"string","minLength":10,"maxLength":300},"filename":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","minLength":3,"maxLength":100},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["storage_key","filename","content_type","size"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}/documents/uploads":{"post":{"operationId":"presignCoBrokeDocument","summary":"Upload URL for a deal room document","description":"PDF or image, up to 15 MB, to this company’s private storage.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","minLength":3,"maxLength":100},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"storage_key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["storage_key","url","method","headers","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}/documents/{documentId}/download":{"get":{"operationId":"coBrokeDocumentDownload","summary":"Download a deal room document","description":"A short-lived URL; 403 when the malware scan quarantined the file, 404 for anyone but the two companies.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"documentId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"}},"/api/v1/network/co-brokes/{id}/esign":{"post":{"operationId":"requestCoBrokeEsign","summary":"E-sign the agreed terms (optional)","description":"Freezes the agreed terms into a PDF and sends it to both brokers for electronic signature at PropZolo’s e-sign partner (signers: each network profile’s business phone or email). The signed copy lands in the deal room’s documents.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}/esign/sign":{"post":{"operationId":"signCoBrokeEsign","summary":"Open this broker’s signing page","description":"A short-lived link to the e-sign partner’s page for this company’s signer; never stored.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}/link-deal":{"post":{"operationId":"linkCoBrokeDeal","summary":"Link the company’s own deal","description":"Links this side’s CRM deal; on a pooled agreement the deal’s co-broker share becomes the partner’s agreed share (the partner company as a broker contact), so the commission net and splits follow.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deal_id":{"$ref":"#/components/schemas/Id"}},"required":["deal_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}/messages":{"post":{"operationId":"postCoBrokeMessage","summary":"Write in the deal room","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["body"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/co-brokes/{id}/registrations":{"post":{"operationId":"registerNetworkClient","summary":"Register a client with the sharer","description":"Locks the client to this company on the shared item for the sharer’s lock window (30–180 days). The sharer sees a masked label only. First come, first served across the network: 409 names the holder until when; send `dispute_reason` to file a dispute the sharer decides.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"dispute_reason":{"anyOf":[{"type":"string","minLength":10,"maxLength":1000},{"type":"null"}]}},"required":["contact_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/directory":{"get":{"operationId":"listNetworkDirectory","summary":"The broker directory","description":"Listed companies, trusted first; search by name or area, filter by city and speciality.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"speciality","in":"query","required":false,"schema":{"type":"string","enum":["resale","rental","new_projects","commercial","plots","luxury","nri","pg_coliving"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NetworkDirectoryEntry"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"}},"/api/v1/network/feed":{"get":{"operationId":"listNetworkFeed","summary":"Shares from the network","description":"Other companies’ live shares this company may see (the network, and circles it is an active member of).","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["listing","requirement"]}},{"name":"side","in":"query","required":false,"schema":{"type":"string","enum":["sale","rent"]}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"circle_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NetworkShare"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"}},"/api/v1/network/matches":{"get":{"operationId":"listNetworkMatches","summary":"Matches across the network","description":"The company’s shared requirements against other companies’ shared listings, and its shared listings against their requirements. Best first.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"share_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NetworkMatch"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"}},"/api/v1/network/profile":{"get":{"operationId":"getNetworkProfile","summary":"The company’s network profile","description":"Null until the company sets one up. Trust facts are recomputed daily by PropZolo.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/NetworkProfile"},{"type":"null"}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"},"put":{"operationId":"saveNetworkProfile","summary":"Set up or edit the network profile","description":"`listed` shows the company in the directory (needs a business phone or email). A new RERA number or validity drops PropZolo’s verification until checked again.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["draft","listed","paused"]},"display_name":{"type":"string","minLength":2,"maxLength":120},"about":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"city":{"type":"string","minLength":2,"maxLength":80},"areas":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"specialities":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","enum":["resale","rental","new_projects","commercial","plots","luxury","nri","pg_coliving"]}},"languages":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":30}},"business_phone":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"business_email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]},"rera_number":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"rera_state":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"lock_days":{"default":90,"type":"integer","minimum":30,"maximum":180}},"required":["status","display_name","city"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.manage"}},"/api/v1/network/profile/kyc":{"post":{"operationId":"submitNetworkKyc","summary":"Submit KYC for verification","description":"The uploaded document goes to PropZolo’s review; the badge shows once verified.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storage_key":{"type":"string","minLength":10,"maxLength":300}},"required":["storage_key"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkProfile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.manage"}},"/api/v1/network/profile/kyc/uploads":{"post":{"operationId":"presignNetworkKyc","summary":"Upload URL for the KYC document","description":"A PDF or photo of the firm’s registration / PAN / RERA certificate, to the company’s private storage.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","minLength":3,"maxLength":100},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"storage_key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["storage_key","url","method","headers","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.manage"}},"/api/v1/network/registrations/{id}":{"post":{"operationId":"actOnNetworkRegistration","summary":"Release, reject or decide a registration","description":"Registering company: release. Sharer: reject (e.g. already its own client), or decide a dispute — keep the existing lock, award the disputer, or reject both.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["release","reject","keep_existing","award_disputer","reject_both"]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoBrokeDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/shares":{"get":{"operationId":"listMyNetworkShares","summary":"What the company shares","description":"Live (active / paused) by default; `status=all` includes expired, revoked and closed shares.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["live","all"]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["listing","requirement"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NetworkShare"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"},"post":{"operationId":"createNetworkShare","summary":"Share a listing or a requirement (masked)","description":"Shares a masked copy: price band, area range, locality and city — never the owner, the client, the unit or the address. A listing needs co-broking allowed; a requirement needs a buy / rent lead.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["listing","requirement"]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"visibility":{"type":"string","enum":["circle","network"]},"circle_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"co_broke_terms":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"offered_split_bps":{"anyOf":[{"type":"integer","minimum":50,"maximum":9950},{"type":"null"}]}},"required":["kind","visibility"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkShare"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.share"}},"/api/v1/network/shares/{id}/availability":{"post":{"operationId":"askNetworkAvailability","summary":"Ask whether a shared item is still available","description":"One open ping per share; the sharer has 48 hours to answer.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkAvailabilityCheck"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.deal"}},"/api/v1/network/shares/{id}/status":{"post":{"operationId":"setNetworkShareStatus","summary":"Confirm, pause, resume, revoke or close a share","description":"`confirm`: still available (resets the 15-day clock, re-opens an expired share). `revoke` removes it from the network at once; open co-brokes keep their snapshot.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["confirm","pause","resume","revoke","close"]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkShare"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.share"}},"/api/v1/network/suggestions":{"get":{"operationId":"listNetworkSuggestions","summary":"Network shares for your unshared leads and listings","description":"Other companies’ live shares that fit the company’s own open buyer / tenant leads and active listings that are not shared. Suggestions only: nothing is shared or sent; the other side is seen only as its masked share.","tags":["Broker network"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NetworkSuggestion"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"network.view"}},"/api/v1/notifications":{"get":{"operationId":"listNotifications","summary":"The member’s notifications","description":"Newest first, keyset-paginated. `unread=1` lists unread ones only.","tags":["Notifications"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"unread","in":"query","required":false,"description":"Only unread notifications.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/notifications/read-all":{"post":{"operationId":"markAllNotificationsRead","summary":"Mark all notifications read","description":"Send `before` (the created_at of the newest notification shown) so one arriving while the member clicks stays unread.","tags":["Notifications"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"before":{"$ref":"#/components/schemas/DateTime"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"updated":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["updated"],"additionalProperties":false},"meta":{"type":"object","properties":{"counters":{"type":"object","properties":{"notifications.unread":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["notifications.unread"],"additionalProperties":false}},"required":["counters"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/notifications/{id}/read":{"post":{"operationId":"markNotificationRead","summary":"Mark a notification read","description":"Idempotent. Another member’s notification is reported as not found.","tags":["Notifications"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Notification"},"meta":{"type":"object","properties":{"counters":{"type":"object","properties":{"notifications.unread":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["notifications.unread"],"additionalProperties":false}},"required":["counters"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/oauth/consent":{"post":{"operationId":"decideMcpConsent","summary":"Approve or deny an assistant’s request to connect","description":"The consent screen’s submit: the authorization request is checked again, then the member’s choice of scopes and autonomy is recorded and a single-use code issued. Answers the URL to send the browser to (the client’s redirect URI with `code` or `error`).","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"request":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"string","maxLength":2048}},"decision":{"type":"string","enum":["approve","deny"]},"scopes":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":64}},"autonomy":{"default":"draft","type":"string","enum":["read","draft","execute"]}},"required":["request","decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"redirect_to":{"type":"string"}},"required":["redirect_to"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/onboarding":{"get":{"operationId":"getOnboarding","summary":"Onboarding checklist","description":"Computed from the workspace’s real data on every call.","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Onboarding"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"patch":{"operationId":"updateOnboarding","summary":"Hide or show the checklist","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOnboardingInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Onboarding"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/openapi.json":{"get":{"operationId":"getOpenApiDocument","summary":"OpenAPI 3.1 document","description":"This document. Cached by clients for five minutes; supports If-None-Match.","tags":["System"],"security":[],"parameters":[{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"OpenAPI 3.1 document."}}}},"304":{"description":"Not modified.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"}},"/api/v1/owner-reports/entries/{id}":{"patch":{"operationId":"updateOwnerReportEntry","summary":"Change, show or hide a line for the owner","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":560},"action_kind":{"anyOf":[{"type":"string","enum":["open_house","price_advice","marketing","photos","note"]},{"type":"null"}]},"occurred_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string","enum":["draft","published"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerReportEntry"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.edit"},"delete":{"operationId":"deleteOwnerReportEntry","summary":"Remove a line for the owner","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.edit"}},"/api/v1/owner-reports/links":{"post":{"operationId":"issueOwnerReportLink","summary":"Get the owner’s report link","description":"The live link for a listing (scope listing) or every listing of its owner (scope owner, from a listing or the owner contact): the existing one when there is one (renewed if it expired), else a new one.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["listing","owner"]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"owner_contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"days":{"anyOf":[{"type":"integer","minimum":7,"maximum":365},{"type":"null"}]}},"required":["scope"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerReportLink"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.share"}},"/api/v1/owner-reports/links/{id}/renew":{"post":{"operationId":"renewOwnerReportLink","summary":"Renew an owner report link","description":"The same URL works again for the company’s link lifetime (or `days`). A revoked link cannot be renewed.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"days":{"anyOf":[{"type":"integer","minimum":7,"maximum":365},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerReportLink"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.share"}},"/api/v1/owner-reports/links/{id}/revoke":{"post":{"operationId":"revokeOwnerReportLink","summary":"Revoke an owner report link","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerReportLink"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.share"}},"/api/v1/owner-reports/links/{id}/rotate":{"post":{"operationId":"rotateOwnerReportLink","summary":"Replace an owner report link","description":"Revokes the link (the old URL stops working at once) and returns a new one for the same owner and scope.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerReportLink"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.share"}},"/api/v1/owner-reports/links/{id}/send":{"post":{"operationId":"sendOwnerReport","summary":"Send the owner their report now","description":"Through the compliance-gated pipeline (a service message to an existing client); the link is minted at delivery.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"anyOf":[{"type":"string","enum":["auto","email","whatsapp_cloud","sms"]},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerReportSendResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.share"}},"/api/v1/owner-reports/settings":{"get":{"operationId":"getOwnerReportSettings","summary":"Owner report settings","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"digest_enabled":{"type":"boolean","description":"Send owners a periodic report (off by default)."},"cadence":{"type":"string","enum":["weekly","monthly"]},"weekday":{"type":"integer","minimum":1,"maximum":7,"description":"Weekly: 1 = Monday … 7 = Sunday."},"month_day":{"type":"integer","minimum":1,"maximum":28,"description":"Monthly: the day of the month (1–28)."},"send_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"HH:mm on the company clock."},"channel":{"type":"string","enum":["email","whatsapp_cloud","auto"],"description":"email · whatsapp_cloud (the approved owner_report template) · auto (the best reachable channel)"},"link_days":{"type":"integer","minimum":7,"maximum":365,"description":"How long a new link works (default 90)."},"sections":{"$ref":"#/components/schemas/OwnerReportSections"},"schedule_text":{"type":"string","description":"\"Every Monday at 10:00\"."}},"required":["digest_enabled","cadence","weekday","month_day","send_time","channel","link_days","sections","schedule_text"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.inventory","settings.view"]},"patch":{"operationId":"updateOwnerReportSettings","summary":"Change owner report settings","description":"The periodic digest is off until switched on; sections are the defaults each listing may override.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"digest_enabled":{"type":"boolean","description":"Send owners a periodic report (off by default)."},"cadence":{"type":"string","enum":["weekly","monthly"]},"weekday":{"type":"integer","minimum":1,"maximum":7,"description":"Weekly: 1 = Monday … 7 = Sunday."},"month_day":{"type":"integer","minimum":1,"maximum":28,"description":"Monthly: the day of the month (1–28)."},"send_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"HH:mm on the company clock."},"channel":{"type":"string","enum":["email","whatsapp_cloud","auto"],"description":"email · whatsapp_cloud (the approved owner_report template) · auto (the best reachable channel)"},"link_days":{"type":"integer","minimum":7,"maximum":365,"description":"How long a new link works (default 90)."},"sections":{"type":"object","properties":{"price":{"type":"boolean"},"views":{"type":"boolean"},"enquiries":{"type":"boolean"},"visits":{"type":"boolean"},"feedback":{"type":"boolean"},"offers":{"type":"boolean"},"matches":{"type":"boolean"},"activity":{"type":"boolean"}}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"digest_enabled":{"type":"boolean","description":"Send owners a periodic report (off by default)."},"cadence":{"type":"string","enum":["weekly","monthly"]},"weekday":{"type":"integer","minimum":1,"maximum":7,"description":"Weekly: 1 = Monday … 7 = Sunday."},"month_day":{"type":"integer","minimum":1,"maximum":28,"description":"Monthly: the day of the month (1–28)."},"send_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"HH:mm on the company clock."},"channel":{"type":"string","enum":["email","whatsapp_cloud","auto"],"description":"email · whatsapp_cloud (the approved owner_report template) · auto (the best reachable channel)"},"link_days":{"type":"integer","minimum":7,"maximum":365,"description":"How long a new link works (default 90)."},"sections":{"$ref":"#/components/schemas/OwnerReportSections"},"schedule_text":{"type":"string","description":"\"Every Monday at 10:00\"."}},"required":["digest_enabled","cadence","weekday","month_day","send_time","channel","link_days","sections","schedule_text"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.inventory"}},"/api/v1/partner-agreements/{id}/cancel":{"post":{"operationId":"cancelPartnerAgreement","summary":"Cancel a signing request that is still open","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","sent","signed","declined","expired","cancelled","failed"]},"signer_name":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","signer_name","sent_at","signed_at","expires_at","last_error","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.edit"}},"/api/v1/partner-agreements/{id}/download":{"get":{"operationId":"downloadPartnerAgreement","summary":"A short-lived link to the agreement (the signed copy once signed)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["partners.view","partner_portal.access"]}},"/api/v1/partner-collateral":{"get":{"operationId":"listPartnerCollateral","summary":"The collateral library (published and archived)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["published","archived"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"kind":{"type":"string","enum":["brochure","floor_plan","price_sheet","creative","video","other"]},"title":{"type":"string"},"description":{"type":["string","null"]},"file_name":{"type":["string","null"]},"content_type":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"link_url":{"type":["string","null"]},"cobrand":{"type":"boolean"},"status":{"type":"string","enum":["published","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"cobrand_line":{"description":"Portal only: the partner’s share line.","type":["string","null"]}},"required":["id","project","kind","title","description","file_name","content_type","size_bytes","link_url","cobrand","status","created_at","cobrand_line"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.view"},"post":{"operationId":"createPartnerCollateral","summary":"Publish a collateral item (an uploaded file or an https link)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"kind":{"type":"string","enum":["brochure","floor_plan","price_sheet","creative","video","other"]},"title":{"type":"string","minLength":2,"maxLength":160},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"key":{"anyOf":[{"type":"string","minLength":1,"maxLength":300},{"type":"null"}]},"content_type":{"anyOf":[{"type":"string","minLength":3,"maxLength":120},{"type":"null"}]},"size":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"file_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"link_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"cobrand":{"default":true,"type":"boolean"}},"required":["kind","title"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"kind":{"type":"string","enum":["brochure","floor_plan","price_sheet","creative","video","other"]},"title":{"type":"string"},"description":{"type":["string","null"]},"file_name":{"type":["string","null"]},"content_type":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"link_url":{"type":["string","null"]},"cobrand":{"type":"boolean"},"status":{"type":"string","enum":["published","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"cobrand_line":{"description":"Portal only: the partner’s share line.","type":["string","null"]}},"required":["id","project","kind","title","description","file_name","content_type","size_bytes","link_url","cobrand","status","created_at","cobrand_line"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.configure"}},"/api/v1/partner-collateral/uploads":{"post":{"operationId":"presignPartnerCollateral","summary":"Upload a collateral file (PDF, image or video)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["key","url","method","headers","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.configure"}},"/api/v1/partner-collateral/{id}":{"patch":{"operationId":"updatePartnerCollateral","summary":"Edit, archive or republish a collateral item","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":2,"maxLength":160},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"kind":{"type":"string","enum":["brochure","floor_plan","price_sheet","creative","video","other"]},"cobrand":{"type":"boolean"},"status":{"type":"string","enum":["published","archived"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"kind":{"type":"string","enum":["brochure","floor_plan","price_sheet","creative","video","other"]},"title":{"type":"string"},"description":{"type":["string","null"]},"file_name":{"type":["string","null"]},"content_type":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"link_url":{"type":["string","null"]},"cobrand":{"type":"boolean"},"status":{"type":"string","enum":["published","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"cobrand_line":{"description":"Portal only: the partner’s share line.","type":["string","null"]}},"required":["id","project","kind","title","description","file_name","content_type","size_bytes","link_url","cobrand","status","created_at","cobrand_line"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.configure"}},"/api/v1/partner-collateral/{id}/download":{"get":{"operationId":"downloadPartnerCollateral","summary":"A short-lived link to a collateral file (partners: published items only)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["partners.view","partner_portal.access"]}},"/api/v1/partner-documents/{id}/download":{"get":{"operationId":"downloadPartnerDocument","summary":"A short-lived link to a partner’s document (members, or the partner itself)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["partners.view","partner_portal.access"]}},"/api/v1/partner-documents/{id}/review":{"post":{"operationId":"reviewPartnerDocument","summary":"Verify or reject a partner’s KYC document","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"verified":{"type":"boolean"},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["verified"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.approve"}},"/api/v1/partner-kyc-shares/{id}/decision":{"post":{"operationId":"decidePartnerKycShare","summary":"Accept or reject a shared KYC document","description":"Accepted counts as verified on the onboarding checklist. A rejection needs a note. Decided once; audited.","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["accept","reject"]},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PartnerKycShare"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.approve"}},"/api/v1/partners":{"get":{"operationId":"listPartners","summary":"Channel partners, with onboarding status and live registrations","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","approved","rejected","suspended"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"},"type":{"type":"string"},"contact_name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected","suspended"]},"tier":{"type":["string","null"]},"rera_agent_number":{"type":["string","null"]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_status":{"type":"string","enum":["missing","valid","expiring","expired"]},"kyc":{"type":"object","properties":{"pan":{"description":"Masked PAN (XXXXXX234F); null when missing or hidden.","type":["string","null"]},"gstin":{"type":["string","null"]},"bank":{"description":"IFSC and masked account (HDFC0001234 · ••••5678).","type":["string","null"]}},"required":["pan","gstin","bank"],"additionalProperties":false},"manager":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"portal_users":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registrations":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","disputed"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","firm_name","type","contact_name","phone","email","status","tier","rera_agent_number","rera_expires_on","rera_status","kyc","manager","portal_users","registrations","created_at","approved_at"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.view"},"post":{"operationId":"createPartner","summary":"Add a partner firm (pending until approved)","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firm_name":{"type":"string","minLength":2,"maxLength":160},"type":{"default":"cp_firm","type":"string","enum":["cp_firm","broker","referrer","co_broker"]},"tier":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"tag_validity_days":{"anyOf":[{"type":"integer","minimum":7,"maximum":365},{"type":"null"}]},"manager_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]},"rera_agent_number":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_state":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"pan":{"description":"Stored encrypted; returned masked.","anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"gstin":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"bank":{"anyOf":[{"type":"object","properties":{"account_number":{"type":"string","maxLength":24},"ifsc":{"type":"string","maxLength":11},"holder_name":{"type":"string","minLength":2,"maxLength":120},"bank_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["account_number","ifsc","holder_name"]},{"type":"null"}]}},"required":["firm_name"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"},"type":{"type":"string"},"contact_name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected","suspended"]},"tier":{"type":["string","null"]},"rera_agent_number":{"type":["string","null"]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_status":{"type":"string","enum":["missing","valid","expiring","expired"]},"kyc":{"type":"object","properties":{"pan":{"description":"Masked PAN (XXXXXX234F); null when missing or hidden.","type":["string","null"]},"gstin":{"type":["string","null"]},"bank":{"description":"IFSC and masked account (HDFC0001234 · ••••5678).","type":["string","null"]}},"required":["pan","gstin","bank"],"additionalProperties":false},"manager":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"portal_users":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registrations":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","disputed"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"rera_state":{"type":["string","null"]},"tag_validity_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status_reason":{"type":["string","null"]},"invited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kyc_submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"checklist":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"done":{"type":"boolean"},"required":{"type":"boolean"}},"required":["key","label","done","required"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"can_approve":{"type":"boolean"}},"required":["steps","missing","can_approve"],"additionalProperties":false},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false}},"agreement":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","sent","signed","declined","expired","cancelled","failed"]},"signer_name":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","signer_name","sent_at","signed_at","expires_at","last_error","created_at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","firm_name","type","contact_name","phone","email","status","tier","rera_agent_number","rera_expires_on","rera_status","kyc","manager","portal_users","registrations","created_at","approved_at","rera_state","tag_validity_days","status_reason","invited_at","kyc_submitted_at","checklist","documents","agreement"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.create"}},"/api/v1/partners/{id}":{"get":{"operationId":"getPartner","summary":"A partner with its onboarding checklist, documents and agreement","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"},"type":{"type":"string"},"contact_name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected","suspended"]},"tier":{"type":["string","null"]},"rera_agent_number":{"type":["string","null"]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_status":{"type":"string","enum":["missing","valid","expiring","expired"]},"kyc":{"type":"object","properties":{"pan":{"description":"Masked PAN (XXXXXX234F); null when missing or hidden.","type":["string","null"]},"gstin":{"type":["string","null"]},"bank":{"description":"IFSC and masked account (HDFC0001234 · ••••5678).","type":["string","null"]}},"required":["pan","gstin","bank"],"additionalProperties":false},"manager":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"portal_users":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registrations":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","disputed"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"rera_state":{"type":["string","null"]},"tag_validity_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status_reason":{"type":["string","null"]},"invited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kyc_submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"checklist":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"done":{"type":"boolean"},"required":{"type":"boolean"}},"required":["key","label","done","required"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"can_approve":{"type":"boolean"}},"required":["steps","missing","can_approve"],"additionalProperties":false},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false}},"agreement":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","sent","signed","declined","expired","cancelled","failed"]},"signer_name":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","signer_name","sent_at","signed_at","expires_at","last_error","created_at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","firm_name","type","contact_name","phone","email","status","tier","rera_agent_number","rera_expires_on","rera_status","kyc","manager","portal_users","registrations","created_at","approved_at","rera_state","tag_validity_days","status_reason","invited_at","kyc_submitted_at","checklist","documents","agreement"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.view"},"patch":{"operationId":"updatePartner","summary":"Update a partner’s profile and KYC details","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firm_name":{"type":"string","minLength":2,"maxLength":160},"type":{"default":"cp_firm","type":"string","enum":["cp_firm","broker","referrer","co_broker"]},"tier":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"tag_validity_days":{"anyOf":[{"type":"integer","minimum":7,"maximum":365},{"type":"null"}]},"manager_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]},"rera_agent_number":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_state":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"pan":{"description":"Stored encrypted; returned masked.","anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"gstin":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"bank":{"anyOf":[{"type":"object","properties":{"account_number":{"type":"string","maxLength":24},"ifsc":{"type":"string","maxLength":11},"holder_name":{"type":"string","minLength":2,"maxLength":120},"bank_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["account_number","ifsc","holder_name"]},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"},"type":{"type":"string"},"contact_name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected","suspended"]},"tier":{"type":["string","null"]},"rera_agent_number":{"type":["string","null"]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_status":{"type":"string","enum":["missing","valid","expiring","expired"]},"kyc":{"type":"object","properties":{"pan":{"description":"Masked PAN (XXXXXX234F); null when missing or hidden.","type":["string","null"]},"gstin":{"type":["string","null"]},"bank":{"description":"IFSC and masked account (HDFC0001234 · ••••5678).","type":["string","null"]}},"required":["pan","gstin","bank"],"additionalProperties":false},"manager":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"portal_users":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registrations":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","disputed"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"rera_state":{"type":["string","null"]},"tag_validity_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status_reason":{"type":["string","null"]},"invited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kyc_submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"checklist":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"done":{"type":"boolean"},"required":{"type":"boolean"}},"required":["key","label","done","required"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"can_approve":{"type":"boolean"}},"required":["steps","missing","can_approve"],"additionalProperties":false},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false}},"agreement":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","sent","signed","declined","expired","cancelled","failed"]},"signer_name":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","signer_name","sent_at","signed_at","expires_at","last_error","created_at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","firm_name","type","contact_name","phone","email","status","tier","rera_agent_number","rera_expires_on","rera_status","kyc","manager","portal_users","registrations","created_at","approved_at","rera_state","tag_validity_days","status_reason","invited_at","kyc_submitted_at","checklist","documents","agreement"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.edit"}},"/api/v1/partners/{id}/agreement":{"post":{"operationId":"sendPartnerAgreement","summary":"Send the channel-partner agreement for e-signature","description":"Freezes the agreement as a PDF and queues it for the e-sign partner. One live request per partner; until the platform’s e-sign partner is switched on the request waits.","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","sent","signed","declined","expired","cancelled","failed"]},"signer_name":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","signer_name","sent_at","signed_at","expires_at","last_error","created_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.edit"}},"/api/v1/partners/{id}/decision":{"post":{"operationId":"decidePartner","summary":"Approve, reject, suspend or reinstate a partner","description":"Approval needs every required onboarding step (Settings → Partners). Reject and suspend need a reason.","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["approve","reject","suspend","reinstate"]},"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"},"type":{"type":"string"},"contact_name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected","suspended"]},"tier":{"type":["string","null"]},"rera_agent_number":{"type":["string","null"]},"rera_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rera_status":{"type":"string","enum":["missing","valid","expiring","expired"]},"kyc":{"type":"object","properties":{"pan":{"description":"Masked PAN (XXXXXX234F); null when missing or hidden.","type":["string","null"]},"gstin":{"type":["string","null"]},"bank":{"description":"IFSC and masked account (HDFC0001234 · ••••5678).","type":["string","null"]}},"required":["pan","gstin","bank"],"additionalProperties":false},"manager":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"portal_users":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registrations":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","disputed"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"rera_state":{"type":["string","null"]},"tag_validity_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status_reason":{"type":["string","null"]},"invited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kyc_submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"checklist":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"done":{"type":"boolean"},"required":{"type":"boolean"}},"required":["key","label","done","required"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"can_approve":{"type":"boolean"}},"required":["steps","missing","can_approve"],"additionalProperties":false},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false}},"agreement":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","sent","signed","declined","expired","cancelled","failed"]},"signer_name":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","signer_name","sent_at","signed_at","expires_at","last_error","created_at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","firm_name","type","contact_name","phone","email","status","tier","rera_agent_number","rera_expires_on","rera_status","kyc","manager","portal_users","registrations","created_at","approved_at","rera_state","tag_validity_days","status_reason","invited_at","kyc_submitted_at","checklist","documents","agreement"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.approve"}},"/api/v1/partners/{id}/documents":{"post":{"operationId":"addPartnerDocument","summary":"Register an uploaded KYC document","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"key":{"type":"string","minLength":1,"maxLength":300},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"file_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["kind","key","content_type","size"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"label":{"type":"string"},"status":{"type":"string","enum":["submitted","verified","rejected"]},"file_name":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"review_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","status","file_name","content_type","size_bytes","review_note","created_at","reviewed_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.edit"}},"/api/v1/partners/{id}/documents/uploads":{"post":{"operationId":"presignPartnerDocument","summary":"Upload a KYC document (PDF or photo) for a partner","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["key","url","method","headers","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.edit"}},"/api/v1/partners/{id}/invite":{"post":{"operationId":"invitePartner","summary":"Invite the partner to the portal (a link to share once)","description":"Uses the partner’s phone (or email). Partner portal users take no paid seat.","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"share":{"type":"object","properties":{"message":{"type":"string"},"whatsapp_url":{"type":["string","null"]},"email_url":{"type":["string","null"]}},"required":["message","whatsapp_url","email_url"],"additionalProperties":false}},"required":["url","expires_at","share"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.create"}},"/api/v1/partners/{id}/kyc-shares":{"get":{"operationId":"listPartnerKycShares","summary":"KYC a partner shared from other builders","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PartnerKycShare"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.view"}},"/api/v1/partners/{id}/ledger":{"get":{"operationId":"getPartnerLedger","summary":"A partner’s ledger: brokerage owed, the incentive wallet and every line","tags":["Channel-partner brokerage"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"balances":{"type":"object","properties":{"brokerage":{"description":"Still owed to the partner (negative: a clawback they owe).","$ref":"#/components/schemas/Paise"},"incentive":{"description":"The visit-incentive wallet.","$ref":"#/components/schemas/Paise"}},"required":["brokerage","incentive"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"account":{"type":"string","enum":["brokerage","incentive"]},"kind":{"type":"string"},"label":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"booking_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"invoice_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","account","kind","label","amount","booking_id","invoice_id","note","created_at"],"additionalProperties":false}}},"required":["balances","lines"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"commissions.view"}},"/api/v1/payment-links/{id}/cancel":{"post":{"operationId":"cancelPaymentLink","summary":"Cancel a payment link","description":"Cancelled at the provider too; payments already received keep their receipts.","tags":["Payment links"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentLink"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/payment-links/{id}/send":{"post":{"operationId":"sendPaymentLink","summary":"Send a payment link to the payer","description":"Through the compliance-gated pipeline (consent, quiet hours, DLT); answers why when it is blocked.","tags":["Payment links"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"default":"auto","type":"string","enum":["auto","whatsapp_cloud","sms","email"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentLinkSendResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/payment-plans/{id}":{"patch":{"operationId":"updatePaymentPlan","summary":"Change a payment plan or switch it off (confirmed bookings keep their schedule)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["clp","down_payment","subvention","flexi","possession_linked","custom"]},"milestones":{"minItems":1,"maxItems":40,"type":"array","items":{"$ref":"#/components/schemas/PaymentMilestoneInput"}},"is_active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentPlan"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/pipelines":{"get":{"operationId":"listPipelines","summary":"Pipelines with statuses","description":"Every pipeline with its statuses and sub-statuses in order, switched-off ones included (flagged). Readable with settings.pipelines, settings.view or leads.view; lead counts only for settings access.","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PipelineDetail"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"post":{"operationId":"createPipeline","summary":"Create a pipeline","description":"Starts with a copy of another pipeline’s statuses, or a starter set (New, Follow-up, Won, Lost, Invalid).","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePipelineInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pipelines/reorder":{"post":{"operationId":"reorderPipelines","summary":"Reorder pipelines","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PipelineDetail"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pipelines/{id}":{"get":{"operationId":"getPipeline","summary":"A pipeline","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"patch":{"operationId":"updatePipeline","summary":"Rename a pipeline, change its lead types or make it the default","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePipelineInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"},"delete":{"operationId":"deletePipeline","summary":"Delete a pipeline","description":"Only a pipeline without leads (deleted leads count) that is not the default (409 otherwise).","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pipelines/{id}/statuses":{"post":{"operationId":"createPipelineStatus","summary":"Add a status","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePipelineStatusInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pipelines/{id}/statuses/reorder":{"post":{"operationId":"reorderPipelineStatuses","summary":"Reorder statuses","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pipelines/{id}/statuses/{statusId}":{"patch":{"operationId":"updatePipelineStatus","summary":"Change a status","description":"The key never changes. The default status cannot be switched off.","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"statusId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePipelineStatusInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"},"delete":{"operationId":"deletePipelineStatus","summary":"Delete a status","description":"Only a status no lead has had (409 otherwise — switch it off instead).","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"statusId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pipelines/{id}/statuses/{statusId}/sub-statuses":{"post":{"operationId":"createPipelineSubStatus","summary":"Add a sub-status","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"statusId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePipelineSubStatusInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pipelines/{id}/statuses/{statusId}/sub-statuses/reorder":{"post":{"operationId":"reorderPipelineSubStatuses","summary":"Reorder sub-statuses","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"statusId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pipelines/{id}/statuses/{statusId}/sub-statuses/{subId}":{"patch":{"operationId":"updatePipelineSubStatus","summary":"Change a sub-status","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"statusId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"subId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePipelineSubStatusInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"},"delete":{"operationId":"deletePipelineSubStatus","summary":"Delete a sub-status","description":"Only a sub-status no lead has had (409 otherwise — switch it off instead).","tags":["Pipelines"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"statusId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"subId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/pools":{"get":{"operationId":"listLeadPools","summary":"Lead pools with their counts","description":"“All unassigned leads” is always first. `mine` shows what you may still claim today.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadPool"}},"meta":{"type":"object","properties":{"can_claim":{"type":"boolean"},"can_give":{"type":"boolean"},"can_edit":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"description":"Active members you may give leads to."}},"required":["can_claim","can_give","can_edit","members"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["leads.claim","leads.assign","settings.lead_routing","settings.view"]},"put":{"operationId":"saveLeadPools","summary":"Save the pool definitions","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pools":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/LeadPoolInput"}}},"required":["pools"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadPoolDefinition"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/pools/{id}/claim":{"post":{"operationId":"claimPoolLead","summary":"Claim a lead from a pool","description":"A given lead, or the longest-waiting one. 409 when over the daily limit or capacity, or taken first.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"claimed_today":{"type":"integer","minimum":0,"maximum":9007199254740991},"remaining_today":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["lead_id","claimed_today","remaining_today"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.claim","x-idempotent":true}},"/api/v1/pools/{id}/give":{"post":{"operationId":"givePoolLeads","summary":"Give members leads from a pool","description":"Each member gets up to `count` random leads (never beyond their open-lead capacity).","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member_ids":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"count":{"type":"integer","minimum":1,"maximum":500},"fresh_only":{"type":"boolean"}},"required":["member_ids","count"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"given":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["member_id","count"],"additionalProperties":false}},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"short":{"type":"boolean"}},"required":["given","total","short"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.assign","x-idempotent":true}},"/api/v1/pools/{id}/leads":{"get":{"operationId":"listLeadPoolLeads","summary":"Leads waiting in a pool","description":"Longest waiting first. Phone numbers are never included.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadPoolLead"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.claim"}},"/api/v1/portal-referrals":{"get":{"operationId":"listPortalReferrals","summary":"Referrals from the customer portal","description":"Newest first, with the lead each became and who referred it; keyset pagination.","tags":["Customer portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PortalReferral"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/post-sales/bookings/{id}/registration":{"post":{"operationId":"registerPostSalesBooking","summary":"Record that a booking’s agreement was registered","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["bookings:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"on":{"$ref":"#/components/schemas/LocalDate"}},"required":["on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"registered"},"registration_date":{"$ref":"#/components/schemas/LocalDate"}},"required":["id","status","registration_date"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"bookings.edit"}},"/api/v1/post-sales/files":{"get":{"operationId":"listPostSalesFiles","summary":"In-flight post-sales files (bookings, resale and rental deals)","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read","bookings:read"]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["new_booking","resale","rental"]}},{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"unit_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"owner_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"stage","in":"query","required":false,"schema":{"type":"string","enum":["token","agreement","registration","handover","completed"]}},{"name":"stuck_days","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":3650}},{"name":"loan_required","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"documents_pending","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"brokerage_due","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"include_completed","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PostSalesFile"}},"meta":{"type":"object","properties":{"truncated":{"type":"boolean"}},"required":["truncated"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.view","bookings.view"]}},"/api/v1/post-sales/files/{type}/{id}":{"get":{"operationId":"getPostSalesFile","summary":"One post-sales file","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read","bookings:read"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesFile"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.view","bookings.view"]}},"/api/v1/post-sales/files/{type}/{id}/checklist":{"get":{"operationId":"getPostSalesChecklist","summary":"The document checklist of a file","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read","bookings:read"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesChecklist"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.view","bookings.view"]}},"/api/v1/post-sales/files/{type}/{id}/checklist/remind":{"post":{"operationId":"remindPostSalesDocuments","summary":"Remind the customer about missing required documents","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"queued"},"message_id":{"$ref":"#/components/schemas/Id"},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status","message_id","items"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"blocked"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["status","reasons"],"additionalProperties":false}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/post-sales/files/{type}/{id}/checklist/{key}/review":{"post":{"operationId":"reviewPostSalesDocument","summary":"Verify, reject (with a reason) or reset a checklist item","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["verify","reject","reset"]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesChecklist"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/post-sales/files/{type}/{id}/checklist/{key}/upload":{"post":{"operationId":"uploadPostSalesDocument","summary":"File an uploaded document against a checklist item","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":52428800},"key":{"type":"string","minLength":10,"maxLength":500},"id_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"applicant_id":{"description":"A booking’s personal item (income proof, ITR, bank papers, KYC): whose it is; default the primary applicant.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["filename","content_type","size","key"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesChecklist"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/post-sales/files/{type}/{id}/handover":{"get":{"operationId":"getPostSalesHandover","summary":"The possession / move-in handover of a file","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read","bookings:read"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesHandover"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.view","bookings.view"]},"patch":{"operationId":"updatePostSalesHandover","summary":"Update the handover checklist (keys, meters, day, notes)","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keys_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"keys_note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"meters":{"type":"object","properties":{"electricity":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"water":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"gas":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]}}},"handover_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesHandover"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/post-sales/files/{type}/{id}/handover/acceptance":{"post":{"operationId":"attachHandoverAcceptance","summary":"File the signed possession acceptance / move-in letter","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":52428800},"key":{"type":"string","minLength":10,"maxLength":500}},"required":["filename","content_type","size","key"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesHandover"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/post-sales/files/{type}/{id}/handover/complete":{"post":{"operationId":"completePostSalesHandover","summary":"Complete the handover (a blocked gate needs the override permission and a reason)","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"handover_date":{"$ref":"#/components/schemas/LocalDate"},"override_reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["handover_date"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesHandover"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/post-sales/files/{type}/{id}/handover/snags":{"post":{"operationId":"addHandoverSnag","summary":"Log a snag with photos","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":2,"maxLength":300},"location":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"photos":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":52428800},"key":{"type":"string","minLength":10,"maxLength":500}},"required":["filename","content_type","size","key"]}}},"required":["description"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesHandover"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/post-sales/files/{type}/{id}/handover/snags/{snagId}":{"patch":{"operationId":"updateHandoverSnag","summary":"Resolve or reopen a snag","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"snagId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"resolved":{"type":"boolean"}},"required":["resolved"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesHandover"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/post-sales/files/{type}/{id}/handover/snags/{snagId}/photos/{index}":{"get":{"operationId":"getHandoverSnagPhoto","summary":"A 60-second signed URL of a snag photo","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read","bookings:read"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"snagId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":5}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.view","bookings.view"]}},"/api/v1/post-sales/files/{type}/{id}/uploads/presign":{"post":{"operationId":"presignPostSalesUpload","summary":"Presign a private upload for a file (checklist document, acceptance letter, snag photo)","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write","bookings:write"]}],"parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["deal","booking"]}},{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":52428800},"item_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["filename","content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"},"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","url","method","headers","expires_at","max_bytes"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.edit","bookings.edit"]}},"/api/v1/price-lists/{id}":{"patch":{"operationId":"updatePriceList","summary":"Edit a draft price list (published versions are frozen: 409)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"template_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string","minLength":1,"maxLength":80},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"rates":{"$ref":"#/components/schemas/PriceRatesInput"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceList"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"},"delete":{"operationId":"deletePriceList","summary":"Delete a draft price list","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/price-lists/{id}/archive":{"post":{"operationId":"archivePriceList","summary":"Withdraw a published version from new cost sheets (sheets quoted on it keep it)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceList"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/price-lists/{id}/publish":{"post":{"operationId":"publishPriceList","summary":"Publish a draft from its effective date (today or later); its rates and template config freeze","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceList"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/pricing/stamp-duty-states":{"get":{"operationId":"listStampDutyStates","summary":"Stamp duty and registration estimates by state (unverified starting points)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string"},"name":{"type":"string"},"stamp_duty_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registration_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registration_cap":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"note":{"type":"string"}},"required":["state","name","stamp_duty_bp","registration_bp","registration_cap","note"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["projects.pricing","units.cost_sheet"]}},"/api/v1/privacy/audit-logs":{"get":{"operationId":"listAuditLogs","summary":"The audit log","description":"Newest first; values in diffs follow your field rules (masked numbers stay masked).","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"actor","in":"query","required":false,"description":"A member id, or `system`.","schema":{"type":"string","maxLength":64}},{"name":"action","in":"query","required":false,"schema":{"type":"string","maxLength":32}},{"name":"entity_type","in":"query","required":false,"schema":{"type":"string","maxLength":32}},{"name":"entity_id","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"from","in":"query","required":false,"description":"YYYY-MM-DD, company calendar, inclusive.","schema":{"type":"string","maxLength":10}},{"name":"to","in":"query","required":false,"description":"YYYY-MM-DD, company calendar, inclusive.","schema":{"type":"string","maxLength":10}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogEntry"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.audit_log"}},"/api/v1/privacy/audit-logs/export":{"get":{"operationId":"exportAuditLogs","summary":"Export the filtered audit log as CSV","description":"Watermarked with your name; at most 10,000 entries (narrow the dates otherwise); audited.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"actor","in":"query","required":false,"description":"A member id, or `system`.","schema":{"type":"string","maxLength":64}},{"name":"action","in":"query","required":false,"schema":{"type":"string","maxLength":32}},{"name":"entity_type","in":"query","required":false,"schema":{"type":"string","maxLength":32}},{"name":"entity_id","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"from","in":"query","required":false,"description":"YYYY-MM-DD, company calendar, inclusive.","schema":{"type":"string","maxLength":10}},{"name":"to","in":"query","required":false,"description":"YYYY-MM-DD, company calendar, inclusive.","schema":{"type":"string","maxLength":10}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.audit_log"}},"/api/v1/privacy/audit-logs/options":{"get":{"operationId":"getAuditLogOptions","summary":"Values for the audit log filters","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"actions":{"type":"array","items":{"type":"string"}},"entity_types":{"type":"array","items":{"type":"string"}}},"required":["members","actions","entity_types"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.audit_log"}},"/api/v1/privacy/audit-logs/{id}":{"get":{"operationId":"getAuditLog","summary":"One audit entry with its diff","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AuditLogEntry"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.audit_log"}},"/api/v1/privacy/company-exports":{"get":{"operationId":"listCompanyExports","summary":"Full company exports","description":"The company owner only.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CompanyExport"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"imports_exports.full_export"},"post":{"operationId":"requestCompanyExport","summary":"Export all company data","description":"CSV + JSON per table and an index of stored files; the owner is notified when it is ready (24 h links).","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyExport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"imports_exports.full_export"}},"/api/v1/privacy/company-exports/{id}":{"get":{"operationId":"downloadCompanyExport","summary":"Download links of a finished company export","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyExportDownload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"imports_exports.full_export"}},"/api/v1/privacy/holds":{"get":{"operationId":"listLegalHolds","summary":"Legal holds","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","released","all"]}},{"name":"contact_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegalHold"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.retention"},"post":{"operationId":"placeLegalHold","summary":"Place a legal hold","description":"A hold on a contact, lead or deal protects everything of that person from purges and erasure.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_type":{"$ref":"#/components/schemas/LegalHoldEntity"},"entity_id":{"$ref":"#/components/schemas/Id"},"reason":{"type":"string","minLength":3,"maxLength":500},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["entity_type","entity_id","reason"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LegalHold"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.retention"}},"/api/v1/privacy/holds/{id}/release":{"post":{"operationId":"releaseLegalHold","summary":"Release a legal hold","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LegalHold"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.retention"}},"/api/v1/privacy/notices":{"get":{"operationId":"listPrivacyNotices","summary":"Privacy notices with their publish history","description":"Needs `settings.communication` or `privacy.requests`.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PrivacyNotice"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","privacy.requests"]},"post":{"operationId":"createPrivacyNotice","summary":"Start the next version of a notice (draft)","description":"One draft per purpose and language; publishing makes it the version in force.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"$ref":"#/components/schemas/NoticePurpose"},"language":{"$ref":"#/components/schemas/NoticeLanguage"},"title":{"type":"string","minLength":3,"maxLength":200},"body":{"type":"string","maxLength":20000}},"required":["purpose","language","title","body"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivacyNotice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","privacy.requests"]}},"/api/v1/privacy/notices/{id}":{"patch":{"operationId":"updatePrivacyNotice","summary":"Edit a draft notice","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":200},"body":{"type":"string","maxLength":20000}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivacyNotice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","privacy.requests"]},"delete":{"operationId":"deletePrivacyNotice","summary":"Delete a draft notice","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","privacy.requests"]}},"/api/v1/privacy/notices/{id}/publish":{"post":{"operationId":"publishPrivacyNotice","summary":"Publish a draft notice","description":"The previous published version of the same purpose and language is retired.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivacyNotice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","privacy.requests"]}},"/api/v1/privacy/notices/{id}/retire":{"post":{"operationId":"retirePrivacyNotice","summary":"Take a published notice down","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivacyNotice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","privacy.requests"]}},"/api/v1/privacy/requests":{"get":{"operationId":"listRightsRequests","summary":"DPDP rights requests","description":"Newest first. `view=open|overdue|closed`; `q` matches the requester, phone, email or R-number.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["open","overdue","closed","all"]}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RightsStatus"}},{"name":"kind","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RightsKind"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RightsRequestListItem"}},"meta":{"type":"object","properties":{"next_cursor":{"description":"Opaque cursor of the next page; null on the last page.","type":["string","null"]},"has_more":{"type":"boolean"},"summary":{"type":"object","properties":{"open":{"type":"number"},"overdue":{"type":"number"},"due_soon":{"type":"number"},"closed_90d":{"type":"number"}},"required":["open","overdue","due_soon","closed_90d"],"additionalProperties":false}},"required":["next_cursor","has_more","summary"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"},"post":{"operationId":"createRightsRequest","summary":"Record a request received offline","description":"For requests by phone, letter or in person; note how the person’s identity was checked.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/RightsKind"},"requester_name":{"type":"string","minLength":2,"maxLength":120},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"details":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"nominee":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"relationship":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"contact":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["name"]},{"type":"null"}]},"identity_note":{"type":"string","minLength":5,"maxLength":500}},"required":["kind","requester_name","identity_note"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RightsRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"}},"/api/v1/privacy/requests/intake":{"get":{"operationId":"getRightsIntake","summary":"The public request link and its QR code","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"notice_url":{"type":"string"},"qr_svg":{"type":"string","description":"data:image/svg+xml URL of the QR code."}},"required":["url","notice_url","qr_svg"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"}},"/api/v1/privacy/requests/{id}":{"get":{"operationId":"getRightsRequest","summary":"A rights request with its timeline","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RightsRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"},"patch":{"operationId":"updateRightsRequest","summary":"Assign, confirm contacts, answer or close a request","description":"Closing (completed / rejected) needs a resolution — the answer given to the person.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/RightsStatus"},"assignee_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"resolution":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"contact_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"subprocessor":{"type":"object","properties":{"key":{"type":"string","maxLength":40},"done":{"type":"boolean"}},"required":["key","done"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RightsRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"}},"/api/v1/privacy/requests/{id}/access-report":{"get":{"operationId":"downloadAccessReport","summary":"Download the access report","description":"Redirects (302) to a 5-minute link; with `Accept: application/json` the link comes back instead.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"filename":{"type":"string"}},"required":["url","expires_at","filename"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"302":{"description":"Redirect to the report.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"},"post":{"operationId":"generateAccessReport","summary":"Generate the access report","description":"Queued; the handler is notified when the JSON report is ready.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RightsRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"}},"/api/v1/privacy/requests/{id}/correction":{"post":{"operationId":"applyRightsCorrection","summary":"Apply a correction to a contact","description":"Before / after values go to the audit log. Phones are changed on the contact page.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"changes":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"first_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"alt_email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"occupation":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"employer":{"anyOf":[{"type":"string","maxLength":150},{"type":"null"}]},"designation":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"language":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]}}}},"required":["contact_id","changes"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RightsRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"}},"/api/v1/privacy/requests/{id}/erase":{"post":{"operationId":"eraseRightsRequest","summary":"Erase the person’s data","description":"Queues the erasure cascade (contacts, leads, message bodies, media, AI links, storage objects); statutory records are kept with personal fields masked, the addresses are suppressed and a tombstone is recorded. Refused (409) while a legal hold covers the person.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RightsRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"}},"/api/v1/privacy/requests/{id}/notes":{"post":{"operationId":"addRightsRequestNote","summary":"Add a case note","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["text"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RightsRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.requests"}},"/api/v1/privacy/retention":{"get":{"operationId":"listRetentionPolicies","summary":"Retention policies","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RetentionPolicy"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.retention"},"put":{"operationId":"updateRetentionPolicies","summary":"Set retention periods and switch policies on or off","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"policies":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/RetentionKind"},"keep_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"}},"required":["kind","keep_days","enabled"]}}},"required":["policies"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RetentionPolicy"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.retention"}},"/api/v1/privacy/retention/preview":{"get":{"operationId":"previewRetention","summary":"Dry run: what each policy would purge now","description":"Optional `<kind>=<days>` query values preview periods before saving them.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"invalid_leads","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"lost_leads","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"message_bodies","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"call_recordings","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"ingest_payloads","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"synced_emails","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"field_locations","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"attendance_selfies","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"inventory_messages","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"debrief_audio","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"kyc_artifacts","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RetentionPreview"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.retention"}},"/api/v1/privacy/retention/run":{"post":{"operationId":"runRetention","summary":"Run the enabled policies now","description":"Queued; the purge runs in batches and each policy keeps its last run report.","tags":["Data & privacy"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean","const":true}},"required":["queued"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.retention"}},"/api/v1/project-updates/{id}":{"patch":{"operationId":"updateProjectUpdate","summary":"Edit or publish a construction update","tags":["Customer portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":160},"body":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"progress_pct":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"publish":{"default":false,"description":"Publish now: buyers with a booking in the project see it.","type":"boolean"}},"required":["title"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectUpdate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.edit"},"delete":{"operationId":"deleteProjectUpdate","summary":"Delete a construction update","tags":["Customer portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.edit"}},"/api/v1/projects":{"get":{"operationId":"listProjects","summary":"List projects","description":"Filters: status, developer_id, locality_id, published; `q` searches names and RERA numbers.","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ProjectStatus"}},{"name":"developer_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"locality_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"published","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectSummary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.view"},"post":{"operationId":"createProject","summary":"Add a project","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.edit","x-idempotent":true}},"/api/v1/projects/developers":{"get":{"operationId":"listDevelopers","summary":"Developers","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:read"]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Developer"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.view"},"post":{"operationId":"createDeveloper","summary":"Add a developer","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Developer"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.edit"}},"/api/v1/projects/developers/{developerId}":{"patch":{"operationId":"updateDeveloper","summary":"Update a developer","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:write"]}],"parameters":[{"name":"developerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"website":{"anyOf":[{"type":"string","maxLength":300,"format":"uri"},{"type":"null"}]},"rera_promoter_numbers":{"maxItems":20,"type":"array","items":{"type":"string","minLength":3,"maxLength":80}},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Developer"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.edit"}},"/api/v1/projects/{id}":{"get":{"operationId":"getProject","summary":"A project","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.view"},"patch":{"operationId":"updateProject","summary":"Update a project","description":"Publishing (is_published) needs projects.publish.","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.edit"},"delete":{"operationId":"deleteProject","summary":"Archive a project","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.delete"}},"/api/v1/projects/{id}/availability":{"get":{"operationId":"getInventoryAvailability","summary":"Inventory availability by tower and configuration","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryAvailability"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"}},"/api/v1/projects/{id}/charge-templates":{"get":{"operationId":"listChargeTemplates","summary":"Charge templates of a project","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChargeTemplate"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["projects.pricing","units.cost_sheet"]},"post":{"operationId":"createChargeTemplate","summary":"Add a charge template (the starter set with the state’s estimate when no config is sent)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"config":{"$ref":"#/components/schemas/ChargeTemplateConfigInput"},"is_default":{"type":"boolean"}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChargeTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/projects/{id}/completion":{"get":{"operationId":"getProjectCompletion","summary":"Completion / occupancy certificate dates of a project and its towers","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectCompletion"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.view"},"put":{"operationId":"recordProjectCompletion","summary":"Record (or clear) the completion / occupancy certificate date of a tower or the whole project","description":"BLD-10: cost sheets priced from that day carry the ready-flat GST; demands from that day follow the company’s gst_after_cc setting. Audited.","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"cc_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["cc_on"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectCompletion"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/projects/{id}/configurations":{"post":{"operationId":"addProjectConfiguration","summary":"Add a configuration","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectConfigurationInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.edit"}},"/api/v1/projects/{id}/configurations/{configurationId}":{"patch":{"operationId":"updateProjectConfiguration","summary":"Update a configuration","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"configurationId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"examples":["3 BHK Premium"]},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"carpet_min":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]},"carpet_max":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]},"super_min":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]},"super_max":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]},"area_unit":{"default":"sqft","$ref":"#/components/schemas/AreaUnit"},"price_min":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"units_total":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"units_available":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.edit"},"delete":{"operationId":"deleteProjectConfiguration","summary":"Remove a configuration","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"configurationId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.edit"}},"/api/v1/projects/{id}/construction-stages":{"get":{"operationId":"listConstructionStages","summary":"Construction stages certified for a project","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConstructionStage"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.view"},"post":{"operationId":"certifyConstructionStage","summary":"Certify a stage: every allotted booking’s instalments linked to it fall due and are demanded","description":"BLD-03: with tower_id only that tower’s bookings are dated and demanded (CLP milestones are per tower); without it the whole project. A stage is certified per tower or for the whole project, never both.","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"type":"string","pattern":"^[a-z0-9_]{1,40}$"},"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"certified_on":{"$ref":"#/components/schemas/LocalDate"},"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"certificate_ref":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["stage","certified_on"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/ConstructionStage"},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"demands":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["stage","bookings","demands"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.demand"}},"/api/v1/projects/{id}/construction-stages/preview":{"get":{"operationId":"previewConstructionStage","summary":"How many allotted bookings (and instalments) certifying a stage would demand — before certifying","tags":["Collections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"stage","in":"query","required":true,"schema":{"type":"string","pattern":"^[a-z0-9_]{1,40}$"}},{"name":"tower_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instalments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["bookings","instalments"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"receipts.demand"}},"/api/v1/projects/{id}/inventory-items":{"get":{"operationId":"listInventoryItems","summary":"Parking and storerooms of a project","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"kind","in":"query","required":false,"schema":{"$ref":"#/components/schemas/InventoryItemKind"}},{"name":"unallocated","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryItem"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"},"post":{"operationId":"createInventoryItems","summary":"Add a range of parking slots or storerooms (existing codes are skipped)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/InventoryItemKind"},"range":{"type":"object","properties":{"prefix":{"type":"string","maxLength":20},"from":{"type":"integer","minimum":0,"maximum":9007199254740991},"to":{"type":"integer","minimum":0,"maximum":9007199254740991},"pad":{"type":"integer","minimum":0,"maximum":6},"suffix":{"type":"string","maxLength":10}},"required":["prefix","from","to"]},"parking_type":{"anyOf":[{"$ref":"#/components/schemas/ParkingType"},{"type":"null"}]},"level":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":100000},{"type":"null"}]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}},"required":["kind","range"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["created","skipped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/inventory-items/{itemId}":{"patch":{"operationId":"updateInventoryItem","summary":"Edit a parking slot or storeroom","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"itemId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parking_type":{"anyOf":[{"$ref":"#/components/schemas/ParkingType"},{"type":"null"}]},"level":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":100000},{"type":"null"}]},"price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryItem"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"},"delete":{"operationId":"deleteInventoryItem","summary":"Remove a parking slot or storeroom (refused while held, booked or sold)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"itemId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"}},"required":["id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/inventory-items/{itemId}/allocation":{"post":{"operationId":"allocateInventoryItem","summary":"Allocate to a unit (or take off one with unit_id null)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"itemId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["unit_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryItem"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/inventory-items/{itemId}/hold":{"post":{"operationId":"holdInventoryItem","summary":"Hold a parking slot or storeroom sold on its own","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"itemId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitHoldInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitHold"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.hold"}},"/api/v1/projects/{id}/lead-capture":{"get":{"operationId":"getProjectLeadCapture","summary":"Where a project’s leads come from","description":"Meta lead forms mapped to the project (Settings → Integrations → Meta), hosted forms that tag it and lead sources whose default project it is (CMP-01).","tags":["Projects"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["projects:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectLeadCapture"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"projects.view"}},"/api/v1/projects/{id}/payment-plans":{"get":{"operationId":"listPaymentPlans","summary":"Payment plans of a project","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentPlan"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["projects.pricing","bookings.create","units.cost_sheet"]},"post":{"operationId":"createPaymentPlan","summary":"Add a payment plan (milestones add up to exactly 100 %)","tags":["Bookings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["clp","down_payment","subvention","flexi","possession_linked","custom"]},"milestones":{"minItems":1,"maxItems":40,"type":"array","items":{"$ref":"#/components/schemas/PaymentMilestoneInput"}}},"required":["name","type","milestones"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentPlan"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/projects/{id}/price-lists":{"get":{"operationId":"listPriceLists","summary":"Price-list versions of a project, newest first","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceList"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["projects.pricing","units.cost_sheet"]},"post":{"operationId":"createPriceList","summary":"Draft the next price-list version (copied from the latest unless rates are sent)","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"template_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string","minLength":1,"maxLength":80},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"rates":{"$ref":"#/components/schemas/PriceRatesInput"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"copy_from_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceList"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/projects/{id}/releases":{"get":{"operationId":"listUnitReleases","summary":"Release phases of a project","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UnitRelease"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"},"post":{"operationId":"createUnitRelease","summary":"Plan a release phase","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitRelease"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/releases/{releaseId}/release":{"post":{"operationId":"releaseUnitPhase","summary":"Put a planned phase on sale","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"releaseId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"status":{"type":"string","enum":["planned","released"]},"notes":{"type":["string","null"]},"released_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"units_released":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","project_id","name","status","notes","released_at","created_at","units","units_released"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/releases/{releaseId}/units":{"post":{"operationId":"assignUnitsToRelease","summary":"Put units into a phase (live units are refused)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"releaseId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unit_ids":{"minItems":1,"maxItems":2000,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["unit_ids"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refused":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"reason":{"type":"string"}},"required":["id","reason"],"additionalProperties":false}}},"required":["added","refused"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/releases/{releaseId}/withdraw":{"post":{"operationId":"withdrawUnitPhase","summary":"Take a phase off sale (only units nobody is working on)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"releaseId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"withdrawn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kept":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["withdrawn","kept"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/towers":{"get":{"operationId":"listTowers","summary":"Towers of a project with unit counts per status","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tower"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"},"post":{"operationId":"createTower","summary":"Add a tower (optionally laying out its units)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTowerInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"floors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basement_levels":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"units_per_floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stage":{"type":["string","null"]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"units_total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"units_by_status":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"generated":{"anyOf":[{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["created","skipped"],"additionalProperties":false},{"type":"null"}]}},"required":["id","project_id","name","floors","basement_levels","units_per_floor","stage","possession_date","sort_order","units_total","units_by_status","generated"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/towers/{towerId}":{"patch":{"operationId":"updateTower","summary":"Edit a tower","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"towerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTowerInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Tower"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"},"delete":{"operationId":"deleteTower","summary":"Remove a tower and its units (refused while any is held, booked or sold)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"towerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"units_removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","units_removed"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/towers/{towerId}/grid":{"get":{"operationId":"getTowerGrid","summary":"The tower grid: floors × stacks with every unit","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"towerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitGrid"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"}},"/api/v1/projects/{id}/towers/{towerId}/units":{"post":{"operationId":"createUnit","summary":"Add one unit to a tower","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"towerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUnitInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Unit"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/towers/{towerId}/units/generate":{"post":{"operationId":"generateTowerUnits","summary":"Lay out units by a numbering scheme (existing numbers are kept)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"towerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"numbering":{"type":"object","properties":{"floor_from":{"type":"integer","minimum":-5,"maximum":200},"floor_to":{"type":"integer","minimum":-5,"maximum":200},"units_per_floor":{"type":"integer","minimum":1,"maximum":50},"prefix":{"type":"string","maxLength":10},"stack_digits":{"type":"integer","minimum":1,"maximum":3},"skip_floors":{"maxItems":50,"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"ground":{"type":"string","enum":["0","G"]}},"required":["floor_from","floor_to","units_per_floor"]},"defaults":{"type":"object","properties":{"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"carpet_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"super_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"base_rate":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"status":{"type":"string","enum":["available","not_released"]}}}},"required":["numbering"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["created","skipped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/units":{"get":{"operationId":"listUnits","summary":"Units of a project (the grid’s list view), filtered","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"tower_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/UnitStatus"}}},{"name":"configuration_id","in":"query","required":false,"schema":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},{"name":"facing","in":"query","required":false,"schema":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Facing"}}},{"name":"floor_min","in":"query","required":false,"schema":{"type":"integer","minimum":-10,"maximum":200}},{"name":"floor_max","in":"query","required":false,"schema":{"type":"integer","minimum":-10,"maximum":200}},{"name":"price_min","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"price_max","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":30}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"truncated":{"type":"boolean"}},"required":["units","truncated"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"}},"/api/v1/projects/{id}/units/bulk-status":{"post":{"operationId":"bulkUnitStatus","summary":"Block, unblock or hold back many units (live units are skipped)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unit_ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"status":{"type":"string","enum":["blocked","available","not_released"]},"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["unit_ids","status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"changed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"},"reason":{"type":"string"}},"required":["id","unit_no","reason"],"additionalProperties":false}}},"required":["changed","skipped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/units/import":{"post":{"operationId":"importUnits","summary":"Import units from the builder’s sheet (dry run, then apply)","description":"multipart/form-data: `file` (CSV / XLSX, ≤ 5 MB, ≤ 5,000 rows), `mode` (`dry_run` — the default — or `apply`) and an optional `mapping` (JSON: field → column index; the dry run suggests one). Applying upserts by tower + unit number, so re-importing the same sheet changes nothing; held, booked and sold units keep their status.","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/UnitImportPreview"},{"$ref":"#/components/schemas/UnitImportResult"}]},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/units/{unitId}":{"get":{"operationId":"getUnit","summary":"One unit with its hold history and parking","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"unitId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"},"patch":{"operationId":"updateUnit","summary":"Edit a unit (prices need units.price_edit)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"unitId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUnitInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Unit"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"},"delete":{"operationId":"deleteUnit","summary":"Remove a unit (refused while held, booked, sold or linked to a deal)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"unitId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"}},"required":["id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/units/{unitId}/hold":{"post":{"operationId":"holdUnit","summary":"Hold an available unit (atomic; 409 when someone else got it first)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"unitId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitHoldInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitHold"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.hold"}},"/api/v1/projects/{id}/units/{unitId}/status":{"post":{"operationId":"changeUnitStatus","summary":"Change a unit’s status by hand (blocking needs a reason; booking converts a hold)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"unitId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["available","blocked","booked","sold","not_released","landowner_share","mortgaged"]},"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Unit"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.edit"}},"/api/v1/projects/{id}/updates":{"get":{"operationId":"listProjectUpdates","summary":"Construction updates of a project","tags":["Customer portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectUpdate"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.view"},"post":{"operationId":"createProjectUpdate","summary":"Post a construction update","description":"A draft, or published at once (`project_update.published` for automations).","tags":["Customer portal"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":160},"body":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"progress_pct":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"publish":{"default":false,"description":"Publish now: buyers with a booking in the project see it.","type":"boolean"}},"required":["title"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectUpdate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.edit"}},"/api/v1/properties":{"get":{"operationId":"listProperties","summary":"List listings","description":"Keyset-paginated listings within the caller’s view scope. `filter` takes the shared filter DSL over PROPERTY_FILTER_FIELDS, `q` searches the title, society and P- reference; `near_*`/`radius_m` or `polygon` narrow by map area (PostGIS). Sort keys: created_at, updated_at, price, rent_amount, area_sqft (- for descending).","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"filter","in":"query","required":false,"description":"Filter tree ({ all | any | not | field/op/value }) as JSON or base64url(JSON).","schema":{"type":"string","maxLength":20000}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"near_lat","in":"query","required":false,"schema":{"type":"number","minimum":-90,"maximum":90}},{"name":"near_lng","in":"query","required":false,"schema":{"type":"number","minimum":-180,"maximum":180}},{"name":"radius_m","in":"query","required":false,"schema":{"type":"integer","minimum":50,"maximum":100000}},{"name":"polygon","in":"query","required":false,"description":"JSON array of [lng, lat] pairs (3–200 points), or base64url of it.","schema":{"type":"string","maxLength":20000}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PropertySummary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"},"post":{"operationId":"createProperty","summary":"Create a listing","description":"Creates a draft (or an active listing when complete). The P- reference is allocated per company.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePropertyInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PropertyDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.create","x-idempotent":true}},"/api/v1/properties/amenities":{"get":{"operationId":"listAmenities","summary":"Amenities","description":"Global amenities plus the company’s own, in display order.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AmenityRef"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"}},"/api/v1/properties/bulk/status":{"post":{"operationId":"bulkChangePropertyStatus","summary":"Move several listings to a status","description":"Each listing is checked on its own; the response says which moved and why the others did not.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkPropertyStatusInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"updated":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"reason":{"type":"string"}},"required":["id","reason"],"additionalProperties":false}}},"required":["updated","skipped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.edit"}},"/api/v1/properties/from-lead":{"post":{"operationId":"draftPropertyFromLead","summary":"Draft a listing from an owner lead","description":"Owner acquisition (E6-04): a sell / let-out lead becomes a draft listing with its contact as the owner and the mandate terms; the lead is linked to the listing. Running it again returns the listing already linked.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"mandate":{"anyOf":[{"$ref":"#/components/schemas/MandateType"},{"type":"null"}]},"mandate_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"brokerage_from_owner":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}},"required":["lead_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PropertyDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.create","x-idempotent":true}},"/api/v1/properties/localities":{"get":{"operationId":"searchLocalities","summary":"Search localities","description":"The locality master (global + the company’s own), matched on name and aliases (\"HSR\", \"Bengaluru\").","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"ids","in":"query","required":false,"description":"Comma-separated ids to resolve (filters and saved views).","schema":{"type":"string","maxLength":2000}},{"name":"limit","in":"query","required":false,"schema":{"default":15,"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LocalityOption"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"}},"/api/v1/properties/map":{"get":{"operationId":"listPropertyMapPoints","summary":"Map points of listings","description":"Pinned listings matching the same filters as the list (up to 2,000 points; approximate pins ~100 m).","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"filter","in":"query","required":false,"description":"Filter tree ({ all | any | not | field/op/value }) as JSON or base64url(JSON).","schema":{"type":"string","maxLength":20000}},{"name":"q","in":"query","required":false,"description":"Free-text search.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"near_lat","in":"query","required":false,"schema":{"type":"number","minimum":-90,"maximum":90}},{"name":"near_lng","in":"query","required":false,"schema":{"type":"number","minimum":-180,"maximum":180}},{"name":"radius_m","in":"query","required":false,"schema":{"type":"integer","minimum":50,"maximum":100000}},{"name":"polygon","in":"query","required":false,"description":"JSON array of [lng, lat] pairs (3–200 points), or base64url of it.","schema":{"type":"string","maxLength":20000}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PropertyMapPoint"}},"meta":{"type":"object","properties":{"truncated":{"type":"boolean"}},"required":["truncated"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"}},"/api/v1/properties/views":{"get":{"operationId":"listPropertyViews","summary":"Saved views of the listings page","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PropertySavedView"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.view"},"post":{"operationId":"createPropertyView","summary":"Save a view","description":"Team views are visible to every member who can see listings.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropertySavedViewInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PropertySavedView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.view"}},"/api/v1/properties/views/{viewId}":{"patch":{"operationId":"updatePropertyView","summary":"Update a saved view","description":"Only its author changes a view.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"viewId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"visibility":{"default":"private","type":"string","enum":["private","team"]},"filters":{"description":"Filter tree (the shared filter DSL), or null."},"sort":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"layout":{"default":"table","type":"string","enum":["table","grid","map"]},"is_pinned":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PropertySavedView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.view"},"delete":{"operationId":"deletePropertyView","summary":"Delete a saved view","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"viewId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.view"}},"/api/v1/properties/{id}":{"get":{"operationId":"getProperty","summary":"A listing","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PropertyDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"},"patch":{"operationId":"updateProperty","summary":"Update a listing","description":"Price and rent changes are recorded (price history, property.price_changed).","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePropertyInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PropertyDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.edit"},"delete":{"operationId":"deleteProperty","summary":"Delete a listing","description":"Soft delete: the listing disappears from lists, matches and share pages (recoverable by support).","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.delete"}},"/api/v1/properties/{id}/freshness/confirm":{"post":{"operationId":"confirmListingAvailability","summary":"Mark availability confirmed with the owner","description":"After a call: the listing is fresh again (and no longer stale).","tags":["Listing freshness"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"verified_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","verified_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.edit"}},"/api/v1/properties/{id}/freshness/ping":{"post":{"operationId":"pingListingOwner","summary":"Ask the owner to confirm availability now","description":"Sends the tracked “still available?” link through the messaging pipeline (compliance gates apply).","tags":["Listing freshness"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerPingResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.edit"}},"/api/v1/properties/{id}/keys":{"get":{"operationId":"getPropertyKeyRegister","summary":"Key register of a listing","description":"Who holds the keys and every hand-over. Private like the owner details (field rule property.owner).","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KeyRegister"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"},"post":{"operationId":"recordPropertyKeyMovement","summary":"Record a key hand-over","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyMovementInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KeyRegister"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.edit"}},"/api/v1/properties/{id}/owner-report":{"get":{"operationId":"getListingOwnerReport","summary":"A listing’s owner report panel","description":"Links, the listing’s choices, curated lines, visit feedback to draft from and the reports sent.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingOwnerReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.edit"},"patch":{"operationId":"updateListingOwnerReport","summary":"Change a listing’s owner report choices","description":"Take the listing out of the periodic report, or choose the sections its owner sees (null: defaults).","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"digest_opt_out":{"type":"boolean"},"sections":{"anyOf":[{"type":"object","properties":{"price":{"type":"boolean"},"views":{"type":"boolean"},"enquiries":{"type":"boolean"},"visits":{"type":"boolean"},"feedback":{"type":"boolean"},"offers":{"type":"boolean"},"matches":{"type":"boolean"},"activity":{"type":"boolean"}}},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingOwnerReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.edit"}},"/api/v1/properties/{id}/owner-report/entries":{"post":{"operationId":"createOwnerReportEntry","summary":"Add a line for the owner","description":"Visit feedback in the agent’s words or an update (open house, price advice …); phone numbers and emails are masked.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["feedback","action"]},"action_kind":{"anyOf":[{"type":"string","enum":["open_house","price_advice","marketing","photos","note"]},{"type":"null"}]},"text":{"type":"string","minLength":1,"maxLength":560},"occurred_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string","enum":["draft","published"]},"visit_item_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["kind","text"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerReportEntry"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.edit"}},"/api/v1/properties/{id}/owner-report/preview":{"get":{"operationId":"previewOwnerReport","summary":"Preview the owner’s report","description":"Exactly what the owner sees: this listing, or (scope=owner) every listing of the owner.","tags":["Owner reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"scope","in":"query","required":false,"schema":{"default":"listing","type":"string","enum":["listing","owner"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerReportPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.edit"}},"/api/v1/properties/{id}/status":{"post":{"operationId":"changePropertyStatus","summary":"Move a listing to another status","description":"Allowed moves only (see allowed_statuses); activating needs a title, a city and a price or rent.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePropertyStatusInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PropertyDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.edit"}},"/api/v1/properties/{id}/syndication":{"get":{"operationId":"getListingSyndication","summary":"A listing on the portals","description":"Per portal: the account, the status on the portal (chip), the last error and sync, views / responses / leads, and the listing checked against the portal’s rules now (`issues`: errors block a publish, warnings do not). `history`: the last 20 exchanges.","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingSyndicationOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.view"},"post":{"operationId":"publishListingSyndication","summary":"Publish or update the listing on portals","description":"Queues a publish (or an update where the listing is already on the portal) per chosen portal. Every portal is checked first — account connected, the portal’s rules, a free package slot; if any is blocked nothing is queued and the 422 names the reason per portal in `fields`.","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portals":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"portal":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]},"price_display":{"type":"string","enum":["exact","on_request"]},"contact_mode":{"type":"string","enum":["agent","company"]}},"required":["portal"]}}},"required":["portals"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingSyndicationOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.publish"}},"/api/v1/properties/{id}/syndication/{portal}/deactivate":{"post":{"operationId":"deactivateListingSyndication","summary":"Take the listing down from a portal","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingSyndicationOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.publish"}},"/api/v1/properties/{id}/syndication/{portal}/retry":{"post":{"operationId":"retryListingSyndication","summary":"Send a failed portal request again","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingSyndicationOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.publish"}},"/api/v1/properties/{id}/timeline":{"get":{"operationId":"getPropertyTimeline","summary":"Timeline of a listing","description":"Status and price changes, shares and views, key movements and notes, newest first.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PropertyTimelineItem"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"}},"/api/v1/properties/{id}/verification":{"get":{"operationId":"getListingVerification","summary":"A listing’s badge, open verification and history","description":"Everyone who sees the listing gets its badge; the verifications need the verify or review permission.","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.view"},"post":{"operationId":"startListingVerification","summary":"Start (or continue) a verification visit","description":"Opens a verification with the company’s checklist and distance rule — or returns the open one (200).","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify"}},"/api/v1/properties/{id}/verification/revoke":{"post":{"operationId":"revokeListingBadge","summary":"Revoke a listing’s Verified badge","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.verify_review"}},"/api/v1/qr-codes":{"get":{"operationId":"listQrCodes","summary":"QR codes","description":"Newest first, with scan counts, the placement window and where each code leads now.","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"source_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"placement","in":"query","required":false,"schema":{"$ref":"#/components/schemas/QrPlacement"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/QrCode"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"},"post":{"operationId":"createQrCode","summary":"Create a QR code","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQrCode"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QrCode"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit","x-idempotent":true}},"/api/v1/qr-codes/stats":{"get":{"operationId":"getQrStats","summary":"QR placement analytics","description":"Per code for [from, to): people’s scans, unique devices, leads whose enquiries came through the code, and of those the leads with a site visit done and won. Aggregates only. Default: the last 30 days.","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"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","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QrStats"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"}},"/api/v1/qr-codes/{id}":{"get":{"operationId":"getQrCode","summary":"A QR code","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QrCode"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"},"patch":{"operationId":"updateQrCode","summary":"Update a QR code","description":"Name, attribution, validity window and target — printed codes follow the new target at once.","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQrCode"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QrCode"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"},"delete":{"operationId":"deleteQrCode","summary":"Delete a QR code","description":"Printed copies stop working.","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"}},"/api/v1/qr-codes/{id}/daily":{"get":{"operationId":"getQrDailyScans","summary":"Scans per day of a QR code","description":"Local days in the company time zone, today included; days without scans as 0.","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":180}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QrDailyScans"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"}},"/api/v1/qr-codes/{id}/image":{"get":{"operationId":"getQrCodeImage","summary":"The QR code as SVG or PNG","description":"Print-ready (quarter error correction, full quiet zone). `download=true` saves it as a file.","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"format","in":"query","required":false,"schema":{"default":"svg","type":"string","enum":["svg","png"]}},{"name":"size","in":"query","required":false,"description":"PNG width in pixels.","schema":{"default":1024,"type":"integer","minimum":128,"maximum":4096}},{"name":"download","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"image/svg+xml or image/png."}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"}},"/api/v1/qr-codes/{id}/sheet":{"get":{"operationId":"getQrCodeSheet","summary":"A printable sheet of the QR code (PDF)","description":"One page — A4, A5, A6 or a 24 × 36 inch standee — with a headline, the code (vector), its short link and a call to action, ready for the printer.","tags":["QR codes"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"size","in":"query","required":false,"schema":{"default":"a4","type":"string","enum":["a4","a5","a6","standee"]}},{"name":"headline","in":"query","required":false,"description":"Default: the code’s name.","schema":{"type":"string","maxLength":60}},{"name":"cta","in":"query","required":false,"description":"Default: “Scan to know more”.","schema":{"type":"string","maxLength":80}},{"name":"download","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf."}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"}},"/api/v1/quick-replies":{"get":{"operationId":"listQuickReplies","summary":"Quick replies","description":"The caller’s personal quick replies and the shared ones, by shortcut (a small list: no pagination).","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/QuickReply"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["inbox.reply","templates.view"]},"post":{"operationId":"createQuickReply","summary":"Add a quick reply","description":"`shared: true` makes it the team’s (needs `templates.edit`). A shortcut is unique per owner (409).","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQuickReplyInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QuickReply"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"}},"/api/v1/quick-replies/{id}":{"patch":{"operationId":"updateQuickReply","summary":"Edit a quick reply","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuickReplyInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QuickReply"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"},"delete":{"operationId":"deleteQuickReply","summary":"Delete a quick reply","tags":["Messaging"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.reply"}},"/api/v1/reactivation/programs":{"get":{"operationId":"listReactivationPrograms","summary":"Re-activation programmes","description":"Newest first, with live counts; keyset pagination.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","active","paused","stopped"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReactivationProgramListItem"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"},"post":{"operationId":"createReactivationProgram","summary":"Draft a re-activation programme","description":"The configuration may be partial: defaults fill the rest (lost or cold 30–365 days, 10 % hold-out).","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"config":{"$ref":"#/components/schemas/ReactivationConfig"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.create","x-idempotent":true}},"/api/v1/reactivation/programs/{id}":{"get":{"operationId":"getReactivationProgram","summary":"A re-activation programme","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"},"patch":{"operationId":"updateReactivationProgram","summary":"Change a draft or paused programme","description":"Send the whole configuration. A change to the audience, channels or messages after the first approval asks for a new approval of the next batch.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"config":{"$ref":"#/components/schemas/ReactivationConfig"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"},"delete":{"operationId":"deleteReactivationProgram","summary":"Delete a draft that never ran","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.delete"}},"/api/v1/reactivation/programs/{id}/attempts":{"get":{"operationId":"listReactivationAttempts","summary":"The live log of a programme","description":"Latest activity first; leads outside your lead scope are left out. Keyset pagination.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["holdout","pending","sent","replied","handed_off","skipped","closed"]}},{"name":"cohort","in":"query","required":false,"schema":{"type":"string","enum":["treatment","holdout","none"]}},{"name":"batch_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReactivationAttempt"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/reactivation/programs/{id}/batches/{batchId}":{"get":{"operationId":"getReactivationBatch","summary":"A day’s batch with sample first messages","description":"For the approval: the counts and up to 10 contacted-group leads (within your lead scope) with their message.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"batchId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"batch":{"$ref":"#/components/schemas/ReactivationBatch"},"samples":{"type":"array","items":{"$ref":"#/components/schemas/ReactivationMessagePreview"}}},"required":["batch","samples"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/reactivation/programs/{id}/batches/{batchId}/approve":{"post":{"operationId":"approveReactivationBatch","summary":"Approve the programme’s first batch","description":"The batch goes out within the sending window; later batches no longer wait for approval.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"batchId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/reactivation/programs/{id}/batches/{batchId}/reject":{"post":{"operationId":"rejectReactivationBatch","summary":"Send the first batch back","description":"Nobody in it is contacted or measured; the programme pauses until it is changed and resumed.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"batchId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/reactivation/programs/{id}/compliance":{"post":{"operationId":"checkReactivationCompliance","summary":"Run the AI compliance check of the programme’s messages","description":"Company rules, template categories and RERA numbers, then an AI review when needed. Mandatory before launch.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/reactivation/programs/{id}/compliance/override":{"post":{"operationId":"overrideReactivationCompliance","summary":"Override an AI-only compliance finding","description":"Only blocks raised by the AI review; never a company rule. Audited with the reason.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/reactivation/programs/{id}/export":{"get":{"operationId":"exportReactivationAttempts","summary":"Export the attempts as CSV","description":"Group, channel, legal basis, skip / close reasons and milestones of the leads your export scope reaches. Watermarked, formula-safe, audited; step-up for Owner/Admin roles.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.export"}},"/api/v1/reactivation/programs/{id}/launch":{"post":{"operationId":"launchReactivationProgram","summary":"Launch (or resume) a programme","description":"Checks the company switch, the templates (WhatsApp marketing, DLT promotional), the AI variables and a current passing compliance check. The day’s selection runs at once; its first batch waits for a manager’s approval.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/reactivation/programs/{id}/message-preview":{"post":{"operationId":"previewReactivationMessages","summary":"The first message for a few sample leads","description":"Writes the AI values live for up to 3 leads (metered on the AI wallet), checks them, renders the template and asks the messaging pipeline whether it would send now. Nothing is sent.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_ids":{"minItems":1,"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["lead_ids"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReactivationMessagePreview"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/reactivation/programs/{id}/pause":{"post":{"operationId":"pauseReactivationProgram","summary":"Pause a running programme","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"}},"/api/v1/reactivation/programs/{id}/preview":{"post":{"operationId":"previewReactivationAudience","summary":"Who the programme would pick today","description":"Counts by first lawful channel and legal basis, leads skipped for want of a lawful channel (by reason), exclusions, and a few sample leads within your lead scope. Nothing is written.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationPreview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/reactivation/programs/{id}/stats":{"get":{"operationId":"getReactivationStats","summary":"Funnel, lift against the hold-out group and cost","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationStats"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/reactivation/programs/{id}/stop":{"post":{"operationId":"stopReactivationProgram","summary":"Stop a programme for good","description":"Nothing more is picked or sent; replies in progress are still handled and measured.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationProgram"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/receipts":{"get":{"operationId":"listReceipts","summary":"List commission receipts","description":"Receipts of the deals in the caller’s scope, newest first. Sort keys: received_on, created_at, amount.","tags":["Receipts"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"deal_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ReceiptStatus"}},{"name":"mode","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaymentMode"}},{"name":"fy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Receipt"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.view"},"post":{"operationId":"recordReceipt","summary":"Record a commission receipt","description":"Needs edit rights on the deal and deal.commission in clear. The reference must fit the mode; the amount may not exceed what is still due. Updates the deal’s received commission.","tags":["Receipts"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordReceiptInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Receipt"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit","x-idempotent":true}},"/api/v1/receipts/{id}/status":{"post":{"operationId":"changeReceiptStatus","summary":"Clear, bounce or cancel a receipt","description":"Clearing needs deals.edit; a bounced cheque or a cancellation needs deals.approve.","tags":["Receipts"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeReceiptStatusInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Receipt"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.edit"}},"/api/v1/rent/instalments":{"get":{"operationId":"listRentInstalments","summary":"The Rent board","description":"Instalments of the agreements you may see, by due date (oldest first): open by default; filter by status, due month or agreement. Keyset pagination.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","due","overdue","partially_paid","paid","waived","all"]}},{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"agreement_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period_label":{"type":"string","description":"Nov 2026, or 12–30 Nov 2026 for a prorated period"},"period_start":{"$ref":"#/components/schemas/LocalDate"},"period_end":{"$ref":"#/components/schemas/LocalDate"},"due_on":{"$ref":"#/components/schemas/LocalDate"},"amount":{"$ref":"#/components/schemas/Paise"},"prorated":{"type":"boolean"},"late_fee":{"description":"Approved late fees (charged).","$ref":"#/components/schemas/Paise"},"paid":{"$ref":"#/components/schemas/Paise"},"outstanding":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["scheduled","due","overdue","partially_paid","paid","waived","cancelled"]},"waived_reason":{"type":["string","null"]},"late_fee_proposed":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["id","amount"],"additionalProperties":false},{"type":"null"}],"description":"A late fee waiting for approval (not charged yet)."},"agreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property":{"type":["string","null"]},"tenant":{"type":"string"},"landlord":{"type":"string"}},"required":["id","property","tenant","landlord"],"additionalProperties":false}},"required":["id","seq","period_label","period_start","period_end","due_on","amount","prorated","late_fee","paid","outstanding","status","waived_reason","late_fee_proposed","agreement"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.view"}},"/api/v1/rent/instalments/{id}/pay-link":{"post":{"operationId":"sendRentPayLink","summary":"Send the tenant the pay link","description":"Queues the pay link (UPI to the landlord’s own UPI id, then the UTR) through the messaging pipeline and returns the link to share by hand.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["queued","blocked"]},"reason":{"type":["string","null"]},"url":{"type":"string"}},"required":["status","reason","url"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rent/instalments/{id}/waive":{"post":{"operationId":"waiveRentInstalment","summary":"Waive an instalment","description":"An unpaid or part-paid instalment is waived with a reason; its open late-fee proposal goes with it.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"waived"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rent/late-fees/{id}/decision":{"post":{"operationId":"decideRentLateFee","summary":"Approve or waive a late fee","description":"An approved fee is charged with its instalment; a waiver needs a reason. Audited.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","waive"]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["approved","waived"]},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["id","status","amount"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.late_fees"}},"/api/v1/rent/payments/{id}/decision":{"post":{"operationId":"decideRentPayment","summary":"Confirm, reject or reverse a payment","description":"`confirm` / `reject` a tenant’s pending UTR claim (after checking the landlord’s statement); `reverse` a confirmed payment with a new reversal row (a bounced cheque, a wrong entry). Reasons are required for reject / reverse. Audited.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"confirm"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"reject"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]},{"type":"object","properties":{"action":{"type":"string","const":"reverse"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]}]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rent/payments/{id}/receipt":{"get":{"operationId":"getRentReceipt","summary":"A payment’s rent receipt (PDF)","description":"HRA-ready: landlord name and PAN (needed above ₹1,00,000 a year), tenant, period, amount in words.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.view"}},"/api/v1/rent/receipts/by-token/{token}":{"get":{"operationId":"getRentReceiptByToken","summary":"A rent receipt by its signed link","description":"The tenant’s link from the receipt message (180 days). Unknown, expired or reversed links answer 404.","tags":["Rent collection"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":20,"maxLength":300}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"}},"/api/v1/rent/summary":{"get":{"operationId":"getRentSummary","summary":"This month’s rent figures","description":"Due this month, overdue and collected (net of reversals) for a month (default: this month on the company clock), with the tenants’ UTR claims and the late fees waiting for a decision.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentSummary"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.view"}},"/api/v1/rental-agreements":{"get":{"operationId":"listRentalAgreements","summary":"List rental agreements","description":"Within the caller’s rentals scope (agreements of their rental deals for own / team). Sort keys: end_date (default), start_date, created_at, rent_amount.","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AgreementStatus"}},{"name":"expiring_within","in":"query","required":false,"description":"Active or expiring agreements ending within this many days.","schema":{"type":"integer","minimum":1,"maximum":365}},{"name":"property_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"deal_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RentalAgreement"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"},"post":{"operationId":"createRentalAgreement","summary":"Record a rental agreement","description":"Schedules the renewal reminders (T-60 / T-45 / T-30) from the end date.","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRentalAgreementInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalAgreement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.create","x-idempotent":true}},"/api/v1/rental-agreements/{id}":{"get":{"operationId":"getRentalAgreement","summary":"A rental agreement","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalAgreement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"},"patch":{"operationId":"updateRentalAgreement","summary":"Update a rental agreement","description":"A new end date (or reactivation) restarts the renewal reminders.","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRentalAgreementInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalAgreement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"},"delete":{"operationId":"deleteRentalAgreement","summary":"Delete a rental agreement","description":"Removes the record (the audit log keeps a copy). Prefer terminating an agreement that ran.","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.delete"}},"/api/v1/rental-agreements/{id}/agreement-document":{"get":{"operationId":"getAgreementDocument","summary":"The agreement document panel","description":"Templates that fit the state, the draft (fields, clauses with what changed, the rendered preview and what is missing), the stamp-duty estimate, e-stamp credits, the latest signing request and the registration.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementDocumentPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"},"post":{"operationId":"startAgreementDocument","summary":"Draft the agreement from a template","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAgreementDocumentInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementDocumentPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"},"patch":{"operationId":"updateAgreementDocument","summary":"Save the draft","description":"A new version. Not while a signing request is out (409).","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgreementDocumentInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementDocumentPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/agreement-document/cancel":{"post":{"operationId":"cancelAgreementSignature","summary":"Cancel the signing request","description":"Links stop working; an unattached stamp’s credit returns; the partner is told.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSignatureInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementDocumentPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/agreement-document/preview":{"get":{"operationId":"previewAgreementDocument","summary":"The draft as a PDF","description":"Watermarked “DRAFT”; every download is audited.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf."}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"}},"/api/v1/rental-agreements/{id}/agreement-document/registration":{"post":{"operationId":"startAgreementRegistration","summary":"Start the registration checklist","description":"Maharashtra’s online registration (IGR) or the Sub-Registrar: one task per step with due dates.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartRegistrationInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementDocumentPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"},"put":{"operationId":"recordAgreementRegistration","summary":"Record the registration number","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordRegistrationInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementDocumentPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/agreement-document/send":{"post":{"operationId":"sendAgreementForSignature","summary":"Send for e-stamp and Aadhaar e-sign","description":"Freezes the current version as a PDF, uses an e-stamp credit (402 when none is left), and queues the request for the partner; the signers get personal links in signing order. Step-up for Owner/Admin sessions.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendForSignatureInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementDocumentPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/agreement-document/signed":{"get":{"operationId":"downloadSignedAgreement","summary":"Download the signed agreement or its audit trail","description":"A 60-second signed URL; every open is audited.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"file","in":"query","required":false,"schema":{"default":"signed","type":"string","enum":["signed","audit_trail"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"}},"/api/v1/rental-agreements/{id}/agreement-document/signers/{signerId}/resend":{"post":{"operationId":"resendSignerLink","summary":"Send a signer’s link again","description":"A new message with a new link (the old one stops working when it is minted). Once per 10 minutes.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"signerId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["queued","blocked"]}},"required":["status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/comparison":{"get":{"operationId":"getRentalComparison","summary":"Move-out compared with move-in","description":"Side by side with both inspections’ photos, meter deltas, missing inventory and keys, proposals.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalComparison"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"}},"/api/v1/rental-agreements/{id}/comparison/report":{"get":{"operationId":"downloadComparisonReport","summary":"Download the comparison report","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"},"post":{"operationId":"refreshComparisonReport","summary":"Render the comparison report again","description":"Queued; the PDF is added to the deal’s files with the deductions as they stand.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QueuedResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/compliance":{"get":{"operationId":"getRentalCompliance","summary":"The documents & compliance panel","description":"KYC per person (masked results) and the police verification pack of a rental agreement.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalCompliancePanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"}},"/api/v1/rental-agreements/{id}/deductions":{"post":{"operationId":"addDeduction","summary":"Add a deduction by hand","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddDeductionInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/deductions/propose":{"post":{"operationId":"proposeDeductions","summary":"Add the comparison’s proposals as draft deductions","description":"From the signed move-out compared with the signed move-in; once per difference.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/deductions/send":{"post":{"operationId":"sendDeductionsForReview","summary":"Send the deductions to the tenant","description":"Drafts go to the tenant, who accepts or disputes each on their link (minted at delivery).","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/deductions/unpaid-rent":{"post":{"operationId":"recoverUnpaidRent","summary":"Recover unpaid rent from the deposit","description":"Puts the outstanding rent instalments into one draft deduction (refreshed while it is a draft). Once the tenant accepts it, or a dispute is resolved, the decided amount is recorded on the rent ledger as paid from the deposit.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/deposit":{"get":{"operationId":"getRentalDeposit","summary":"The deposit of a rental agreement","description":"Holder, ledger, deductions and the settlement (refund due, refundable now, shortfall, landlord’s due).","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"},"put":{"operationId":"updateRentalDeposit","summary":"The agreed deposit and who holds it","description":"A holder change needs rentals.deposits (step-up); the brokerage holds deposits only when allowed.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDepositInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["rentals.edit","rentals.deposits"]}},"/api/v1/rental-agreements/{id}/deposit/entries":{"post":{"operationId":"recordDepositEntry","summary":"Record deposit money","description":"Received from the tenant, paid to the landlord for agreed deductions (escrow / brokerage holders), or refunded. A refund is limited to what can be refunded now (open deductions stay held). Step-up; audited; never edited.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordDepositEntryInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.deposits","x-idempotent":true}},"/api/v1/rental-agreements/{id}/deposit/escrow":{"post":{"operationId":"requestDepositEscrow","summary":"Escrow account: open, release or check","description":"open: ask the escrow partner for an account · release: pay out the settlement (deductions to the landlord, the rest to the tenant) · sync: check now. Queued; 409 without an escrow partner. Step-up.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositEscrowInput"}}}},"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.deposits"}},"/api/v1/rental-agreements/{id}/deposit/statement":{"get":{"operationId":"depositStatement","summary":"The deposit statement (PDF)","description":"The ledger, the deductions and the settlement, for both parties. Never brokerage revenue.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf."}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"}},"/api/v1/rental-agreements/{id}/document":{"get":{"operationId":"downloadAgreementDocument","summary":"Download the agreement document","description":"A 60-second signed URL; every open is audited.","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"},"put":{"operationId":"setAgreementDocument","summary":"Attach the signed agreement","description":"Replaces the previous document.","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgreementDocumentInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalAgreement"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/document/presign":{"post":{"operationId":"presignAgreementDocument","summary":"Start the agreement document upload","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["filename","content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PresignedUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/inspections":{"get":{"operationId":"getRentalInspections","summary":"The inspections of a rental agreement","description":"Tenancy dates, the move-in and move-out inspections with their corrections, and the templates.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspectionsPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"},"post":{"operationId":"createRentalInspection","summary":"Start an inspection","description":"A move-in from a template shaped by the listing, a move-out from the signed move-in. 409 while one of the kind is open, or when it is signed (record a correction instead).","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInspectionInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/kyc":{"post":{"operationId":"requestKyc","summary":"Ask a party for KYC","description":"Creates the request and sends the person a link (minted at delivery) through the compliance-gated pipeline. 409 while one is open for the person, or when PropZolo’s KYC partner is not set up.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestKycInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalCompliancePanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/kyc/{requestId}/cancel":{"post":{"operationId":"cancelKycRequest","summary":"Cancel a KYC request","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"requestId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelKycInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalCompliancePanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/kyc/{requestId}/decision":{"post":{"operationId":"decideKycReview","summary":"Accept or reject a KYC result in review","description":"Audited with the member’s note.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"requestId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KycDecisionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalCompliancePanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/kyc/{requestId}/photo":{"get":{"operationId":"getKycPhoto","summary":"The person’s KYC photo","description":"A 60-second signed URL — only when the company keeps photos and retention has not removed it. Step-up for Owner/Admin sessions; audited.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"requestId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/kyc/{requestId}/resend":{"post":{"operationId":"resendKycLink","summary":"Send a KYC link again","description":"A new message and a new link (the old one stops working); at most once per 10 minutes.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"requestId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalCompliancePanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/maintenance":{"get":{"operationId":"getAgreementMaintenance","summary":"An agreement’s maintenance","description":"The agreement drawer’s section: its tickets, the owner-approval threshold and the tenant’s request link.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementMaintenance"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.view"},"put":{"operationId":"setAgreementMaintenance","summary":"Set the owner-approval threshold","description":"Repairs the owner pays above this amount need the owner’s approval; null uses the company default. Also needs deals.approve (403).","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"threshold":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}},"required":["threshold"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementMaintenance"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/maintenance/tenant-link":{"post":{"operationId":"sendMaintenanceTenantLink","summary":"Send the tenant their repair request link","description":"A sign-in-free link to report repairs with photos (reusable until it expires; an earlier one stops working).","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["queued","blocked"]},"reason":{"type":["string","null"]}},"required":["status","reason"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/police-verification":{"put":{"operationId":"recordPoliceVerification","summary":"Record the police verification","description":"pending (start tracking / reopen) · submitted (acknowledgement number, optional proof) · done · na (with a reason). \"done → submitted\" is refused (409).","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPoliceVerificationInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalCompliancePanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/police-verification/acknowledgement":{"get":{"operationId":"downloadPoliceAcknowledgement","summary":"Download the police acknowledgement","description":"A 60-second signed URL (audited).","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"}},"/api/v1/rental-agreements/{id}/police-verification/acknowledgement/presign":{"post":{"operationId":"presignPoliceAcknowledgement","summary":"Start the acknowledgement upload","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliceAcknowledgementUpload"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PresignedUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/police-verification/form":{"get":{"operationId":"policeVerificationForm","summary":"The prefilled police verification form (PDF)","description":"Filled from the agreement, its parties and the tenant’s KYC (masked Aadhaar only). Audited.","tags":["Rental agreements"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"application/pdf."}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-agreements/{id}/renewal":{"post":{"operationId":"createRenewalDeal","summary":"Draft the renewal deal","description":"A rental deal in negotiation with the escalated rent (rounded to the rupee), the same parties, listing and commission terms. An open renewal deal of this agreement is returned instead of a second one.","tags":["Rentals"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRenewalInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deal":{"$ref":"#/components/schemas/DealDetail"},"created":{"type":"boolean"}},"required":["deal","created"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"deals.create","x-idempotent":true}},"/api/v1/rental-agreements/{id}/rent":{"get":{"operationId":"getAgreementRent","summary":"An agreement’s rent","description":"The drawer’s Rent section: profile, schedule with statuses and open late fees, payments, mandate, totals.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementRent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.view"},"put":{"operationId":"setupAgreementRent","summary":"Set up rent collection","description":"The landlord’s UPI id and PAN, the due day (1–28; changing it needs `rentals.edit`), reminders and late fees on / off; (re)generates the schedule without touching rows with money. Audited.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"due_day":{"anyOf":[{"type":"integer","minimum":1,"maximum":28},{"type":"null"}]},"payee_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"upi_vpa":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"landlord_pan":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"reminders_enabled":{"type":"boolean"},"late_fees_enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementRent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rental-agreements/{id}/rent/mandate":{"post":{"operationId":"requestRentMandate","summary":"Set up AutoPay / e-NACH","description":"UPI AutoPay up to ₹15,000 per debit, e-NACH above (default cap: the rent the mandate will debit; widen it to cover an escalation). The worker sets it up at the provider and stores the tenant’s setup link; statuses follow the provider’s verified webhooks.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"max_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["autopay","enach"]},"status":{"type":"string"},"max_amount":{"$ref":"#/components/schemas/Paise"}},"required":["id","kind","status","max_amount"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rental-agreements/{id}/rent/mandate/revoke":{"post":{"operationId":"revokeRentMandate","summary":"Revoke the mandate","description":"Recorded at once; the worker tells the provider.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"revoked"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rental-agreements/{id}/rent/payments":{"post":{"operationId":"recordRentPayment","summary":"Record rent received","description":"Cash, cheque, UPI or bank transfer to the landlord. UPI and bank need the UTR; a UTR already on another live payment of the company is refused (409). Allocated oldest first (approved late fees included) unless an instalment is named; a surplus is kept as an advance. Numbers a receipt. Audited.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PaiseInput"},"method":{"type":"string","enum":["upi","cash","bank","cheque"]},"received_on":{"$ref":"#/components/schemas/LocalDate"},"utr":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"instalment_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["amount","method","received_on"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"receipt_number":{"type":"string"},"advance":{"$ref":"#/components/schemas/Paise"}},"required":["id","receipt_number","advance"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rental-agreements/{id}/rent/regenerate":{"post":{"operationId":"regenerateAgreementRent","summary":"Regenerate the rent schedule","description":"After an amendment (the daily scan also does it): paid, part-paid and waived rows stay as they are.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementRent"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rental-agreements/{id}/rent/reveal-pan":{"post":{"operationId":"revealLandlordPan","summary":"The landlord’s full PAN (audited)","description":"RENT-14: needs a fresh second factor; every reveal is written to the audit log.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"pan":{"type":"string"}},"required":["pan"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.rent"}},"/api/v1/rental-agreements/{id}/tenancy":{"put":{"operationId":"recordRentalTenancy","summary":"Record the move-in, the notice and the move-out","description":"A notice stops the renewal reminders; the move-out ends the let (the agreement is terminated) and starts the deposit settlement with the refund due date.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordTenancyInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TenancyDates"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-deductions/{id}":{"patch":{"operationId":"updateDeduction","summary":"Change a deduction","description":"Drafts and deductions waiting for the tenant only.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDeductionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-deductions/{id}/resolve":{"post":{"operationId":"resolveDeduction","summary":"Resolve a disputed deduction","description":"At the agreed amount (at most what was claimed; 0 drops it), with how it was agreed. Step-up.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveDeductionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.deposits"}},"/api/v1/rental-deductions/{id}/response":{"post":{"operationId":"respondToDeduction","summary":"Record the tenant’s answer","description":"Accept or dispute with a note saying how the tenant answered (in person, on a call). Deposit rights and step-up. Audited.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeductionResponseInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.deposits"}},"/api/v1/rental-deductions/{id}/waive":{"post":{"operationId":"waiveDeduction","summary":"Waive a deduction","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaiveDeductionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-deposit-entries/{id}/reverse":{"post":{"operationId":"reverseDepositEntry","summary":"Reverse a deposit entry","description":"A new entry cancels it (with the reason); escrow movements come from the partner and cannot be reversed.","tags":["Rental deposits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseDepositEntryInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalDepositPanel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.deposits"}},"/api/v1/rental-inspection-media/{id}":{"delete":{"operationId":"removeRentalInspectionMedia","summary":"Remove a photo / video","description":"Drafts only; the file stays in the trail.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}":{"get":{"operationId":"getRentalInspection","summary":"An inspection","description":"Checklist, answers, photo / video previews (EXIF/GPS-free), what is missing, signatures.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"}},"/api/v1/rental-inspections/{id}/answers":{"patch":{"operationId":"saveRentalInspectionAnswers","summary":"Save answers (offline queue)","description":"Applies the operations in order; stale or misplaced ones are skipped and reported. Drafts only.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveInspectionAnswersInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SaveInspectionAnswersResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/cancel":{"post":{"operationId":"cancelRentalInspection","summary":"Cancel a draft","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelInspectionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/complete":{"post":{"operationId":"completeRentalInspection","summary":"Ready for signatures","description":"Freezes the content with its SHA-256 (422 with what is missing). A new signing round starts.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/media":{"post":{"operationId":"registerRentalInspectionMedia","summary":"Add an uploaded photo / video","description":"Registered with its capture times; checked and stripped of EXIF/GPS in the background.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterInspectionMediaInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/media/uploads":{"post":{"operationId":"presignRentalInspectionMedia","summary":"Start a photo / video upload","description":"A presigned PUT into private storage (photos up to 15 MB; videos up to the company’s limit).","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InspectionMediaUpload"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PresignedUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/reopen":{"post":{"operationId":"reopenRentalInspection","summary":"Reopen for changes","description":"Back to the draft; the round’s signatures are withdrawn (kept as such, with their evidence).","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InspectionReasonInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/report":{"get":{"operationId":"downloadInspectionReport","summary":"Download the signed inspection report","description":"A 60-second signed URL of the PDF (both signatures, photo thumbnails, meters).","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.view"}},"/api/v1/rental-inspections/{id}/revise":{"post":{"operationId":"reviseRentalInspection","summary":"Correct a signed inspection","description":"A new revision (same answers and files) to fix and sign again; the signed one is superseded then.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InspectionReasonInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/signatures/{party}/otp":{"post":{"operationId":"requestInspectionSignOtp","summary":"Send a party their signing code (at the handover)","description":"The code goes to the party’s own phone / email (minted at delivery); they read it out to the agent.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"party","in":"path","required":true,"schema":{"type":"string","enum":["landlord","tenant"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InspectionOtpRequest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/signatures/{party}/revoke":{"post":{"operationId":"revokeInspectionSignLink","summary":"Stop a party’s signing link","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"party","in":"path","required":true,"schema":{"type":"string","enum":["landlord","tenant"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/signatures/{party}/send":{"post":{"operationId":"sendInspectionSignLink","summary":"Send a party their signing link","description":"Minted when the message is delivered; a new link replaces the old one. At most every 2 minutes.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"party","in":"path","required":true,"schema":{"type":"string","enum":["landlord","tenant"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"rentals.edit"}},"/api/v1/rental-inspections/{id}/signatures/{party}/sign":{"post":{"operationId":"signInspectionInPerson","summary":"Sign for a party on this phone (at the handover)","description":"Typed name, optional drawing and the party’s code. A wrong code is an answer (attempts left), not an error.","tags":["Rental inspections"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"party","in":"path","required":true,"schema":{"type":"string","enum":["landlord","tenant"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInspectionInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SignInspectionResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"rentals.edit"}},"/api/v1/reports/agent-activity":{"get":{"operationId":"getAgentActivityReport","summary":"Agent activity matrix","description":"Per member of your scope: calls, connected, WhatsApp / SMS / email sent, visits done, and on their leads bookings, callbacks due, not interested and dropped in the range; plus what AI handled (replies, voice calls, qualified, visits booked, hand-offs).","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentActivityReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/agent-activity/export":{"get":{"operationId":"exportAgentActivityReport","summary":"Download the agent activity matrix as CSV","description":"The same rows as the report (with the automation line), formula-safe; audited. Needs a fresh step-up.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.export"}},"/api/v1/reports/builder/catalogue":{"get":{"operationId":"getReportCatalogue","summary":"What I can report on","description":"Entities, fields, outcomes and ratios the caller may use (cost fields and field-ruled money left out).","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportCatalogue"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/builder/drill":{"post":{"operationId":"drillReport","summary":"Records behind a report cell","description":"The records of one group (and series) of a spec — only those you may open (the record’s own view scope), newest first, 50 a page. `group` / `split` are the result’s row and series keys.","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/ReportSpec"},"group":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"split":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"period":{"anyOf":[{"type":"object","properties":{"preset":{"anyOf":[{"type":"string","enum":["today","yesterday","tomorrow","this_week","last_week","next_week","this_month","last_month","next_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","last_12_months","next_7_days"]},{"type":"null"}]},"from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["preset","from","to"],"additionalProperties":false,"description":"Replaces the report’s range (a preset, or calendar days)."},{"type":"null"}]},"cursor":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["spec"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportDrillPage"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/builder/run":{"post":{"operationId":"runReportSpec","summary":"Run a report","description":"Runs an unsaved spec within your report scope (422 with spec paths when it cannot run).","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"spec":{"$ref":"#/components/schemas/ReportSpec"},"period":{"anyOf":[{"type":"object","properties":{"preset":{"anyOf":[{"type":"string","enum":["today","yesterday","tomorrow","this_week","last_week","next_week","this_month","last_month","next_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","last_12_months","next_7_days"]},{"type":"null"}]},"from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["preset","from","to"],"additionalProperties":false,"description":"Replaces the report’s range (a preset, or calendar days)."},{"type":"null"}]}},"required":["spec"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/campaigns":{"get":{"operationId":"getCampaignReport","summary":"Campaign & source costs","description":"Spend in the range (prorated spend entries, or a source’s monthly cost) against the funnel of the leads received in it: cost per lead, per qualified lead, per visit, per deal and per dead lead, per campaign and per source.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/ctwa":{"get":{"operationId":"getCtwaReport","summary":"Click-to-WhatsApp attribution","description":"Leads from Click-to-WhatsApp ads received in the range, by ad: qualified %, site visits, bookings, the conversions sent back to Meta, and spend with cost per lead where spend is recorded on the ad’s campaign.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CtwaReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/custom":{"get":{"operationId":"listCustomReports","summary":"Saved reports","description":"Your reports, your teams’ and the company’s (built-in reports for those who schedule).","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"entity","in":"query","required":false,"schema":{"type":"string","maxLength":16}},{"name":"mine","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomReport"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"},"post":{"operationId":"createCustomReport","summary":"Save a report","description":"Company-wide sharing needs `reports.schedule`; team sharing a team you belong to.","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"visibility":{"type":"string","enum":["private","team","company"]},"team_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"spec":{"$ref":"#/components/schemas/ReportSpec"}},"required":["name","spec"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/custom/{id}":{"get":{"operationId":"getCustomReport","summary":"A saved report","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"},"patch":{"operationId":"updateCustomReport","summary":"Change a saved report","description":"A changed name or spec is a new version. Only the author changes who sees it.","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"visibility":{"type":"string","enum":["private","team","company"]},"team_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"spec":{"$ref":"#/components/schemas/ReportSpec"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"},"delete":{"operationId":"deleteCustomReport","summary":"Delete a saved report","description":"Archives it and pauses its schedules (the delivery log stays).","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"}},"required":["id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/custom/{id}/duplicate":{"post":{"operationId":"duplicateCustomReport","summary":"Copy a report","description":"A private copy for you of any report you may open.","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/custom/{id}/export":{"get":{"operationId":"exportCustomReport","summary":"Download a report as CSV","description":"The report’s result within your scope, formula-safe; audited. Needs a fresh step-up.","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.export"}},"/api/v1/reports/custom/{id}/run":{"post":{"operationId":"runCustomReport","summary":"Run a saved report","description":"Within your own scope and field rules; `period` replaces its range.","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"anyOf":[{"type":"object","properties":{"preset":{"anyOf":[{"type":"string","enum":["today","yesterday","tomorrow","this_week","last_week","next_week","this_month","last_month","next_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","last_12_months","next_7_days"]},{"type":"null"}]},"from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["preset","from","to"],"additionalProperties":false,"description":"Replaces the report’s range (a preset, or calendar days)."},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/custom/{id}/schedules":{"get":{"operationId":"listReportSchedules","summary":"Schedules of a report","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportSchedule"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"},"post":{"operationId":"createReportSchedule","summary":"Schedule a report","description":"Members get it within their own scope. Outside addresses are added separately (step-up).","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"time":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"month_day":{"anyOf":[{"type":"integer","minimum":-1,"maximum":31},{"type":"null"}]},"period":{"type":"string","enum":["report","yesterday","last_7_days","last_week","last_month","last_30_days"]},"channels":{"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["email","whatsapp"]}},"member_ids":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["frequency","time","channels"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportSchedule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.schedule"}},"/api/v1/reports/custom/{id}/versions":{"get":{"operationId":"listCustomReportVersions","summary":"Versions of a saved report","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomReportVersion"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/custom/{id}/versions/{version}/restore":{"post":{"operationId":"restoreCustomReportVersion","summary":"Restore a version","description":"Saves the old version again as the newest one.","tags":["Report builder"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"}},"/api/v1/reports/dashboard":{"get":{"operationId":"getOwnerDashboard","summary":"Owner dashboard","description":"The funnel of the leads received in the range by source with costs and ROI, deals won and receipts, commission still to come, team health (untouched leads, overdue follow-ups, first-response SLA) and daily trends.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"scope","in":"query","required":false,"description":"`team`: everyone your report scope reaches; `me`: your own; `member`: one member of your scope (with `member_id`; outside your scope → 404). Without it: your whole report scope.","schema":{"type":"string","enum":["team","me","member"]}},{"name":"member_id","in":"query","required":false,"description":"The member of `scope=member`.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerDashboard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/delivery-settings":{"get":{"operationId":"getReportDeliverySettings","summary":"Scheduled report delivery settings","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportDeliverySettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["reports.schedule","settings.company"]},"patch":{"operationId":"updateReportDeliverySettings","summary":"Allow or stop reports to outside addresses","description":"The owner’s switch for scheduled reports to email addresses outside the company. Needs a fresh step-up.","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDeliverySettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportDeliverySettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/reports/digest":{"get":{"operationId":"getOwnerDigest","summary":"Daily owner digest","description":"The digest settings, who receives it and a preview of yesterday’s digest within your scope.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerDigestView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.view"},"patch":{"operationId":"updateOwnerDigest","summary":"Change the daily owner digest","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"time":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"email":{"type":"boolean","description":"Also by email when an email channel is connected."}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OwnerDigestSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.schedule"}},"/api/v1/reports/engagement":{"get":{"operationId":"getEngagementReport","summary":"Shares & matching report","description":"Share links sent in the range — opened, views, time spent, hot ones and share → visit — by channel and member; matches suggested in the range by status.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EngagementReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/matrix":{"get":{"operationId":"getStatusMatrix","summary":"Status matrix","description":"Member / source / project / campaign / partner / branch × status, sub-status or lost reason for one pipeline. An unknown pipeline answers 404.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"dimension","in":"query","required":false,"schema":{"default":"owner","type":"string","enum":["owner","presales","source","project","campaign","partner","branch"]}},{"name":"level","in":"query","required":false,"description":"`lost_reason` counts the leads lost in the range by the sub-status of their lost status.","schema":{"default":"status","type":"string","enum":["status","sub_status","lost_reason"]}},{"name":"pipeline_id","in":"query","required":false,"description":"Default: the company’s default pipeline.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StatusMatrix"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/messaging":{"get":{"operationId":"getMessagingReport","summary":"Messaging report","description":"Outbound WhatsApp / SMS / email of the range per channel and per template: sent, delivered, read, failed, replied within 7 days and cost; opt-outs.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessagingReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/schedules/{id}":{"patch":{"operationId":"updateReportSchedule","summary":"Change, pause or resume a schedule","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"time":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"weekday":{"anyOf":[{"type":"integer","minimum":1,"maximum":7},{"type":"null"}]},"month_day":{"anyOf":[{"type":"integer","minimum":-1,"maximum":31},{"type":"null"}]},"period":{"type":"string","enum":["report","yesterday","last_7_days","last_week","last_month","last_30_days"]},"channels":{"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["email","whatsapp"]}},"member_ids":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"status":{"type":"string","enum":["active","paused"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportSchedule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.schedule"},"delete":{"operationId":"deleteReportSchedule","summary":"Delete a schedule","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"}},"required":["id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.schedule"}},"/api/v1/reports/schedules/{id}/deliveries":{"get":{"operationId":"listReportDeliveries","summary":"Delivery log of a schedule","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"before","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReportDelivery"}},"next":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["items","next"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.schedule"}},"/api/v1/reports/schedules/{id}/external-recipients":{"put":{"operationId":"setReportScheduleExternalRecipients","summary":"Outside email recipients of a schedule","description":"Data leaves the company: needs the company’s switch, `reports.export` and a fresh step-up. Outside recipients get the report by email within the schedule owner’s scope, with an unsubscribe link; unsubscribed addresses are refused.","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":254}}},"required":["emails"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReportSchedule"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.export"}},"/api/v1/reports/schedules/{id}/send":{"post":{"operationId":"sendReportScheduleNow","summary":"Send a scheduled report now","tags":["Scheduled reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["queued"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.schedule"}},"/api/v1/reports/scorecard":{"get":{"operationId":"getAgentScorecard","summary":"Agent scorecard","description":"Per member of your scope: calls, connected, talk time, follow-ups on time / late / missed, visits, conversions, deals won and median first response, each ranked, with an overall rank by average position.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentScorecard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/sla":{"get":{"operationId":"getSlaDashboard","summary":"SLA dashboard","description":"Per policy for the range: on the clock, met on time, met late, breached and still open; breaches by member and team; what is at risk and breached right now. Within the caller’s report scope.","tags":["SLA policies"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"scope","in":"query","required":false,"description":"`team`: everyone your report scope reaches; `me`: your own; `member`: one member of your scope (with `member_id`; outside your scope → 404). Without it: your whole report scope.","schema":{"type":"string","enum":["team","me","member"]}},{"name":"member_id","in":"query","required":false,"description":"The member of `scope=member`.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SlaDashboard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/speed-to-lead":{"get":{"operationId":"getSpeedToLeadReport","summary":"Speed to lead & SLA","description":"First-response times of the leads that arrived in the range on the SLA clock (business hours or plain), their distribution, SLA met / late / breached, by member and by source.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"scope","in":"query","required":false,"description":"`team`: everyone your report scope reaches; `me`: your own; `member`: one member of your scope (with `member_id`; outside your scope → 404). Without it: your whole report scope.","schema":{"type":"string","enum":["team","me","member"]}},{"name":"member_id","in":"query","required":false,"description":"The member of `scope=member`.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SpeedToLeadReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/visit-funnel":{"get":{"operationId":"getVisitFunnelReport","summary":"Visit & meeting funnel","description":"Leads whose chosen date falls in the range, per owner (or pre-sales): visit scheduled, done, no-show only, not interested / dropped / booked after a visit, meetings scheduled / done. Counts are leads and match the leads-list filters their cells link to.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"date_type","in":"query","required":false,"description":"Which lead date the range applies to (default received_at).","schema":{"type":"string","enum":["received_at","status_changed_at","last_activity_at","created_at"]}},{"name":"group","in":"query","required":false,"description":"Rows per owner (default) or per pre-sales member.","schema":{"type":"string","enum":["owner","presales"]}},{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"source_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"sub_source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VisitFunnelReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/reports/visit-funnel/export":{"get":{"operationId":"exportVisitFunnelReport","summary":"Download the visit & meeting funnel as CSV","description":"The same rows as the report, formula-safe; audited. Needs a fresh step-up.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"date_type","in":"query","required":false,"description":"Which lead date the range applies to (default received_at).","schema":{"type":"string","enum":["received_at","status_changed_at","last_activity_at","created_at"]}},{"name":"group","in":"query","required":false,"description":"Rows per owner (default) or per pre-sales member.","schema":{"type":"string","enum":["owner","presales"]}},{"name":"member_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"source_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"sub_source","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reports.export"}},"/api/v1/reports/visits":{"get":{"operationId":"getVisitsReport","summary":"Visits report","description":"Site visits scheduled in the range: done, OTP-verified, no-shows, cancelled, revisits and visit → deal.","tags":["Reports"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["reports:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"A preset on the company calendar (default 30d; `all` = from the company’s first day with data); from / to win over it.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month","all"]}},{"name":"from","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"to","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VisitsReport"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"reports.view"}},"/api/v1/roles":{"get":{"operationId":"listRoles","summary":"Roles","description":"Roles with member counts. Needs `settings.roles`, `settings.users`, `settings.security` or `settings.view`.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"meta":{"type":"object","properties":{"custom_roles":{"type":"boolean","description":"The plan allows custom roles and permissions."}},"required":["custom_roles"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.roles","settings.users","settings.security","settings.view"]},"post":{"operationId":"createRole","summary":"Create or duplicate a role","description":"Custom roles are on the Growth plan and above. You can only grant what you hold yourself.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoleInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RoleDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.roles"}},"/api/v1/roles/{id}":{"get":{"operationId":"getRole","summary":"A role with its permissions","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RoleDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.roles","settings.security","settings.view"]},"patch":{"operationId":"updateRole","summary":"Edit a role","description":"Name, description, permissions (audited with the diff; you can only grant what you hold) and the 2FA requirement (needs `settings.security`). The Owner role’s permissions are fixed.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RoleDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.roles"},"delete":{"operationId":"deleteRole","summary":"Delete an unused custom role","description":"Seeded roles cannot be deleted; nor can a role still held by a member or a pending invitation.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.roles"}},"/api/v1/roles/{id}/diff":{"post":{"operationId":"diffRole","summary":"Preview a permission change","description":"What would change, what you may not grant and how many members it affects. Writes nothing.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"permissions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/PermissionValue"}},"description":"Resource → action → value, plus `fields` → field rule → mode (registry in docs/04 §4.2)."}},"required":["permissions"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RoleDiff"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.roles"}},"/api/v1/saved-views":{"get":{"operationId":"listSavedViews","summary":"Saved views of a list","description":"Your private views and the team’s, pinned first. Needs view access to the entity (leads.view …).","tags":["Saved views"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"entity","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SavedViewEntity"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SavedView"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"post":{"operationId":"createSavedView","summary":"Save a view","description":"The filter is checked against the entity’s field registry (422 names the bad condition).","tags":["Saved views"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSavedViewInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SavedView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/saved-views/counts":{"post":{"operationId":"countViews","summary":"Counts for list tabs","description":"Up to 25 list queries (smart lists, saved views, the current filter) counted within your scope; the answer maps each key to its count.","tags":["Saved views"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewCountsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/saved-views/{id}":{"patch":{"operationId":"updateSavedView","summary":"Change, rename or re-share a view","tags":["Saved views"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSavedViewInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SavedView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"delete":{"operationId":"deleteSavedView","summary":"Delete a view","tags":["Saved views"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/search":{"get":{"operationId":"search","summary":"Search leads and contacts","description":"Fewer than 2 characters answer an empty list.","tags":["Search"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SearchHit"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal"}},"/api/v1/searches/contact":{"get":{"operationId":"searchContactsForAutomation","summary":"Find contacts (automation search)","description":"Contacts matching every parameter given (phone and / or email), oldest first, at most 10. Needs `contacts:read`.","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["contacts:read"]}],"parameters":[{"name":"phone","in":"query","required":false,"description":"Any format: 10 digits read as Indian, +<country code> for NRI numbers (kept as sent).","schema":{"type":"string","maxLength":32}},{"name":"email","in":"query","required":false,"description":"Case-insensitive.","schema":{"type":"string","maxLength":160}},{"name":"limit","in":"query","required":false,"schema":{"default":10,"type":"integer","minimum":1,"maximum":10}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"contacts.view"}},"/api/v1/searches/lead":{"get":{"operationId":"searchLeadsForAutomation","summary":"Find leads (automation search)","description":"Leads matching every parameter given (at least one of phone, email, external_id), newest first, at most 10. `external_id` is the id sent with upsert_lead or a provider’s own lead id. Needs `leads:read`.","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read"]}],"parameters":[{"name":"phone","in":"query","required":false,"description":"Any format: 10 digits read as Indian, +<country code> for NRI numbers (kept as sent).","schema":{"type":"string","maxLength":32}},{"name":"email","in":"query","required":false,"description":"Case-insensitive.","schema":{"type":"string","maxLength":160}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","maxLength":191}},{"name":"limit","in":"query","required":false,"schema":{"default":10,"type":"integer","minimum":1,"maximum":10}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"leads.view"}},"/api/v1/security/login-policy":{"get":{"operationId":"getLoginPolicy","summary":"Sign-in rules: login approvals and device limits","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoginPolicyView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.security","settings.view"]},"put":{"operationId":"updateLoginPolicy","summary":"Change the sign-in rules","description":"Only the fields sent change. Owner/Admin sessions confirm with step-up. Audited.","tags":["Login devices"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approval_required":{"type":"boolean","description":"Sign-ins from devices not yet approved wait for approval."},"max_web_devices":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}],"description":"Approved browsers per member; null: no limit."},"max_mobile_devices":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}],"description":"Approved phones per member; null: no limit."},"approval_minutes":{"type":"integer","minimum":5,"maximum":60},"secure_screens":{"type":"boolean","description":"Block screenshots and screen recording on the app’s sensitive screens (Android)."}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoginPolicyView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.security"}},"/api/v1/sequences":{"get":{"operationId":"listSequences","summary":"Follow-up plans","description":"Plans you may see (archived ones only with `status=archived`), newest change first, with counts.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","active","paused","archived"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Sequence"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"},"post":{"operationId":"createSequence","summary":"Create a follow-up plan","description":"A draft plan; activate it to enrol leads.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSequenceInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Sequence"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.create","x-idempotent":true}},"/api/v1/sequences/enrollments":{"get":{"operationId":"listLeadEnrollments","summary":"A lead’s follow-up plans","description":"Live enrolments first, then the last five finished ones — the lead page card.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"lead_id","in":"query","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SequenceEnrollment"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/sequences/enrollments/{id}":{"patch":{"operationId":"changeSequenceEnrollment","summary":"Pause, resume or remove an enrolment","description":"Resuming runs the next step after its own delay, counted from now.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeSequenceEnrollmentInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SequenceEnrollment"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/sequences/{id}":{"get":{"operationId":"getSequence","summary":"A follow-up plan","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Sequence"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"},"patch":{"operationId":"updateSequence","summary":"Edit a follow-up plan","description":"Edits apply to what is not sent yet: an enrolment runs its next step from the current steps. An active plan must stay runnable (approved templates).","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSequenceInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Sequence"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.edit"},"delete":{"operationId":"archiveSequence","summary":"Archive a follow-up plan","description":"Live enrolments end (removed, reason archived); history and analytics stay.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Sequence"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.delete"}},"/api/v1/sequences/{id}/activate":{"post":{"operationId":"activateSequence","summary":"Activate a follow-up plan","description":"Needs at least one step and an approved template on every message step (422 otherwise).","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Sequence"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/sequences/{id}/analytics":{"get":{"operationId":"getSequenceAnalytics","summary":"Step analytics of a follow-up plan","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SequenceAnalytics"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"}},"/api/v1/sequences/{id}/enrollments":{"get":{"operationId":"listSequenceEnrollments","summary":"Enrolments of a follow-up plan","description":"Newest first; keyset pagination.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","paused","completed","exited","removed"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SequenceEnrollment"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view"},"post":{"operationId":"enrollInSequence","summary":"Enrol leads in a follow-up plan","description":"By ids or \"all matching\" a leads list (at most 10,000). One live enrolment per lead per plan; closed leads and leads outside your `leads.edit` scope are skipped with a reason.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceEnrollInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SequenceEnrollResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.view","x-idempotent":true}},"/api/v1/sequences/{id}/pause":{"post":{"operationId":"pauseSequence","summary":"Pause a follow-up plan","description":"No new enrolments; enrolled leads hold where they are until the plan is activated again.","tags":["Campaigns"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Sequence"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"campaigns.send"}},"/api/v1/settings/agreement-clauses":{"get":{"operationId":"listAgreementClauses","summary":"The clause library","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementClauseLibrary"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.view"},"post":{"operationId":"createAgreementClause","summary":"Add a clause of the company","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgreementClauseInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementClause"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/settings/agreement-clauses/{key}":{"patch":{"operationId":"updateAgreementClause","summary":"Save a clause (PropZolo’s are copied on the first save)","description":"Archiving the copy of a PropZolo clause hides it from new drafts; every save is a new version.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{2,63}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgreementClauseInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementClause"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/settings/agreement-templates":{"get":{"operationId":"listAgreementTemplates","summary":"Agreement templates","description":"PropZolo’s templates (read-only) and the company’s own copies.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementTemplateList"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.view"},"post":{"operationId":"copyAgreementTemplate","summary":"Copy a template to edit it","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopyAgreementTemplateInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/settings/agreement-templates/{key}":{"get":{"operationId":"getAgreementTemplate","summary":"An agreement template with its versions","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{2,63}$"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.view"},"patch":{"operationId":"updateAgreementTemplate","summary":"Save a new version of a company template","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{2,63}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgreementTemplateUpdateInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgreementTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/settings/ai-assistants":{"get":{"operationId":"getMcpSettings","summary":"AI assistant settings","description":"The policy, member overrides, clients with a decision or a connection, and the last 7 days’ usage.","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/McpOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"patch":{"operationId":"updateMcpSettings","summary":"Change the AI assistant settings","description":"Only the keys sent change. Needs a fresh TOTP step-up (it opens CRM data to third-party AI). Audited.","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"default_autonomy":{"type":"string","enum":["read","draft","execute"]},"group_caps":{"type":"object","properties":{"leads":{"type":"string","enum":["read","draft","execute"]},"properties":{"type":"string","enum":["read","draft","execute"]},"site_visits":{"type":"string","enum":["read","draft","execute"]},"tasks":{"type":"string","enum":["read","draft","execute"]}},"additionalProperties":false,"description":"The most any assistant may do per tool group (absent: the default applies)."},"allow_dynamic_clients":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/McpSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/ai-assistants/activity":{"get":{"operationId":"listMcpActivity","summary":"The assistant call log of the company","description":"Client, member, tool, autonomy, outcome and latency per call; arguments only as a hash.","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"connection_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/McpCallLog"}},"meta":{"type":"object","properties":{"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["next_cursor","has_more"],"additionalProperties":false}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/ai-assistants/clients/{id}":{"put":{"operationId":"setMcpClientPolicy","summary":"Allow or block an assistant client","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["allowed","blocked"]},{"type":"null"}]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"client_id":{"$ref":"#/components/schemas/Id"},"status":{"anyOf":[{"type":"string","enum":["allowed","blocked"]},{"type":"null"}]}},"required":["client_id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/ai-assistants/connections":{"get":{"operationId":"listMcpConnections","summary":"Every member’s connected assistants","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/McpConnection"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/ai-assistants/connections/{id}":{"delete":{"operationId":"revokeMcpConnection","summary":"Disconnect a member’s assistant","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/ai-assistants/members/{id}":{"put":{"operationId":"setMcpMemberPolicy","summary":"A member’s assistant autonomy (or off)","description":"`off` refuses the member’s assistants at once; null follows the company default again.","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"autonomy":{"anyOf":[{"type":"string","enum":["off","read","draft","execute"]},{"type":"null"}]}},"required":["autonomy"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"autonomy":{"anyOf":[{"type":"string","enum":["off","read","draft","execute"]},{"type":"null"}]}},"required":["member_id","autonomy"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/ai-assistants/stop":{"post":{"operationId":"stopMcpAccess","summary":"Kill switch: stop every assistant now","description":"Turns access off; every token is refused on its next request. No step-up: stopping is never harder.","tags":["AI assistants"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/McpSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/approval-policies":{"get":{"operationId":"getApprovalPolicies","summary":"Approval policies","description":"What waits for approval (exports, deletes, discounts, rent below the floor, brokerage, stage gates).","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalPolicySettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["automations.edit","settings.view"]},"put":{"operationId":"updateApprovalPolicies","summary":"Change the approval policies","description":"Levels name approvers by permission, role, member or the requester’s manager. Needs a fresh TOTP.","tags":["Approvals"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"whatsapp":{"type":"boolean"},"policies":{"type":"object","propertyNames":{"type":"string","enum":["export","lead_delete","deal_delete","deal_discount","rent_floor","brokerage_waiver","stage_gate","payout","cost_sheet_discount","booking","booking_cancellation","receipt_cancellation","interest_waiver"]},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"anyOf":[{"type":"number","minimum":0,"maximum":10000000},{"type":"null"}]},"threshold_months":{"anyOf":[{"type":"number","minimum":0,"maximum":24},{"type":"null"}]},"levels":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"approvers":{"type":"object","properties":{"permission":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"role_keys":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":40}},"member_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"requester_manager":{"type":"boolean"}}},"due_minutes":{"type":"integer","minimum":15,"maximum":43200},"escalate_to":{"anyOf":[{"type":"object","properties":{"permission":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"role_keys":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":40}},"member_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"requester_manager":{"type":"boolean"}}},{"type":"null"}]},"escalation_minutes":{"type":"integer","minimum":15,"maximum":43200}},"required":["approvers"]}}},"required":["enabled","levels"]}}},"required":["whatsapp","policies"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApprovalPolicySettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit"}},"/api/v1/settings/bank-reconciliation":{"get":{"operationId":"getReconciliationSettings","summary":"The reconciliation rule","description":"Auto-confirm (off by default), the date window and the amount tolerance.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReconciliationSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.view"},"put":{"operationId":"saveReconciliationSettings","summary":"Save the reconciliation rule","description":"Audited.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconciliationSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReconciliationSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.confirm"}},"/api/v1/settings/bank-reconciliation/mailbox":{"get":{"operationId":"getStatementMailbox","summary":"The bank statement mailbox","description":"The inbound address statement mails are forwarded to, the bank format and the accepted senders.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StatementMailbox"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.confirm"},"put":{"operationId":"saveStatementMailbox","summary":"Set up the bank statement mailbox","description":"On / off, the bank whose format the attachments are read in, and the senders accepted (addresses or @domain; a mail must also be DKIM-signed by that domain). `rotate` issues a new address. Audited.","tags":["Bank reconciliation"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"bank":{"type":"string","enum":["hdfc","icici","sbi","axis","kotak","generic"]},"senders":{"maxItems":10,"type":"array","items":{"type":"string","minLength":3,"maxLength":120}},"accounts":{"maxItems":5,"type":"array","items":{"type":"string","minLength":6,"maxLength":24}},"rotate":{"type":"boolean"}},"required":["enabled","bank","senders"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StatementMailbox"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"reconciliation.confirm"}},"/api/v1/settings/briefing":{"get":{"operationId":"getBriefingSettings","summary":"The daily briefing settings of the company","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BriefingSettingsView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"patch":{"operationId":"updateBriefingSettings","summary":"Change the daily briefing settings (push and email are opt-in)","tags":["AI"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"push":{"type":"boolean"},"email":{"type":"boolean"},"ai_summary":{"type":"boolean"},"stuck_deal_days":{"type":"integer","minimum":3,"maximum":90},"lead_minutes":{"type":"integer","minimum":0,"maximum":180}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BriefingSettingsView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/settings/call-insights":{"get":{"operationId":"getCallInsightsSettings","summary":"Call-insights settings","description":"The switch, QA rubric, objection categories, daily budget and the last week’s usage.","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallInsightsSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"},"patch":{"operationId":"updateCallInsightsSettings","summary":"Change the call-insights settings","description":"Only the keys sent change. Audited. Analysis is metered on the AI wallet within the daily budget.","tags":["Call insights"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"qa":{"type":"boolean"},"daily_credit_cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}]},"ivr_disclosure":{"type":"boolean"},"show_scores_to_agents":{"type":"boolean"},"coaching_threshold":{"type":"integer","minimum":0,"maximum":100},"rubric":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":10,"maxLength":400},"weight":{"type":"integer","minimum":1,"maximum":5},"critical":{"type":"boolean"}},"required":["key","label","description","weight","critical"]}},"objection_categories":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{2,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["key","label","description"]}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallInsightsSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/settings/call-planner":{"get":{"operationId":"getCallPlannerSettings","summary":"Call list and accountability settings","tags":["Call list"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallPlannerSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.view","settings.lead_routing"]},"patch":{"operationId":"updateCallPlannerSettings","summary":"Change call list and accountability settings","description":"Sections are merged over the current values. Turning on rotation eligibility means only members at or above the bar and on shift get new leads from automatic routing (no score yet, or a stale one, never blocks; when nobody is eligible the rule’s fallback member gets the lead, else the gate is waived).","tags":["Call list"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"call_list":{"type":"object","properties":{"daily_cap":{"type":"integer","minimum":5,"maximum":300},"max_source_share":{"type":"number","minimum":0.1,"maximum":1},"signal_weights":{"type":"object","propertyNames":{"type":"string","enum":["callback","follow_up","sla","new_lead","hot","score","value","best_time","retry"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":200}}}},"accountability":{"type":"object","properties":{"weights":{"type":"object","propertyNames":{"type":"string","enum":["first_response","follow_ups","callbacks","call_notes","stale_leads","hygiene"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":100}},"rotation_enabled":{"type":"boolean"},"rotation_min_score":{"type":"integer","minimum":0,"maximum":100},"rotation_window":{"type":"string","enum":["d7","d30"]},"share_ranking_with_agents":{"type":"boolean"}}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallPlannerSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/settings/company-rules":{"get":{"operationId":"getCompanyRules","summary":"Business rules","description":"The company’s on/off business rules and the legally required gates that always apply.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"module":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"on":{"type":"boolean"}},"required":["key","module","label","description","default","on"],"additionalProperties":false}},"legal_gates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"],"additionalProperties":false}}},"required":["rules","legal_gates"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.company","settings.view"]},"patch":{"operationId":"updateCompanyRules","summary":"Switch business rules on or off","description":"A map of rule keys to on/off. Unknown keys (and the legal gates) are refused.","tags":["Company"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"type":"boolean"}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"module":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"on":{"type":"boolean"}},"required":["key","module","label","description","default","on"],"additionalProperties":false}},"legal_gates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"],"additionalProperties":false}}},"required":["rules","legal_gates"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/settings/cost-sheets":{"get":{"operationId":"getCostSheetPolicy","summary":"Cost-sheet settings: discount caps per role, validity, terms","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CostSheetPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"},"patch":{"operationId":"updateCostSheetPolicy","summary":"Change the cost-sheet settings","tags":["Pricing & cost sheets"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"default_cap_bp":{"type":"integer","minimum":0,"maximum":10000},"role_caps_bp":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"type":"integer","minimum":0,"maximum":10000}},"validity_days":{"type":"integer","minimum":1,"maximum":90},"book_within_days":{"description":"Days an accepted sheet keeps its price for the booking; null: as many as validity_days.","anyOf":[{"type":"integer","minimum":1,"maximum":90},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CostSheetPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"projects.pricing"}},"/api/v1/settings/deal-guard":{"get":{"operationId":"getDealGuard","summary":"The deal stages’ process guard","tags":["Process guard"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealGuard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view"]},"put":{"operationId":"updateDealGuard","summary":"Change the deal stages’ process guard","description":"Rules per deal type (rent covers leases); deal stages never move automatically.","tags":["Process guard"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"sale":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"next":{"default":null,"anyOf":[{"maxItems":40,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}},{"type":"null"}]},"entry":{"default":[],"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"field"},"field":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"record"},"record":{"type":"string","enum":["completed_visit","any_visit","open_deal","linked_property","connected_call","share_sent","live_offer","accepted_offer"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","record"]},{"type":"object","properties":{"kind":{"type":"string","const":"document"},"document":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","document"]},{"type":"object","properties":{"kind":{"type":"string","const":"photos"},"min":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"approval"}},"required":["kind"]}]}},"checklist":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"evidence":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"field"},"field":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"record"},"record":{"type":"string","enum":["completed_visit","any_visit","open_deal","linked_property","connected_call","share_sent","live_offer","accepted_offer"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","record"]},{"type":"object","properties":{"kind":{"type":"string","const":"document"},"document":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","document"]},{"type":"object","properties":{"kind":{"type":"string","const":"photos"},"min":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["kind"]}]},{"type":"null"}]}},"required":["key","label"]}},"auto":{"default":[],"maxItems":5,"type":"array","items":{"oneOf":[{"type":"object","properties":{"on":{"type":"string","const":"event"},"event":{"type":"string","enum":["visit.scheduled","visit.completed","visit.no_show","deal.opened","deal.won","deal.lost","checklist.completed"]},"to":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"sub":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["on","event","to","sub"]},{"type":"object","properties":{"on":{"type":"string","const":"timer"},"after_minutes":{"type":"integer","minimum":5,"maximum":527040},"to":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"sub":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["on","after_minutes","to","sub"]}]}}}}},"rent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"next":{"default":null,"anyOf":[{"maxItems":40,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}},{"type":"null"}]},"entry":{"default":[],"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"field"},"field":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"record"},"record":{"type":"string","enum":["completed_visit","any_visit","open_deal","linked_property","connected_call","share_sent","live_offer","accepted_offer"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","record"]},{"type":"object","properties":{"kind":{"type":"string","const":"document"},"document":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","document"]},{"type":"object","properties":{"kind":{"type":"string","const":"photos"},"min":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"approval"}},"required":["kind"]}]}},"checklist":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"evidence":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"field"},"field":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"record"},"record":{"type":"string","enum":["completed_visit","any_visit","open_deal","linked_property","connected_call","share_sent","live_offer","accepted_offer"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","record"]},{"type":"object","properties":{"kind":{"type":"string","const":"document"},"document":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","document"]},{"type":"object","properties":{"kind":{"type":"string","const":"photos"},"min":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["kind"]}]},{"type":"null"}]}},"required":["key","label"]}},"auto":{"default":[],"maxItems":5,"type":"array","items":{"oneOf":[{"type":"object","properties":{"on":{"type":"string","const":"event"},"event":{"type":"string","enum":["visit.scheduled","visit.completed","visit.no_show","deal.opened","deal.won","deal.lost","checklist.completed"]},"to":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"sub":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["on","event","to","sub"]},{"type":"object","properties":{"on":{"type":"string","const":"timer"},"after_minutes":{"type":"integer","minimum":5,"maximum":527040},"to":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"sub":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["on","after_minutes","to","sub"]}]}}}}}},"required":["enabled","sale","rent"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DealGuard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/duplicate-policy":{"get":{"operationId":"getDuplicatePolicy","summary":"Duplicate policy","description":"How repeat enquiries from known people are handled; unset keys show the defaults. `version` is sent back on PATCH.","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"match_by":{"type":"string","enum":["lead_type","lead_type_and_project"]},"open_lead":{"type":"string","enum":["attach","new_labelled"]},"won":{"type":"string","enum":["new_labelled","attach"]},"lost":{"type":"string","enum":["reopen","new_labelled","attach"]},"invalid":{"type":"string","enum":["reopen","new_labelled","attach"]},"reopen_within_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"no_reopen_sub_status_keys":{"type":"array","items":{"type":"string"}},"reopen_to":{"type":"object","properties":{"status_key":{"type":"string"},"sub_status_key":{"type":["string","null"]}},"required":["status_key","sub_status_key"],"additionalProperties":false},"sticky_owner":{"type":"boolean"},"sticky_within_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"version":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["match_by","open_lead","won","lost","invalid","reopen_within_days","no_reopen_sub_status_keys","reopen_to","sticky_owner","sticky_within_days","version"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.lead_routing","settings.view"]},"patch":{"operationId":"updateDuplicatePolicy","summary":"Change the duplicate policy","description":"Changes the given keys; the rest stay as they are. Send the `version` from the last read: 409 CONFLICT when the policy changed since. Only keys that differ from the defaults are stored.","tags":["Leads"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"match_by":{"type":"string","enum":["lead_type","lead_type_and_project"]},"open_lead":{"type":"string","enum":["attach","new_labelled"]},"won":{"type":"string","enum":["new_labelled","attach"]},"lost":{"type":"string","enum":["reopen","new_labelled","attach"]},"invalid":{"type":"string","enum":["reopen","new_labelled","attach"]},"reopen_within_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"sticky_owner":{"type":"boolean"},"sticky_within_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"version":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["version"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"match_by":{"type":"string","enum":["lead_type","lead_type_and_project"]},"open_lead":{"type":"string","enum":["attach","new_labelled"]},"won":{"type":"string","enum":["new_labelled","attach"]},"lost":{"type":"string","enum":["reopen","new_labelled","attach"]},"invalid":{"type":"string","enum":["reopen","new_labelled","attach"]},"reopen_within_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"no_reopen_sub_status_keys":{"type":"array","items":{"type":"string"}},"reopen_to":{"type":"object","properties":{"status_key":{"type":"string"},"sub_status_key":{"type":["string","null"]}},"required":["status_key","sub_status_key"],"additionalProperties":false},"sticky_owner":{"type":"boolean"},"sticky_within_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"version":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["match_by","open_lead","won","lost","invalid","reopen_within_days","no_reopen_sub_status_keys","reopen_to","sticky_owner","sticky_within_days","version"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/settings/e-sign":{"get":{"operationId":"getESignSettings","summary":"e-sign status and e-stamp credits","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ESignSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]}},"/api/v1/settings/email-sync":{"get":{"operationId":"getEmailSyncPolicy","summary":"Email sync policy and every connected mailbox","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmailSyncPolicyView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]},"put":{"operationId":"updateEmailSyncPolicy","summary":"Save the email sync policy","description":"Owner/Admin-level sessions need a fresh step-up (it decides whose mail PropZolo may read).","tags":["Email sync"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSyncPolicyInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmailSyncPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/followup-agent":{"get":{"operationId":"getFollowupAgentSettings","summary":"Follow-up agent settings","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FollowupAgentSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["ai.followups","ai.agents_manage"]},"put":{"operationId":"updateFollowupAgentSettings","summary":"Change the follow-up agent settings","description":"The switch, channels, autopilot (per kind of goal), sending window and days, cool-down, max touches, deadline, approval window, when a call task replaces messages, and the approved templates used outside the free-text window.","tags":["Follow-up agent"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"channels":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]}},"autopilot_allowed":{"type":"boolean"},"autopilot_goals":{"maxItems":4,"type":"array","items":{"type":"string","enum":["site_visit","documents","decision","revive"]}},"window":{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Sending hours, company clock (09:00–21:00 at most)."},"working_days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"1 = Monday … 7 = Sunday."},"cool_down_hours":{"type":"integer","minimum":12,"maximum":336},"max_touches":{"type":"integer","minimum":1,"maximum":10},"default_deadline_days":{"type":"integer","minimum":1,"maximum":60},"approval_ttl_hours":{"type":"integer","minimum":1,"maximum":72},"call_after":{"type":"integer","minimum":1,"maximum":5},"templates":{"type":"object","properties":{"whatsapp_cloud":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sms":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["whatsapp_cloud","sms"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FollowupAgentSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.agents_manage"}},"/api/v1/settings/inspection-templates":{"get":{"operationId":"listInspectionTemplates","summary":"Inspection templates","description":"PropZolo’s (as shipped or edited) and the company’s own.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InspectionTemplate"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["settings.pipelines","settings.view"]},"post":{"operationId":"createInspectionTemplate","summary":"Add an inspection template","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveInspectionTemplateInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InspectionTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"settings.pipelines"}},"/api/v1/settings/inspection-templates/{key}":{"put":{"operationId":"saveInspectionTemplate","summary":"Save an inspection template","description":"PropZolo’s template: saves the company’s edited copy. Inspections keep their own snapshot.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveInspectionTemplateInputInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InspectionTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"settings.pipelines"}},"/api/v1/settings/inspection-templates/{key}/archive":{"post":{"operationId":"archiveInspectionTemplate","summary":"Archive / restore a template, or reset an edited PropZolo template","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveInspectionTemplateInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InspectionTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"settings.pipelines"}},"/api/v1/settings/listing-verification":{"get":{"operationId":"getListingVerificationSettings","summary":"Listing verification settings","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.inventory","settings.view"]},"patch":{"operationId":"updateListingVerificationSettings","summary":"Change listing verification settings","description":"The reminder must come before the badge lapses; the checklist needs at least one required photo.","tags":["Listing verification"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"radius_m":{"type":"integer","minimum":100,"maximum":1000},"max_accuracy_m":{"type":"integer","minimum":10,"maximum":500},"checklist":{"minItems":1,"maxItems":12,"type":"array","items":{"$ref":"#/components/schemas/VerificationChecklistItemInput"}},"document_kinds":{"minItems":1,"type":"array","items":{"type":"string","enum":["sale_deed","index_ii","property_tax","electricity_bill","society_noc","authority_letter","other"]}},"min_documents":{"type":"integer","minimum":0,"maximum":5},"validity_days":{"type":"integer","minimum":30,"maximum":730},"price_change_pct":{"type":"integer","minimum":1,"maximum":100},"remind_days":{"type":"integer","minimum":0,"maximum":60},"allow_self_review":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingVerificationSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.inventory"}},"/api/v1/settings/listings":{"get":{"operationId":"getListingSettings","summary":"Listing settings","description":"Photo watermark, the price-per-sq-ft basis, mandate reminder days, matching and share-link rules.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.inventory","settings.view"]},"patch":{"operationId":"updateListingSettings","summary":"Change listing settings","description":"Sections merge field by field; each changed section is audited.","tags":["Properties"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"watermark":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"description":"Drawn when there is no logo (default: company name).","anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"use_logo":{"type":"boolean"},"position":{"type":"string","enum":["bottom_right","bottom_left","top_right","top_left","center"]},"opacity":{"type":"number","minimum":0.05,"maximum":1}}},"price_per_sqft_basis":{"type":"string","enum":["super","builtup","carpet"]},"mandate_reminder_days":{"type":"integer","minimum":1,"maximum":90},"matching":{"type":"object","properties":{"radius_km":{"type":"number","minimum":0.5,"maximum":50},"budget_tolerance_pct":{"type":"number","minimum":0,"maximum":50},"min_score":{"type":"integer","minimum":0,"maximum":100},"max_per_lead":{"type":"integer","minimum":1,"maximum":200},"max_per_property":{"type":"integer","minimum":1,"maximum":500}}},"shares":{"type":"object","properties":{"expiry_days":{"type":"integer","minimum":1,"maximum":365},"session_gap_minutes":{"type":"integer","minimum":5,"maximum":1440},"long_dwell_seconds":{"type":"integer","minimum":15,"maximum":3600},"hot_task":{"type":"boolean"}}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.inventory"}},"/api/v1/settings/loans":{"get":{"operationId":"getLoanSettings","summary":"Loan desk settings","description":"Eligibility defaults, the lender link’s life, the sanction warning and the commission overdue window.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["loans.view","loans.configure","settings.view"]},"put":{"operationId":"saveLoanSettings","summary":"Save the loan desk settings","description":"Audited; the change is an outbox event.","tags":["Loan desk"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoanSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"loans.configure"}},"/api/v1/settings/marketing-studio":{"get":{"operationId":"getMarketingStudioSettings","summary":"The marketing studio settings","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingStudioSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["marketing.view","marketing.studio","marketing.social","marketing.audiences"]},"put":{"operationId":"saveMarketingStudioSettings","summary":"Save the marketing studio settings","description":"Disclaimer, brand colour, defaults and the audience rules (lawful bases, platforms). Audited.","tags":["Marketing studio"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketingStudioSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingStudioSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.edit"}},"/api/v1/settings/partners":{"get":{"operationId":"getPartnerPolicy","summary":"Partner settings: lock windows, alerts, the price toggle and onboarding rules","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"company_lock_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The company window (shared with the kiosk policy)."},"project_lock_days":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"visit_extension_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiry_alert_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rera_alert_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"show_prices":{"type":"boolean"},"require_agreement":{"type":"boolean"},"require_kyc":{"type":"boolean"},"agreement_terms":{"type":["string","null"]},"registrations_per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Portal registrations one partner may submit a day."},"registration_client_otp":{"type":"boolean","description":"A registration needs the one-time code sent to the client (the client consents)."}},"required":["company_lock_days","project_lock_days","visit_extension_days","expiry_alert_days","rera_alert_days","show_prices","require_agreement","require_kyc","agreement_terms","registrations_per_day","registration_client_otp"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["partners.view","partners.configure"]},"patch":{"operationId":"updatePartnerPolicy","summary":"Change the partner settings","tags":["Channel partners"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"company_lock_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"project_lock_days":{"type":"object","propertyNames":{"$ref":"#/components/schemas/Id"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"visit_extension_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiry_alert_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rera_alert_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"show_prices":{"type":"boolean"},"require_agreement":{"type":"boolean"},"require_kyc":{"type":"boolean"},"agreement_terms":{"anyOf":[{"type":"string","maxLength":6000},{"type":"null"}]},"registrations_per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registration_client_otp":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"company_lock_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The company window (shared with the kiosk policy)."},"project_lock_days":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"visit_extension_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiry_alert_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rera_alert_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"show_prices":{"type":"boolean"},"require_agreement":{"type":"boolean"},"require_kyc":{"type":"boolean"},"agreement_terms":{"type":["string","null"]},"registrations_per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Portal registrations one partner may submit a day."},"registration_client_otp":{"type":"boolean","description":"A registration needs the one-time code sent to the client (the client consents)."}},"required":["company_lock_days","project_lock_days","visit_extension_days","expiry_alert_days","rera_alert_days","show_prices","require_agreement","require_kyc","agreement_terms","registrations_per_day","registration_client_otp"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"partners.configure"}},"/api/v1/settings/pipelines/{id}/guard":{"get":{"operationId":"getPipelineGuard","summary":"A pipeline’s process guard","tags":["Process guard"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineGuard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view"]},"put":{"operationId":"updatePipelineGuard","summary":"Change a pipeline’s process guard","description":"The rules by status key (statuses left out have none), the switch, and the sub-statuses that pause SLAs.","tags":["Process guard"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"rules":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"next":{"default":null,"anyOf":[{"maxItems":40,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}},{"type":"null"}]},"entry":{"default":[],"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"field"},"field":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"record"},"record":{"type":"string","enum":["completed_visit","any_visit","open_deal","linked_property","connected_call","share_sent","live_offer","accepted_offer"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","record"]},{"type":"object","properties":{"kind":{"type":"string","const":"document"},"document":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","document"]},{"type":"object","properties":{"kind":{"type":"string","const":"photos"},"min":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"approval"}},"required":["kind"]}]}},"checklist":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"evidence":{"default":null,"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"field"},"field":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"record"},"record":{"type":"string","enum":["completed_visit","any_visit","open_deal","linked_property","connected_call","share_sent","live_offer","accepted_offer"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","record"]},{"type":"object","properties":{"kind":{"type":"string","const":"document"},"document":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","document"]},{"type":"object","properties":{"kind":{"type":"string","const":"photos"},"min":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["kind"]}]},{"type":"null"}]}},"required":["key","label"]}},"auto":{"default":[],"maxItems":5,"type":"array","items":{"oneOf":[{"type":"object","properties":{"on":{"type":"string","const":"event"},"event":{"type":"string","enum":["visit.scheduled","visit.completed","visit.no_show","deal.opened","deal.won","deal.lost","checklist.completed"]},"to":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"sub":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["on","event","to","sub"]},{"type":"object","properties":{"on":{"type":"string","const":"timer"},"after_minutes":{"type":"integer","minimum":5,"maximum":527040},"to":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"sub":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["on","after_minutes","to","sub"]}]}}}}},"pauses_sla":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}}},"required":["enabled","rules"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PipelineGuard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/police-verification-rules":{"get":{"operationId":"listPoliceRules","summary":"Police verification rules","description":"PropZolo’s city and state rules (sources, dates, [U] flags) and the company’s own rules.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PoliceRulesTable"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view"]},"post":{"operationId":"savePoliceRule","summary":"Add or change a company police verification rule","description":"Audited with before/after. Step-up for Owner/Admin sessions.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliceRuleOverrideInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PoliceRuleOverride"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/police-verification-rules/{id}":{"delete":{"operationId":"deletePoliceRule","summary":"Remove a company police verification rule","description":"PropZolo’s rule applies again. Audited; step-up for Owner/Admin sessions.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/post-sales":{"get":{"operationId":"getPostSalesSettings","summary":"Post-sales settings: checklist templates, stage SLAs, stage updates","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["deals:read","bookings:read"]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesConfig"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["deals.view","bookings.view","settings.view"]},"put":{"operationId":"updatePostSalesSettings","summary":"Save the post-sales settings and checklist templates","tags":["Post-sales"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"stage_sla_days":{"type":"object","properties":{"token":{"type":"integer","minimum":1,"maximum":365},"agreement":{"type":"integer","minimum":1,"maximum":365},"registration":{"type":"integer","minimum":1,"maximum":365},"handover":{"type":"integer","minimum":1,"maximum":365}},"required":["token","agreement","registration","handover"]},"stage_messages":{"type":"object","properties":{"agreement":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"]},"registration":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"]},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"]},"completed":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"]}},"required":["agreement","registration","handover","completed"]},"document_reminders":{"type":"boolean"},"escalation_lead_days":{"type":"integer","minimum":1,"maximum":90},"auto_raise_brokerage":{"type":"boolean"}},"required":["stage_sla_days","stage_messages","document_reminders","escalation_lead_days","auto_raise_brokerage"]},"templates":{"type":"object","properties":{"new_booking":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label"]}},"resale":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label"]}},"rental":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label"]}}},"required":["new_booking","resale","rental"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PostSalesConfig"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"settings.company"}},"/api/v1/settings/predictive-scoring":{"get":{"operationId":"getPredictiveScoring","summary":"Predictive lead scoring: status, data readiness, the latest model and its history","tags":["Predictive scoring"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PredictiveScoringView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.view","settings.pipelines"]},"patch":{"operationId":"updatePredictiveScoring","summary":"Switch predictive scoring on or off, or make its thresholds stricter","description":"Keys are merged over the current settings. Thresholds may only be made stricter than the defaults (90 days, 150 visits or bookings, AUC 0.70, +0.01 over the rules score, calibration error 0.10); a value out of bounds is a 422. Switching re-scores open leads within minutes.","tags":["Predictive scoring"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"min_history_days":{"type":"integer","minimum":90,"maximum":730},"min_positives":{"type":"integer","minimum":150,"maximum":100000},"min_auc":{"type":"number","minimum":0.7,"maximum":0.95},"min_auc_lift":{"type":"number","minimum":0.01,"maximum":0.2},"max_ece":{"type":"number","minimum":0.02,"maximum":0.1}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PredictiveScoringView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/predictive-scoring/train":{"post":{"operationId":"trainPredictiveScoring","summary":"Retrain the company’s model now (runs in the background; one run per 10 minutes)","tags":["Predictive scoring"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean","const":true}},"required":["queued"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/reactivation":{"get":{"operationId":"getReactivationSettings","summary":"Re-activation settings","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","settings.view","campaigns.view"]},"put":{"operationId":"updateReactivationSettings","summary":"Change the re-activation settings","description":"The company switch, the email basis, the cool-down, the lifetime cap and the recent-contact window.","tags":["Re-activation"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"email_basis":{"type":"string","enum":["consent","legitimate_interest"],"description":"consent: an explicit email opt-in · legitimate_interest: also people whose consent ledger records a DPDP legitimate-use basis for email. Every email carries a one-click unsubscribe."},"cooldown_days":{"type":"integer","minimum":30,"maximum":365},"lifetime_cap":{"type":"integer","minimum":1,"maximum":10},"recent_contact_days":{"type":"integer","minimum":7,"maximum":180}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReactivationSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/settings/rent":{"get":{"operationId":"getRentSettings","summary":"Rent settings","description":"Reminder cadence with quiet weekdays and holidays, the late-fee rule and receipt options.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view","rentals.view"]},"put":{"operationId":"saveRentSettings","summary":"Save the rent settings","description":"Replaces the settings (422 on a bad value; at least one working weekday). Audited.","tags":["Rent collection"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/rental-compliance":{"get":{"operationId":"getRentalComplianceSettings","summary":"KYC and police verification settings","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalComplianceSettingsView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view"]},"put":{"operationId":"saveRentalComplianceSettings","summary":"Change the KYC and police verification settings","description":"Audited with before/after.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentalComplianceSettings"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalComplianceSettingsView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/rental-inspections":{"get":{"operationId":"getRentalInspectionSettings","summary":"Inspection and deposit settings","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspectionSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["settings.pipelines","settings.view"]},"put":{"operationId":"saveRentalInspectionSettings","summary":"Change the inspection and deposit settings","description":"Audited.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentalInspectionSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalInspectionSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"settings.pipelines"}},"/api/v1/settings/rental-maintenance":{"get":{"operationId":"getMaintenanceSettings","summary":"Maintenance settings","description":"Categories, SLA hours per urgency, the default owner-approval threshold, auto-close, reopen and the intake.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view","rentals.view"]},"put":{"operationId":"saveMaintenanceSettings","summary":"Save the maintenance settings","description":"Replaces the settings (422 on a bad value, resolving due before responding). Audited.","tags":["Rental maintenance"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaintenanceSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaintenanceSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/rental-pipeline":{"get":{"operationId":"getRentalPipelineSettings","summary":"Rental pipeline defaults","tags":["Rental offers"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalPipelineSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view"]},"put":{"operationId":"updateRentalPipelineSettings","summary":"Change the rental pipeline defaults","tags":["Rental offers"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentalPipelineSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RentalPipelineSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/site-chat":{"get":{"operationId":"getSiteChatSettings","summary":"Site chat settings","description":"Whether published landing pages and microsites show the AI property chat, and its greeting.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteChatSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"},"put":{"operationId":"saveSiteChatSettings","summary":"Save the site chat settings","description":"Switching it on publishes an AI chat on the public pages (answers use AI credits). Audited.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteChatSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteChatSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.publish"}},"/api/v1/settings/sla-policies":{"get":{"operationId":"listSlaPolicies","summary":"SLA policies","description":"The first-response SLA first, then the company’s policies, each with what is on the clock right now.","tags":["SLA policies"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SlaPolicy"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.lead_routing","settings.view"]},"post":{"operationId":"createSlaPolicy","summary":"Add an SLA policy","tags":["SLA policies"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"metric":{"type":"string","enum":["first_call","first_visit","stage_dwell","task_overdue"]},"enabled":{"type":"boolean"},"target_minutes":{"type":"integer","minimum":1,"maximum":527040},"clock":{"type":"string","enum":["business","calendar"]},"scope":{"type":"object","properties":{"entity":{"type":"string","enum":["lead","deal"]},"pipeline_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"status_keys":{"type":"array","items":{"type":"string"}},"deal_stages":{"type":"array","items":{"type":"string","enum":["negotiation","token","agreement","registration"]}},"deal_types":{"type":"array","items":{"type":"string","enum":["sale","rent","lease"]}},"lead_types":{"type":"array","items":{"type":"string","enum":["buy","rent","sell","let_out","invest"]}},"source_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"task_types":{"type":"array","items":{"type":"string"}}}},"ladder":{"type":"object","properties":{"at_risk_percent":{"type":"integer","minimum":10,"maximum":99},"notify_owner":{"type":"boolean"},"breach_notify":{"type":"string","enum":["team_lead","manager","owner"]},"after_breach_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":43200},{"type":"null"}]},"after_breach_action":{"type":"string","enum":["none","notify","reassign","pool"]},"repeat_threshold":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}]},"repeat_window_days":{"type":"integer","minimum":1,"maximum":30}}}},"required":["name","metric","target_minutes"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SlaPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/settings/sla-policies/{id}":{"patch":{"operationId":"updateSlaPolicy","summary":"Change an SLA policy","description":"`first_response` names the E3 first-response SLA (its scope and name are fixed). Running clocks keep their target.","tags":["SLA policies"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"type":"boolean"},"target_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":527040},{"type":"null"}]},"clock":{"type":"string","enum":["business","calendar"]},"scope":{"type":"object","properties":{"entity":{"type":"string","enum":["lead","deal"]},"pipeline_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"status_keys":{"type":"array","items":{"type":"string"}},"deal_stages":{"type":"array","items":{"type":"string","enum":["negotiation","token","agreement","registration"]}},"deal_types":{"type":"array","items":{"type":"string","enum":["sale","rent","lease"]}},"lead_types":{"type":"array","items":{"type":"string","enum":["buy","rent","sell","let_out","invest"]}},"source_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"task_types":{"type":"array","items":{"type":"string"}}}},"ladder":{"type":"object","properties":{"at_risk_percent":{"type":"integer","minimum":10,"maximum":99},"notify_owner":{"type":"boolean"},"breach_notify":{"type":"string","enum":["team_lead","manager","owner"]},"after_breach_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":43200},{"type":"null"}]},"after_breach_action":{"type":"string","enum":["none","notify","reassign","pool"]},"repeat_threshold":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}]},"repeat_window_days":{"type":"integer","minimum":1,"maximum":30}}},"settings":{"type":"object","properties":{"digest_enabled":{"type":"boolean"},"digest_time":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SlaPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"},"delete":{"operationId":"deleteSlaPolicy","summary":"Delete an SLA policy","description":"With its clocks. The first-response SLA is switched off instead.","tags":["SLA policies"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/settings/stamp-duty":{"get":{"operationId":"listStampDutyRules","summary":"The stamp-duty table","description":"PropZolo’s rules (with sources, effective dates and [U] flags) and the company’s own.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StampDutyTable"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view"]},"post":{"operationId":"saveStampDutyOverride","summary":"Add or change a company stamp-duty rule","description":"Audited with before/after. Step-up for Owner/Admin sessions.","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampDutyOverrideInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StampDutyOverride"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/stamp-duty/estimate":{"post":{"operationId":"calculateStampDuty","summary":"Try the stamp-duty calculator","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampDutyCalculatorInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StampDutyEstimate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.pipelines","settings.view"]}},"/api/v1/settings/stamp-duty/{id}":{"delete":{"operationId":"deleteStampDutyOverride","summary":"Remove a company stamp-duty rule","tags":["Rental agreement settings"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.pipelines"}},"/api/v1/settings/syndication":{"get":{"operationId":"getSyndicationSettings","summary":"Portal syndication settings and accounts","description":"The defaults of a new publish and every portal account (no credentials — which ones are stored only).","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/SyndicationSettings"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/SyndicationPortalAccount"}}},"required":["settings","accounts"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]},"patch":{"operationId":"updateSyndicationSettings","summary":"Change the syndication defaults","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"default_portals":{"maxItems":5,"type":"array","items":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]}},"price_display":{"type":"string","enum":["exact","on_request"]},"contact_mode":{"type":"string","enum":["agent","company"]},"company_contact_name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"company_contact_phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"agent_rera_number":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"auto_update":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SyndicationSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.inventory"}},"/api/v1/settings/syndication/accounts/{portal}":{"put":{"operationId":"saveSyndicationAccount","summary":"Connect a portal account or change it","description":"Account id and package (listing slots, end date) are settings; the API key / login is sealed in the vault and never returned. Omitted credentials stay as they are; `null` removes one.","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"settings":{"type":"object","properties":{"account_id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"package_name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"listing_limit":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"package_ends_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}}},"secrets":{"type":"object","properties":{"api_key":{"anyOf":[{"type":"string","minLength":8,"maxLength":512},{"type":"null"}]},"username":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"password":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}}}},"required":["settings"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SyndicationPortalAccount"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"delete":{"operationId":"disconnectSyndicationAccount","summary":"Disconnect a portal account","description":"Credentials are wiped; listings stay on the portal as they are and nothing new is sent.","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"portal","in":"path","required":true,"schema":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/settings/unit-holds":{"get":{"operationId":"getUnitHoldPolicy","summary":"Unit hold settings","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitHoldPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["units.view","settings.inventory"]},"patch":{"operationId":"updateUnitHoldPolicy","summary":"Change unit hold settings","description":"The default hold cannot be longer than the longest hold.","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"default_hours":{"type":"integer","minimum":1,"maximum":720},"max_hours":{"type":"integer","minimum":1,"maximum":720},"role_max_hours":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"type":"integer","minimum":1,"maximum":720}},"max_active_per_member":{"type":"integer","minimum":1,"maximum":200},"allow_extension":{"type":"boolean"},"extension_hours":{"type":"integer","minimum":1,"maximum":168},"warn_before_minutes":{"type":"integer","minimum":0,"maximum":1440},"require_lead":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitHoldPolicy"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.inventory"}},"/api/v1/settings/voice-agent":{"get":{"operationId":"getVoiceAgentSettings","summary":"AI voice agent settings","description":"The settings, the company’s numbers with their A2P state (only numbers declared for AI voice are dialled from), members who can take a transfer, and whether a voice partner is configured.","tags":["AI voice agent"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceAgentSettingsView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["ai.voice_agent_manage","ai.voice_agent","settings.view"]},"put":{"operationId":"saveVoiceAgentSettings","summary":"Save the AI voice agent settings","description":"Replaces the settings. 422 when calling hours leave 09:00–21:00, a number is not the company’s, or the agent is switched on without a number declared for AI voice. Audited.","tags":["AI voice agent"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceAgentSettingsInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceAgentSettingsView"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.voice_agent_manage"}},"/api/v1/shares":{"get":{"operationId":"listShares","summary":"Share links","description":"Newest first, for a lead or a listing (or the caller’s own); with view counts and reactions.","tags":["Shares"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"property_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Share"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"},"post":{"operationId":"createShare","summary":"Create a tracked share link","description":"A shortlist of up to 20 listings, or a project, for a lead. Returns the link, a ready message and a wa.me draft. The listings must be visible to the caller; the lead must be one the caller can see.","tags":["Shares"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShareInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreatedShare"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.share","x-idempotent":true}},"/api/v1/shares/recipients":{"get":{"operationId":"searchShareRecipients","summary":"Leads to share with","description":"Open buyer / tenant leads the caller can see, by name, phone digits or L- reference.","tags":["Shares"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":60}},{"name":"limit","in":"query","required":false,"schema":{"default":8,"type":"integer","minimum":1,"maximum":20}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ShareRecipient"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.share"}},"/api/v1/shares/{id}":{"get":{"operationId":"getShare","summary":"A share link with its views","tags":["Shares"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["properties:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"url":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string","enum":["active","expired","revoked"]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},{"type":"null"}]},"property_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"shared_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"view_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"view_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"first_viewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_viewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reactions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/ShareReaction"}},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"views":{"type":"array","items":{"$ref":"#/components/schemas/ShareView"}}},"required":["id","url","title","channel","status","lead","property_ids","project_id","shared_by","view_count","view_seconds","first_viewed_at","last_viewed_at","reactions","expires_at","revoked_at","created_at","views"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.view"}},"/api/v1/shares/{id}/revoke":{"post":{"operationId":"revokeShare","summary":"Revoke a share link","description":"The page stops rendering at once (410 Gone). The author, or anyone who may edit the lead, can revoke.","tags":["Shares"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Share"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"properties.share"}},"/api/v1/site-domains":{"get":{"operationId":"listSiteDomains","summary":"Custom domains","description":"The company’s own domains for its pages, with the DNS records to add and the plan’s limit.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/SiteDomain"}},"limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"cname_target":{"type":["string","null"]}},"required":["domains","limit","cname_target"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.view","marketing.view"]},"post":{"operationId":"addSiteDomain","summary":"Add a custom domain","description":"A sub-domain the company owns (homes.acme.in). It serves pages once the CNAME is in place and Cloudflare confirmed ownership and the certificate. Needs a recent two-factor check.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","minLength":1,"maxLength":300},"home_page_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["hostname"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteDomain"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company","x-idempotent":true}},"/api/v1/site-domains/{id}":{"patch":{"operationId":"updateSiteDomain","summary":"Change a domain’s home page","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"home_page_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["home_page_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteDomain"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"},"delete":{"operationId":"removeSiteDomain","summary":"Remove a custom domain","description":"Stops serving at once; the hostname is released at Cloudflare in the background.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"hostname":{"type":"string"}},"required":["id","hostname"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/site-domains/{id}/check":{"post":{"operationId":"checkSiteDomain","summary":"Check a domain now","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteDomain"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/site-settings":{"get":{"operationId":"getSiteSettings","summary":"Website tracking and consent","description":"The tags every page inherits, the consent banner’s words and the microsite defaults.","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.view"},"patch":{"operationId":"updateSiteSettings","summary":"Change website tracking and consent","tags":["Landing pages"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSiteSettings"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"marketing.publish"}},"/api/v1/sla/digest":{"get":{"operationId":"getSlaDigest","summary":"A day of first responses","description":"Leads that arrived that company day: on time, late, breached, per owner, plus uncalled open leads.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"day","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SlaDigest"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"}},"/api/v1/sla/leads":{"get":{"operationId":"listSlaLeads","summary":"Unanswered leads against their SLA","description":"At risk and breached by default (`state=open` adds on-track ones), most urgent first.","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["at_risk","breached","open"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SlaLead"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"}},"/api/v1/sla/settings":{"get":{"operationId":"getSlaSettings","summary":"First-response SLA settings","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FirstResponseSlaSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"put":{"operationId":"saveSlaSettings","summary":"Change the first-response SLA","tags":["Assignment"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"default_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":10080},{"type":"null"}]},"per_source":{"type":"object","propertyNames":{"$ref":"#/components/schemas/Id"},"additionalProperties":{"anyOf":[{"type":"integer","minimum":1,"maximum":10080},{"type":"null"}]}},"at_risk_percent":{"type":"integer","minimum":10,"maximum":99},"clock":{"type":"string","enum":["business","calendar"]},"notify_manager":{"type":"boolean"},"digest_enabled":{"type":"boolean"},"digest_time":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FirstResponseSlaSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/sources":{"get":{"operationId":"listLeadSources","summary":"Lead sources","description":"Every lead source with its defaults, endpoints and health (members who see Lead sources or sources ROI).","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"include_inactive","in":"query","required":false,"description":"Default true.","schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/LeadSourceType"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadSourceDetail"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.lead_routing","settings.view","marketing.view"]},"post":{"operationId":"createLeadSource","summary":"Create a lead source","description":"Creates a source with its own Lead Push URL token.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadSource"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadSourceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing","x-idempotent":true}},"/api/v1/sources/stats":{"get":{"operationId":"getIngestionStats","summary":"Ingestion dashboard","description":"Outcomes per source and per day, provider → lead latency against the SLO, silent sources.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"default":7,"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IngestionStats"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.lead_routing","settings.view","marketing.view"]}},"/api/v1/sources/{id}":{"get":{"operationId":"getLeadSource","summary":"A lead source","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadSourceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.lead_routing","settings.view","marketing.view"]},"patch":{"operationId":"updateLeadSource","summary":"Update a lead source","description":"Name, type, cost, defaults, field mapping, silent-source alarm, active flag.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLeadSource"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadSourceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"},"delete":{"operationId":"deleteLeadSource","summary":"Delete an unused lead source","description":"A source that already has leads or ingestion history answers 409 — deactivate it instead.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/sources/{id}/email":{"get":{"operationId":"getSourceEmail","summary":"A source’s inbound email address","description":"The address, mails waiting for review and open Gmail / Outlook forwarding confirmations.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SourceInboundEmail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"},"post":{"operationId":"enableSourceEmail","summary":"Turn on a source’s inbound address","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SourceInboundEmail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"},"delete":{"operationId":"disableSourceEmail","summary":"Turn off a source’s inbound address","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SourceInboundEmail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/sources/{id}/email/rotate":{"post":{"operationId":"rotateSourceEmail","summary":"Issue a new inbound address","description":"The old address stops receiving at once — update the forwarding rule.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SourceInboundEmail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/sources/{id}/logs":{"get":{"operationId":"listLeadSourceLogs","summary":"Ingestion log of a source","description":"Recent ingest events, newest first (keyset pagination); failed events are dead letters to replay.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IngestStatus"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":400}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IngestLogEntry"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/sources/{id}/logs/{eventId}":{"get":{"operationId":"getLeadSourceLogEvent","summary":"One ingest event with its archived payload","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"eventId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IngestLogDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/sources/{id}/logs/{eventId}/replay":{"post":{"operationId":"replayLeadSourceEvent","summary":"Replay an ingest event","description":"Re-runs the pipeline for a failed or rejected event (e.g. after fixing the field mapping).","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"eventId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","const":"received"},"queued":{"type":"boolean"}},"required":["id","status","queued"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/sources/{id}/rotate-token":{"post":{"operationId":"rotateLeadSourceToken","summary":"Rotate the Lead Push URL","description":"Issues a new URL token; the old URL stops working at once.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadSourceDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/sources/{id}/test-capture":{"get":{"operationId":"captureLeadSourceTest","summary":"Listen for a test lead","description":"Long-polls (up to `wait` seconds) for the next event of the source received after `since` and describes its incoming keys with mapping suggestions. Without `since`, returns the latest event at once.","tags":["Lead sources"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"since","in":"query","required":false,"description":"Instant in ISO 8601, e.g. 2026-10-03T04:30:00.000Z.","schema":{"$ref":"#/components/schemas/DateTime"}},{"name":"wait","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":0,"maximum":25}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"captured":{"type":"boolean"},"event":{"anyOf":[{"$ref":"#/components/schemas/IngestLogDetail"},{"type":"null"}]},"fields":{"type":"array","items":{"$ref":"#/components/schemas/IncomingFieldDescription"}}},"required":["captured","event","fields"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.lead_routing"}},"/api/v1/status":{"get":{"operationId":"getStatus","summary":"PropZolo status","description":"Live health of the app, lead capture, background jobs, database, file storage and messaging providers, with incidents and planned maintenance. Public; refreshed at most every 30 seconds.","tags":["Status"],"security":[],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StatusSnapshot"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"public"}},"/api/v1/support-access":{"get":{"operationId":"listSupportAccess","summary":"Support-access grants and sessions","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportAccess"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.support_access"},"post":{"operationId":"createSupportGrant","summary":"Let PropZolo support in","description":"Time-boxed (≤ 72 h), read-only by default; every action support takes is audited with both identities.","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupportGrantInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportGrant"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.support_access"}},"/api/v1/support-access/{id}/revoke":{"post":{"operationId":"revokeSupportGrant","summary":"Revoke support access","description":"Ends the grant and every support session on it at once.","tags":["Billing"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportGrant"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"privacy.support_access"}},"/api/v1/support/tickets":{"get":{"operationId":"listSupportTickets","summary":"Your support tickets","description":"Latest activity first. `scope=company` lists every ticket of the company (Owners and Admins — privacy.support_access).","tags":["Support"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","company"]}},{"name":"status","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["active","all","open","pending","solved","closed"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":500}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SupportTicket"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"post":{"operationId":"createSupportTicket","summary":"Ask PropZolo support","description":"Opens a ticket; the first-response target follows your plan and the priority you choose.","tags":["Support"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupportTicketInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportTicketDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-idempotent":true}},"/api/v1/support/tickets/{id}":{"get":{"operationId":"getSupportTicket","summary":"A ticket and its thread","tags":["Support"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportTicketDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/support/tickets/{id}/messages":{"post":{"operationId":"replySupportTicket","summary":"Reply in a ticket","description":"The ticket goes back to PropZolo; a solved ticket reopens. A closed ticket answers 409.","tags":["Support"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplySupportTicketInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportTicketDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-idempotent":true}},"/api/v1/support/tickets/{id}/resolve":{"post":{"operationId":"resolveSupportTicket","summary":"Mark a ticket as solved","tags":["Support"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportTicketDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/support/uploads":{"post":{"operationId":"startSupportUpload","summary":"Upload URL for a ticket attachment","description":"A presigned PUT for one screenshot or PDF (up to 10 MB); pass the key with the ticket or reply.","tags":["Support"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportUploadInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SupportUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/syndication/dashboard":{"get":{"operationId":"getSyndicationDashboard","summary":"Portal syndication dashboard","description":"Per portal: listings by status, views and linked leads, the package quota and the last sync; the listings that need attention (failed, rejected, expired). Within the listings the member may see.","tags":["Portal syndication"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SyndicationDashboard"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"properties.view"}},"/api/v1/tasks":{"get":{"operationId":"listTasks","summary":"List tasks","description":"Keyset-paginated tasks within the caller’s scope. Sort keys: due_at (default), created_at, priority.","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["tasks:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"view","in":"query","required":false,"description":"Default `open` (or `all` with a from / to range).","schema":{"$ref":"#/components/schemas/TaskView"}},{"name":"assignee_id","in":"query","required":false,"description":"A member id, or `me`.","schema":{"type":"string","maxLength":64}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"contact_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TaskType"}},{"name":"from","in":"query","required":false,"description":"Calendar range start (due_at ≥), local date or instant.","schema":{"type":"string","minLength":10,"maxLength":40}},{"name":"to","in":"query","required":false,"description":"Calendar range end (due_at ≤), local date or instant.","schema":{"type":"string","minLength":10,"maxLength":40}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"tasks.view"},"post":{"operationId":"createTask","summary":"Create a task","description":"For yourself by default; assigning to colleagues needs tasks.assign over them.","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["tasks:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"tasks.create","x-idempotent":true}},"/api/v1/tasks/summary":{"get":{"operationId":"getTaskSummary","summary":"Overdue / today / upcoming counts","description":"The caller’s own open tasks (or `assignee_id`’s, within scope) on the company’s calendar day.","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"assignee_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"overdue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"today":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upcoming":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["overdue","today","upcoming"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"tasks.view"}},"/api/v1/tasks/{id}":{"get":{"operationId":"getTask","summary":"A task","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["tasks:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"tasks.view"},"patch":{"operationId":"updateTask","summary":"Update a task","description":"A new due time, reminder or assignee re-arms the reminder.","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["tasks:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"tasks.edit"},"delete":{"operationId":"cancelTask","summary":"Cancel a task","description":"The task leaves every list but stays in the history.","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"tasks.delete"}},"/api/v1/tasks/{id}/complete":{"post":{"operationId":"completeTask","summary":"Complete a task","description":"A recurring task creates its next occurrence (returned as `next`). A replay with the same `Idempotency-Key` returns the first answer (never a second occurrence).","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["tasks:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/Task"},"next":{"anyOf":[{"$ref":"#/components/schemas/Task"},{"type":"null"}]}},"required":["task","next"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"tasks.edit","x-idempotent":true}},"/api/v1/tasks/{id}/reopen":{"post":{"operationId":"reopenTask","summary":"Reopen a task","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["tasks:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"tasks.edit"}},"/api/v1/tasks/{id}/snooze":{"post":{"operationId":"snoozeTask","summary":"Snooze a task","description":"To a preset (the status sheet chips) or an exact time; due time and reminder move together. Idempotent with an `Idempotency-Key` (a replayed \"tomorrow\" keeps the first answer).","tags":["Tasks"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["tasks:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnoozeTaskInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Task"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"tasks.edit","x-idempotent":true}},"/api/v1/teams":{"get":{"operationId":"listTeams","summary":"Teams","description":"Teams with their lead and members. Needs `settings.company`, `settings.users` or `settings.view`.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Team"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.company","settings.users","settings.view"]},"post":{"operationId":"createTeam","summary":"Create a team","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Team"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/teams/{id}":{"patch":{"operationId":"updateTeam","summary":"Edit a team","description":"`member_ids` replaces the member list.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Team"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"},"delete":{"operationId":"deleteTeam","summary":"Delete a team","description":"Leads keep their history; the team stops appearing in routing and filters.","tags":["Team"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/telephony":{"get":{"operationId":"getTelephony","summary":"Telephony overview","description":"The connection (webhook URLs for members who manage integrations), settings and virtual numbers.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonyOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]}},"/api/v1/telephony/declarations/{id}":{"patch":{"operationId":"updateA2pDeclaration","summary":"Move an A2P declaration forward","description":"draft → submitted → declared / rejected, declared → revoked; the reference, dates and the document.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["draft","submitted","declared","rejected","revoked"]},"uses":{"maxItems":4,"type":"array","items":{"type":"string","enum":["click_to_call","dialer","voice_agent","ivr"]}},"filed_with":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"reference":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"declared_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"document_key":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"document_name":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/A2pDeclaration"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/telephony/declarations/{id}/document":{"get":{"operationId":"getA2pDeclarationDocument","summary":"Open the filed declaration","description":"A five-minute link; audited.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]}},"/api/v1/telephony/declarations/{id}/upload":{"post":{"operationId":"presignA2pDeclarationUpload","summary":"Upload the filed declaration","description":"A presigned PUT (PDF or image); then PATCH the declaration with the returned `key`.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]}},"required":["content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/A2pDeclarationUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/telephony/number-sources/{id}":{"patch":{"operationId":"updateTelephonyNumberSource","summary":"Change or end a number’s source period","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_id":{"$ref":"#/components/schemas/Id"},"valid_from":{"$ref":"#/components/schemas/DateTime"},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"route_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonyNumber"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"delete":{"operationId":"deleteTelephonyNumberSource","summary":"Remove a number’s source period","description":"Calls already received keep their source.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonyNumber"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/telephony/numbers":{"post":{"operationId":"addTelephonyNumber","summary":"Add a virtual number by hand","description":"For accounts whose plan has no number API: the ExoPhone exactly as Exotel shows it.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"e164":{"type":"string","minLength":6,"maxLength":24},"label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["e164"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonyNumber"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/telephony/numbers/{id}":{"patch":{"operationId":"updateTelephonyNumber","summary":"Change a virtual number","description":"Its label, the default caller id, the branch it belongs to and where unanswerable calls go.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"is_default":{"type":"boolean"},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"fallback_e164":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}]},"status":{"type":"string","enum":["active","released"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonyNumber"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/telephony/numbers/{id}/declarations":{"post":{"operationId":"createA2pDeclaration","summary":"Record an A2P declaration of a number","description":"TRAI (18 Sep 2026): numbers used for software-initiated calls must be declared to the operator. Each filing is its own record; the newest decides the number’s state.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["draft","submitted","declared","rejected","revoked"]},"uses":{"maxItems":4,"type":"array","items":{"type":"string","enum":["click_to_call","dialer","voice_agent","ivr"]}},"filed_with":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"reference":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"declared_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/A2pDeclaration"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/telephony/numbers/{id}/sources":{"post":{"operationId":"addTelephonyNumberSource","summary":"Let a number stand for a lead source","description":"From `valid_from` until `valid_to` (open-ended when empty); periods of one number never overlap.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_id":{"$ref":"#/components/schemas/Id"},"valid_from":{"$ref":"#/components/schemas/DateTime"},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"route_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["source_id","valid_from"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonyNumber"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/telephony/settings":{"put":{"operationId":"updateTelephonySettings","summary":"Change the telephony settings","description":"Recording and its disclosure, the A2P rule for click-to-call, missed-call acknowledgement, call-back time.","tags":["Telephony"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"record_calls":{"type":"boolean"},"disclosure_text":{"type":"string","minLength":10,"maxLength":500},"recording_disclosed":{"type":"boolean","description":"The provider flows play the disclosure to the customer before the call connects; no call is recorded until it is set."},"ai_assist_disclosed":{"type":"boolean","description":"The disclosure tells callers an AI assistant processes the call; live call assist stays off until it is set."},"click_to_call_a2p":{"type":"string","enum":["warn","block","off"]},"missed_call_ack":{"type":"boolean"},"missed_call_channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]},"callback_minutes":{"type":"integer","minimum":5,"maximum":1440},"ring_timeout_sec":{"type":"integer","minimum":15,"maximum":120},"max_call_minutes":{"type":"integer","minimum":5,"maximum":240},"calling_hours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TelephonySettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/templates":{"get":{"operationId":"listTemplates","summary":"Message templates","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["templates:read"]}],"parameters":[{"name":"channel","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TemplateChannel"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TemplateStatus"}},{"name":"use_case","in":"query","required":false,"schema":{"type":"string","maxLength":32}},{"name":"language","in":"query","required":false,"schema":{"type":"string","maxLength":8}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MessageTemplate"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"templates.view"},"post":{"operationId":"createTemplate","summary":"Create a template","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/templates/dlt-import":{"post":{"operationId":"importDltTemplates","summary":"Import DLT templates (CSV)","description":"The template export of the operator’s DLT portal, as text. Rows with problems are reported and skipped.","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"csv":{"type":"string","minLength":1,"maxLength":900000}},"required":["csv"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"headers_added":{"type":"array","items":{"type":"string"}},"missing_columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":"string"},"name":{"type":"string"},"outcome":{"type":"string","enum":["created","updated","unchanged","skipped"]},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}},"required":["row","template_id","name","outcome","errors","warnings"],"additionalProperties":false}}},"required":["created","updated","unchanged","skipped","headers_added","missing_columns","rows"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/templates/library":{"post":{"operationId":"seedTemplateLibrary","summary":"Add the template library","description":"Adds the seeded Indian real-estate templates the company does not have yet; never overwrites.","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/TemplateChannel"}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["created","skipped"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/templates/preview":{"post":{"operationId":"previewDraftTemplate","summary":"Preview an unsaved template","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"record":{"description":"Fill the variables from this record; sample data when absent.","type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"},"property_id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"visit_id":{"$ref":"#/components/schemas/Id"}}},"vars":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"additionalProperties":{"type":"string","maxLength":1000}},"draft":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/TemplateChannel"},"language":{"default":"en","type":"string","maxLength":8},"display_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"category":{"type":"string","minLength":1,"maxLength":24},"use_case":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"header":{"description":"email: { type: \"email\", subject, text? } · WhatsApp: { type, text? }"},"body":{"type":"string","minLength":1,"maxLength":200000},"footer":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"buttons":{},"variables":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/TemplateVariableInput"}},"dlt_template_id":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}]},"dlt_header":{"anyOf":[{"type":"string","maxLength":11},{"type":"null"}]},"provider_template_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["channel","category","body"]}},"required":["draft"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TemplatePreview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.view"}},"/api/v1/templates/variables":{"get":{"operationId":"listTemplateVariables","summary":"Variables a template can use","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["templates:read"]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"sample":{"type":"string"},"group":{"type":"string"}},"required":["key","label","sample","group"],"additionalProperties":false}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"templates.view"}},"/api/v1/templates/{id}":{"get":{"operationId":"getTemplate","summary":"A template","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["templates:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"templates.view"},"patch":{"operationId":"updateTemplate","summary":"Update a template","description":"DLT-registered SMS text is immutable (re-import it); editing an approved WhatsApp template sends it back to draft.","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"},"delete":{"operationId":"deleteTemplate","summary":"Delete a template","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.delete"}},"/api/v1/templates/{id}/preview":{"post":{"operationId":"previewTemplate","summary":"Preview a template","tags":["Templates"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["templates:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"record":{"description":"Fill the variables from this record; sample data when absent.","type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"},"property_id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"visit_id":{"$ref":"#/components/schemas/Id"}}},"vars":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"additionalProperties":{"type":"string","maxLength":1000}}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TemplatePreview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"templates.view"}},"/api/v1/triggers":{"get":{"operationId":"listAutomationTriggers","summary":"Triggers for automation tools","description":"The triggers with sample records. Apps also use it to test the API key.","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read","site_visits:read","deals:read","contacts:read","tasks:read","calls:read","inbox:read","properties:read","receipts:read","webhooks:manage"]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AutomationTrigger"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["leads.view","site_visits.view","deals.view","contacts.view","tasks.view","calls.view","inbox.view","properties.view","receipts.view","settings.integrations"]}},"/api/v1/triggers/{trigger}":{"get":{"operationId":"pollAutomationTrigger","summary":"Poll a trigger","description":"The newest records the key can see, newest first; `id` is the deduplication key (the record’s id, or `evt_<event id>` for events that can repeat). Field rules of the key’s creator apply (e.g. masked phones). Each trigger needs its own read scope (403 otherwise).","tags":["Automation tools"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["leads:read","site_visits:read","deals:read","contacts:read","tasks:read","calls:read","inbox:read","properties:read","receipts:read","webhooks:manage"]}],"parameters":[{"name":"trigger","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AutomationTriggerKey"}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission-any":["leads.view","site_visits.view","deals.view","contacts.view","tasks.view","calls.view","inbox.view","properties.view","receipts.view","settings.integrations"]}},"/api/v1/unit-holds":{"get":{"operationId":"listUnitHolds","summary":"Running holds: mine, or every hold within my release scope (pending extensions first)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"mine","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UnitHoldListItem"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"}},"/api/v1/unit-holds/{id}/extension":{"post":{"operationId":"requestUnitHoldExtension","summary":"Ask for the one extension a hold may get (the holder)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":168},{"type":"null"}]},"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitHold"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.hold"}},"/api/v1/unit-holds/{id}/extension/decision":{"post":{"operationId":"decideUnitHoldExtension","summary":"Approve or deny an extension — or grant one unasked (a manager, never the holder)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approve":{"type":"boolean"},"hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":168},{"type":"null"}]}},"required":["approve"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitHold"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"}},"/api/v1/unit-holds/{id}/release":{"post":{"operationId":"releaseUnitHold","summary":"Release a hold (the holder, or a manager within units.release scope)","tags":["Unit inventory"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UnitHold"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"units.view"}},"/api/v1/visits":{"get":{"operationId":"listSiteVisits","summary":"List site visits","description":"Keyset-paginated visits in your scope (agent / booker, or visits on leads you can see).","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:read"]}],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page (`meta.next_cursor`).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Comma list of sort keys, \"-\" prefix for descending, e.g. -received_at.","schema":{"type":"string","maxLength":200}},{"name":"view","in":"query","required":false,"description":"Default `all`; `today` uses the company’s day.","schema":{"type":"string","enum":["upcoming","today","past","needs_feedback","all"]}},{"name":"status","in":"query","required":false,"description":"Comma list of statuses.","schema":{"type":"string","maxLength":200}},{"name":"agent_id","in":"query","required":false,"description":"A member id, or `me`.","schema":{"type":"string","maxLength":64}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"property_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"from","in":"query","required":false,"description":"scheduled_at ≥ (local date or instant).","schema":{"type":"string","minLength":10,"maxLength":40}},{"name":"to","in":"query","required":false,"description":"scheduled_at ≤ (a local date includes the whole day).","schema":{"type":"string","minLength":10,"maxLength":40}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SiteVisit"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.view"},"post":{"operationId":"scheduleSiteVisit","summary":"Schedule a site visit","description":"A tour of up to 10 properties / units; the response warns about the agent’s nearby visits.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSiteVisitInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScheduleVisitResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.create","x-idempotent":true}},"/api/v1/visits/analytics":{"get":{"operationId":"getSiteVisitAnalytics","summary":"Visit analytics","description":"Scheduled → done → deal, no-show, verified and feedback rates by agent, source or project.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:read"]}],"parameters":[{"name":"range","in":"query","required":false,"description":"Default 30d, on the company’s calendar.","schema":{"type":"string","enum":["today","yesterday","7d","30d","90d","week","last_week","month","last_month"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","enum":["agent","source","project"]}},{"name":"agent_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisitAnalytics"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.view"}},"/api/v1/visits/calendar":{"get":{"operationId":"getSiteVisitCalendar","summary":"Visits calendar with agent lanes","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:read"]}],"parameters":[{"name":"from","in":"query","required":true,"description":"First local day (YYYY-MM-DD) or instant.","schema":{"type":"string","minLength":10,"maxLength":40}},{"name":"to","in":"query","required":true,"description":"Last local day (inclusive) or instant; up to 42 days.","schema":{"type":"string","minLength":10,"maxLength":40}},{"name":"agent_ids","in":"query","required":false,"schema":{"type":"string","maxLength":2000}},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisitCalendar"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.view"}},"/api/v1/visits/conflicts":{"get":{"operationId":"checkSiteVisitConflicts","summary":"The agent’s nearby visits","description":"Visits overlapping the slot or within the travel buffer (live warnings in the booking form).","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:read"]}],"parameters":[{"name":"agent_id","in":"query","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"scheduled_at","in":"query","required":true,"schema":{"type":"string","minLength":10,"maxLength":40}},{"name":"duration_min","in":"query","required":false,"schema":{"type":"integer","minimum":15,"maximum":480}},{"name":"exclude_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SiteVisitConflict"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.view"}},"/api/v1/visits/settings":{"get":{"operationId":"getSiteVisitSettings","summary":"Site visit settings","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:read"]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisitSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.view"},"patch":{"operationId":"updateSiteVisitSettings","summary":"Change site visit settings","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVisitSettingsPatch"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisitSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.company"}},"/api/v1/visits/{id}":{"get":{"operationId":"getSiteVisit","summary":"A site visit","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisit"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.view"},"patch":{"operationId":"updateSiteVisit","summary":"Change a visit","description":"Agent, pre-sales, project, tour, meeting point, pickup, length or partner (the time: reschedule).","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSiteVisitInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScheduleVisitResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit"}},"/api/v1/visits/{id}/cancel":{"post":{"operationId":"cancelSiteVisit","summary":"Cancel a visit","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSiteVisitInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisit"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit"}},"/api/v1/visits/{id}/certificate":{"get":{"operationId":"getSiteVisitCertificate","summary":"The visit certificate","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisitCertificate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.view"}},"/api/v1/visits/{id}/check-in":{"post":{"operationId":"checkInSiteVisit","summary":"Check in at the site","description":"GPS + optional photo and OTP; warns beyond the company radius.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVisitCheckInInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VisitCheckInResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit","x-idempotent":true}},"/api/v1/visits/{id}/check-out":{"post":{"operationId":"checkOutSiteVisit","summary":"Check out and finish the visit","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVisitCheckOutInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VisitCheckOutResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit","x-idempotent":true}},"/api/v1/visits/{id}/complete":{"post":{"operationId":"completeSiteVisit","summary":"Mark the visit as done","description":"Without a GPS capture (web). Needs the OTP when required, or an override.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteSiteVisitInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisit"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit"}},"/api/v1/visits/{id}/confirm":{"post":{"operationId":"confirmSiteVisit","summary":"Mark the visit confirmed","description":"The client confirmed on the phone (the link confirms by itself).","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisit"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit"}},"/api/v1/visits/{id}/feedback":{"post":{"operationId":"recordSiteVisitFeedback","summary":"Record visit feedback","description":"Per property (liked / maybe / disliked + reasons), interest, objections and the next step.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVisitFeedbackInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SiteVisit"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit","x-idempotent":true}},"/api/v1/visits/{id}/no-show":{"post":{"operationId":"markSiteVisitNoShow","summary":"Mark a no-show","description":"Sends the client a reschedule offer unless switched off.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVisitNoShowInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VisitNoShowResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit","x-idempotent":true}},"/api/v1/visits/{id}/otp":{"post":{"operationId":"sendSiteVisitOtp","summary":"Send the visit code to the client","description":"WhatsApp / SMS / email through the send pipeline; 30-second resend gap, 5 codes per visit.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SendVisitOtpResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit"}},"/api/v1/visits/{id}/otp/verify":{"post":{"operationId":"verifySiteVisitOtp","summary":"Check the client’s visit code","description":"A wrong code answers `verified: false` with the attempts left; the third locks the code.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifySiteVisitOtpInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VerifyVisitOtpResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit"}},"/api/v1/visits/{id}/photos":{"post":{"operationId":"presignSiteVisitPhoto","summary":"Upload URL for a check-in photo","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteVisitPhotoInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VisitPhotoUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit"}},"/api/v1/visits/{id}/reschedule":{"post":{"operationId":"rescheduleSiteVisit","summary":"Reschedule a visit","description":"Also rebooks a no-show. Reminders, the client’s confirmation and the OTP start over.","tags":["Site visits"],"security":[{"session":[]},{"mobileSession":[]},{"apiKey":["site_visits:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RescheduleSiteVisitInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScheduleVisitResult"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"principal","x-permission":"site_visits.edit","x-idempotent":true}},"/api/v1/voice-agent/calls":{"get":{"operationId":"listVoiceCalls","summary":"AI voice calls","description":"Live and recent calls of the agent, newest first: `open` = waiting or on the line, `live` = ringing or talking; filter by kind, outcome or lead. Keyset pagination.","tags":["AI voice agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["scheduled","dialing","live","completed","failed","blocked","cancelled","open"]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["new_enquiry","missed_call","visit_confirmation","visit_feedback"]}},{"name":"outcome","in":"query","required":false,"schema":{"type":"string","enum":["visit_booked","visit_confirmed","visit_reschedule","visit_cancel","feedback_given","qualified","transferred","callback_requested","not_interested","opted_out","wrong_number","no_answer","busy","voicemail","failed"]}},{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceCall"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.voice_agent"},"post":{"operationId":"queueVoiceCall","summary":"Ask the agent to call a lead","description":"A callback now (or at the next opening of the calling hours), a visit confirmation or a feedback call. The same checks as every AI call apply when it dials (consent, the enquiry window, DND, a declared number). 409 while the lead already has a call waiting.","tags":["AI voice agent"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["new_enquiry","visit_confirmation","visit_feedback"]},"visit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["lead_id","kind"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceCall"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.voice_agent"}},"/api/v1/voice-agent/calls/{id}":{"get":{"operationId":"getVoiceCall","summary":"An AI voice call with its transcript","description":"The call, every turn (with where the product overrode the model) and what it collected and did.","tags":["AI voice agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceCallDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.voice_agent"}},"/api/v1/voice-agent/calls/{id}/cancel":{"post":{"operationId":"cancelVoiceCall","summary":"Cancel a call that has not rung","description":"409 once the call is ringing or done. Audited.","tags":["AI voice agent"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceCall"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.voice_agent"}},"/api/v1/voice-agent/stats":{"get":{"operationId":"getVoiceStats","summary":"Today’s AI voice numbers","description":"Calls dialled and connected today (company clock), visits booked and confirmed, transfers, opt-outs, minutes and credits, the new-enquiry callback speed (median and the share inside 60 s), and calls waiting or live.","tags":["AI voice agent"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceStats"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"ai.voice_agent"}},"/api/v1/voice-debriefs":{"get":{"operationId":"listVoiceDebriefs","summary":"My voice debriefs","description":"Your own debriefs on a lead (`lead_id`) or those waiting for you (`pending=1`), newest first (20).","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"lead_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"pending","in":"query","required":false,"schema":{"type":"string","enum":["1","true"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceDebrief"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"},"post":{"operationId":"registerVoiceDebrief","summary":"Register a recorded voice debrief","description":"Idempotent on `client_key` (200 with the stored debrief on a replay). The audio is transcribed and read by the AI in the background; poll GET /voice-debriefs/{id} (or wait for the notification) until it is `ready`.","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceDebriefInput"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"debrief":{"$ref":"#/components/schemas/VoiceDebrief"},"replayed":{"type":"boolean"}},"required":["debrief","replayed"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.edit"}},"/api/v1/voice-debriefs/uploads":{"post":{"operationId":"presignVoiceDebrief","summary":"Upload URL for a voice debrief","description":"A presigned PUT (private, at most 10 MB of audio); register the key with POST /voice-debriefs.","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content_type":{"type":"string","minLength":3,"maxLength":100},"size":{"type":"integer","minimum":1,"maximum":10485760}},"required":["content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PresignedAudioUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.edit"}},"/api/v1/voice-debriefs/{id}":{"get":{"operationId":"getVoiceDebrief","summary":"A voice debrief","description":"Your own, or one on a lead you may view (read-only).","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceDebrief"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/voice-debriefs/{id}/apply":{"post":{"operationId":"applyVoiceDebrief","summary":"Apply a reviewed voice debrief","description":"What you kept of the proposal, in one transaction: the requirement (recomputed against the lead now), the status through the pipeline’s requirements and process guard (a gated status is refused — use the status sheet), the follow-up, the tasks and the timeline entry \"Voice debrief\".","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceDebriefApplyInput"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"debrief":{"$ref":"#/components/schemas/VoiceDebrief"},"status_changed":{"type":"boolean"},"task_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"requirement_fields":{"type":"array","items":{"type":"string"}}},"required":["debrief","status_changed","task_ids","requirement_fields"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.edit"}},"/api/v1/voice-debriefs/{id}/audio":{"get":{"operationId":"getVoiceDebriefAudio","summary":"Listen to a voice debrief (short-lived link)","description":"A 5-minute link; each listen is audited. 404 once the audio is past the `debrief_audio` retention.","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.view"}},"/api/v1/voice-debriefs/{id}/discard":{"post":{"operationId":"discardVoiceDebrief","summary":"Discard a voice debrief","description":"Your own, not yet applied: the audio is deleted now.","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceDebrief"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.edit"}},"/api/v1/voice-debriefs/{id}/transcript":{"post":{"operationId":"submitVoiceDebriefTranscript","summary":"Type or correct a debrief’s transcript","description":"Your own debrief; the AI reads the new text again.","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":2,"maxLength":20000}},"required":["text"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceDebrief"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"leads.edit"}},"/api/v1/voice/settings":{"get":{"operationId":"getVoiceSettings","summary":"Voice settings","description":"Debriefs, call transcription and its summary, the language hint; whether transcription is set up.","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"},"patch":{"operationId":"updateVoiceSettings","summary":"Change the voice settings","description":"Audited. Call transcription is metered on the AI wallet.","tags":["Voice debriefs"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"debriefs":{"type":"boolean"},"transcribe_call_recordings":{"type":"boolean"},"summarize_calls":{"type":"boolean"},"language":{"type":"string","enum":["auto","en-IN","hi-IN","bn-IN","gu-IN","kn-IN","ml-IN","mr-IN","od-IN","pa-IN","ta-IN","te-IN"]},"debrief_max_seconds":{"type":"integer","minimum":30,"maximum":300}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceSettings"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.mobile_app"}},"/api/v1/walk-ins":{"get":{"operationId":"listWalkIns","summary":"The site-office queue","description":"Walk-ins of a local day (default today) in arrival order, with tokens, waiting times and who has the visitor. Scope: site_visits.view — “all” sees the whole queue, narrower scopes their own and those of leads they see.","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"date","in":"query","required":false,"description":"Calendar date YYYY-MM-DD in the company time zone.","schema":{"$ref":"#/components/schemas/LocalDate"}},{"name":"kiosk_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"project_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["waiting","with_agent","done","left"]}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WalkInQueue"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"site_visits.view"}},"/api/v1/walk-ins/{id}":{"get":{"operationId":"getWalkIn","summary":"A walk-in","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WalkIn"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"site_visits.view"}},"/api/v1/walk-ins/{id}/status":{"post":{"operationId":"transitionWalkIn","summary":"Move a walk-in through the queue","description":"attend (someone takes the visitor), done, left (gone before anyone saw them) or requeue.","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionWalkIn"}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WalkIn"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"site_visits.edit"}},"/api/v1/walk-ins/{id}/visit":{"post":{"operationId":"startWalkInVisit","summary":"Start the site visit of a walk-in","description":"A site visit now, at the kiosk’s project, with whoever has the visitor and the partner who brought them.","tags":["Walk-ins"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"walk_in":{"$ref":"#/components/schemas/WalkIn"},"visit_id":{"$ref":"#/components/schemas/Id"}},"required":["walk_in","visit_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"site_visits.create"}},"/api/v1/webhook-deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"Webhook delivery log","description":"Newest first, 30 days. Filter by endpoint, by workflow “Send webhook” steps or by status.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"endpoint_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["endpoints","workflows"]}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WebhookDeliveryStatus"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/webhook-deliveries/{id}/replay":{"post":{"operationId":"replayWebhookDelivery","summary":"Replay one delivery","description":"Queues a new delivery of the same event to the same endpoint (re-signed); the original stays in the log.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"202":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/webhooks":{"get":{"operationId":"listWebhookEndpoints","summary":"Webhook endpoints and automation subscriptions","description":"Endpoints configured in Settings and the REST hooks Zapier, Make or Pabbly created, with their health.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"plan":{"type":"object","properties":{"endpoints":{"type":"boolean"},"rest_hooks":{"type":"boolean"}},"required":["endpoints","rest_hooks"],"additionalProperties":false}},"required":["endpoints","plan"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"post":{"operationId":"createWebhookEndpoint","summary":"Add a webhook endpoint","description":"A public https URL and the events it receives. The signing secret is in this response only. Growth plan (`api_webhooks`). Needs a recent two-factor check (step-up) for Owner/Admin sessions.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"url":{"type":"string","minLength":8,"maxLength":500,"examples":["https://example.com/webhooks/propzolo"]},"events":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"string","maxLength":48,"pattern":"^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$"}},"api_version":{"$ref":"#/components/schemas/WebhookApiVersion"}},"required":["url","events"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations","x-idempotent":true}},"/api/v1/webhooks/events":{"get":{"operationId":"listWebhookEvents","summary":"Events an endpoint can receive","description":"The event catalogue with sample `data`, the signature headers and the retry ladder.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEventCatalogue"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.integrations","settings.view"]}},"/api/v1/webhooks/workflow-secret":{"post":{"operationId":"revealWorkflowWebhookSecret","summary":"Show or rotate the workflow signing secret","description":"Signs the “Send webhook” steps of workflows. Created on first use; `rotate: true` replaces it at once.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rotate":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/webhooks/{id}":{"get":{"operationId":"getWebhookEndpoint","summary":"A webhook endpoint","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"patch":{"operationId":"updateWebhookEndpoint","summary":"Change, pause or resume a webhook endpoint","description":"REST hooks can only be paused or resumed (the app manages them). Resuming clears the failure count.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"url":{"type":"string","minLength":8,"maxLength":500,"examples":["https://example.com/webhooks/propzolo"]},"events":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"string","maxLength":48,"pattern":"^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$"}},"api_version":{"$ref":"#/components/schemas/WebhookApiVersion"},"is_active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"},"delete":{"operationId":"deleteWebhookEndpoint","summary":"Remove a webhook endpoint or subscription","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/webhooks/{id}/rotate-secret":{"post":{"operationId":"rotateWebhookSecret","summary":"Rotate an endpoint’s signing secret","description":"The new secret is in this response only; the previous one keeps signing next to it for 24 hours.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/webhooks/{id}/test":{"post":{"operationId":"testWebhookEndpoint","summary":"Send a test event","description":"Posts the sample of one of the endpoint’s events (or `webhook.test`) marked `\"test\": true`, signed like a real delivery, and returns the attempt. Tests are never retried and do not count towards auto-disable.","tags":["Webhooks"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"anyOf":[{"type":"string","maxLength":48,"pattern":"^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.integrations"}},"/api/v1/whatsapp/assisted":{"post":{"operationId":"openAssistedWhatsapp","summary":"Open a WhatsApp draft on the phone (wa.me)","description":"Builds the wa.me link for a lead, a contact or a tracked share and logs it on the timeline (assisted_whatsapp). The number is in the link only when the caller may see it; a masked number is revealed (audited, daily quota) only with `reveal`. Nothing is sent — the agent taps send in WhatsApp. A blocked contact, or a promotion to a contact who opted out or is suppressed, is refused (422); a service draft to them needs `override_reason`.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"share_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"text":{"type":"string","minLength":1,"maxLength":1500},"reveal":{"type":"boolean"},"purpose":{"description":"What the message is (default promotional): consent and suppression are checked for it.","type":"string","enum":["promotional","service"]},"override_reason":{"description":"Why a service draft goes to a contact who opted out or is suppressed (recorded).","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["text"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"text":{"type":"string"},"number_included":{"type":"boolean"},"activity_id":{"$ref":"#/components/schemas/Id"}},"required":["url","text","number_included","activity_id"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/whatsapp/connect":{"post":{"operationId":"connectWhatsapp","summary":"Connect WhatsApp with your own credentials","description":"Checks the credentials with Meta, subscribes your app to the WABA and stores the token and secrets encrypted. The callback URL and verify token are shown once: paste them into your app’s WhatsApp webhook settings.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappCredentials"}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/WhatsappConnection"},"conflict":{"type":"boolean"},"revealed":{"type":"object","properties":{"verify_token":{"type":"string"},"callback_url":{"type":"string"},"fields":{"type":"array","items":{"type":"string"}}},"required":["verify_token","callback_url","fields"],"additionalProperties":false}},"required":["connection","conflict","revealed"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/whatsapp/connections/{id}":{"delete":{"operationId":"disconnectWhatsapp","summary":"Disconnect WhatsApp","description":"Wipes the token and secrets, stops routing webhooks here; numbers and conversations stay for history.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/whatsapp/connections/{id}/refresh":{"post":{"operationId":"refreshWhatsappConnection","summary":"Refresh numbers from Meta","description":"Quality rating, messaging tier, display-name review and numbers added in WhatsApp Manager.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WhatsappConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/whatsapp/connections/{id}/register":{"post":{"operationId":"registerWhatsappNumber","summary":"Register a WhatsApp number","description":"Registers the number for the Cloud API with its six-digit two-step verification PIN.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone_number_id":{"type":"string","pattern":"^\\d{1,32}$"},"pin":{"type":"string","pattern":"^\\d{6}$"}},"required":["phone_number_id","pin"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WhatsappConnection"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/whatsapp/embedded-signup":{"post":{"operationId":"completeWhatsappEmbeddedSignup","summary":"Finish WhatsApp Embedded Signup","description":"Exchanges the code from FB.login (within its ~30 s lifetime), subscribes PropZolo’s app to the WABA and, with a PIN, registers the number. 404 when PropZolo’s Meta app has no Embedded Signup configuration.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":10,"maxLength":1024},"waba_id":{"type":"string","pattern":"^\\d{1,32}$"},"phone_number_id":{"type":"string","pattern":"^\\d{1,32}$"},"business_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,32}$"},{"type":"null"}]},"pin":{"anyOf":[{"type":"string","pattern":"^\\d{6}$"},{"type":"null"}]}},"required":["code","waba_id","phone_number_id"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/WhatsappConnection"},"conflict":{"type":"boolean"},"registered":{"type":"boolean"},"register_error":{"type":["string","null"]}},"required":["connection","conflict","registered","register_error"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/whatsapp/linked":{"get":{"operationId":"getLinkedWhatsapp","summary":"Linked WhatsApp: switches, risk notices and devices","description":"PropZolo’s and the company’s switches, what stops the caller from linking, the risk notices to accept, the caller’s own device and — for admins (settings.communication) — every device. Needs inbox.link_whatsapp or settings.communication.","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedWhatsappOverview"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/whatsapp/linked/accept":{"post":{"operationId":"acceptLinkedWhatsappRisk","summary":"Accept the linked WhatsApp risk notice","description":"Records the member’s own acceptance (text version, its SHA-256, time, IP) once the company has switched linked WhatsApp on. 409 when the notice changed since it was shown.","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","minLength":1,"maxLength":16},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["version","hash"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"accepted_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","accepted_at"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.link_whatsapp"}},"/api/v1/whatsapp/linked/links":{"post":{"operationId":"startLinkedWhatsapp","summary":"Start linking my WhatsApp","description":"Creates a link attempt on the bridge (or hands back the one still waiting for its QR scan). `phone` is the number that will be linked — another number scanning the code is refused; default: the member’s verified phone.","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}]}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedWhatsappDevice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.link_whatsapp"}},"/api/v1/whatsapp/linked/links/{id}":{"delete":{"operationId":"unlinkLinkedWhatsapp","summary":"Unlink a device","description":"Your own device, or anyone’s for admins (settings.communication). The bridge unlinks it on the phone when it is online and wipes its keys either way; chats already copied stay in the inbox.","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"link":{"anyOf":[{"$ref":"#/components/schemas/LinkedWhatsappDevice"},{"type":"null"}]},"unlinked_on_phone":{"type":["boolean","null"]}},"required":["link","unlinked_on_phone"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/whatsapp/linked/links/{id}/pair-code":{"post":{"operationId":"linkedWhatsappPairCode","summary":"Link with a code instead of the QR","description":"WhatsApp → Linked devices → Link with phone number, then type the code shown.","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":6,"maxLength":24}},"required":["phone"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"code":{"type":"string"},"phone":{"type":"string"}},"required":["code","phone"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.link_whatsapp"}},"/api/v1/whatsapp/linked/links/{id}/qr":{"get":{"operationId":"streamLinkedWhatsappQr","summary":"QR codes of a link attempt (stream)","description":"text/event-stream: `status`, `qr` ({ image: an SVG data URL, expires_at }, replaced about every 20 s), `paired`, `error` and `end`. Codes run out after about 160 s — start again then.","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"An event stream; every `data:` line is one RealtimeEvent JSON object.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"text/event-stream":{"schema":{"type":"string"},"x-event-schema":{"type":"object","properties":{"event":{"type":"string","enum":["status","qr","paired","error","end"]},"data":{}},"required":["event","data"],"additionalProperties":false}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.link_whatsapp"}},"/api/v1/whatsapp/linked/links/{id}/refresh":{"post":{"operationId":"refreshLinkedWhatsapp","summary":"Re-read a device from the bridge","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedWhatsappDevice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member"}},"/api/v1/whatsapp/linked/links/{id}/resume":{"post":{"operationId":"resumeLinkedWhatsapp","summary":"Resume sending on a frozen device","description":"After a temporary ban ended or an auto-throttle was reviewed. 409 while WhatsApp’s ban still runs.","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedWhatsappDevice"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/whatsapp/linked/opt-out":{"post":{"operationId":"optOutLinkedWhatsapp","summary":"Withdraw from linked WhatsApp","description":"Withdraws the member’s acceptance and unlinks their phone (retried in the background if the bridge is down).","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"unlinked":{"type":"boolean"},"queued":{"type":"boolean"}},"required":["unlinked","queued"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"inbox.link_whatsapp"}},"/api/v1/whatsapp/linked/policy":{"patch":{"operationId":"updateLinkedWhatsappPolicy","summary":"Switch linked WhatsApp on or off for the company","description":"Switching on needs the company risk notice accepted (`acceptance`) and the plan feature. Switching off stops every linked send at once; with `unlink_all` every device is unlinked too. Also: what a first message from an unknown number does, and how many days of history a new link copies.","tags":["Linked WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"unknown_numbers":{"type":"string","enum":["ignore","enquiry"]},"history_sync_days":{"type":"integer","minimum":0,"maximum":90},"reply_first_days":{"description":"Linked sends need the contact’s own message to that number within this many days.","type":"integer","minimum":1,"maximum":90},"acceptance":{"type":"object","properties":{"version":{"type":"string","minLength":1,"maxLength":16},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["version","hash"]},"unlink_all":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"enabled":{"type":"boolean"},"unknown_numbers":{"type":"string","enum":["ignore","enquiry"]},"history_sync_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_first_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unlinked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unlink_queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","unknown_numbers","history_sync_days","reply_first_days","unlinked","unlink_queued"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/whatsapp/settings":{"patch":{"operationId":"updateWhatsappSettings","summary":"WhatsApp messaging settings","description":"“Send read receipts” (default on): customers see blue ticks when a member opens their thread and “typing…” while a member answers (official WhatsApp only; audited).","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"read_receipts":{"type":"boolean"}},"required":["read_receipts"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"read_receipts":{"type":"boolean"}},"required":["read_receipts"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/whatsapp/setup":{"get":{"operationId":"getWhatsappSetup","summary":"WhatsApp connections and numbers","description":"Connections with their numbers (quality, tier, name review), Embedded Signup availability, webhook.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WhatsappSetup"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission-any":["settings.communication","settings.view"]}},"/api/v1/whatsapp/templates/sync":{"post":{"operationId":"syncWhatsappTemplates","summary":"Sync templates from Meta","description":"Statuses, quality and categories of every template of the connected WABAs (also ones made in Meta).","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"connections":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"disabled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused_broadcasts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors":{"type":"array","items":{"type":"string"}}},"required":["connections","created","updated","unchanged","disabled","paused_broadcasts","errors"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/whatsapp/templates/uploads":{"post":{"operationId":"uploadWhatsappTemplateSample","summary":"Upload a template header file","description":"A presigned PUT for the header’s sample photo, video or PDF (JPEG / PNG ≤ 5 MB, MP4 ≤ 16 MB, PDF).","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","enum":["image/jpeg","image/png","video/mp4","application/pdf"]},"size":{"type":"integer","minimum":1,"maximum":16777216}},"required":["filename","content_type","size"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InboxUpload"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/whatsapp/templates/{id}/submit":{"post":{"operationId":"submitWhatsappTemplate","summary":"Submit a template to Meta","description":"Sends a draft (or rejected / paused) WhatsApp template for review, with example values from its variables and the header sample file. Meta’s objections answer 422 with its message.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageTemplate"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"templates.edit"}},"/api/v1/whatsapp/test":{"post":{"operationId":"testWhatsappCredentials","summary":"Test WhatsApp credentials","description":"Reads the number and the WABA with the token (nothing is stored). Wrong values answer 422 per field.","tags":["WhatsApp"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"waba_id":{"type":"string","pattern":"^\\d{1,32}$"},"phone_number_id":{"type":"string","pattern":"^\\d{1,32}$"},"access_token":{"type":"string","minLength":20,"maxLength":2048},"app_secret":{"type":"string","minLength":16,"maxLength":256},"app_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,32}$"},{"type":"null"}]}},"required":["waba_id","phone_number_id","access_token","app_secret"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WhatsappCredentialCheck"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.communication"}},"/api/v1/white-label":{"get":{"operationId":"getWhiteLabel","summary":"White label","tags":["White label"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WhiteLabel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"patch":{"operationId":"updateWhiteLabel","summary":"Change the white label","description":"Fields left out keep their value; null clears one. Colours are checked for contrast (WCAG 2.2).","tags":["White label"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brand_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"accent_color":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"hide_powered_by":{"type":"boolean"},"email_from_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"email_identity_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"android_app_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"android_package_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WhiteLabel"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.white_label"}},"/api/v1/white-label/android-manifest":{"get":{"operationId":"getAndroidManifest","summary":"Branded Android app manifest","description":"The build configuration of the company’s branded app, with what a release still needs.","tags":["White label"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"manifest":{"type":"object","properties":{"schema":{"type":"number","const":1},"company_id":{"$ref":"#/components/schemas/Id"},"app_name":{"type":"string"},"package_id":{"type":"string"},"colors":{"type":"object","properties":{"brand":{"type":"string"},"accent":{"type":"string"},"background_light":{"type":"string"},"background_dark":{"type":"string"}},"required":["brand","accent","background_light","background_dark"],"additionalProperties":false},"icons":{"type":"object","properties":{"app_icon":{"type":["string","null"]},"logo":{"type":["string","null"]}},"required":["app_icon","logo"],"additionalProperties":false},"urls":{"type":"object","properties":{"workspace":{"type":"string"},"api":{"type":"string"}},"required":["workspace","api"],"additionalProperties":false},"powered_by":{"type":"boolean"},"generated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["schema","company_id","app_name","package_id","colors","icons","urls","powered_by","generated_at"],"additionalProperties":false},"missing":{"type":"array","items":{"type":"string"}},"ready":{"type":"boolean"}},"required":["manifest","missing","ready"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"}},"/api/v1/white-label/domains":{"get":{"operationId":"listWorkspaceDomains","summary":"Workspace domains","description":"The company’s own sign-in addresses with the DNS records to add.","tags":["White label"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceDomain"}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cname_target":{"type":["string","null"]},"entitled":{"type":"boolean"}},"required":["domains","limit","cname_target","entitled"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.view"},"post":{"operationId":"addWorkspaceDomain","summary":"Add a workspace domain","description":"A sub-domain the company owns (crm.acme.in). It goes live once the TXT and CNAME records are found. Needs a recent two-factor check.","tags":["White label"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","minLength":1,"maxLength":300}},"required":["hostname"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkspaceDomain"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.white_label","x-idempotent":true}},"/api/v1/white-label/domains/{id}":{"delete":{"operationId":"removeWorkspaceDomain","summary":"Remove a workspace domain","tags":["White label"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"hostname":{"type":"string"}},"required":["id","hostname"],"additionalProperties":false},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.white_label"}},"/api/v1/white-label/domains/{id}/check":{"post":{"operationId":"checkWorkspaceDomain","summary":"Check a workspace domain now","tags":["White label"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkspaceDomain"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"settings.white_label"}},"/api/v1/workflows":{"get":{"operationId":"listWorkflows","summary":"Workflows","description":"Newest first; archived workflows only when asked for with `status=archived`.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WorkflowStatus"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":256}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowListItem"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"},"post":{"operationId":"createWorkflow","summary":"Create a workflow (draft)","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"graph":{"description":"Default: a lone \"Lead created\" trigger.","$ref":"#/components/schemas/WorkflowGraphInput"},"settings":{"$ref":"#/components/schemas/WorkflowSettingsInput"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workflow"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit","x-idempotent":true}},"/api/v1/workflows/catalogue":{"get":{"operationId":"getWorkflowCatalogue","summary":"Builder catalogue","description":"Triggers with their fields and operators, actions with parameter schemas and availability, AI steps.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowCatalogue"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}},"/api/v1/workflows/options":{"get":{"operationId":"getWorkflowBuilderOptions","summary":"Builder pickers","description":"Members, roles, pipeline statuses (by key), lead sources and message templates for the builder.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowBuilderOptions"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}},"/api/v1/workflows/recipes":{"get":{"operationId":"listWorkflowRecipes","summary":"Recipe gallery","description":"Ready-made workflows (docs §6.5) with what this company still lacks for each.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRecipe"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}},"/api/v1/workflows/recipes/{key}/install":{"post":{"operationId":"installWorkflowRecipe","summary":"Install a recipe","description":"Creates the workflow — live when nothing is missing, otherwise a draft listing what to set up first.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"overrides":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"responses":{"201":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowRecipeInstall"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit","x-idempotent":true}},"/api/v1/workflows/validate":{"post":{"operationId":"validateWorkflowGraph","summary":"Validate an unsaved graph","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"graph":{"description":"A WorkflowGraph (checked by the engine)."}},"required":["graph"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowValidation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}},"/api/v1/workflows/{id}":{"get":{"operationId":"getWorkflow","summary":"A workflow","description":"The draft graph with its issues and summary, settings and the live version.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workflow"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"},"patch":{"operationId":"updateWorkflow","summary":"Save the draft","description":"Name, description and graph change the draft only (publish makes it live); settings apply at once.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"graph":{"$ref":"#/components/schemas/WorkflowGraphInput"},"settings":{"$ref":"#/components/schemas/WorkflowSettingsInput"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workflow"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit"},"delete":{"operationId":"archiveWorkflow","summary":"Archive a workflow","description":"Stops it and cancels its active runs; the run history stays.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workflow"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit"}},"/api/v1/workflows/{id}/dry-run":{"post":{"operationId":"dryRunWorkflow","summary":"Test with a record","description":"Walks the draft (or a version) for a sample record of the trigger’s kind without side effects: conditions are evaluated, actions show what they would do, delays and waits advance a simulated clock.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"description":"A record of the trigger’s kind (a lead for lead triggers …).","$ref":"#/components/schemas/Id"},"payload":{"description":"The sample event payload.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"version":{"description":"A published version instead of the draft.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"waits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["event","timeout"]}},"ai":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":32}}},"required":["entity_id"]}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowDryRun"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit"}},"/api/v1/workflows/{id}/pause":{"post":{"operationId":"pauseWorkflow","summary":"Pause a workflow","description":"No new runs; running runs wait at their next step until the workflow is resumed.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workflow"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit"}},"/api/v1/workflows/{id}/publish":{"post":{"operationId":"publishWorkflow","summary":"Publish the draft","description":"Validates and freezes the draft as a new version; new runs use it, running runs keep theirs.","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"activate":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workflow"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit","x-idempotent":true}},"/api/v1/workflows/{id}/resume":{"post":{"operationId":"resumeWorkflow","summary":"Resume a workflow","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workflow"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.edit"}},"/api/v1/workflows/{id}/runs":{"get":{"operationId":"listWorkflowRuns","summary":"Runs of a workflow","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WorkflowRunStatus"}},{"name":"entity_type","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z]{1,16}$"}},{"name":"entity_id","in":"query","required":false,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"from","in":"query","required":false,"description":"Runs started at or after this instant (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"description":"Runs started before this instant (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":256}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRun"}},"meta":{"$ref":"#/components/schemas/PageMeta"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}},"/api/v1/workflows/{id}/runs/{runId}":{"get":{"operationId":"getWorkflowRun","summary":"A run with its steps","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"runId","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowRunDetail"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}},"/api/v1/workflows/{id}/stats":{"get":{"operationId":"getWorkflowStats","summary":"Runs per day","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}},{"name":"days","in":"query","required":false,"schema":{"default":14,"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowStats"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}},"/api/v1/workflows/{id}/validate":{"post":{"operationId":"validateWorkflow","summary":"Validate the draft","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowValidation"},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}},"/api/v1/workflows/{id}/versions":{"get":{"operationId":"listWorkflowVersions","summary":"Published versions","tags":["Automations"],"security":[{"session":[]},{"mobileSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque record id.","schema":{"$ref":"#/components/schemas/Id"}}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowVersion"}},"meta":{"type":"object"}},"required":["data","meta"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"x-auth":"member","x-permission":"automations.view"}}},"components":{"schemas":{"A2pDeclaration":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["draft","submitted","declared","rejected","revoked"]},"uses":{"type":"array","items":{"type":"string"}},"filed_with":{"type":["string","null"]},"reference":{"type":["string","null"]},"submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"declared_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"has_document":{"type":"boolean"},"document_name":{"type":["string","null"]},"note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","uses","filed_with","reference","submitted_at","declared_at","valid_until","has_document","document_name","note","created_at","updated_at"],"additionalProperties":false},"A2pDeclarationUpload":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["key","url","method","headers","expires_at"],"additionalProperties":false},"AcceptRentalOfferInput":{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"owner_consent":{"description":"The owner agreed off-line (deals.approve): how and when — recorded and audited.","anyOf":[{"type":"object","properties":{"note":{"type":"string","minLength":3,"maxLength":500}},"required":["note"]},{"type":"null"}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}}},"AccountProfile":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"email":{"type":["string","null"]},"email_verified":{"type":"boolean"},"phone":{"type":["string","null"]},"phone_verified":{"type":"boolean"},"image_url":{"type":["string","null"]}},"required":["id","name","email","email_verified","phone","phone_verified","image_url"],"additionalProperties":false},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"designation":{"type":["string","null"]},"employee_code":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"string"}},"role":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"branch":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"reports_to":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","designation","employee_code","languages","role","branch","reports_to"],"additionalProperties":false},"pending":{"type":"object","properties":{"email":{"description":"A new email waiting for its verification link.","type":["string","null"]},"email_expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"phone":{"description":"A new number waiting for its code.","type":["string","null"]}},"required":["email","email_expires_at","phone"],"additionalProperties":false}},"required":["user","member","pending"],"additionalProperties":false},"AccountSecurity":{"type":"object","properties":{"password":{"type":"object","properties":{"set":{"type":"boolean"},"min_length":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_length":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["set","min_length","max_length"],"additionalProperties":false},"two_factor":{"type":"object","properties":{"enabled":{"type":"boolean"},"enabled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"backup_codes_left":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":{"type":"boolean","description":"A role you hold in some workspace requires it — it cannot be switched off."},"required_by":{"type":"array","items":{"type":"string"},"description":"\"Owner · Acme Realty\" …"}},"required":["enabled","enabled_at","backup_codes_left","required","required_by"],"additionalProperties":false},"google_linked":{"type":"boolean"},"session_policy":{"type":"object","properties":{"web_idle_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"web_absolute_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mobile_idle_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["web_idle_days","web_absolute_days","mobile_idle_days"],"additionalProperties":false}},"required":["password","two_factor","google_linked","session_policy"],"additionalProperties":false},"AccountSession":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["web","mobile"]},"current":{"type":"boolean"},"device":{"type":"string","description":"Readable device, e.g. \"Chrome on Windows\", \"PropZolo app on Android\"."},"ip_address":{"type":["string","null"]},"workspace":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The workspace that session has open."},"created_at":{"description":"When that sign-in happened.","$ref":"#/components/schemas/DateTime"},"last_seen_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","current","device","ip_address","workspace","created_at","last_seen_at","expires_at"],"additionalProperties":false},"AccountabilityComponent":{"type":"object","properties":{"key":{"type":"string","enum":["first_response","follow_ups","callbacks","call_notes","stale_leads","hygiene"]},"label":{"type":"string"},"weight":{"type":"number"},"share":{"description":"Its part of the score now (0–1); null without events.","type":["number","null"]},"value":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Smoothed 0–100."},"raw_pct":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"good":{"type":"integer","minimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"text":{"type":"string"},"tip":{"type":"string"}},"required":["key","label","weight","share","value","raw_pct","good","total","text","tip"],"additionalProperties":false},"AccountabilitySnapshot":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"period":{"type":"string","enum":["d7","d30"]},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"null: not enough activity yet."},"band":{"anyOf":[{"type":"string","enum":["strong","steady","attention"]},{"type":"null"}]},"events":{"type":"integer","minimum":0,"maximum":9007199254740991},"components":{"type":"array","items":{"$ref":"#/components/schemas/AccountabilityComponent"}},"computed_at":{"$ref":"#/components/schemas/DateTime"}},"required":["day","period","score","band","events","components","computed_at"],"additionalProperties":false},"Activity":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"type":{"type":"string"},"title":{"type":["string","null"]},"body":{"type":["string","null"]},"meta":{"description":"Type-specific details (status ids and duration_ms, task ids, call id …)."},"is_pinned":{"type":"boolean"},"occurred_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"actor":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"edited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"can_edit":{"type":"boolean"}},"required":["id","type","title","body","meta","is_pinned","occurred_at","created_at","actor","lead_id","contact_id","edited_at","can_edit"],"additionalProperties":false},"AdConversionDelivery":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"connection_id":{"$ref":"#/components/schemas/Id"},"platform":{"type":"string","enum":["meta","google"]},"channel":{"type":"string","description":"crm · messaging · website (Meta) · click · enhanced (Google)."},"kind":{"type":"string","enum":["event","test"]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_ref":{"type":["string","null"]},"milestone":{"type":"string"},"milestone_label":{"type":"string"},"event_name":{"type":"string","description":"Meta event name or Google conversion action id."},"destination":{"type":"string","description":"Meta dataset id or Google customer id."},"status":{"type":"string","enum":["pending","sending","sent","failed","skipped"]},"reason":{"type":["string","null"]},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"next_attempt_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"event_time":{"$ref":"#/components/schemas/DateTime"},"value_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"error":{"type":["string","null"]},"identifiers":{"type":"array","items":{"type":"string"},"description":"Kinds of identifiers sent (never their values)."},"response":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","connection_id","platform","channel","kind","lead_id","lead_ref","milestone","milestone_label","event_name","destination","status","reason","attempts","next_attempt_at","sent_at","event_time","value_paise","error","identifiers","response","created_at"],"additionalProperties":false},"AdConversionsOverview":{"type":"object","properties":{"milestones":{"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/AdMilestone"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"rules":{"$ref":"#/components/schemas/AdMilestoneRules"},"statuses":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"pipeline":{"type":"string"},"sub_statuses":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}}},"required":["key","name","category","pipeline","sub_statuses"],"additionalProperties":false}},"windows":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Days after the lead each platform still takes a milestone."},"notice_line":{"type":"string","description":"The data-sharing line for the workspace’s privacy notice."},"meta":{"type":"object","properties":{"connection":{"anyOf":[{"$ref":"#/components/schemas/IntegrationConnection"},{"type":"null"}]},"settings":{"anyOf":[{"$ref":"#/components/schemas/MetaConversionsSettings"},{"type":"null"}]},"configured":{"type":"boolean"},"counts":{"type":"object","propertyNames":{"type":"string","enum":["pending","sending","sent","failed","skipped"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Conversions of the last 30 days by status."},"whatsapp_accounts":{"type":"array","items":{"type":"object","properties":{"waba_id":{"type":"string"},"name":{"type":["string","null"]},"dataset_id":{"type":["string","null"]}},"required":["waba_id","name","dataset_id"],"additionalProperties":false}}},"required":["connection","settings","configured","counts","whatsapp_accounts"],"additionalProperties":false},"google":{"type":"object","properties":{"available":{"type":"boolean","description":"PropZolo’s Google sign-in for Ads is set up."},"listing":{"type":"boolean","description":"Accounts and conversion actions can be listed."},"connection":{"anyOf":[{"$ref":"#/components/schemas/IntegrationConnection"},{"type":"null"}]},"settings":{"anyOf":[{"$ref":"#/components/schemas/GoogleConversionsSettings"},{"type":"null"}]},"configured":{"type":"boolean"},"counts":{"type":"object","propertyNames":{"type":"string","enum":["pending","sending","sent","failed","skipped"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Conversions of the last 30 days by status."}},"required":["available","listing","connection","settings","configured","counts"],"additionalProperties":false}},"required":["milestones","rules","statuses","windows","notice_line","meta","google"],"additionalProperties":false},"AdCopySet":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"subject_type":{"type":"string","enum":["property","project"]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"title":{"type":"string"},"objective":{"type":"string","enum":["leads","site_visits","awareness"]},"tone":{"type":"string","enum":["professional","warm","premium"]},"languages":{"type":"array","items":{"type":"string","enum":["en","hi","hinglish"]}},"platforms":{"type":"array","items":{"type":"string","enum":["meta_feed","instagram","google_search","google_display","whatsapp_status","portal"]}},"rera_numbers":{"type":"array","items":{"type":"string"}},"project_status":{"type":["string","null"]},"notes":{"type":["string","null"]},"ai_model":{"type":["string","null"]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"archived_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"variants":{"type":"array","items":{"$ref":"#/components/schemas/AdVariant"}},"approved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"facts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"missing_facts":{"type":"array","items":{"type":"string"}}},"required":["id","subject_type","property_id","project_id","title","objective","tone","languages","platforms","rera_numbers","project_status","notes","ai_model","created_by_id","created_at","archived_at","variants","approved","blocked","facts","missing_facts"],"additionalProperties":false,"description":"One studio session: the facts the AI was given and its variants."},"AdCopySetSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"subject_type":{"type":"string","enum":["property","project"]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"title":{"type":"string"},"objective":{"type":"string","enum":["leads","site_visits","awareness"]},"tone":{"type":"string","enum":["professional","warm","premium"]},"languages":{"type":"array","items":{"type":"string","enum":["en","hi","hinglish"]}},"platforms":{"type":"array","items":{"type":"string","enum":["meta_feed","instagram","google_search","google_display","whatsapp_status","portal"]}},"rera_numbers":{"type":"array","items":{"type":"string"}},"project_status":{"type":["string","null"]},"notes":{"type":["string","null"]},"ai_model":{"type":["string","null"]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"archived_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"variants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","subject_type","property_id","project_id","title","objective","tone","languages","platforms","rera_numbers","project_status","notes","ai_model","created_by_id","created_at","archived_at","variants","approved","blocked"],"additionalProperties":false},"AdFinding":{"type":"object","properties":{"source":{"type":"string","enum":["rules","grounding","compliance","route"]},"code":{"type":"string"},"severity":{"type":"string","enum":["block","warn","info"]},"message":{"type":"string"},"field":{"type":["string","null"]}},"required":["source","code","severity","message","field"],"additionalProperties":false,"description":"A rule, grounding or compliance finding on ad copy; `block` stops approval."},"AdMilestone":{"type":"string","enum":["lead_created","qualified","visit_scheduled","visit_done","booked"]},"AdMilestoneRules":{"type":"object","properties":{"qualified":{"type":"object","properties":{"status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}},"sub_status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}}},"required":["status_keys","sub_status_keys"],"additionalProperties":false},"visit_scheduled":{"type":"object","properties":{"status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}},"sub_status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}}},"required":["status_keys","sub_status_keys"],"additionalProperties":false},"visit_done":{"type":"object","properties":{"status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}},"sub_status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}}},"required":["status_keys","sub_status_keys"],"additionalProperties":false},"booked":{"type":"object","properties":{"status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}},"sub_status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}}},"required":["status_keys","sub_status_keys"],"additionalProperties":false}},"required":["qualified","visit_scheduled","visit_done","booked"],"additionalProperties":false,"description":"Status and sub-status keys that reach each milestone."},"AdMilestoneRulesInput":{"type":"object","properties":{"qualified":{"type":"object","properties":{"status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}},"sub_status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}}},"required":["status_keys","sub_status_keys"]},"visit_scheduled":{"type":"object","properties":{"status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}},"sub_status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}}},"required":["status_keys","sub_status_keys"]},"visit_done":{"type":"object","properties":{"status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}},"sub_status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}}},"required":["status_keys","sub_status_keys"]},"booked":{"type":"object","properties":{"status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}},"sub_status_keys":{"maxItems":60,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,48}$"}}},"required":["status_keys","sub_status_keys"]}},"required":["qualified","visit_scheduled","visit_done","booked"],"description":"Status and sub-status keys that reach each milestone."},"AdVariant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"set_id":{"$ref":"#/components/schemas/Id"},"platform":{"type":"string","enum":["meta_feed","instagram","google_search","google_display","whatsapp_status","portal"]},"language":{"type":"string","enum":["en","hi","hinglish"]},"headline":{"type":"string"},"primary_text":{"type":"string"},"description":{"type":["string","null"]},"cta":{"type":"string","enum":["learn_more","call_now","book_visit","whatsapp","get_quote","sign_up"]},"rera_line":{"type":["string","null"]},"disclaimer":{"type":["string","null"]},"hashtags":{"type":"array","items":{"type":"string"}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AdFinding"}},"blocked":{"type":"boolean"},"status":{"type":"string","enum":["draft","approved","archived"]},"source":{"type":"string"},"edited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"approved_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","set_id","platform","language","headline","primary_text","description","cta","rera_line","disclaimer","hashtags","findings","blocked","status","source","edited_at","approved_at","approved_by_id","created_at","updated_at"],"additionalProperties":false},"AddCallAsLeadInput":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"lead_type":{"$ref":"#/components/schemas/LeadType"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}},"AddCallAsLeadResult":{"type":"object","properties":{"call":{"$ref":"#/components/schemas/CallDetail"},"lead_id":{"$ref":"#/components/schemas/Id"},"contact_id":{"$ref":"#/components/schemas/Id"},"outcome":{"$ref":"#/components/schemas/EnquiryOutcome"},"linked":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Calls with this number now linked to the lead."}},"required":["call","lead_id","contact_id","outcome","linked"],"additionalProperties":false},"AddDeductionInput":{"type":"object","properties":{"source":{"type":"string","enum":["damage","missing_item","utilities","cleaning","keys","unpaid_rent","repair","other"]},"label":{"type":"string","minLength":1,"maxLength":200},"detail":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"amount":{"$ref":"#/components/schemas/PaiseInput"}},"required":["source","label","amount"]},"AdsMeasurement":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"state":{"type":"string","enum":["allowed","objected"]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decided_by":{"description":"`ads_measurement` (an objection or its lifting) or `all` (every purpose withdrawn).","type":["string","null"]}},"required":["contact_id","state","decided_at","decided_by"],"additionalProperties":false},"AgentActivityReport":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"rows":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"whatsapp":{"type":"integer","minimum":0,"maximum":9007199254740991},"sms":{"type":"integer","minimum":0,"maximum":9007199254740991},"email":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":0,"maximum":9007199254740991},"callbacks":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_interested":{"type":"integer","minimum":0,"maximum":9007199254740991},"dropped":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["member_id","name","calls","connected","whatsapp","sms","email","visits_done","bookings","callbacks","not_interested","dropped"],"additionalProperties":false}},"totals":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"whatsapp":{"type":"integer","minimum":0,"maximum":9007199254740991},"sms":{"type":"integer","minimum":0,"maximum":9007199254740991},"email":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":0,"maximum":9007199254740991},"callbacks":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_interested":{"type":"integer","minimum":0,"maximum":9007199254740991},"dropped":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","connected","whatsapp","sms","email","visits_done","bookings","callbacks","not_interested","dropped"],"additionalProperties":false},"automation":{"type":"object","properties":{"whatsapp_replies":{"type":"integer","minimum":0,"maximum":9007199254740991},"voice_calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"voice_connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits_booked":{"type":"integer","minimum":0,"maximum":9007199254740991},"handed_off":{"type":"integer","minimum":0,"maximum":9007199254740991},"handling_now":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["whatsapp_replies","voice_calls","voice_connected","qualified","visits_booked","handed_off","handling_now"],"additionalProperties":false,"description":"What AI handled in the range (WhatsApp AI agent, AI voice agent); zeros for one member."}},"required":["range","rows","totals","automation"],"additionalProperties":false},"AgentCallAnalytics":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"branch":{"type":["string","null"]},"role":{"type":"string"},"tracking_enabled":{"type":"boolean"}},"required":["id","name","branch","role","tracking_enabled"],"additionalProperties":false},"range":{"$ref":"#/components/schemas/CallRange"},"totals":{"$ref":"#/components/schemas/CallTotals"},"previous":{"$ref":"#/components/schemas/CallTotals"},"by_day":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"outgoing":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"missed":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["day","total","outgoing","connected","missed","talk_sec"],"additionalProperties":false}},"by_hour":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"integer","minimum":0,"maximum":23},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["hour","total","connected","talk_sec"],"additionalProperties":false}},"by_result":{"type":"array","items":{"type":"object","properties":{"result":{"type":"string"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["result","total","talk_sec"],"additionalProperties":false}},"devices":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"model":{"type":["string","null"]},"app_version":{"type":["string","null"]},"last_sync_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_seen_at":{"$ref":"#/components/schemas/DateTime"},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"health":{"$ref":"#/components/schemas/DeviceHealthState"}},"required":["id","model","app_version","last_sync_at","last_seen_at","revoked_at","health"],"additionalProperties":false}},"call_health":{"$ref":"#/components/schemas/CallHealth"},"first_call_minute":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_call_minute":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"targets":{"$ref":"#/components/schemas/CallTargetsView"},"recent_calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"}}},"required":["member","range","totals","previous","by_day","by_hour","by_result","devices","call_health","first_call_minute","last_call_minute","targets","recent_calls"],"additionalProperties":false},"AgentPhone":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"platform":{"type":"string"},"build_flavor":{"type":"string"},"brand":{"type":["string","null"]},"model":{"type":["string","null"]},"os_version":{"type":["string","null"]},"app_version":{"type":["string","null"]},"runtime_version":{"description":"The native fingerprint the phone runs (OTA updates match it).","type":["string","null"]},"update_id":{"description":"The OTA update it runs; `embedded` for the APK’s own bundle.","type":["string","null"]},"version_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"build_state":{"type":"string","enum":["current","update_available","unsupported","unknown"],"description":"Against the newest published build of its flavour: below the minimum supported version, a newer build exists, current — or unknown (no version reported, nothing published)."},"latest_version":{"type":["string","null"]},"latest_version_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"min_supported_version_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ota_state":{"type":"string","enum":["current","pending","none","unknown"],"description":"Against the live OTA item of its runtime: runs it, will switch on next launch, nothing live, unknown."},"live_update_id":{"type":["string","null"]},"sims":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Identity across reports (subscription id, else slot); what a work-SIM lock names."},"slot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"carrier":{"type":["string","null"]},"number_last4":{"type":["string","null"]},"is_work":{"type":"boolean"}},"required":["key","slot","carrier","number_last4","is_work"],"additionalProperties":false}},"permissions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}},"battery_optimized":{"type":["boolean","null"]},"tracking_enabled":{"type":"boolean"},"push_enabled":{"type":"boolean"},"last_sync_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_seen_at":{"$ref":"#/components/schemas/DateTime"},"last_call_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"health":{"$ref":"#/components/schemas/DeviceHealthState"},"issues":{"type":"array","items":{"type":"string"}},"recording_sync":{"anyOf":[{"type":"object","properties":{"opted_in":{"type":"boolean"},"access":{"type":"string","enum":["none","media","all_files"]},"wifi_only":{"type":"boolean"},"folders":{"type":"integer","minimum":0,"maximum":9007199254740991},"found":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"uploaded":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_scan_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_upload_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"reported_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["opted_in","access","wifi_only","folders","found","pending","uploaded","failed","last_scan_at","last_upload_at","last_error","reported_at"],"additionalProperties":false},{"type":"null"}],"description":"The phone’s recording-folder sync as it last reported it (F-06); null: never reported."},"sync_days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"received":{"type":"integer","minimum":0,"maximum":9007199254740991},"stored":{"type":"integer","minimum":0,"maximum":9007199254740991},"skipped":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Calls dropped by reason (personal SIM, clock …)."}},"required":["day","received","stored","skipped"],"additionalProperties":false},"description":"What its syncs did per company-local day, newest first (CALL-10)."},"clock_offset_ms":{"type":["number","null"]},"work_sims_locked":{"type":"boolean","description":"An admin fixed its work SIMs; the member’s toggle is ignored."},"work_sim_changes":{"type":"array","items":{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"before":{"type":"array","items":{"type":"string"}},"after":{"type":"array","items":{"type":"string"}},"by_admin":{"type":"boolean"}},"required":["at","before","after","by_admin"],"additionalProperties":false},"description":"The latest work-SIM changes, newest first (CALL-10)."}},"required":["id","platform","build_flavor","brand","model","os_version","app_version","runtime_version","update_id","version_code","build_state","latest_version","latest_version_code","min_supported_version_code","ota_state","live_update_id","sims","permissions","battery_optimized","tracking_enabled","push_enabled","last_sync_at","last_seen_at","last_call_at","created_at","revoked_at","health","issues","recording_sync","sync_days","clock_offset_ms","work_sims_locked","work_sim_changes"],"additionalProperties":false},"AgentScorecard":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"members":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardRow"}}},"required":["range","members"],"additionalProperties":false},"AggregateDateRange":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z_]\\w*(?:\\[\\]|!)?(?:\\.[A-Za-z_]\\w*(?:\\[\\]|!)?)*$"},"preset":{"anyOf":[{"type":"string","enum":["today","yesterday","tomorrow","this_week","last_week","next_week","this_month","last_month","next_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","last_12_months","next_7_days"]},{"type":"null"}]},"from":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["field","preset","from","to"],"additionalProperties":false,"description":"A preset period or calendar days (inclusive), company time zone."},"AggregateGroupBy":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z_]\\w*(?:\\[\\]|!)?(?:\\.[A-Za-z_]\\w*(?:\\[\\]|!)?)*$"},"bucket":{"anyOf":[{"type":"string","enum":["day","week","month","quarter"]},{"type":"null"}]}},"required":["field","bucket"],"additionalProperties":false},"AggregateMeasure":{"type":"object","properties":{"fn":{"type":"string","enum":["count","sum","avg","min","max"]},"field":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z_]\\w*(?:\\[\\]|!)?(?:\\.[A-Za-z_]\\w*(?:\\[\\]|!)?)*$"},{"type":"null"}]}},"required":["fn","field"],"additionalProperties":false},"AggregateQuery":{"type":"object","properties":{"entity":{"type":"string","minLength":1,"maxLength":24,"pattern":"^[a-z_]+$"},"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"range":{"anyOf":[{"$ref":"#/components/schemas/AggregateDateRange"},{"type":"null"}]},"measures":{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/AggregateMeasure"}},"group_by":{"anyOf":[{"$ref":"#/components/schemas/AggregateGroupBy"},{"type":"null"}]},"sort":{"anyOf":[{"$ref":"#/components/schemas/AggregateSort"},{"type":"null"}]},"limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]}},"required":["entity","filter","range","measures","group_by","sort","limit"],"additionalProperties":false,"description":"Ask PropZolo query: an entity, a filter (shared filter DSL), a calendar range, measures, one group-by, sort, top-N."},"AggregateSort":{"type":"object","properties":{"by":{"type":"string","enum":["value","key","field"]},"field":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z_]\\w*(?:\\[\\]|!)?(?:\\.[A-Za-z_]\\w*(?:\\[\\]|!)?)*$"},{"type":"null"}]},"dir":{"type":"string","enum":["asc","desc"]}},"required":["by","field","dir"],"additionalProperties":false},"AgreementClause":{"type":"object","properties":{"key":{"type":"string"},"category":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"states":{"type":"array","items":{"type":"string"}},"kinds":{"type":"array","items":{"type":"string"}},"needs":{"type":"array","items":{"type":"string"}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"origin":{"type":"string","enum":["system","override","company"]},"id":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"updated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["key","category","title","body","states","kinds","version","origin","id","status","updated_at"],"additionalProperties":false},"AgreementClauseChanges":{"type":"object","properties":{"added":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"}},"required":["key","title"],"additionalProperties":false}},"removed":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"}},"required":["key","title"],"additionalProperties":false}},"moved":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"from":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","title","from","to"],"additionalProperties":false}},"edited":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"diff":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["same","add","del"]},"text":{"type":"string"}},"required":["op","text"],"additionalProperties":false}}},"required":["key","title","diff"],"additionalProperties":false}}},"required":["added","removed","moved","edited"],"additionalProperties":false,"description":"The draft against the template’s starting clauses."},"AgreementClauseInput":{"type":"object","properties":{"category":{"type":"string","enum":["rent_deposit","maintenance","utilities","escalation","lock_in","notice","pets","painting","police_verification","sub_letting","society_rules","use","repairs","registration","termination","general"]},"title":{"type":"string","minLength":2,"maxLength":160},"body":{"type":"string","minLength":1,"maxLength":4000},"states":{"description":"Empty: every state.","maxItems":40,"type":"array","items":{"$ref":"#/components/schemas/IndianStateCode"}},"kinds":{"description":"Empty: every kind.","maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/AgreementDocumentKind"}},"status":{"type":"string","enum":["active","archived"]},"expected_version":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}}},"AgreementClauseLibrary":{"type":"object","properties":{"clauses":{"type":"array","items":{"$ref":"#/components/schemas/AgreementClause"}},"archived":{"type":"array","items":{"$ref":"#/components/schemas/AgreementClause"}},"categories":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"group":{"type":"string"}},"required":["key","label","group"],"additionalProperties":false}}},"required":["clauses","archived","categories","fields"],"additionalProperties":false},"AgreementClauseSelection":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"title":{"type":"string","minLength":1,"maxLength":160},"body":{"type":"string","minLength":1,"maxLength":4000},"origin":{"type":"string","enum":["library","custom"]},"version":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The library version (null: written here)."}},"required":["key","title","body","origin","version"],"additionalProperties":false},"AgreementClauseSelectionInput":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"title":{"type":"string","minLength":1,"maxLength":160},"body":{"type":"string","minLength":1,"maxLength":4000},"origin":{"type":"string","enum":["library","custom"]},"version":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The library version (null: written here)."}},"required":["key","title","body","origin","version"]},"AgreementDocument":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","stamped","sent","partially_signed","signed","registered"]},"template":{"type":"object","properties":{"key":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"current_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The template’s version now (newer = edited)."}},"required":["key","version","title","current_version"],"additionalProperties":false},"kind":{"$ref":"#/components/schemas/AgreementDocumentKind"},"kind_label":{"type":"string"},"state":{"type":"string"},"execution":{"$ref":"#/components/schemas/AgreementExecution"},"area":{"type":"string"},"title":{"type":"string"},"fields":{"$ref":"#/components/schemas/AgreementDocumentFields"},"clauses":{"type":"array","items":{"$ref":"#/components/schemas/AgreementClauseSelection"}},"slots":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"required":{"type":"boolean"},"included":{"type":"boolean"}},"required":["key","required","included"],"additionalProperties":false}},"changes":{"$ref":"#/components/schemas/AgreementClauseChanges"},"library":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"origin":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applies":{"type":"boolean"},"body":{"type":"string"}},"required":["key","title","category","origin","version","applies","body"],"additionalProperties":false}},"preview":{"type":"object","properties":{"title":{"type":"string"},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/AgreementRenderedBlock"}},"missing":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"unknown":{"type":"array","items":{"type":"string"}}},"required":["title","blocks","missing","unknown"],"additionalProperties":false},"stamp":{"$ref":"#/components/schemas/StampDutyEstimate"},"stamp_override":{"anyOf":[{"type":"object","properties":{"duty":{"$ref":"#/components/schemas/Paise"},"registration_fee":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"reason":{"type":"string"}},"required":["duty","registration_fee","reason"],"additionalProperties":false},{"type":"null"}],"description":"The deal’s own duty / fee (beats the estimate; the estimate’s warnings still show)."},"stamp_certificate_no":{"type":["string","null"]},"registration_plan":{"type":["string","null"]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"has_signed_pdf":{"type":"boolean"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","version","status","template","kind","kind_label","state","execution","area","title","fields","clauses","slots","changes","library","preview","stamp","stamp_override","stamp_certificate_no","registration_plan","signed_at","has_signed_pdf","updated_at"],"additionalProperties":false},"AgreementDocumentFields":{"type":"object","properties":{"place":{"type":["string","null"]},"execution_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"landlord":{"type":"object","properties":{"relation":{"type":["string","null"]},"age":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"address":{"type":["string","null"]}},"additionalProperties":false},"tenant":{"type":"object","properties":{"relation":{"type":["string","null"]},"age":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"address":{"type":["string","null"]}},"additionalProperties":false},"property_address":{"type":["string","null"]},"property_description":{"type":["string","null"]},"city":{"type":["string","null"]},"inclusions":{"type":"array","items":{"type":"string"}},"special_conditions":{"type":["string","null"]},"non_refundable_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"witnesses":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name"],"additionalProperties":false}}},"additionalProperties":false},"AgreementDocumentFieldsInput":{"type":"object","properties":{"place":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"execution_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"landlord":{"type":"object","properties":{"relation":{"description":"Parentage as written: \"S/o Ajay Mehta\".","anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"age":{"anyOf":[{"type":"integer","minimum":18,"maximum":120},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},"tenant":{"type":"object","properties":{"relation":{"description":"Parentage as written: \"S/o Ajay Mehta\".","anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"age":{"anyOf":[{"type":"integer","minimum":18,"maximum":120},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},"property_address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"property_description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"inclusions":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"special_conditions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"non_refundable_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"witnesses":{"maxItems":2,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":160},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]}},"required":["name"]}}}},"AgreementDocumentInput":{"type":"object","properties":{"key":{"type":"string","minLength":10,"maxLength":300},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["key","filename","content_type","size"]},"AgreementDocumentKind":{"type":"string","enum":["leave_licence","rent_11m","lease_deed"]},"AgreementDocumentPanel":{"type":"object","properties":{"agreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"start_date":{"$ref":"#/components/schemas/LocalDate"},"end_date":{"$ref":"#/components/schemas/LocalDate"},"term_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rent_amount":{"$ref":"#/components/schemas/Paise"},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"agreement_type":{"type":["string","null"]},"landlord":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"tenant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"},"state":{"type":["string","null"]}},"required":["id","title","state"],"additionalProperties":false},{"type":"null"}]},"state":{"type":["string","null"]}},"required":["id","status","start_date","end_date","term_months","rent_amount","deposit_amount","agreement_type","landlord","tenant","property","state"],"additionalProperties":false},"templates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"origin":{"type":"string","enum":["system","company"]},"system_key":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/AgreementDocumentKind"},"states":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":["string","null"]},"execution":{"$ref":"#/components/schemas/AgreementExecution"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","archived"]},"updated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"fits":{"type":"boolean"}},"required":["key","origin","system_key","kind","states","title","description","execution","version","status","updated_at","fits"],"additionalProperties":false}},"suggested_template":{"type":["string","null"]},"document":{"anyOf":[{"$ref":"#/components/schemas/AgreementDocument"},{"type":"null"}]},"envelope":{"anyOf":[{"$ref":"#/components/schemas/ESignEnvelope"},{"type":"null"}]},"registration":{"anyOf":[{"$ref":"#/components/schemas/AgreementRegistration"},{"type":"null"}]},"credits":{"type":"array","items":{"type":"object","properties":{"denomination":{"$ref":"#/components/schemas/Paise"},"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["denomination","available"],"additionalProperties":false}},"esign_configured":{"type":"boolean"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"send":{"type":"boolean"},"cancel":{"type":"boolean"},"register":{"type":"boolean"}},"required":["edit","send","cancel","register"],"additionalProperties":false}},"required":["agreement","templates","suggested_template","document","envelope","registration","credits","esign_configured","capabilities"],"additionalProperties":false},"AgreementExecution":{"type":"string","enum":["notarised","registered","e_stamp"]},"AgreementMaintenance":{"type":"object","properties":{"agreement_id":{"$ref":"#/components/schemas/Id"},"threshold":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"The agreement’s own; null: the company default applies."},"default_threshold":{"$ref":"#/components/schemas/Paise"},"tenant_link":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","expires_at"],"additionalProperties":false},{"type":"null"}]},"tickets":{"type":"array","items":{"$ref":"#/components/schemas/MaintenanceTicket"}}},"required":["agreement_id","threshold","default_threshold","tenant_link","tickets"],"additionalProperties":false},"AgreementRegistration":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"plan":{"type":"string"},"plan_label":{"type":"string"},"status":{"type":"string","enum":["open","done","cancelled"]},"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"due_on":{"$ref":"#/components/schemas/LocalDate"},"task_id":{"type":["string","null"]},"task_status":{"anyOf":[{"type":"string","enum":["open","done","cancelled"]},{"type":"null"}]}},"required":["key","title","detail","due_on","task_id","task_status"],"additionalProperties":false}},"registration_no":{"type":["string","null"]},"registered_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"office":{"type":["string","null"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","plan","plan_label","status","steps","registration_no","registered_on","office","assignee"],"additionalProperties":false},"AgreementRenderedBlock":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"heading"},"segments":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"field":{"type":"string"},"missing":{"type":"boolean"}},"required":["text"],"additionalProperties":false}}},"required":["kind","segments"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"paragraph"},"segments":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"field":{"type":"string"},"missing":{"type":"boolean"}},"required":["text"],"additionalProperties":false}}},"required":["kind","segments"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"clause"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"segments":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"field":{"type":"string"},"missing":{"type":"boolean"}},"required":["text"],"additionalProperties":false}}},"required":["kind","number","title","segments"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"schedule"},"title":{"type":"string"},"segments":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"field":{"type":"string"},"missing":{"type":"boolean"}},"required":["text"],"additionalProperties":false}}},"required":["kind","title","segments"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"signatures"},"signatories":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["landlord","tenant","witness"]},"label":{"type":"string"},"name":{"type":["string","null"]}},"required":["role","label","name"],"additionalProperties":false}}},"required":["kind","signatories"],"additionalProperties":false}]},"AgreementRent":{"type":"object","properties":{"agreement_id":{"$ref":"#/components/schemas/Id"},"set_up":{"type":"boolean"},"problem":{"description":"Why a schedule cannot be generated yet (no due day …).","type":["string","null"]},"rent_amount":{"$ref":"#/components/schemas/Paise"},"due_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pan_required":{"type":"boolean","description":"Annual rent above ₹1,00,000: receipts need the landlord’s PAN."},"profile":{"anyOf":[{"type":"object","properties":{"payee_name":{"type":["string","null"]},"upi_vpa":{"type":["string","null"]},"landlord_pan":{"description":"Masked (XXXXXX1234D); the full PAN prints only on the HRA receipt.","type":["string","null"]},"reminders_enabled":{"type":"boolean"},"late_fees_enabled":{"type":"boolean"},"generated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["payee_name","upi_vpa","landlord_pan","reminders_enabled","late_fees_enabled","generated_at"],"additionalProperties":false},{"type":"null"}]},"instalments":{"type":"array","items":{"$ref":"#/components/schemas/RentInstalment"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/RentPayment"}},"mandate":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["autopay","enach"]},"status":{"type":"string","enum":["created","pending","active","paused","revoked","failed"]},"max_amount":{"$ref":"#/components/schemas/Paise"},"setup_url":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"activated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","status","max_amount","setup_url","failure_reason","activated_at","created_at"],"additionalProperties":false},{"type":"null"}]},"totals":{"type":"object","properties":{"outstanding":{"$ref":"#/components/schemas/Paise"},"overdue":{"$ref":"#/components/schemas/Paise"},"collected":{"$ref":"#/components/schemas/Paise"},"advance":{"$ref":"#/components/schemas/Paise"},"pending_claims":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["outstanding","overdue","collected","advance","pending_claims"],"additionalProperties":false},"capabilities":{"type":"object","properties":{"manage":{"type":"boolean"},"late_fees":{"type":"boolean"},"autopay":{"type":"boolean","description":"A Razorpay connection can carry AutoPay / e-NACH mandates."},"reveal_pan":{"type":"boolean","description":"May reveal the landlord’s full PAN (audited, step-up)."}},"required":["manage","late_fees","autopay","reveal_pan"],"additionalProperties":false}},"required":["agreement_id","set_up","problem","rent_amount","due_day","pan_required","profile","instalments","payments","mandate","totals","capabilities"],"additionalProperties":false},"AgreementStatus":{"type":"string","enum":["draft","active","expiring","renewed","terminated","expired"]},"AgreementTemplate":{"type":"object","properties":{"key":{"type":"string"},"origin":{"type":"string","enum":["system","company"]},"system_key":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/AgreementDocumentKind"},"states":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":["string","null"]},"execution":{"$ref":"#/components/schemas/AgreementExecution"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","archived"]},"updated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/AgreementTemplateBlock"}},"slots":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"required":{"type":"boolean"},"included":{"type":"boolean"}},"required":["key","required","included"],"additionalProperties":false}},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"change_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["version","title","change_note","created_at","created_by"],"additionalProperties":false}},"problems":{"type":"array","items":{"type":"string"}},"editable":{"type":"boolean"}},"required":["key","origin","system_key","kind","states","title","description","execution","version","status","updated_at","blocks","slots","versions","problems","editable"],"additionalProperties":false},"AgreementTemplateBlock":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"heading"},"text":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"paragraph"},"text":{"type":"string","minLength":1,"maxLength":4000},"when":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"clauses"},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"schedule"},"title":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["kind","title","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"signatures"}},"required":["kind"],"additionalProperties":false}]},"AgreementTemplateBlockInput":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"heading"},"text":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"paragraph"},"text":{"type":"string","minLength":1,"maxLength":4000},"when":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"clauses"},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"schedule"},"title":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["kind","title","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"signatures"}},"required":["kind"]}]},"AgreementTemplateList":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"origin":{"type":"string","enum":["system","company"]},"system_key":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/AgreementDocumentKind"},"states":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"description":{"type":["string","null"]},"execution":{"$ref":"#/components/schemas/AgreementExecution"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","archived"]},"updated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["key","origin","system_key","kind","states","title","description","execution","version","status","updated_at"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"group":{"type":"string"}},"required":["key","label","group"],"additionalProperties":false},"description":"Merge fields a template or clause may use."}},"required":["templates","fields"],"additionalProperties":false},"AgreementTemplateUpdateInput":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":160},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"states":{"maxItems":40,"type":"array","items":{"$ref":"#/components/schemas/IndianStateCode"}},"execution":{"$ref":"#/components/schemas/AgreementExecution"},"blocks":{"minItems":2,"maxItems":80,"type":"array","items":{"$ref":"#/components/schemas/AgreementTemplateBlockInput"}},"slots":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"required":{"type":"boolean"},"included":{"type":"boolean"}},"required":["key","required","included"]}},"status":{"type":"string","enum":["active","archived"]},"change_note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"expected_version":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}}},"AgreementType":{"type":"string","enum":["notarised","registered","e_stamp"]},"AiAgent":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"kind":{"type":"string"},"persona":{"type":["string","null"]},"instructions":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"string"}},"actions":{"type":"array","items":{"type":"string","enum":["send_asset","create_shortlist","book_visit","schedule_followup","mark_disqualified"]}},"qualification":{"type":"object","properties":{"slots":{"maxItems":10,"type":"array","items":{"type":"string","enum":["transaction","budget","bhk","property_type","locality","city","purpose","timeline","loan","possession"]}},"required":{"maxItems":10,"type":"array","items":{"type":"string","enum":["transaction","budget","bhk","property_type","locality","city","purpose","timeline","loan","possession"]}}},"required":["slots","required"],"additionalProperties":false},"handoff_rules":{"type":"object","properties":{"negative_sentiment":{"type":"boolean","description":"Hand off when the customer is upset (complaints always do)."},"failed_turns":{"type":"integer","minimum":1,"maximum":5},"off_topic_redirects":{"type":"integer","minimum":0,"maximum":3},"vip_budget_rupees":{"anyOf":[{"type":"integer","minimum":100000,"maximum":10000000000},{"type":"null"}]},"vip_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["negative_sentiment","failed_turns","off_topic_redirects","vip_budget_rupees","vip_tags"],"additionalProperties":false,"description":"Requests for a person, complaints, RERA complaints, negotiation, booking or payment and legal / tax / loan questions always hand off; these settings tune the rest."},"working_hours":{"anyOf":[{"type":"object","properties":{"shifts":{"minItems":1,"maxItems":14,"type":"array","items":{"type":"object","properties":{"days":{"minItems":1,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["days","start","end"],"additionalProperties":false}}},"required":["shifts"],"additionalProperties":false},{"type":"null"}],"description":"null = 24×7; otherwise ISO weekdays and HH:mm windows in the company time zone."},"config":{"type":"object","properties":{"price_policy":{"anyOf":[{"type":"string","enum":["exact","band","never"]},{"type":"null"}],"description":"null = the company AI setting."},"caps":{"type":"object","properties":{"replies_per_day":{"type":"integer","minimum":1,"maximum":200},"followups_per_week":{"type":"integer","minimum":0,"maximum":7}},"required":["replies_per_day","followups_per_week"],"additionalProperties":false},"quiet_hours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["start","end"],"additionalProperties":false},"human_active_minutes":{"type":"integer","minimum":5,"maximum":1440},"handoff_idle_hours":{"type":"integer","minimum":1,"maximum":168},"allowed_asset_ids":{"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"intent_templates":{"type":"object","properties":{"follow_up":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"visit_confirmation":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"handoff_notice":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reengage":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["follow_up","visit_confirmation","handoff_notice","reengage"],"additionalProperties":false}},"required":["price_policy","caps","quiet_hours","human_active_minutes","handoff_idle_hours","allowed_asset_ids","intent_templates"],"additionalProperties":false},"settings_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"eval":{"anyOf":[{"type":"object","properties":{"settings_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"passed":{"type":"boolean"},"current":{"type":"boolean","description":"The check ran on the current settings version."},"ran_at":{"type":"string"},"gates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"threshold":{"type":"number"},"value":{"type":"number"},"passed":{"type":"boolean"}},"required":["threshold","value","passed"],"additionalProperties":false}},"failed_cases":{"type":"array","items":{"type":"string"}},"cases":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["settings_version","passed","current","ran_at","gates","failed_cases","cases"],"additionalProperties":false},{"type":"null"}]},"channels":{"type":"array","items":{"type":"object","properties":{"channel_account_id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"},"address":{"type":"string"},"status":{"type":"string"},"mode":{"type":"string","enum":["off","shadow","live"]},"changed_at":{"$ref":"#/components/schemas/DateTime"}},"required":["channel_account_id","label","address","status","mode","changed_at"],"additionalProperties":false}},"is_active":{"type":"boolean"},"archived_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","kind","persona","instructions","languages","actions","qualification","handoff_rules","working_hours","config","settings_version","eval","channels","is_active","archived_at","created_at","updated_at"],"additionalProperties":false},"AiAgentChip":{"type":"object","properties":{"conversation_id":{"$ref":"#/components/schemas/Id"},"agent_name":{"type":"string"},"mode":{"type":"string","enum":["off","shadow","live"]},"state":{"anyOf":[{"type":"string","enum":["NEW","ENGAGED","QUALIFYING","RECOMMENDING","SCHEDULING","BOOKED","POST_VISIT","HANDOFF","NURTURE","CLOSED"]},{"type":"null"}]},"pending_drafts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handoff_reason":{"type":["string","null"]},"handoff_label":{"type":["string","null"]},"handoff_due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["conversation_id","agent_name","mode","state","pending_drafts","handoff_reason","handoff_label","handoff_due_at"],"additionalProperties":false},"AiAgentConversation":{"anyOf":[{"type":"object","properties":{"chip":{"$ref":"#/components/schemas/AiAgentChip"},"handoff_summary":{"type":["string","null"]},"opted_out":{"type":"boolean"},"closed_reason":{"type":["string","null"]},"next_followup_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"noted":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"value":{},"confidence":{"type":"number"},"status":{"type":"string"},"source_message_id":{"type":"string"},"at":{"type":"string"}},"required":["field","value","confidence","status","source_message_id","at"],"additionalProperties":false}},"drafts":{"type":"array","items":{"$ref":"#/components/schemas/AiAgentDraft"}},"turns":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"outcome":{"type":["string","null"]},"intent":{"type":["string","null"]},"skip_reason":{"type":["string","null"]},"mode":{"type":"string"},"state_after":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","outcome","intent","skip_reason","mode","state_after","created_at","credits"],"additionalProperties":false}}},"required":["chip","handoff_summary","opted_out","closed_reason","next_followup_at","noted","drafts","turns"],"additionalProperties":false},{"type":"null"}]},"AiAgentDraft":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"conversation_id":{"$ref":"#/components/schemas/Id"},"mode":{"type":"string"},"text":{"type":"string"},"language":{"type":["string","null"]},"actions":{"type":"array","items":{"type":"string"},"description":"Actions run when the draft is approved (visit, shortlist …)."},"handoff_reason":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"expired":{"type":"boolean"}},"required":["id","conversation_id","mode","text","language","actions","handoff_reason","created_at","expires_at","expired"],"additionalProperties":false},"AiAgentEvalReport":{"type":"object","properties":{"agent":{"$ref":"#/components/schemas/AiAgent"},"passed":{"type":"boolean"},"modes":{"type":"array","items":{"type":"object","properties":{"mode":{"type":"string","enum":["self-check","safety-net"]},"passed":{"type":"boolean"},"cases":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"threshold":{"type":"number"},"value":{"type":"number"},"passed":{"type":"boolean"}},"required":["threshold","value","passed"],"additionalProperties":false}},"failed_cases":{"type":"array","items":{"type":"string"}}},"required":["mode","passed","cases","skipped","gates","failed_cases"],"additionalProperties":false}}},"required":["agent","passed","modes"],"additionalProperties":false},"AiAgentFact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_name":{"type":["string","null"]},"topic":{"type":"string","enum":["pricing","payment_plan","possession","amenities","location","specs","rera","offers","process","other"]},"title":{"type":"string"},"body":{"type":"string"},"as_of":{"type":"string"},"valid_from":{"type":["string","null"]},"valid_until":{"type":["string","null"]},"status":{"type":"string"},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","project_id","project_name","topic","title","body","as_of","valid_from","valid_until","status","approved_at","updated_at"],"additionalProperties":false},"AiAgentFactInput":{"type":"object","properties":{"project_id":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"topic":{"type":"string","enum":["pricing","payment_plan","possession","amenities","location","specs","rera","offers","process","other"]},"title":{"type":"string","minLength":2,"maxLength":120},"body":{"type":"string","minLength":2,"maxLength":1000},"as_of":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"valid_from":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"valid_until":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["topic","title","body","as_of"]},"AiAgentOptions":{"type":"object","properties":{"numbers":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"},"address":{"type":"string"},"status":{"type":"string"},"agent_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"mode":{"anyOf":[{"type":"string","enum":["off","shadow","live"]},{"type":"null"}]}},"required":["id","label","address","status","agent_id","mode"],"additionalProperties":false}},"templates":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"language":{"type":"string"},"status":{"type":"string"}},"required":["id","name","language","status"],"additionalProperties":false}},"assets":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string"},"title":{"type":"string"},"project_name":{"type":["string","null"]}},"required":["id","kind","title","project_name"],"additionalProperties":false}},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["numbers","templates","assets","projects"],"additionalProperties":false},"AiAgentOverview":{"type":"object","properties":{"period":{"type":"object","properties":{"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"}},"required":["days","from","to"],"additionalProperties":false},"turns":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kpis":{"type":"object","properties":{"conversations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"first_response":{"anyOf":[{"type":"object","properties":{"median_ms":{"type":"number"},"p90_ms":{"type":"number"},"samples":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["median_ms","p90_ms","samples"],"additionalProperties":false},{"type":"null"}]},"reply_rate":{"type":["number","null"]},"qualified_rate":{"type":["number","null"]},"visits_booked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handoff_rate":{"type":["number","null"]},"edit_rate":{"type":["number","null"]},"opt_out_rate":{"type":["number","null"]},"credits":{"type":"number"},"credits_per_qualified":{"type":["number","null"]}},"required":["conversations","first_response","reply_rate","qualified_rate","visits_booked","handoff_rate","edit_rate","opt_out_rate","credits","credits_per_qualified"],"additionalProperties":false},"outcomes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"skip_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["reason","count"],"additionalProperties":false}},"handoff_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["reason","label","count"],"additionalProperties":false}}},"required":["period","turns","kpis","outcomes","skip_reasons","handoff_reasons"],"additionalProperties":false},"AiAgentPatch":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"persona":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"languages":{"minItems":1,"type":"array","items":{"type":"string","enum":["en","hi","hinglish","mr","ta","te","kn","ml","bn","gu","pa"]}},"actions":{"type":"array","items":{"type":"string","enum":["send_asset","create_shortlist","book_visit","schedule_followup","mark_disqualified"]}},"qualification":{"type":"object","properties":{"slots":{"maxItems":10,"type":"array","items":{"type":"string","enum":["transaction","budget","bhk","property_type","locality","city","purpose","timeline","loan","possession"]}},"required":{"maxItems":10,"type":"array","items":{"type":"string","enum":["transaction","budget","bhk","property_type","locality","city","purpose","timeline","loan","possession"]}}},"required":["slots","required"]},"handoff_rules":{"type":"object","properties":{"negative_sentiment":{"type":"boolean","description":"Hand off when the customer is upset (complaints always do)."},"failed_turns":{"type":"integer","minimum":1,"maximum":5},"off_topic_redirects":{"type":"integer","minimum":0,"maximum":3},"vip_budget_rupees":{"anyOf":[{"type":"integer","minimum":100000,"maximum":10000000000},{"type":"null"}]},"vip_tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["negative_sentiment","failed_turns","off_topic_redirects","vip_budget_rupees","vip_tags"],"description":"Requests for a person, complaints, RERA complaints, negotiation, booking or payment and legal / tax / loan questions always hand off; these settings tune the rest."},"working_hours":{"anyOf":[{"type":"object","properties":{"shifts":{"minItems":1,"maxItems":14,"type":"array","items":{"type":"object","properties":{"days":{"minItems":1,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["days","start","end"]}}},"required":["shifts"]},{"type":"null"}],"description":"null = 24×7; otherwise ISO weekdays and HH:mm windows in the company time zone."},"config":{"type":"object","properties":{"price_policy":{"anyOf":[{"type":"string","enum":["exact","band","never"]},{"type":"null"}],"description":"null = the company AI setting."},"caps":{"type":"object","properties":{"replies_per_day":{"type":"integer","minimum":1,"maximum":200},"followups_per_week":{"type":"integer","minimum":0,"maximum":7}},"required":["replies_per_day","followups_per_week"]},"quiet_hours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$|^24:00$"}},"required":["start","end"]},"human_active_minutes":{"type":"integer","minimum":5,"maximum":1440},"handoff_idle_hours":{"type":"integer","minimum":1,"maximum":168},"allowed_asset_ids":{"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"intent_templates":{"type":"object","properties":{"follow_up":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"visit_confirmation":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"handoff_notice":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reengage":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["follow_up","visit_confirmation","handoff_notice","reengage"]}}}}},"AiConversationSummary":{"type":"object","properties":{"summary":{"type":"string"},"customer_needs":{"type":"array","items":{"type":"string"}},"key_facts":{"type":"array","items":{"type":"string"}},"open_questions":{"type":"array","items":{"type":"string"}},"next_steps":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"owner":{"type":"string"},"due":{"type":["string","null"]}},"required":["action","owner","due"],"additionalProperties":false}},"sentiment":{"type":"string"},"customer_language":{"type":"string"},"handoff_recommended":{"type":"boolean"}},"required":["summary","customer_needs","key_facts","open_questions","next_steps","sentiment","customer_language","handoff_recommended"],"additionalProperties":false},"AiFeedbackInput":{"type":"object","properties":{"request_id":{"type":"string","minLength":1,"maxLength":120,"description":"The `request_id` of the AI answer rated."},"rating":{"type":"string","enum":["up","down"]},"comment":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]}},"required":["request_id","rating"]},"AiFinding":{"type":"object","properties":{"validator":{"type":"string","enum":["grounding","compliance","pii","route"]},"code":{"type":"string"},"severity":{"type":"string","enum":["info","warn","block"]},"message":{"type":"string"},"path":{"type":"string"},"match":{"type":"string"},"action":{"type":"string","enum":["flagged","stripped","masked"]}},"required":["validator","code","severity","message","action"],"additionalProperties":false,"description":"A validator decision on an AI output (grounding, compliance, PII, route rules)."},"AiHistoryItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"route":{"type":"string"},"label":{"type":"string"},"status":{"type":"string"},"error_code":{"type":["string","null"]},"preview":{"type":["string","null"]},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"findings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"id":{"type":["string","null"]}},"required":["type","id"],"additionalProperties":false},{"type":"null"}]},"member_id":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","route","label","status","error_code","preview","credits","findings","entity","member_id","created_at"],"additionalProperties":false},"AiLeadExplanation":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold","unclear"]},"reasons":{"type":"array","items":{"type":"object","properties":{"signal":{"type":"string"},"evidence":{"type":"string"},"effect":{"type":"string","enum":["raises","lowers"]},"strength":{"type":"string","enum":["strong","moderate","weak"]}},"required":["signal","evidence","effect","strength"],"additionalProperties":false}},"next_best_action":{"type":"object","properties":{"action":{"type":"string"},"detail":{"type":"string"},"when":{"type":["string","null"]}},"required":["action","detail","when"],"additionalProperties":false},"missing_information":{"type":"array","items":{"type":"string"}}},"required":["temperature","reasons","next_best_action","missing_information"],"additionalProperties":false},"AiLeadSummary":{"type":"object","properties":{"headline":{"type":"string"},"summary":{"type":"string"},"requirement_line":{"type":["string","null"]},"status_line":{"type":"string"},"last_interaction":{"type":["string","null"]},"next_step":{"type":["string","null"]},"flags":{"type":"array","items":{"type":"string"}}},"required":["headline","summary","requirement_line","status_line","last_interaction","next_step","flags"],"additionalProperties":false},"AiListingCopy":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"highlights":{"type":"array","items":{"type":"string"}},"whatsapp_text":{"type":"string"},"rera_line":{"type":["string","null"]},"missing_facts":{"type":"array","items":{"type":"string"}}},"required":["title","description","highlights","whatsapp_text","rera_line","missing_facts"],"additionalProperties":false},"AiReplyDraft":{"type":"object","properties":{"mode":{"type":"string","enum":["free_text","template","none"]},"language":{"type":"string","enum":["en","hi","hinglish"]},"reply_parts":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"],"additionalProperties":false}},"template":{"anyOf":[{"type":"object","properties":{"template_id":{"type":"string"},"variables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"],"additionalProperties":false}}},"required":["template_id","variables"],"additionalProperties":false},{"type":"null"}]},"needs_human":{"type":"boolean"},"handoff_reason":{"type":["string","null"]},"unanswered_questions":{"type":"array","items":{"type":"string"}},"facts_used":{"type":"array","items":{"type":"string"}}},"required":["mode","language","reply_parts","template","needs_human","handoff_reason","unanswered_questions","facts_used"],"additionalProperties":false},"AiSearchChip":{"type":"object","properties":{"field":{"type":"string"},"label":{"type":"string"},"op":{"type":"string"},"value":{},"text":{"type":"string"},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["field","label","op","text","index"],"additionalProperties":false},"AiSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"monthly_credit_cap":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"intent_signals":{"type":"boolean"},"persona":{"type":["string","null"]},"instructions":{"type":["string","null"]},"price_policy":{"type":"string","enum":["exact","band","never"]},"compliance":{"type":"object","properties":{"banned_phrases":{"type":"array","items":{"type":"string"}},"disabled_rules":{"type":"array","items":{"type":"string"}}},"required":["banned_phrases","disabled_rules"],"additionalProperties":false,"description":"AI Compliance Check rules of the company: banned phrases, default rules switched off."}},"required":["enabled","monthly_credit_cap","intent_signals","persona","instructions","price_policy","compliance"],"additionalProperties":false},"AiSettingsPatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"monthly_credit_cap":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000},{"type":"null"}]},"intent_signals":{"type":"boolean"},"persona":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"price_policy":{"type":"string","enum":["exact","band","never"]},"compliance":{"type":"object","properties":{"banned_phrases":{"maxItems":50,"type":"array","items":{"type":"string","minLength":2,"maxLength":80}},"disabled_rules":{"maxItems":30,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"}}},"required":["banned_phrases","disabled_rules"]}}},"AiStatus":{"type":"object","properties":{"available":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["not_configured","disabled","no_permission","no_credits","cap_reached"]},{"type":"null"}]},"message":{"type":["string","null"]},"configured":{"type":"boolean"},"enabled":{"type":"boolean"},"permissions":{"type":"object","properties":{"copilot":{"type":"boolean"},"inventory_inbox":{"type":"boolean"},"manage":{"type":"boolean"}},"required":["copilot","inventory_inbox","manage"],"additionalProperties":false},"credits":{"anyOf":[{"type":"object","properties":{"available":{"type":"number"},"low_balance":{"type":"boolean"}},"required":["available","low_balance"],"additionalProperties":false},{"type":"null"}]}},"required":["available","reason","message","configured","enabled","permissions","credits"],"additionalProperties":false},"AiUsage":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/AiSettings"},"month":{"type":"object","properties":{"period_start":{"type":"string"},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"runs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cap":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["period_start","credits","runs","cap"],"additionalProperties":false},"wallet":{"anyOf":[{"type":"object","properties":{"balance":{"type":"number"},"available":{"type":"number"},"low_balance":{"type":"boolean"},"disabled":{"type":"boolean"}},"required":["balance","available","low_balance","disabled"],"additionalProperties":false},{"type":"null"}]},"by_feature":{"type":"array","items":{"type":"object","properties":{"feature":{"type":"string"},"label":{"type":"string"},"runs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["feature","label","runs","credits"],"additionalProperties":false}},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"runs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","runs","credits"],"additionalProperties":false}}},"required":["settings","month","wallet","by_feature","daily"],"additionalProperties":false},"AmenityRef":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"category":{"type":["string","null"]},"icon":{"type":["string","null"]}},"required":["id","name","category","icon"],"additionalProperties":false},"Announcement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"},"body":{"type":"string"},"level":{"type":"string","enum":["info","success","warning","critical"]},"starts_at":{"$ref":"#/components/schemas/DateTime"},"ends_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","title","body","level","starts_at","ends_at"],"additionalProperties":false},"ApiKey":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"prefix":{"type":"string","description":"First characters of the key, to tell keys apart."},"scopes":{"type":"array","items":{"type":"string"}},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string","enum":["active","expired","revoked"]},"last_used_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","prefix","scopes","created_by","status","last_used_at","expires_at","revoked_at","created_at"],"additionalProperties":false},"ApiKeyCreated":{"type":"object","properties":{"api_key":{"$ref":"#/components/schemas/ApiKey"},"key":{"type":"string","description":"The secret key — returned only this once; store it safely."}},"required":["api_key","key"],"additionalProperties":false},"ApprovalChain":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","description":"The policy: export, lead_delete, deal_delete, deal_discount, rent_floor, …"},"kind_label":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","expired","cancelled"]},"title":{"type":"string"},"reason":{"description":"Why approval is needed.","type":["string","null"]},"summary":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"level":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The level deciding now (or the last one)."},"levels":{"type":"array","items":{"type":"object","properties":{"level":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":["string","null"]},"status":{"type":"string","description":"A request status, or `waiting` (not reached yet) / `skipped`."},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decision_note":{"type":["string","null"]},"channel":{"type":["string","null"]},"hold_reason":{"type":["string","null"]},"escalated":{"type":"boolean"},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["level","name","status","decided_by","decided_at","decision_note","channel","hold_reason","escalated","due_at"],"additionalProperties":false}},"requested_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"request_note":{"type":["string","null"]},"action_status":{"type":"string","enum":["waiting","applying","applied","failed","dropped"],"description":"What became of the action: applied once approved, dropped on rejection or expiry."},"action_error":{"type":["string","null"]},"applied_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/Id"}},"required":["type","id"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","ref","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"can_cancel":{"type":"boolean"}},"required":["id","kind","kind_label","status","title","reason","summary","level","levels","requested_by","request_note","action_status","action_error","applied_at","entity","lead","created_at","decided_at","can_cancel"],"additionalProperties":false},"ApprovalPolicySettings":{"type":"object","properties":{"whatsapp":{"type":"boolean"},"policies":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["export","lead_delete","deal_delete","deal_discount","rent_floor","brokerage_waiver","stage_gate","payout","cost_sheet_discount","booking","booking_cancellation","receipt_cancellation","interest_waiver"]},"label":{"type":"string"},"description":{"type":"string"},"threshold_info":{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"unit":{"type":"string"},"default":{"type":"number"}},"required":["label","unit","default"],"additionalProperties":false},{"type":"null"}]},"enabled":{"type":"boolean"},"threshold":{"type":["number","null"]},"threshold_months":{"type":["number","null"]},"levels":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"approvers":{"type":"object","properties":{"permission":{"type":["string","null"]},"role_keys":{"type":"array","items":{"type":"string"}},"member_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"requester_manager":{"type":"boolean"}},"required":["permission","role_keys","member_ids","requester_manager"],"additionalProperties":false},"due_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"escalate_to":{"anyOf":[{"type":"object","properties":{"permission":{"type":["string","null"]},"role_keys":{"type":"array","items":{"type":"string"}},"member_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"requester_manager":{"type":"boolean"}},"required":["permission","role_keys","member_ids","requester_manager"],"additionalProperties":false},{"type":"null"}]},"escalation_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","approvers","due_minutes","escalate_to","escalation_minutes"],"additionalProperties":false}}},"required":["key","label","description","threshold_info","enabled","threshold","threshold_months","levels"],"additionalProperties":false}}},"required":["whatsapp","policies"],"additionalProperties":false},"ApprovalRequest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","description":"workflow (F-02); F-04 adds deal discounts, bookings, stage gates …"},"status":{"type":"string","enum":["pending","on_hold","approved","edited","rejected","expired","cancelled"]},"title":{"type":"string"},"details":{"type":["string","null"]},"text":{"description":"What is reviewed (an AI draft …).","type":["string","null"]},"edited_text":{"description":"The approver’s version (\"approve with edits\").","type":["string","null"]},"allow_edit":{"type":"boolean"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/Id"}},"required":["type","id"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","ref","name"],"additionalProperties":false},{"type":"null"}]},"workflow":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"approvers":{"type":"object","properties":{"permission":{"type":["string","null"]},"role_keys":{"type":"array","items":{"type":"string"}},"member_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["permission","role_keys","member_ids"],"additionalProperties":false},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"overdue":{"type":"boolean"},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decision_note":{"type":["string","null"]},"decision_channel":{"description":"web · push · whatsapp · link","type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"can_decide":{"type":"boolean"},"chain":{"anyOf":[{"$ref":"#/components/schemas/ApprovalChain"},{"type":"null"}],"description":"The chain this request is a level of (F-04)."},"level":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hold":{"anyOf":[{"type":"object","properties":{"reason":{"type":["string","null"]},"at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["reason","at","by"],"additionalProperties":false},{"type":"null"}]},"escalated":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"kind":{"type":"string"},"by":{"type":["string","null"]},"note":{"type":["string","null"]},"channel":{"type":"string"}},"required":["at","kind"],"additionalProperties":false}}},"required":["id","kind","status","title","details","text","edited_text","allow_edit","entity","lead","workflow","approvers","due_at","overdue","decided_by","decided_at","decision_note","decision_channel","created_at","can_decide","chain","level","hold","escalated","history"],"additionalProperties":false},"ApprovalRequestedMeta":{"type":"object","properties":{"approval":{"$ref":"#/components/schemas/ApprovalChain"}},"additionalProperties":{}},"ApprovalTokenView":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","const":"open"},"title":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"requested_by":{"type":["string","null"]},"approver":{"type":"string"},"level":{"anyOf":[{"type":"object","properties":{"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"of":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":["string","null"]}},"required":["number","of","name"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string"},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decided_by":{"type":["string","null"]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["state","title","reason","summary","requested_by","approver","level","status","due_at","decided_by","decided_at"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","enum":["decided","expired","used","not_allowed"]}},"required":["state"],"additionalProperties":false}]},"ApprovalWhatsappOptIn":{"type":"object","properties":{"enabled":{"type":"boolean"},"company_enabled":{"type":"boolean","description":"The company sends approval requests on WhatsApp at all."},"phone":{"description":"The member’s verified phone, masked; null: none.","type":["string","null"]}},"required":["enabled","company_enabled","phone"],"additionalProperties":false},"ArchiveInspectionTemplateInput":{"type":"object","properties":{"restore":{"default":false,"type":"boolean"}}},"AreaUnit":{"type":"string","enum":["sqft","sqm","sqyd","acre","hectare","bigha","biswa","katha","marla","kanal","guntha","cent","ground","ankanam","decimal","perch","chatak"],"description":"sqyd is gaj."},"AskAnswer":{"type":"object","properties":{"id":{"description":"The question in the member’s history.","$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["answered","clarify","cannot_answer","invalid","failed"]},"explanation":{"type":"string"},"clarifying_question":{"type":["string","null"]},"reason":{"description":"Why it cannot be answered, or what in the plan is not valid.","type":["string","null"]},"plan":{"anyOf":[{"$ref":"#/components/schemas/AskPlan"},{"type":"null"}]},"description":{"description":"The plan in words.","type":["string","null"]},"result":{"anyOf":[{"$ref":"#/components/schemas/AskResult"},{"type":"null"}]},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"description":"Value labels the catalogue cannot give the chips (locality id → name)."},"answer":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"source":{"type":"string","enum":["ai","fallback"]},"citations":{"type":"array","items":{"type":"string"}},"follow_ups":{"type":"array","items":{"type":"string"}}},"required":["text","source","citations","follow_ups"],"additionalProperties":false},{"type":"null"}]},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"blocked":{"type":"boolean"},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"request_id":{"type":"string"}},"required":["id","status","explanation","clarifying_question","reason","plan","description","result","labels","answer","findings","blocked","credits","request_id"],"additionalProperties":false},"AskCatalogue":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"noun":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2},"default_date":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","bigint","boolean","date","enum","array"]},"of":{"type":"string","enum":["string","number","enum"]},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"money":{"type":"boolean"},"nullable":{"type":"boolean"},"section":{"type":"string"},"group":{"type":"boolean"},"measure":{"type":"boolean"},"range":{"type":"boolean"}},"required":["key","label","type","group","measure","range"],"additionalProperties":false}}},"required":["key","label","noun","default_date","fields"],"additionalProperties":false}},"reports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["source_costs","speed_to_lead","agent_scorecard"]},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"],"additionalProperties":false}},"presets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["today","yesterday","tomorrow","this_week","last_week","next_week","this_month","last_month","next_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","last_12_months","next_7_days"]},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"examples":{"type":"array","items":{"type":"string"}}},"required":["entities","reports","presets","examples"],"additionalProperties":false},"AskPlan":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"query"},"query":{"$ref":"#/components/schemas/AggregateQuery"}},"required":["kind","query"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"report"},"report":{"type":"string","enum":["source_costs","speed_to_lead","agent_scorecard"]},"period":{"$ref":"#/components/schemas/ReportPeriod"}},"required":["kind","report","period"],"additionalProperties":false}],"description":"An Ask PropZolo query, or a named report with its period."},"AskPlan2":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"query"},"query":{"$ref":"#/components/schemas/AggregateQuery"}},"required":["kind","query"]},{"type":"object","properties":{"kind":{"type":"string","const":"report"},"report":{"type":"string","enum":["source_costs","speed_to_lead","agent_scorecard"]},"period":{"$ref":"#/components/schemas/ReportPeriodInput"}},"required":["kind","report","period"]}],"description":"An Ask PropZolo query, or a named report with its period."},"AskPlanInput":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"query"},"query":{"$ref":"#/components/schemas/AggregateQuery"}},"required":["kind","query"]},{"type":"object","properties":{"kind":{"type":"string","const":"report"},"report":{"type":"string","enum":["source_costs","speed_to_lead","agent_scorecard"]},"period":{"$ref":"#/components/schemas/ReportPeriodInput"}},"required":["kind","report","period"]}],"description":"An Ask PropZolo query, or a named report with its period."},"AskQuestion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"question":{"type":"string"},"status":{"type":"string","enum":["answered","clarify","cannot_answer","invalid","failed"]},"plan":{"anyOf":[{"$ref":"#/components/schemas/AskPlan"},{"type":"null"}]},"answer":{"type":["string","null"]},"answer_source":{"type":["string","null"]},"citations":{"type":"array","items":{"type":"string"}},"follow_ups":{"type":"array","items":{"type":"string"}},"summary":{"anyOf":[{"type":"object","properties":{"entity":{"type":"string"},"mode":{"type":"string"},"title":{"type":"string"},"matched":{"type":"number"}},"required":["entity","mode","title","matched"],"additionalProperties":false},{"type":"null"}]},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","question","status","plan","answer","answer_source","citations","follow_ups","summary","credits","created_at"],"additionalProperties":false},"AskResult":{"type":"object","properties":{"mode":{"type":"string","enum":["list","total","group","series","report"]},"entity":{"type":"string"},"title":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["text","count","number","money","percent","date","minutes"]}},"required":["key","label","kind"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Stable within the result: what answer citations point at."},"label":{"type":"string","description":"A group name, or a record’s reference code."},"name":{"description":"The record’s person or title (lists only).","type":["string","null"]},"cells":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"value":{"description":"Money in paise (a number), dates ISO.","type":["number","string","null"]},"display":{"type":"string","description":"How people read it: \"₹1.25 Cr\", \"1,234\", \"38.5%\", \"1 h 35 min\"."}},"required":["value","display"],"additionalProperties":false}},"link":{"type":["string","null"]},"filter":{"description":"Leads groups: the filter of the records behind the row."}},"required":["key","label","cells","link"],"additionalProperties":false}},"totals":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"value":{"description":"Money in paise (a number), dates ISO.","type":["number","string","null"]},"display":{"type":"string","description":"How people read it: \"₹1.25 Cr\", \"1,234\", \"38.5%\", \"1 h 35 min\"."}},"required":["value","display"],"additionalProperties":false}},{"type":"null"}]},"matched":{"type":"integer","minimum":0,"maximum":9007199254740991},"truncated":{"type":"boolean"},"range":{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"from_day":{"type":"string"},"to_day":{"type":"string"}},"required":["label","from_day","to_day"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":"array","items":{"type":"string"}}},"required":["mode","entity","title","columns","rows","totals","matched","truncated","range","notes"],"additionalProperties":false},"AssignLeadInput":{"type":"object","properties":{"owner_id":{"description":"Closing owner; null unassigns.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"presales_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}}},"AssignmentConditionField":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","bigint","boolean","date","enum","array"]},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":["string","number"]},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"of":{"type":"string","enum":["string","number","enum"]},"money":{"type":"boolean"},"group":{"type":"string"},"nullable":{"type":"boolean"}},"required":["key","label","type"],"additionalProperties":false},"AssignmentLogEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"created_at":{"$ref":"#/components/schemas/DateTime"},"via":{"type":"string","description":"rule · fallback · source_default · held · waiting · pool · unmatched · rotation · second_chance · rotation_pool · claim · give · pool_return · staff_exit · manual · round_robin"},"reason":{"type":["string","null"]},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"from":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"rule":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"actor":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]}},"required":["id","created_at","via","reason","lead","from","to","rule","actor"],"additionalProperties":false},"AssignmentMethod":{"type":"string","enum":["round_robin","weighted","load_balanced","availability","sticky_owner","pool"]},"AssignmentOptions":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentConditionField"}},"methods":{"type":"array","items":{"type":"object","properties":{"value":{"$ref":"#/components/schemas/AssignmentMethod"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"assignment_rule_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["id","name","assignment_rule_id"],"additionalProperties":false}},"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"active":{"type":"boolean"}},"required":["id","name","active"],"additionalProperties":false}},"localities":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"city":{"type":"string"}},"required":["id","name","city"],"additionalProperties":false}},"languages":{"type":"array","items":{"type":"object","properties":{"value":{"type":["string","number"]},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"specializations":{"type":"array","items":{"type":"object","properties":{"value":{"type":["string","number"]},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"timezone":{"type":"string"},"can_edit":{"type":"boolean"}},"required":["fields","methods","sources","members","localities","languages","specializations","timezone","can_edit"],"additionalProperties":false},"AssignmentRule":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"1 = evaluated first."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_active":{"type":"boolean"},"method":{"$ref":"#/components/schemas/AssignmentMethod"},"conditions":{"$ref":"#/components/schemas/AssignmentRuleConditions"},"summary":{"type":"string","description":"The conditions in words."},"only_available":{"type":"boolean"},"active_app_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"outside_shift":{"type":"string","enum":["assign","hold"]},"daily_cap":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"max_untouched":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"rotation_enabled":{"type":"boolean"},"rotation_minutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"rotation_max":{"type":"integer","minimum":0,"maximum":9007199254740991},"rotation_final":{"type":"string","enum":["pool","keep"]},"rotation_scope":{"type":"string","enum":["auto","all","off"]},"second_chance_enabled":{"type":"boolean"},"second_chance_hours":{"type":"integer","minimum":0,"maximum":9007199254740991},"second_chance_attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"members":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"enabled":{"type":"boolean"},"weight":{"type":"integer","minimum":0,"maximum":9007199254740991},"daily_cap":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["member_id","name","enabled","weight","daily_cap"],"additionalProperties":false}},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","position","priority","is_active","method","conditions","summary","only_available","active_app_minutes","outside_shift","daily_cap","max_untouched","rotation_enabled","rotation_minutes","rotation_max","rotation_final","rotation_scope","second_chance_enabled","second_chance_hours","second_chance_attempts","fallback_member_id","members","created_at","updated_at"],"additionalProperties":false},"AssignmentRuleConditions":{"type":"object","properties":{"filter":{"anyOf":[{},{"type":"null"}],"description":"Filter tree over the assignment condition fields (null = every lead)."},"match":{"type":"object","properties":{"language":{"$ref":"#/components/schemas/CandidateMatchMode"},"locality":{"$ref":"#/components/schemas/CandidateMatchMode"},"specialization":{"$ref":"#/components/schemas/CandidateMatchMode"}},"required":["language","locality","specialization"],"additionalProperties":false},"hourly_cap":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["filter","match","hourly_cap"],"additionalProperties":false},"AssignmentRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"is_active":{"type":"boolean"},"method":{"$ref":"#/components/schemas/AssignmentMethod"},"conditions":{"type":"object","properties":{"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"match":{"type":"object","properties":{"language":{"$ref":"#/components/schemas/CandidateMatchMode"},"locality":{"$ref":"#/components/schemas/CandidateMatchMode"},"specialization":{"$ref":"#/components/schemas/CandidateMatchMode"}}},"hourly_cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]}}},"only_available":{"type":"boolean"},"active_app_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":1440},{"type":"null"}]},"outside_shift":{"type":"string","enum":["assign","hold"]},"daily_cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"max_untouched":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"rotation_enabled":{"type":"boolean"},"rotation_minutes":{"type":"integer","minimum":1,"maximum":1440},"rotation_max":{"type":"integer","minimum":0,"maximum":20},"rotation_final":{"type":"string","enum":["pool","keep"]},"rotation_scope":{"type":"string","enum":["auto","all","off"]},"second_chance_enabled":{"type":"boolean"},"second_chance_hours":{"type":"integer","minimum":1,"maximum":720},"second_chance_attempts":{"type":"integer","minimum":1,"maximum":50},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"members":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"enabled":{"type":"boolean"},"weight":{"type":"integer","minimum":0,"maximum":100},"daily_cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]}},"required":["member_id"]}}}},"AssignmentSimulation":{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"lead":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"ref":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["id","ref","name"],"additionalProperties":false},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_active":{"type":"boolean"},"result":{"type":"string","enum":["matched","no_match","inactive","not_reached"]},"via_source":{"type":"boolean"},"conditions":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"passed":{"type":"boolean"}},"required":["text","passed"],"additionalProperties":false}}},"required":["id","name","position","is_active","result","via_source","conditions"],"additionalProperties":false}},"rule":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"method":{"type":"string"},"via_source":{"type":"boolean"}},"required":["id","name","method","via_source"],"additionalProperties":false},{"type":"null"}]},"candidates":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"eligible":{"type":"boolean"},"winner":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["excluded","off","leave","cap","untouched","capacity","app","unavailable","inactive","hourly_cap","accountability","language","locality","specialization"]},{"type":"null"}]},"reason_label":{"type":["string","null"]},"weight":{"type":"integer","minimum":0,"maximum":9007199254740991},"today":{"type":"integer","minimum":0,"maximum":9007199254740991},"daily_cap":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"last_hour":{"type":"integer","minimum":0,"maximum":9007199254740991},"untouched":{"type":"integer","minimum":0,"maximum":9007199254740991},"open_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"lead_capacity":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"on_shift":{"type":"boolean"},"shift":{"type":"string"},"app_seen_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"fits":{"type":"object","properties":{"language":{"type":"boolean"},"locality":{"type":"boolean"},"specialization":{"type":"boolean"}},"required":["language","locality","specialization"],"additionalProperties":false}},"required":["member_id","name","eligible","winner","reason","reason_label","weight","today","daily_cap","last_hour","untouched","open_leads","lead_capacity","on_shift","shift","app_seen_at","fits"],"additionalProperties":false}},"outcome":{"type":"object","properties":{"kind":{"type":"string","enum":["assign","hold","pool","waiting","unmatched"]},"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"member_name":{"type":["string","null"]},"method":{"type":["string","null"]},"text":{"type":"string"},"until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["kind","member_id","member_name","method","text","until"],"additionalProperties":false},"relaxed":{"type":"boolean"}},"required":["at","lead","rules","rule","candidates","outcome","relaxed"],"additionalProperties":false},"AttachImageInput":{"type":"object","properties":{"key":{"type":"string","minLength":10,"maxLength":300}},"required":["key"]},"AttendanceDay":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"date":{"$ref":"#/components/schemas/LocalDate"},"member_id":{"$ref":"#/components/schemas/Id"},"status":{"anyOf":[{"type":"string","enum":["present","half_day","absent","leave","holiday","weekly_off"]},{"type":"null"}]},"final":{"type":"boolean","description":"The day is over: absent and half day are decided."},"late":{"type":"boolean"},"late_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"early_leave_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"punch_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"punch_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"worked_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"break_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_duty":{"type":"boolean"},"on_break":{"type":"boolean"},"distance_m":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"idle_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"flags":{"type":"array","items":{"type":"string"}},"note":{"type":["string","null"]},"corrected":{"type":"boolean"}},"required":["id","date","member_id","status","final","late","late_minutes","early_leave_minutes","punch_in_at","punch_out_at","worked_minutes","break_minutes","on_duty","on_break","distance_m","idle_minutes","flags","note","corrected"],"additionalProperties":false},"AttendancePunch":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["in","out","break_start","break_end"]},"at":{"description":"When it happened (the server’s reconciled time).","$ref":"#/components/schemas/DateTime"},"source":{"type":"string","description":"app | web | auto (automatic punch-out) | manager (a correction)"},"time_source":{"type":"string","description":"monotonic | device | server — how `at` was established"},"captured_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"},"location":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"accuracy_m":{"type":["number","null"]}},"required":["lat","lng","accuracy_m"],"additionalProperties":false},{"type":"null"}]},"mock_location":{"type":"boolean"},"site":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"distance_m":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"inside":{"description":"Inside an office / site radius; null: no site applies.","type":["boolean","null"]},"outside_reason":{"type":["string","null"]},"has_selfie":{"type":"boolean"},"selfie_status":{"type":"string"},"flags":{"type":"array","items":{"type":"string"},"description":"Tamper signals: mock_location, clock_skew, low_accuracy …"},"voided":{"type":"boolean"},"void_reason":{"type":["string","null"]}},"required":["id","kind","at","source","time_source","captured_at","received_at","location","mock_location","site","distance_m","inside","outside_reason","has_selfie","selfie_status","flags","voided","void_reason"],"additionalProperties":false},"AttendanceRegister":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"},"days":{"type":"array","items":{"$ref":"#/components/schemas/LocalDate"}},"rows":{"type":"array","items":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"branch":{"type":["string","null"]},"employee_code":{"type":["string","null"]}},"required":["id","name","branch","employee_code"],"additionalProperties":false},"days":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"status":{"type":["string","null"]},"late_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"early_leave_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"worked_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"punch_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"punch_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"flags":{"type":"array","items":{"type":"string"}},"corrected":{"type":"boolean"}},"required":["status","late_minutes","early_leave_minutes","worked_minutes","punch_in_at","punch_out_at","flags","corrected"],"additionalProperties":false}},"totals":{"type":"object","properties":{"present":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"late":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"half_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"absent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leave":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holiday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weekly_off":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"worked_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exceptions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["present","late","half_day","absent","leave","holiday","weekly_off","worked_minutes","exceptions"],"additionalProperties":false}},"required":["member","days","totals"],"additionalProperties":false}}},"required":["from","to","days","rows"],"additionalProperties":false},"AttendanceSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"require_punch_in":{"type":"boolean"},"selfie":{"type":"string","enum":["off","optional","required"]},"geofence":{"type":"string","enum":["off","warn","reason","block"]},"max_accuracy_m":{"type":"integer","minimum":20,"maximum":500},"breaks":{"type":"boolean"},"web_punch":{"type":"boolean"},"grace_minutes":{"type":"integer","minimum":0,"maximum":120},"half_day_minutes":{"type":"integer","minimum":60,"maximum":720},"early_leave_grace_minutes":{"type":"integer","minimum":0,"maximum":120},"auto_punch_out":{"type":"object","properties":{"enabled":{"type":"boolean"},"after_minutes":{"type":"integer","minimum":15,"maximum":720},"fallback_hours":{"type":"integer","minimum":4,"maximum":20}},"required":["enabled","after_minutes","fallback_hours"],"additionalProperties":false},"live_location":{"type":"object","properties":{"enabled":{"type":"boolean"},"interval_minutes":{"anyOf":[{"type":"number","const":5},{"type":"number","const":10},{"type":"number","const":15},{"type":"number","const":30}]}},"required":["enabled","interval_minutes"],"additionalProperties":false}},"required":["enabled","require_punch_in","selfie","geofence","max_accuracy_m","breaks","web_punch","grace_minutes","half_day_minutes","early_leave_grace_minutes","auto_punch_out","live_location"],"additionalProperties":false},"AttendanceSite":{"type":"object","properties":{"id":{"type":"string","description":"A site id, or `branch:<id>` for a branch’s own pin."},"kind":{"type":"string","enum":["branch","site"]},"name":{"type":"string"},"branch":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"latitude":{"type":"number"},"longitude":{"type":"number"},"radius_m":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_active":{"type":"boolean"}},"required":["id","kind","name","branch","latitude","longitude","radius_m","is_active"],"additionalProperties":false},"AttendanceToday":{"type":"object","properties":{"enabled":{"type":"boolean"},"require_punch_in":{"type":"boolean","description":"The app keeps the CRM behind the punch-in; the web shows a banner."},"selfie":{"type":"string","enum":["off","optional","required"]},"geofence":{"type":"string","enum":["off","warn","reason","block"]},"max_accuracy_m":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"breaks":{"type":"boolean"},"web_punch":{"type":"boolean"},"can_punch":{"type":"boolean"},"can_view_team":{"type":"boolean"},"state":{"type":"string","enum":["off","on","break"]},"day":{"anyOf":[{"$ref":"#/components/schemas/AttendanceDay"},{"type":"null"}]},"punches":{"type":"array","items":{"$ref":"#/components/schemas/AttendancePunch"}},"plan":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/LocalDate"},"kind":{"type":"string","enum":["working","holiday","weekly_off"]},"shift_start":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"shift_end":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["date","kind","shift_start","shift_end"],"additionalProperties":false},"sites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"},"radius_m":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","lat","lng","radius_m"],"additionalProperties":false}},"live_location":{"$ref":"#/components/schemas/LiveLocationState"},"server_time":{"$ref":"#/components/schemas/DateTime"}},"required":["enabled","require_punch_in","selfie","geofence","max_accuracy_m","breaks","web_punch","can_punch","can_view_team","state","day","punches","plan","sites","live_location","server_time"],"additionalProperties":false},"AudienceSegment":{"type":"object","properties":{"kind":{"type":"string","enum":["leads","contacts"]},"filter":{"default":null,"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]}},"required":["kind","filter"],"additionalProperties":false,"description":"A lead or contact smart list (the filter DSL)."},"AudienceSegmentInput":{"type":"object","properties":{"kind":{"type":"string","enum":["leads","contacts"]},"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]}},"required":["kind"],"description":"A lead or contact smart list (the filter DSL)."},"AudienceSync":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"audience_id":{"$ref":"#/components/schemas/Id"},"destination":{"type":"string","enum":["meta","google"]},"trigger":{"type":"string","enum":["manual","schedule"]},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"eligible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"excluded":{"type":"object","propertyNames":{"type":"string","enum":["deleted","booked_buyer","consent_withdrawn","suppressed","no_lawful_basis","no_identifier","ads_objection"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"error":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"started_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","audience_id","destination","trigger","status","eligible","added","removed","excluded","error","created_at","started_at","finished_at"],"additionalProperties":false,"description":"One sync run to one platform: counts only, never an identifier."},"AuditLogEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"at":{"$ref":"#/components/schemas/DateTime"},"actor":{"type":"object","properties":{"kind":{"type":"string","enum":["member","system","api_key","support","unknown"]},"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"detail":{"type":["string","null"]}},"required":["kind","member_id","name","detail"],"additionalProperties":false},"action":{"type":"string"},"entity_type":{"type":"string"},"entity_id":{"type":["string","null"]},"description":{"type":["string","null"]},"ip":{"type":["string","null"]},"user_agent":{"type":["string","null"]},"request_id":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"old":{},"new":{}},"required":["field","old","new"],"additionalProperties":false}},"meta":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","at","actor","action","entity_type","entity_id","description","ip","user_agent","request_id","changes","meta"],"additionalProperties":false},"AutomationContactUpsert":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/AutomationUpsertAction"},"contact_id":{"$ref":"#/components/schemas/Id"},"contact":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["action","contact_id","contact"],"additionalProperties":false},"AutomationLeadUpsert":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/AutomationUpsertAction"},"outcome":{"type":"string","enum":["created","reenquiry","duplicate_labelled","reopened","existing"]},"lead_id":{"$ref":"#/components/schemas/Id"},"contact_id":{"$ref":"#/components/schemas/Id"},"duplicate_kind":{"type":["string","null"]},"duplicate_of_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["action","outcome","lead_id","contact_id","duplicate_kind","duplicate_of_id","lead"],"additionalProperties":false},"AutomationTrigger":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/AutomationTriggerKey"},"label":{"type":"string"},"description":{"type":"string"},"event":{"type":"string","description":"The outbox event that fires it."},"scope":{"type":"string","description":"The API-key scope the trigger needs (besides webhooks:manage for hooks)."},"sample":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["key","label","description","event","scope","sample"],"additionalProperties":false},"AutomationTriggerKey":{"type":"string","enum":["new_lead","lead_status_changed","visit_booked","deal_won","new_contact","lead_assigned","lead_updated","task_created","task_completed","visit_completed","visit_no_show","visit_cancelled","call_logged","message_received","email_received","property_created","property_price_changed","receipt_recorded","payment_link_paid","payment_refunded","integration_broken"]},"AutomationUpsertAction":{"type":"string","enum":["created","updated"]},"BankStatement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"bank":{"type":"string","enum":["hdfc","icici","sbi","axis","kotak","generic"]},"account_label":{"type":["string","null"]},"file_name":{"type":"string"},"period_from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"period_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"rows_total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows_new":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"auto_matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to_review":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"problems":{"type":"array","items":{"type":"object","properties":{"row_no":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"message":{"type":"string"}},"required":["row_no","message"],"additionalProperties":false}},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","bank","account_label","file_name","period_from","period_to","rows_total","rows_new","credits","auto_matched","to_review","problems","created_at"],"additionalProperties":false},"BankTransaction":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"statement_id":{"$ref":"#/components/schemas/Id"},"row_no":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"txn_date":{"$ref":"#/components/schemas/LocalDate"},"amount":{"description":"Credits positive, debits negative (paise).","$ref":"#/components/schemas/Paise"},"narration":{"type":"string"},"reference":{"type":["string","null"]},"utr":{"type":["string","null"]},"status":{"type":"string","enum":["unmatched","suggested","matched","ignored","debit"]},"match":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"$ref":"#/components/schemas/Id"},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"by":{"type":["string","null"]},"at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["kind","id","score","reasons","by","at"],"additionalProperties":false},{"type":"null"}]},"suggestion":{"anyOf":[{"type":"object","properties":{"best":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["rent_payment","receipt"]},"id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"},"amount":{"type":"string","description":"Paise as a digit string."},"date":{"$ref":"#/components/schemas/LocalDate"},"utr":{"type":["string","null"]},"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasons":{"type":"array","items":{"type":"string"}}},"required":["kind","id","label","amount","date","utr","score","reasons"],"additionalProperties":false},{"type":"null"}]},"alternatives":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["rent_payment","receipt"]},"id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"},"amount":{"type":"string","description":"Paise as a digit string."},"date":{"$ref":"#/components/schemas/LocalDate"},"utr":{"type":["string","null"]},"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasons":{"type":"array","items":{"type":"string"}}},"required":["kind","id","label","amount","date","utr","score","reasons"],"additionalProperties":false}}},"required":["best","alternatives"],"additionalProperties":false},{"type":"null"}]}},"required":["id","statement_id","row_no","txn_date","amount","narration","reference","utr","status","match","suggestion"],"additionalProperties":false},"BillingAmount":{"type":"object","properties":{"taxable":{"$ref":"#/components/schemas/Paise"},"gst":{"$ref":"#/components/schemas/Paise"},"gross":{"$ref":"#/components/schemas/Paise"}},"required":["taxable","gst","gross"],"additionalProperties":false,"description":"Taxable value, 18 % GST and the gross amount charged, in paise."},"BillingOverview":{"type":"object","properties":{"payments_configured":{"type":"boolean","description":"PropZolo’s Razorpay account is set up (D-CFG1)."},"invoicing_configured":{"type":"boolean","description":"PropZolo’s GST billing profile is set up."},"test_mode":{"type":"boolean"},"company_status":{"type":"string","enum":["trial","active","past_due","suspended","cancelled"]},"read_only":{"type":"boolean"},"seats_used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subscription":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionSummary"},{"type":"null"}]},"dunning":{"anyOf":[{"type":"object","properties":{"past_due_at":{"$ref":"#/components/schemas/DateTime"},"days_overdue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suspends_at":{"$ref":"#/components/schemas/DateTime"},"cancels_at":{"$ref":"#/components/schemas/DateTime"}},"required":["past_due_at","days_overdue","suspends_at","cancels_at"],"additionalProperties":false},{"type":"null"}]},"emandate_required":{"type":"boolean","description":"The recurring debit is above ₹15,000: e-NACH or an annual invoice instead of card/UPI."}},"required":["payments_configured","invoicing_configured","test_mode","company_status","read_only","seats_used","subscription","dunning","emandate_required"],"additionalProperties":false},"BillingPlan":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"model":{"type":"string","enum":["free","per_seat","bundle","quote"]},"cycles":{"type":"array","items":{"type":"string","enum":["monthly","yearly"]}},"price_monthly":{"description":"Per seat per month on monthly billing (per-seat plans).","$ref":"#/components/schemas/Paise"},"price_yearly":{"description":"Per seat per year, or the whole bundle per year.","$ref":"#/components/schemas/Paise"},"min_seats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included_seats":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"extra_seat_monthly":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"purchasable":{"type":"boolean"}},"required":["code","name","description","model","cycles","price_monthly","price_yearly","min_seats","included_seats","extra_seat_monthly","purchasable"],"additionalProperties":false},"Booking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string"},"status":{"type":"string"},"approval":{"type":"string","enum":["draft","pending","approved","rejected"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"unit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"},"label":{"type":"string"},"floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","unit_no","label","floor"],"additionalProperties":false},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"primary_applicant":{"type":["string","null"]},"booking_date":{"$ref":"#/components/schemas/LocalDate"},"agreement_value":{"$ref":"#/components/schemas/Paise"},"confirmed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"migrated":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"collections_from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["at","collections_from"],"additionalProperties":false},{"type":"null"}],"description":"BLD-24: brought in by a booking import. Collections (overdue events, demands, reminders, interest) stay off until `collections_from` is set; from then only instalments due on or after it are chased."},"cost_sheet":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"ref":{"type":["string","null"]},"content_hash":{"type":["string","null"]},"accepted_at":{"type":["string","null"]},"accepted_name":{"type":["string","null"]},"sheet":{"description":"The frozen ComputedCostSheet."}},"required":["id","ref","content_hash","accepted_at","accepted_name","sheet"],"additionalProperties":false},"payment_plan":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"],"additionalProperties":false},{"type":"null"}]},"schedule":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milestone":{"type":"string"},"trigger":{"type":["string","null"]},"percent":{"type":["number","null"]},"amount":{"$ref":"#/components/schemas/Paise"},"gst_amount":{"$ref":"#/components/schemas/Paise"},"due_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string","description":"preview before confirmation; upcoming | due | … after."}},"required":["seq","milestone","trigger","percent","amount","gst_amount","due_date","status"],"additionalProperties":false}},"booking_amount":{"$ref":"#/components/schemas/Paise"},"gst_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"stamp_duty":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"registration_fee":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"loan":{"type":"object","properties":{"bank":{"type":["string","null"]},"amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"status":{"type":["string","null"]}},"required":["bank","amount","status"],"additionalProperties":false},"notes":{"type":["string","null"]},"applicants":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"is_primary":{"type":"boolean"},"name":{"type":"string"},"relation":{"type":["string","null"]},"pan_masked":{"type":["string","null"]},"aadhaar_last4":{"type":["string","null"]},"dob":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"address":{"type":["string","null"]},"phone":{"description":"Masked unless you may edit bookings.","type":["string","null"]},"email":{"type":["string","null"]},"has_contact":{"type":"boolean","description":"False: no contact (no reachable number) — demands, receipts and the portal never reach them."}},"required":["id","is_primary","name","relation","pan_masked","aadhaar_last4","dob","address","phone","email","has_contact"],"additionalProperties":false}},"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"}},"required":["id","firm_name"],"additionalProperties":false},{"type":"null"}],"description":"The channel partner the sale is credited to (brokerage accrues to them)."},"document_kinds":{"type":"array","items":{"type":"string"}},"gaps":{"type":"array","items":{"type":"string"}},"editable":{"type":"boolean"},"approval_chain_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"confirmed_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"cancelled":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"reason":{"type":["string","null"]}},"required":["at","reason"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","ref","status","approval","project","unit","lead","primary_applicant","booking_date","agreement_value","confirmed_at","created_at","migrated","cost_sheet","payment_plan","schedule","booking_amount","gst_amount","stamp_duty","registration_fee","loan","notes","applicants","partner","document_kinds","gaps","editable","approval_chain_id","submitted_at","confirmed_by","created_by","cancelled"],"additionalProperties":false},"BookingCollections":{"type":"object","properties":{"booking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"status":{"type":"string"},"unit":{"type":"string"},"agreement_value":{"$ref":"#/components/schemas/Paise"},"gst_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"buyers":{"type":"array","items":{"type":"string"}},"without_contact":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"primary":{"type":"boolean"}},"required":["name","primary"],"additionalProperties":false},"description":"Applicants with no contact: no demands, receipts or reminders reach them (BLD-14)."}},"required":["id","ref","status","unit","agreement_value","gst_amount","buyers","without_contact"],"additionalProperties":false},"totals":{"type":"object","properties":{"total":{"$ref":"#/components/schemas/Paise"},"paid":{"$ref":"#/components/schemas/Paise"},"outstanding":{"$ref":"#/components/schemas/Paise"},"overdue":{"$ref":"#/components/schemas/Paise"},"interest_accrued":{"$ref":"#/components/schemas/Paise"},"interest_outstanding":{"$ref":"#/components/schemas/Paise"},"advance":{"$ref":"#/components/schemas/Paise"},"received":{"$ref":"#/components/schemas/Paise"}},"required":["total","paid","outstanding","overdue","interest_accrued","interest_outstanding","advance","received"],"additionalProperties":false},"tds":{"type":"object","properties":{"section":{"description":"e.g. 194-IA; null when no TDS applies.","type":["string","null"]},"stamp_duty_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"The registered stamp-duty value (BLD-09)."},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"expected":{"$ref":"#/components/schemas/Paise"},"deducted":{"$ref":"#/components/schemas/Paise"},"certified":{"$ref":"#/components/schemas/Paise"},"short":{"$ref":"#/components/schemas/Paise"},"awaiting_certificate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["section","stamp_duty_value","rate_bps","note","expected","deducted","certified","short","awaiting_certificate"],"additionalProperties":false},"schedule":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milestone":{"type":"string"},"trigger":{"type":["string","null"]},"stage":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Paise"},"gst_amount":{"$ref":"#/components/schemas/Paise"},"paid":{"$ref":"#/components/schemas/Paise"},"outstanding":{"$ref":"#/components/schemas/Paise"},"interest_outstanding":{"$ref":"#/components/schemas/Paise"},"due_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string"},"bucket":{"anyOf":[{"type":"string","enum":["not_due","d0_30","d31_60","d61_90","d90_plus"]},{"type":"null"}]},"demand":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"}},"required":["id","ref"],"additionalProperties":false},{"type":"null"}]}},"required":["id","seq","milestone","trigger","stage","amount","gst_amount","paid","outstanding","interest_outstanding","due_date","status","bucket","demand"],"additionalProperties":false}},"demands":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"issued_on":{"$ref":"#/components/schemas/LocalDate"},"due_on":{"$ref":"#/components/schemas/LocalDate"},"amount":{"$ref":"#/components/schemas/Paise"},"interest":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["issued","part_paid","paid","cancelled"]},"trigger":{"type":"string"},"reminders":{"type":"array","items":{"type":"string"}},"sent":{"type":"boolean"}},"required":["id","ref","issued_on","due_on","amount","interest","status","trigger","reminders","sent"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"},"kind":{"type":"string","enum":["payment","refund"]},"mode":{"type":"string"},"reference":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Paise"},"tds_amount":{"$ref":"#/components/schemas/Paise"},"tds_section":{"type":["string","null"]},"tds_status":{"type":"string","enum":["none","expected","certified"]},"form16b_number":{"type":["string","null"]},"form16b_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"The TDS on the Form 16B (BLD-13)."},"advance":{"$ref":"#/components/schemas/Paise"},"received_on":{"$ref":"#/components/schemas/LocalDate"},"cleared_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"type":"string","enum":["claimed","received","cleared","bounced","cancelled","rejected"]}},"required":["id","number","kind","mode","reference","amount","tds_amount","tds_section","tds_status","form16b_number","form16b_amount","advance","received_on","cleared_on","status"],"additionalProperties":false}},"interest":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"schedule_id":{"$ref":"#/components/schemas/Id"},"as_of":{"$ref":"#/components/schemas/LocalDate"},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["accrued","charged","waived"]},"waived_reason":{"type":["string","null"]}},"required":["id","schedule_id","as_of","days","rate_bps","amount","status","waived_reason"],"additionalProperties":false}},"transfers":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"transferred_on":{"$ref":"#/components/schemas/LocalDate"},"fee":{"$ref":"#/components/schemas/Paise"},"from":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"pan_last4":{"type":["string","null"]}},"required":["name","pan_last4"],"additionalProperties":false}},"to":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"pan_last4":{"type":["string","null"]}},"required":["name","pan_last4"],"additionalProperties":false}}},"required":["id","transferred_on","fee","from","to"],"additionalProperties":false}},"ledger":{"type":"array","items":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/LocalDate"},"kind":{"type":"string","enum":["demand","interest","payment","tds","refund","reversal"]},"ref":{"type":"string"},"description":{"type":"string"},"debit":{"$ref":"#/components/schemas/Paise"},"credit":{"$ref":"#/components/schemas/Paise"},"balance":{"$ref":"#/components/schemas/Paise"}},"required":["date","kind","ref","description","debit","credit","balance"],"additionalProperties":false}}},"required":["booking","totals","tds","schedule","demands","receipts","interest","transfers","ledger"],"additionalProperties":false},"BookingDocument":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","aadhaar","photo","address_proof","booking_cheque","loan_sanction","other"]},"applicant_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploaded_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"uploaded_at":{"$ref":"#/components/schemas/DateTime"},"scan_status":{"type":["string","null"]}},"required":["id","kind","applicant_id","name","content_type","size","uploaded_by","uploaded_at","scan_status"],"additionalProperties":false},"BookingSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string"},"status":{"type":"string"},"approval":{"type":"string","enum":["draft","pending","approved","rejected"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"unit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"},"label":{"type":"string"},"floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","unit_no","label","floor"],"additionalProperties":false},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"primary_applicant":{"type":["string","null"]},"booking_date":{"$ref":"#/components/schemas/LocalDate"},"agreement_value":{"$ref":"#/components/schemas/Paise"},"confirmed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"migrated":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"collections_from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["at","collections_from"],"additionalProperties":false},{"type":"null"}],"description":"BLD-24: brought in by a booking import. Collections (overdue events, demands, reminders, interest) stay off until `collections_from` is set; from then only instalments due on or after it are chased."}},"required":["id","number","ref","status","approval","project","unit","lead","primary_applicant","booking_date","agreement_value","confirmed_at","created_at","migrated"],"additionalProperties":false},"Bootstrap":{"type":"object","properties":{"company":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"$ref":"#/components/schemas/CompanyType"},"status":{"$ref":"#/components/schemas/CompanyStatus"},"timezone":{"type":"string","minLength":1,"maxLength":64,"description":"IANA time zone, e.g. Asia/Kolkata.","examples":["Asia/Kolkata"]},"locale":{"type":"string"},"currency":{"type":"string"},"brand_color":{"type":["string","null"]},"logo_url":{"type":["string","null"]},"financial_year_start":{"type":"integer","minimum":1,"maximum":12}},"required":["id","name","slug","type","status","timezone","locale","currency","brand_color","logo_url","financial_year_start"],"additionalProperties":false},"pipelines":{"type":"array","items":{"$ref":"#/components/schemas/Pipeline"},"description":"Ordered; statuses and sub-statuses ordered within."},"lead_sources":{"type":"array","items":{"$ref":"#/components/schemas/LeadSource"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldDefinition"},"description":"Active definitions visible to the caller’s role."},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Client-relevant company settings (calls.*, visits.*, messaging.quiet_hours …)."},"plan":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"],"additionalProperties":false},{"type":"null"}]},"subscription":{"anyOf":[{"type":"object","properties":{"status":{"$ref":"#/components/schemas/SubscriptionStatus"},"trial_ends_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"current_period_end":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["status","trial_ends_at","current_period_end"],"additionalProperties":false},{"type":"null"}]},"features":{"$ref":"#/components/schemas/Features"},"limits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]},"description":"Numeric plan limits after overrides; null = unlimited."},"flags":{"default":{},"description":"Feature flags as they apply to this workspace (rollouts evaluated on the server).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}}},"required":["company","pipelines","lead_sources","custom_fields","settings","plan","subscription","features","limits","flags"],"additionalProperties":false},"Branch":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"city":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"rera_number":{"type":["string","null"]},"gstin":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"geofence_m":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"business_hours":{"anyOf":[{"type":"object","properties":{"weekly":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7},"open":{"type":"boolean"},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["day","open","start","end"],"additionalProperties":false}},"holidays":{"type":"array","items":{"$ref":"#/components/schemas/Holiday"}}},"required":["weekly","holidays"],"additionalProperties":false},{"type":"null"}],"description":"The branch’s own hours for SLA clocks (F-04); null: the company’s business hours."},"is_active":{"type":"boolean"},"members":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","city","address","phone","rera_number","gstin","latitude","longitude","geofence_m","business_hours","is_active","members","created_at","updated_at"],"additionalProperties":false},"BranchInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"rera_number":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"gstin":{"description":"For a branch registered in another state.","anyOf":[{"description":"15-character GSTIN (validated with its check character).","type":"string","maxLength":32},{"type":"null"}]},"latitude":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"geofence_m":{"anyOf":[{"type":"integer","minimum":20,"maximum":5000},{"type":"null"}]},"business_hours":{"anyOf":[{"$ref":"#/components/schemas/BusinessHoursInput"},{"type":"null"}]},"is_active":{"type":"boolean"}},"required":["name"]},"BriefingSettingsView":{"type":"object","properties":{"enabled":{"type":"boolean"},"push":{"type":"boolean"},"email":{"type":"boolean"},"ai_summary":{"type":"boolean"},"stuck_deal_days":{"type":"integer","minimum":3,"maximum":90},"lead_minutes":{"type":"integer","minimum":0,"maximum":180},"push_on_plan":{"type":"boolean","description":"The plan includes \"Morning briefing push\"; off: push is never sent"}},"required":["enabled","push","email","ai_summary","stuck_deal_days","lead_minutes","push_on_plan"],"additionalProperties":false},"Broadcast":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"channel":{"type":"string","enum":["whatsapp_cloud","sms","email"]},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"template":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"category":{"type":"string"},"status":{"type":"string"},"language":{"type":"string"}},"required":["id","name","category","status","language"],"additionalProperties":false},{"type":"null"}]},"audience":{"type":"object","properties":{"kind":{"type":"string","enum":["leads","contacts","csv"]},"summary":{"type":"string"},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","summary","definition"],"additionalProperties":false},"purpose":{"type":["string","null"]},"vars":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scheduled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"send_mode":{"type":"string","enum":["now","best_time"]},"best_time_hours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"personalization":{"$ref":"#/components/schemas/BroadcastPersonalization"},"compliance":{"$ref":"#/components/schemas/BroadcastCompliance"},"throttle_per_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string","enum":["draft","pending","scheduled","running","paused","completed","cancelled"]},"status_reason":{"description":"manual · template_paused · wallet_insufficient · kill_switch · channel_unavailable · dlt_not_configured · channel_auth · account_issue · failure_rate · spam_rate_limited · rejected","type":["string","null"]},"status_note":{"type":["string","null"]},"estimate":{"anyOf":[{"$ref":"#/components/schemas/BroadcastEstimate"},{"type":"null"}]},"built_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"submitted_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"approved_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"started_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"next_batch_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"stats":{"$ref":"#/components/schemas/BroadcastStats"},"eta_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"can_edit":{"type":"boolean"},"can_send":{"type":"boolean"},"can_delete":{"type":"boolean"}},"required":["id","name","channel","channel_account_id","template","audience","purpose","vars","scheduled_at","send_mode","best_time_hours","personalization","compliance","throttle_per_min","window","status","status_reason","status_note","estimate","built_at","submitted_by","submitted_at","approved_by","approved_at","started_at","completed_at","next_batch_at","created_by","created_at","updated_at","stats","eta_minutes","can_edit","can_send","can_delete"],"additionalProperties":false},"BroadcastAudienceInput":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"leads"},"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"view":{"anyOf":[{"$ref":"#/components/schemas/LeadView"},{"type":"null"}]},"q":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"ids":{"anyOf":[{"minItems":1,"maxItems":10000,"type":"array","items":{"$ref":"#/components/schemas/Id"}},{"type":"null"}]},"saved_view_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"contacts"},"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"q":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"ids":{"anyOf":[{"minItems":1,"maxItems":10000,"type":"array","items":{"$ref":"#/components/schemas/Id"}},{"type":"null"}]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"csv"},"file_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"csv":{"type":"string","minLength":1,"maxLength":3000000,"description":"The file’s text: a phone and/or email column; other columns become template variables."}},"required":["kind","csv"]}]},"BroadcastCompliance":{"type":"object","properties":{"status":{"type":"string","enum":["pass","fail","stale","missing"],"description":"stale: the message changed since the check; missing: never checked — both need a new check."},"issues":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["rule","check","ai"],"description":"rule: a company / default rule · check: consent, template category, RERA · ai: the AI review"},"category":{"type":"string"},"severity":{"type":"string","enum":["block","warn"]},"quote":{"type":["string","null"]},"message":{"type":"string"},"rule_id":{"type":["string","null"]}},"required":["source","category","severity","quote","message","rule_id"],"additionalProperties":false}},"ai_review":{"anyOf":[{"type":"string","enum":["done","skipped","unavailable"]},{"type":"null"}]},"checked_at":{"type":["string","null"]},"override":{"anyOf":[{"type":"object","properties":{"by":{"type":"string"},"at":{"type":"string"},"reason":{"type":"string"}},"required":["by","at","reason"],"additionalProperties":false},{"type":"null"}]}},"required":["status","issues","ai_review","checked_at","override"],"additionalProperties":false},"BroadcastEstimate":{"type":"object","properties":{"recipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"segments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_paise":{"$ref":"#/components/schemas/Paise"},"total_paise":{"$ref":"#/components/schemas/Paise"},"meta":{"anyOf":[{"type":"object","properties":{"category":{"type":"string"},"unit_centipaise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_paise":{"$ref":"#/components/schemas/Paise"}},"required":["category","unit_centipaise","total_paise"],"additionalProperties":false},{"type":"null"}],"description":"WhatsApp: what Meta bills the tenant directly — information only."},"wallet":{"type":"object","properties":{"kind":{"type":"string"},"required":{"type":"boolean"},"available_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"disabled":{"type":"boolean"},"sufficient":{"type":"boolean"}},"required":["kind","required","available_paise","disabled","sufficient"],"additionalProperties":false},"tier":{"description":"WhatsApp: the sender number’s messaging tier (unique customers a day; null limit = unlimited). Above it, launch and approval need `tier_override`.","anyOf":[{"type":"object","properties":{"code":{"type":"string"},"limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"exceeds":{"type":"boolean"}},"required":["code","limit","exceeds"],"additionalProperties":false},{"type":"null"}]}},"required":["recipients","segments","unit_paise","total_paise","meta","wallet"],"additionalProperties":false},"BroadcastPersonalization":{"type":"object","properties":{"enabled":{"type":"boolean"},"instructions":{"type":["string","null"]},"variables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"hint":{"type":["string","null"]}},"required":["key","hint"],"additionalProperties":false}},"variable_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"status":{"type":"string","enum":["idle","queued","running","done","failed","cancelled"]},"mode":{"anyOf":[{"type":"string","enum":["live","batch"]},{"type":"null"}]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fallback":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"estimate_credits":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"credits_used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":["string","null"]},"started_at":{"type":["string","null"]},"finished_at":{"type":["string","null"]}},"required":["enabled","instructions","variables","variable_options","status","mode","total","done","fallback","pending","estimate_credits","credits_used","error","started_at","finished_at"],"additionalProperties":false},"BroadcastPersonalizationPreview":{"type":"object","properties":{"recipient_id":{"$ref":"#/components/schemas/Id"},"name":{"type":["string","null"]},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The values the message would use."},"used_ai":{"type":"boolean"},"note":{"description":"Why the template’s normal values were used.","type":["string","null"]},"text":{"type":"string","description":"The message as this recipient would read it."}},"required":["recipient_id","name","values","used_ai","note","text"],"additionalProperties":false},"BroadcastRecipient":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"}},"required":["id","ref"],"additionalProperties":false},{"type":"null"}]},"address":{"description":"Phone or email, masked by your role.","type":["string","null"]},"status":{"type":"string","enum":["queued","sent","skipped","cancelled"]},"skipped_reason":{"type":["string","null"]},"error":{"type":["string","null"]},"message_status":{"type":["string","null"]},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"delivered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"read_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"failed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"replied_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"clicked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"opted_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","contact","lead","address","status","skipped_reason","error","message_status","sent_at","delivered_at","read_at","failed_at","replied_at","clicked_at","opted_out_at"],"additionalProperties":false},"BroadcastSender":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"},"address":{"type":"string","description":"The WhatsApp number, SMS header or sender email."},"status":{"type":"string"},"is_default":{"type":"boolean"}},"required":["id","label","address","status","is_default"],"additionalProperties":false},"BroadcastStats":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clicked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped_by_reason":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"failed_by_reason":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Failed messages by reason: `marketing_limit`, `undeliverable`, `whatsapp_<code>`, `other` …"}},"required":["total","queued","sent","delivered","read","replied","failed","opted_out","clicked","skipped","cancelled","skipped_by_reason","failed_by_reason"],"additionalProperties":false},"BudgetBand":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40},"label":{"type":"string","maxLength":60},"min":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"paise"},"max":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"paise"}},"required":["key","label","min","max"],"additionalProperties":false},"BuildFlavor":{"type":"string","enum":["play","enterprise"],"description":"Play Store build, or the sideloaded / MDM enterprise build."},"BulkLeadsInput":{"type":"object","properties":{"ids":{"maxItems":10000,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"filter":{"$ref":"#/components/schemas/FilterNode"},"view":{"$ref":"#/components/schemas/LeadView"},"q":{"type":"string","minLength":1,"maxLength":100},"all":{"description":"Every lead in scope (with no filter).","type":"boolean"},"action":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"assign"},"role":{"type":"string","enum":["owner","presales"]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"member_ids":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"status"},"status_id":{"$ref":"#/components/schemas/Id"},"sub_status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["action","status_id"]},{"type":"object","properties":{"action":{"type":"string","const":"tags"},"add":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}},"remove":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"delete"}},"required":["action"]}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}},"required":["action"]},"BulkLeadsResult":{"type":"object","properties":{"action":{"type":"string","enum":["assign","status","tags","delete"]},"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string"}},"required":["id","reason"],"additionalProperties":false}}},"required":["action","matched","updated","skipped"],"additionalProperties":false},"BulkPropertyStatusInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"status":{"$ref":"#/components/schemas/ListingStatus"}},"required":["ids","status"]},"BusinessHours":{"type":"object","properties":{"timezone":{"type":"string","minLength":1,"maxLength":64,"description":"IANA time zone, e.g. Asia/Kolkata.","examples":["Asia/Kolkata"]},"weekly":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7},"open":{"type":"boolean"},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["day","open","start","end"],"additionalProperties":false}},"holidays":{"type":"array","items":{"$ref":"#/components/schemas/Holiday"}},"source":{"type":"string","enum":["company","default"],"description":"`default` until the company saves its own hours."},"updated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["timezone","weekly","holidays","source","updated_at"],"additionalProperties":false},"BusinessHoursInput":{"type":"object","properties":{"weekly":{"minItems":7,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7},"open":{"type":"boolean"},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["day","open","start","end"]}},"holidays":{"maxItems":400,"type":"array","items":{"$ref":"#/components/schemas/HolidayInput"}}},"required":["weekly","holidays"]},"BusinessHoursInput2":{"type":"object","properties":{"weekly":{"minItems":7,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7},"open":{"type":"boolean"},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["day","open","start","end"]}},"holidays":{"maxItems":400,"type":"array","items":{"$ref":"#/components/schemas/HolidayInput"}}},"required":["weekly","holidays"]},"BusinessHoursInputInput":{"type":"object","properties":{"weekly":{"minItems":7,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7},"open":{"type":"boolean"},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["day","open","start","end"]}},"holidays":{"maxItems":400,"type":"array","items":{"$ref":"#/components/schemas/HolidayInput"}}},"required":["weekly","holidays"]},"CalendarConnection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string","enum":["google","microsoft"]},"email":{"type":"string"},"status":{"type":"string","enum":["active","error","disconnected"]},"status_reason":{"type":["string","null"]},"settings":{"$ref":"#/components/schemas/CalendarSyncSettings"},"busy_enabled":{"type":"boolean"},"calendar_ready":{"type":"boolean"},"connected_at":{"$ref":"#/components/schemas/DateTime"},"last_sync_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_ok_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"next_sync_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"busy_synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"events":{"type":"integer","minimum":0,"maximum":9007199254740991},"cleanup_pending":{"type":"boolean"}},"required":["id","provider","email","status","status_reason","settings","busy_enabled","calendar_ready","connected_at","last_sync_at","last_ok_at","next_sync_at","busy_synced_at","last_error","events","cleanup_pending"],"additionalProperties":false},"CalendarOverview":{"type":"object","properties":{"connection":{"anyOf":[{"$ref":"#/components/schemas/CalendarConnection"},{"type":"null"}]},"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["google","microsoft"]},"label":{"type":"string"},"available":{"type":"boolean","description":"PropZolo has set this provider up."}},"required":["provider","label","available"],"additionalProperties":false}},"consent":{"type":"object","properties":{"version":{"type":"string"},"points":{"type":"array","items":{"type":"string"}}},"required":["version","points"],"additionalProperties":false}},"required":["connection","providers","consent"],"additionalProperties":false},"CalendarSyncSettings":{"type":"object","properties":{"visits":{"type":"boolean","description":"Site visits where you are the agent."},"meetings":{"type":"boolean","description":"Meetings and other tasks with a time."},"follow_ups":{"type":"boolean","description":"Follow-ups and call tasks."}},"required":["visits","meetings","follow_ups"],"additionalProperties":false},"Call":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source":{"type":"string","description":"device, or the telephony provider."},"direction":{"$ref":"#/components/schemas/CallDirection"},"phone":{"description":"Masked or absent per the caller’s field rules.","type":"string"},"hidden_number":{"type":"boolean"},"contact_name":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/CallKind"},"started_at":{"$ref":"#/components/schemas/DateTime"},"duration_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"attempt_sec":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"ring_sec":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"result":{"$ref":"#/components/schemas/CallResult"},"result_label":{"type":"string","examples":["No answer · rang 31 s"]},"result_reason":{"anyOf":[{"$ref":"#/components/schemas/NetProblem"},{"type":"null"}]},"status":{"type":"string","enum":["answered","not_answered","missed","rejected","blocked","unknown"]},"sim_slot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sim_label":{"type":["string","null"]},"outcome":{"type":["string","null"]},"outcome_label":{"type":["string","null"]},"note":{"type":["string","null"]},"outcome_mismatch":{"type":"boolean","description":"The outcome says they spoke; the phone recorded no talk time."},"first_call":{"type":"boolean"},"member":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"lead":{"anyOf":[{"$ref":"#/components/schemas/CallLeadCard"},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"has_recording":{"type":"boolean"},"recording_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"redacted":{"type":"boolean","description":"Another member’s call in a lead’s history: private parts removed."},"others":{"anyOf":[{"type":"object","properties":{"members":{"type":"integer","minimum":0,"maximum":9007199254740991},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_call_at":{"$ref":"#/components/schemas/DateTime"},"names":{"type":"array","items":{"type":"string"}}},"required":["members","calls","last_call_at","names"],"additionalProperties":false},{"type":"null"}]}},"required":["id","source","direction","hidden_number","contact_name","kind","started_at","duration_sec","attempt_sec","ring_sec","result","result_label","result_reason","status","sim_slot","sim_label","outcome","outcome_label","note","outcome_mismatch","first_call","member","lead","contact","has_recording","recording_seconds","redacted","others"],"additionalProperties":false},"CallAnalytics":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/CallRange"},"previous_range":{"$ref":"#/components/schemas/CallRange"},"scope":{"type":"string","enum":["self","team"]},"totals":{"$ref":"#/components/schemas/CallTotals"},"previous":{"$ref":"#/components/schemas/CallTotals"},"first_call":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"called":{"type":"integer","minimum":0,"maximum":9007199254740991},"median_sec":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"p90_sec":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"within_5m":{"type":"integer","minimum":0,"maximum":9007199254740991},"within_1h":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","called","median_sec","p90_sec","within_5m","within_1h"],"additionalProperties":false},"by_day":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"outgoing":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"missed":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["day","total","outgoing","connected","missed","talk_sec"],"additionalProperties":false}},"by_hour":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"integer","minimum":0,"maximum":23},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["hour","total","connected","talk_sec"],"additionalProperties":false}},"heatmap":{"type":"array","items":{"type":"object","properties":{"dow":{"type":"integer","minimum":1,"maximum":7},"hour":{"type":"integer","minimum":0,"maximum":23},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["dow","hour","total","connected"],"additionalProperties":false}},"by_result":{"type":"array","items":{"type":"object","properties":{"result":{"type":"string"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["result","total","talk_sec"],"additionalProperties":false}},"by_kind":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/CallKind"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","total","connected","talk_sec"],"additionalProperties":false}},"by_outcome":{"type":"array","items":{"type":"object","properties":{"outcome":{"type":"string"},"label":{"type":"string"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["outcome","label","total"],"additionalProperties":false}},"failures":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"by_reason":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["reason","total"],"additionalProperties":false}},"by_member":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"outgoing":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["member_id","name","failed","outgoing"],"additionalProperties":false}}},"required":["total","by_reason","by_member"],"additionalProperties":false},"top_numbers":{"type":"array","items":{"type":"object","properties":{"phone":{"description":"Masked or absent per the caller’s field rules.","type":"string"},"contact_name":{"type":["string","null"]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"kind":{"$ref":"#/components/schemas/CallKind"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_call_at":{"$ref":"#/components/schemas/DateTime"}},"required":["contact_name","lead_id","kind","total","connected","talk_sec","last_call_at"],"additionalProperties":false}},"shared_numbers":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"rows":{"type":"array","items":{"type":"object","properties":{"phone":{"description":"Masked or absent per the caller’s field rules.","type":"string"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","calls"],"additionalProperties":false}}},"required":["total","members"],"additionalProperties":false}}},"required":["count","rows"],"additionalProperties":false},"agents":{"type":"array","items":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"branch":{"type":["string","null"]},"role":{"type":"string"},"tracking_enabled":{"type":"boolean"}},"required":["id","name","branch","role","tracking_enabled"],"additionalProperties":false},"metrics":{"$ref":"#/components/schemas/CallTotals"},"periods":{"type":"object","properties":{"today":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","connected","talk_sec"],"additionalProperties":false},"yesterday":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","connected","talk_sec"],"additionalProperties":false},"this_week":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","connected","talk_sec"],"additionalProperties":false},"last_week":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","connected","talk_sec"],"additionalProperties":false},"last_7d":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","connected","talk_sec"],"additionalProperties":false},"this_month":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","connected","talk_sec"],"additionalProperties":false}},"required":["today","yesterday","this_week","last_week","last_7d","this_month"],"additionalProperties":false},"device":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"model":{"type":["string","null"]},"app_version":{"type":["string","null"]},"last_sync_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_seen_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","model","app_version","last_sync_at","last_seen_at"],"additionalProperties":false},{"type":"null"}]},"health":{"$ref":"#/components/schemas/DeviceHealthState"},"call_health":{"$ref":"#/components/schemas/CallHealth"}},"required":["member","metrics","periods","device","health","call_health"],"additionalProperties":false}},"team":{"type":"object","properties":{"agents":{"type":"integer","minimum":0,"maximum":9007199254740991},"active_agents":{"type":"integer","minimum":0,"maximum":9007199254740991},"avg_calls_per_active_agent":{"type":"integer","minimum":0,"maximum":9007199254740991},"avg_talk_per_active_agent":{"type":"integer","minimum":0,"maximum":9007199254740991},"tracking_healthy":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_installed":{"type":"integer","minimum":0,"maximum":9007199254740991},"calls_failing":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["agents","active_agents","avg_calls_per_active_agent","avg_talk_per_active_agent","tracking_healthy","not_installed","calls_failing"],"additionalProperties":false}},"required":["range","previous_range","scope","totals","previous","first_call","by_day","by_hour","heatmap","by_result","by_kind","by_outcome","failures","top_numbers","shared_numbers","agents","team"],"additionalProperties":false},"CallAssist":{"type":"object","properties":{"state":{"type":"string","enum":["no_partner","no_stream","no_disclosure","waiting","suggested","unavailable"],"description":"no_partner: no live-transcript partner is set up by PropZolo yet · no_stream: no live transcript for this call · no_disclosure: the company has not confirmed callers are told about AI assistance (telephony settings) · waiting: nothing new to answer · suggested: a fresh suggestion · unavailable: AI off or out of credits"},"transcript":{"type":"array","items":{"type":"object","properties":{"speaker":{"type":"string","enum":["agent","customer"]},"text":{"type":"string"},"at_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["speaker","text","at_ms"],"additionalProperties":false}},"suggestion":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"objections":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"handling":{"type":"string"}},"required":["kind","handling"],"additionalProperties":false}},"facts_to_mention":{"type":"array","items":{"type":"string"}},"next_step":{"type":"string"},"at_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Send back as last_suggested_at_ms."}},"required":["text","objections","facts_to_mention","next_step","at_ms"],"additionalProperties":false},{"type":"null"}]}},"required":["state","transcript","suggestion"],"additionalProperties":false},"CallDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source":{"type":"string","description":"device, or the telephony provider."},"direction":{"$ref":"#/components/schemas/CallDirection"},"phone":{"description":"Masked or absent per the caller’s field rules.","type":"string"},"hidden_number":{"type":"boolean"},"contact_name":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/CallKind"},"started_at":{"$ref":"#/components/schemas/DateTime"},"duration_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"attempt_sec":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"ring_sec":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"result":{"$ref":"#/components/schemas/CallResult"},"result_label":{"type":"string","examples":["No answer · rang 31 s"]},"result_reason":{"anyOf":[{"$ref":"#/components/schemas/NetProblem"},{"type":"null"}]},"status":{"type":"string","enum":["answered","not_answered","missed","rejected","blocked","unknown"]},"sim_slot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sim_label":{"type":["string","null"]},"outcome":{"type":["string","null"]},"outcome_label":{"type":["string","null"]},"note":{"type":["string","null"]},"outcome_mismatch":{"type":"boolean","description":"The outcome says they spoke; the phone recorded no talk time."},"first_call":{"type":"boolean"},"member":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"lead":{"anyOf":[{"$ref":"#/components/schemas/CallLeadCard"},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"has_recording":{"type":"boolean"},"recording_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"redacted":{"type":"boolean","description":"Another member’s call in a lead’s history: private parts removed."},"others":{"anyOf":[{"type":"object","properties":{"members":{"type":"integer","minimum":0,"maximum":9007199254740991},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_call_at":{"$ref":"#/components/schemas/DateTime"},"names":{"type":"array","items":{"type":"string"}}},"required":["members","calls","last_call_at","names"],"additionalProperties":false},{"type":"null"}]},"net":{"anyOf":[{"$ref":"#/components/schemas/CallNet"},{"type":"null"}]},"device":{"anyOf":[{"type":"object","properties":{"brand":{"type":["string","null"]},"model":{"type":["string","null"]},"app_version":{"type":["string","null"]}},"required":["brand","model","app_version"],"additionalProperties":false},{"type":"null"}]},"number_history":{"anyOf":[{"type":"object","properties":{"total_calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_call_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_call_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"members":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"answered":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_call_at":{"$ref":"#/components/schemas/DateTime"},"is_me":{"type":"boolean"}},"required":["member_id","name","calls","answered","talk_sec","last_call_at","is_me"],"additionalProperties":false}}},"required":["total_calls","first_call_at","first_call_by","members"],"additionalProperties":false},{"type":"null"}]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"started_at":{"$ref":"#/components/schemas/DateTime"},"direction":{"$ref":"#/components/schemas/CallDirection"},"duration_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"outcome_label":{"type":["string","null"]},"member":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"is_mine":{"type":"boolean"},"openable":{"type":"boolean","description":"Within your call scope — the card can open it."}},"required":["id","started_at","direction","duration_sec","outcome_label","member","is_mine","openable"],"additionalProperties":false}},"can_log_outcome":{"type":"boolean"},"can_add_lead":{"type":"boolean"},"recording":{"anyOf":[{"type":"object","properties":{"source":{"anyOf":[{"type":"string","enum":["device","cloud"]},{"type":"null"}],"description":"device: the phone’s built-in recorder (F-06) · cloud: the telephony provider (F-05)"},"status":{"description":"pending (a phone’s upload being checked) | stored | none | skipped | failed","type":["string","null"]},"transcript_status":{"description":"pending | done | failed | not_configured | skipped (company switch, metered)","type":["string","null"]},"transcript":{"description":"Only for viewers who may play the recording.","type":["string","null"]},"summary":{"anyOf":[{"type":"object","properties":{"summary":{"type":"string"},"next_step":{"type":["string","null"]},"sentiment":{"type":["string","null"]}},"required":["summary","next_step","sentiment"],"additionalProperties":false},{"type":"null"}]}},"required":["source","status","transcript_status","transcript","summary"],"additionalProperties":false},{"type":"null"}],"description":"The call’s recording and its transcription; null without a recording."}},"required":["id","source","direction","hidden_number","contact_name","kind","started_at","duration_sec","attempt_sec","ring_sec","result","result_label","result_reason","status","sim_slot","sim_label","outcome","outcome_label","note","outcome_mismatch","first_call","member","lead","contact","has_recording","recording_seconds","redacted","others","net","device","number_history","history","can_log_outcome","can_add_lead","recording"],"additionalProperties":false},"CallDirection":{"type":"string","enum":["outgoing","incoming","missed","rejected","blocked","unknown"]},"CallHealth":{"type":"object","properties":{"state":{"type":"string","enum":["ok","failing"]},"failed_streak":{"type":"integer","minimum":0,"maximum":9007199254740991},"reason":{"anyOf":[{"$ref":"#/components/schemas/NetProblem"},{"type":"null"}]},"sim_slot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_failed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["state","failed_streak","reason","sim_slot","last_failed_at"],"additionalProperties":false},"CallInsights":{"type":"object","properties":{"call_id":{"$ref":"#/components/schemas/Id"},"state":{"type":"string","enum":["off","not_eligible","not_analysed","queued","analysing","done","failed","skipped"]},"reason":{"type":["string","null"]},"reason_text":{"type":["string","null"]},"mode":{"anyOf":[{"type":"string","enum":["batch","live"]},{"type":"null"}]},"can_analyse":{"type":"boolean"},"analysed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"language":{"type":["string","null"]},"summary":{"type":["string","null"]},"outcome":{"type":["string","null"]},"outcome_label":{"type":["string","null"]},"sentiment":{"type":["string","null"]},"temperature":{"type":["string","null"]},"hot":{"type":"boolean"},"next_step":{"type":["string","null"]},"next_step_evidence":{"type":["string","null"]},"hot_signals":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"evidence":{"type":["string","null"]}},"required":["text","evidence"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"label":{"type":"string"},"text":{"type":"string"},"quote":{"type":["string","null"]},"handling":{"type":"string"}},"required":["category","label","text","quote","handling"],"additionalProperties":false}},"commitments":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"by":{"type":"string"},"kind":{"type":"string"},"title":{"type":"string"},"quote":{"type":["string","null"]},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"date":{"type":["string","null"]},"time":{"type":["string","null"]},"overdue":{"type":"boolean"},"problem":{"type":["string","null"]},"status":{"type":"string"},"task_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"task_type":{"type":"string"}},"required":["key","by","kind","title","quote","due_at","date","time","overdue","problem","status","task_id","task_type"],"additionalProperties":false}},"can_confirm_commitments":{"type":"boolean"},"proposal":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"current":{"type":["string","null"]},"proposed":{"type":"string"},"evidence":{"type":["string","null"]},"conflict":{"type":"boolean"},"suggested":{"type":"boolean"}},"required":["key","label","current","proposed","evidence","conflict","suggested"],"additionalProperties":false}},"applied_fields":{"type":"array","items":{"type":"string"}}},"required":["version","status","items","applied_fields"],"additionalProperties":false},{"type":"null"}]},"can_apply_proposal":{"type":"boolean"},"scorecard":{"anyOf":[{"$ref":"#/components/schemas/CallScorecard"},{"type":"null"}]},"quotes_purged":{"type":"boolean"}},"required":["call_id","state","reason","reason_text","mode","can_analyse","analysed_at","language","summary","outcome","outcome_label","sentiment","temperature","hot","next_step","next_step_evidence","hot_signals","objections","commitments","can_confirm_commitments","proposal","can_apply_proposal","scorecard","quotes_purged"],"additionalProperties":false},"CallInsightsSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"qa":{"type":"boolean"},"daily_credit_cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}]},"ivr_disclosure":{"type":"boolean"},"show_scores_to_agents":{"type":"boolean"},"coaching_threshold":{"type":"integer","minimum":0,"maximum":100},"rubric":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":10,"maxLength":400},"weight":{"type":"integer","minimum":1,"maximum":5},"critical":{"type":"boolean"}},"required":["key","label","description","weight","critical"],"additionalProperties":false}},"objection_categories":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{2,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["key","label","description"],"additionalProperties":false}},"builtin_objection_categories":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]}},"required":["key","label","description"],"additionalProperties":false}},"default_rubric":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":10,"maxLength":400},"weight":{"type":"integer","minimum":1,"maximum":5},"critical":{"type":"boolean"}},"required":["key","label","description","weight","critical"],"additionalProperties":false}},"usage":{"type":"array","items":{"type":"object","properties":{"day":{"$ref":"#/components/schemas/LocalDate"},"analysed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credits":{"type":"number"},"over_budget":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","analysed","credits","over_budget","waiting"],"additionalProperties":false}}},"required":["enabled","qa","daily_credit_cap","ivr_disclosure","show_scores_to_agents","coaching_threshold","rubric","objection_categories","builtin_objection_categories","default_rubric","usage"],"additionalProperties":false},"CallKind":{"type":"string","enum":["lead","client","contact","saved_contact","unknown"],"description":"lead (a lead’s number) · client (a won lead) · contact (a CRM contact without a lead) · saved_contact (not in the CRM, named in the phone book) · unknown."},"CallLeadCard":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"},"pipeline_id":{"$ref":"#/components/schemas/Id"},"status":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"category":{"$ref":"#/components/schemas/StatusCategory"}},"required":["key","name","color","category"],"additionalProperties":false},"sub_status":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false},{"type":"null"}]},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"visible":{"type":"boolean","description":"false: a colleague’s lead — name, status and owner only."}},"required":["id","ref","name","pipeline_id","status","sub_status","owner","visible"],"additionalProperties":false},"CallList":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_me":{"type":"boolean"}},"required":["id","name","is_me"],"additionalProperties":false},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The company-local day."},"window":{"anyOf":[{"type":"object","properties":{"start":{"$ref":"#/components/schemas/DateTime"},"end":{"$ref":"#/components/schemas/DateTime"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}],"description":"The member’s shift ∩ calling hours today; null on a day off (the list is a preview)."},"day_off":{"type":"boolean"},"calling_now":{"type":"boolean"},"opens_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"items":{"type":"array","items":{"$ref":"#/components/schemas/CallListItem"},"description":"Call now, in rank order."},"later":{"type":"array","items":{"$ref":"#/components/schemas/CallListItem"},"description":"Later today, by time."},"done":{"type":"array","items":{"$ref":"#/components/schemas/CallListDone"},"description":"Called today."},"stats":{"type":"object","properties":{"cap":{"type":"integer","minimum":0,"maximum":9007199254740991},"planned":{"type":"integer","minimum":0,"maximum":9007199254740991},"done":{"type":"integer","minimum":0,"maximum":9007199254740991},"capped":{"type":"integer","minimum":0,"maximum":9007199254740991},"diversity_held":{"type":"integer","minimum":0,"maximum":9007199254740991},"candidates":{"type":"integer","minimum":0,"maximum":9007199254740991},"excluded":{"type":"object","propertyNames":{"type":"string","enum":["no_phone","blocked","opted_out","dnd","window_closed","snoozed","skipped","parked","follow_up_later","cooldown","colleague","daily_attempts","recently_spoken","callee_hours"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["cap","planned","done","capped","diversity_held","candidates","excluded"],"additionalProperties":false},"generated_at":{"$ref":"#/components/schemas/DateTime"},"refresh_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"When the list changes by itself next."}},"required":["member","day","window","day_off","calling_now","opens_at","items","later","done","stats","generated_at","refresh_at"],"additionalProperties":false},"CallListAction":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["skip","snooze"]},"reason":{"anyOf":[{"type":"string","enum":["not_reachable","wrong_number","spoke_elsewhere","asked_later","not_interested","other"]},{"type":"null"}]},"until":{"$ref":"#/components/schemas/DateTime"}},"required":["id","lead_id","kind","reason","until"],"additionalProperties":false},"CallListDone":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"},"outcome":{"type":"string","enum":["connected","no_answer"]},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["lead_id","ref","name","at","outcome","attempts"],"additionalProperties":false},"CallListItem":{"type":"object","properties":{"id":{"description":"The lead.","$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"},"phone":{"description":"Display number — masked by the field rules, absent when hidden.","type":["string","null"]},"alternate_phones":{"type":"array","items":{"type":"string"}},"dial_number":{"description":"What the phone dials — only on the member’s own list.","type":["string","null"]},"callee_tz":{"description":"The callee’s time zone when it is not the company’s (an NRI number): show their local time.","type":["string","null"]},"pipeline_id":{"$ref":"#/components/schemas/Id"},"status_id":{"$ref":"#/components/schemas/Id"},"sub_status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"status_key":{"type":"string"},"status_name":{"type":"string"},"source":{"type":["string","null"]},"city":{"type":["string","null"]},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temperature":{"anyOf":[{"type":"string","enum":["hot","warm","cold"]},{"type":"null"}]},"next_follow_up_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_call":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"outcome":{"type":"string","enum":["connected","no_answer","missed"]},"by_me":{"type":"boolean"}},"required":["at","outcome","by_me"],"additionalProperties":false},{"type":"null"}]},"plan":{"$ref":"#/components/schemas/CallListPlan"}},"required":["id","ref","name","dial_number","callee_tz","pipeline_id","status_id","sub_status_id","status_key","status_name","source","city","score","temperature","next_follow_up_at","last_call","plan"],"additionalProperties":false},"CallListPlan":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"rank":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"score":{"type":"number"},"must":{"type":"boolean","description":"A promise (they called, a follow-up, an SLA): kept first under the cap."},"lane":{"type":"string","enum":["now","later"]},"at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"Later today: from when."},"reasons":{"type":"array","items":{"$ref":"#/components/schemas/CallListReason"},"description":"The top 2–3 reasons."},"signals":{"type":"array","items":{"$ref":"#/components/schemas/CallListReason"},"description":"Every signal that scored."},"basis":{"type":"string","enum":["callback","enquiry_window","engaged","consent"],"description":"Why the call is lawful (TCCCPR)."},"attempt":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"p_answer":{"type":"number","minimum":0,"maximum":1},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"source_id":{"type":["string","null"]}},"required":["lead_id","rank","score","must","lane","at","reasons","signals","basis","attempt","p_answer","due_at","source_id"],"additionalProperties":false},"CallListReason":{"type":"object","properties":{"key":{"type":"string","enum":["callback","follow_up","sla","new_lead","hot","score","value","best_time","retry"]},"points":{"type":"number"},"text":{"type":"string"},"tone":{"type":"string","enum":["red","amber","blue","green","violet","grey"]}},"required":["key","points","text","tone"],"additionalProperties":false,"description":"One signal behind the rank, in plain words, with its points."},"CallMemberOption":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"active":{"type":"boolean","description":"false: deactivated or not joined yet — their calls stay in the log."}},"required":["id","name","active"],"additionalProperties":false},"CallNet":{"type":"object","properties":{"air":{"type":"number"},"perm":{"type":"number"},"sims":{"type":"number"},"slot":{"type":"number"},"sim":{"type":"string"},"svc":{"type":"string"},"sig":{"type":"number"},"nt":{"type":"string"},"roam":{"type":"number"},"op":{"type":"string"},"src":{"type":"string","enum":["attempt","dial","sync"]}},"additionalProperties":false},"CallPlannerSettings":{"type":"object","properties":{"call_list":{"type":"object","properties":{"daily_cap":{"type":"integer","minimum":5,"maximum":300},"max_source_share":{"type":"number","minimum":0.1,"maximum":1},"signal_weights":{"type":"object","propertyNames":{"type":"string","enum":["callback","follow_up","sla","new_lead","hot","score","value","best_time","retry"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":200},"required":["callback","follow_up","sla","new_lead","hot","score","value","best_time","retry"]}},"required":["daily_cap","max_source_share","signal_weights"],"additionalProperties":false},"accountability":{"type":"object","properties":{"weights":{"type":"object","propertyNames":{"type":"string","enum":["first_response","follow_ups","callbacks","call_notes","stale_leads","hygiene"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":100},"required":["first_response","follow_ups","callbacks","call_notes","stale_leads","hygiene"]},"rotation_enabled":{"type":"boolean"},"rotation_min_score":{"type":"integer","minimum":0,"maximum":100},"rotation_window":{"type":"string","enum":["d7","d30"]},"share_ranking_with_agents":{"type":"boolean"}},"required":["weights","rotation_enabled","rotation_min_score","rotation_window","share_ranking_with_agents"],"additionalProperties":false}},"required":["call_list","accountability"],"additionalProperties":false},"CallQaTrends":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"},"previous":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"}},"required":["from","to"],"additionalProperties":false},"bucket":{"type":"string","enum":["day","week"]},"team":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string"},"scored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avg":{"type":["number","null"]},"critical":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["bucket","scored","avg","critical"],"additionalProperties":false}},"agents":{"type":"array","items":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"scored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avg":{"type":["number","null"]},"previous_avg":{"type":["number","null"]},"delta":{"type":["number","null"]},"critical":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"points":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string"},"scored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avg":{"type":["number","null"]},"critical":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["bucket","scored","avg","critical"],"additionalProperties":false}}},"required":["member","scored","avg","previous_avg","delta","critical","points"],"additionalProperties":false}},"criteria":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"met":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partial":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_applicable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate":{"type":["number","null"]}},"required":["key","label","met","partial","missed","not_applicable","rate"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","label","count"],"additionalProperties":false}}},"required":["from","to","previous","bucket","team","agents","criteria","objections"],"additionalProperties":false},"CallRange":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"}},"required":["from","to"],"additionalProperties":false},"CallRecording":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["url","expires_at","seconds"],"additionalProperties":false},"CallResult":{"type":"string","enum":["connected","no_answer","ended_early","busy","failed","not_connected","answered","missed","rejected","blocked","unknown"],"description":"What the phone saw. Outgoing: connected (talk time) · no_answer (it rang out) · ended_early (busy, declined, switched off) · failed (never connected — no network / SIM) · not_connected (no timing from the phone). Incoming: answered · missed · rejected · blocked."},"CallRule":{"type":"object","properties":{"enabled":{"type":"boolean"},"min_remark_chars":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Letters / digits a remark needs (0 = optional)."},"role_keys":{"type":"array","items":{"type":"string"},"description":"Roles the rule binds; empty = everyone with call tracking."},"since":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"Switched on at: calls made before it never ask."}},"required":["enabled","min_remark_chars","role_keys","since"],"additionalProperties":false,"description":"Log every call before the next: unlogged work-SIM calls block the next dial in the app."},"CallScorecard":{"type":"object","properties":{"status":{"type":"string","enum":["scored","reviewed"]},"score":{"type":["number","null"]},"model_score":{"type":["number","null"]},"band":{"anyOf":[{"type":"string","enum":["good","fair","poor"]},{"type":"null"}]},"critical_missed":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"critical":{"type":"boolean"},"verdict":{"type":"string"},"model_verdict":{"type":"string"},"evidence":{"type":["string","null"]},"reason":{"type":["string","null"]},"note":{"type":["string","null"]},"overridden":{"type":"boolean"},"unverified":{"type":"boolean"}},"required":["key","label","weight","critical","verdict","model_verdict","evidence","reason","note","overridden","unverified"],"additionalProperties":false}},"reviewed_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"review_note":{"type":["string","null"]},"can_review":{"type":"boolean"}},"required":["status","score","model_score","band","critical_missed","items","reviewed_by","reviewed_at","review_note","can_review"],"additionalProperties":false},"CallScorecardRow":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"call_id":{"$ref":"#/components/schemas/Id"},"day":{"$ref":"#/components/schemas/LocalDate"},"started_at":{"$ref":"#/components/schemas/DateTime"},"duration_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"direction":{"type":"string"},"member":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact_name":{"type":["string","null"]},"score":{"type":["number","null"]},"model_score":{"type":["number","null"]},"band":{"anyOf":[{"type":"string","enum":["good","fair","poor"]},{"type":"null"}]},"status":{"type":"string","enum":["scored","reviewed"]},"critical_missed":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"outcome":{"type":["string","null"]},"outcome_label":{"type":["string","null"]},"hot":{"type":"boolean"}},"required":["id","call_id","day","started_at","duration_sec","direction","member","lead","contact_name","score","model_score","band","status","critical_missed","objections","outcome","outcome_label","hot"],"additionalProperties":false},"CallTargetsBoardRow":{"type":"object","properties":{"member":{"$ref":"#/components/schemas/MemberRef"},"targets":{"$ref":"#/components/schemas/DailyCallTargets"},"today":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","connected","talk_sec"],"additionalProperties":false},"progress":{"type":"number","minimum":0,"maximum":1},"rank":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["member","targets","today","progress","rank"],"additionalProperties":false},"CallTargetsView":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"targets":{"$ref":"#/components/schemas/DailyCallTargets"},"today":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"answered":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["calls","answered","talk_sec"],"additionalProperties":false},"streak":{"type":"object","properties":{"current":{"type":"integer","minimum":0,"maximum":9007199254740991},"best":{"type":"integer","minimum":0,"maximum":9007199254740991},"today_met":{"type":"boolean"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"boolean"}},"required":["day","calls","connected","talk_sec","met"],"additionalProperties":false}}},"required":["current","best","today_met","days"],"additionalProperties":false},"rank":{"anyOf":[{"type":"object","properties":{"position":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"of":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["position","of"],"additionalProperties":false},{"type":"null"}]}},"required":["member_id","targets","today","streak","rank"],"additionalProperties":false},"CallTotals":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"outgoing":{"type":"integer","minimum":0,"maximum":9007199254740991},"outgoing_answered":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_answered":{"type":"integer","minimum":0,"maximum":9007199254740991},"no_answer":{"type":"integer","minimum":0,"maximum":9007199254740991},"ended_early":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"incoming_total":{"type":"integer","minimum":0,"maximum":9007199254740991},"incoming":{"type":"integer","minimum":0,"maximum":9007199254740991},"missed":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"outcome_logged":{"type":"integer","minimum":0,"maximum":9007199254740991},"over_1min":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"outgoing_talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"incoming_talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"avg_talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"longest_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"unique_numbers":{"type":"integer","minimum":0,"maximum":9007199254740991},"lead_calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"crm_calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"unique_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"unique_leads_reached":{"type":"integer","minimum":0,"maximum":9007199254740991},"active_days":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_call_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_call_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["total","outgoing","outgoing_answered","not_answered","no_answer","ended_early","failed","not_connected","incoming_total","incoming","missed","rejected","connected","outcome_logged","over_1min","talk_sec","outgoing_talk_sec","incoming_talk_sec","avg_talk_sec","longest_sec","unique_numbers","lead_calls","crm_calls","unique_leads","unique_leads_reached","active_days","first_call_at","last_call_at"],"additionalProperties":false},"CallTrackingSettings":{"type":"object","properties":{"tracking_scope":{"type":"string","enum":["all_work_sim","crm_only"]},"disclosure_text":{"type":"string"},"unknown_sim_policy":{"type":"string","enum":["skip","store"]},"recordings_enabled":{"type":"boolean","description":"Sync recordings from members’ phones (F-06): each member still opts in on their phone."},"backfill_days":{"type":"integer","minimum":0,"maximum":9007199254740991},"sync_interval_min":{"type":"integer","minimum":0,"maximum":9007199254740991},"min_app_version":{"type":"string"},"require_tracking":{"type":"boolean"},"call_rule":{"$ref":"#/components/schemas/CallRule"}},"required":["tracking_scope","disclosure_text","unknown_sim_policy","recordings_enabled","backfill_days","sync_interval_min","min_app_version","require_tracking","call_rule"],"additionalProperties":false},"CallingQueue":{"type":"object","properties":{"mode":{"type":"string","enum":["autopilot","followups","fresh","hot","retry","custom","smart"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"lanes":{"type":"object","properties":{"callback":{"type":"integer","minimum":0,"maximum":9007199254740991},"due":{"type":"integer","minimum":0,"maximum":9007199254740991},"fresh":{"type":"integer","minimum":0,"maximum":9007199254740991},"smart":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["callback","due","fresh","smart"],"additionalProperties":false},"deferred":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"next_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["total","next_at","by"],"additionalProperties":false},"parked":{"type":"integer","minimum":0,"maximum":9007199254740991},"open_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"outside_hours":{"type":"boolean"},"opens_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"hours":{"type":"array","items":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"maximum":23},"rate":{"type":"number"}},"required":["h","rate"],"additionalProperties":false}},"rules":{"type":"object","properties":{"start_min":{"type":"integer","minimum":0,"maximum":9007199254740991},"end_min":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_unanswered_per_day":{"type":"integer","minimum":0,"maximum":9007199254740991},"park_after":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["start_min","end_min","max_unanswered_per_day","park_after"],"additionalProperties":false},"counts":{"type":"object","properties":{"fresh":{"type":"integer","minimum":0,"maximum":9007199254740991},"followups":{"type":"integer","minimum":0,"maximum":9007199254740991},"hot":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["fresh","followups","hot"],"additionalProperties":false},"skipped":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["mode","items","lanes","deferred","parked","open_leads","outside_hours","opens_at","hours","rules","counts","skipped"],"additionalProperties":false},"CampaignReport":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"costs_visible":{"type":"boolean"},"totals":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"junk":{"type":"integer","minimum":0,"maximum":9007199254740991},"lost":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified":{"type":"integer","minimum":0,"maximum":9007199254740991},"visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991},"cpl_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_qualified_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_visit_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_deal_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_dead_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"spend_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["leads","junk","lost","contacted","qualified","visited","deals","cpl_paise","cost_per_qualified_paise","cost_per_visit_paise","cost_per_deal_paise","cost_per_dead_paise","spend_paise"],"additionalProperties":false},"campaigns":{"type":"array","items":{"type":"object","properties":{"campaign_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"source_name":{"type":"string"},"starts_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"ends_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"spend_total_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"spend_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"junk":{"type":"integer","minimum":0,"maximum":9007199254740991},"lost":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified":{"type":"integer","minimum":0,"maximum":9007199254740991},"visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991},"cpl_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_qualified_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_visit_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_deal_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_dead_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["campaign_id","name","source_id","source_name","starts_on","ends_on","spend_total_paise","spend_paise","leads","junk","lost","contacted","qualified","visited","deals","cpl_paise","cost_per_qualified_paise","cost_per_visit_paise","cost_per_deal_paise","cost_per_dead_paise"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"campaign_spend_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"monthly_cost_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"junk":{"type":"integer","minimum":0,"maximum":9007199254740991},"lost":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified":{"type":"integer","minimum":0,"maximum":9007199254740991},"visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991},"cpl_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_qualified_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_visit_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_deal_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_dead_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["source_id","name","campaign_spend_paise","monthly_cost_paise","cost_paise","leads","junk","lost","contacted","qualified","visited","deals","cpl_paise","cost_per_qualified_paise","cost_per_visit_paise","cost_per_deal_paise","cost_per_dead_paise"],"additionalProperties":false}}},"required":["range","costs_visible","totals","campaigns","sources"],"additionalProperties":false},"CancelInspectionInput":{"type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}}},"CancelKycInput":{"type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}}},"CancelSignatureInput":{"type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}}},"CancelSiteVisitInput":{"type":"object","properties":{"reason":{"type":"string","minLength":2,"maxLength":300}},"required":["reason"]},"CancelSubscriptionInput":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}},"CandidateMatchMode":{"type":"string","enum":["off","prefer","require"],"description":"require: skip members who do not fit · prefer: fitting members first, then everyone · off."},"ChangeDealStageInput":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/DealStage"},"lost_reason":{"anyOf":[{"type":"string","minLength":2,"maxLength":500},{"type":"null"}]},"token_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"token_mode":{"anyOf":[{"$ref":"#/components/schemas/PaymentMode"},{"type":"null"}]},"token_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"agreement_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"registration_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"handover_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"override_guard":{"description":"Override the process guard (F-04): needs the override permission; audited with the reason.","anyOf":[{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]},{"type":"null"}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}},"required":["stage"]},"ChangeLeadStatusInput":{"type":"object","properties":{"status_id":{"$ref":"#/components/schemas/Id"},"sub_status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"follow_up_at":{"anyOf":[{"$ref":"#/components/schemas/ZonedDateTimeInput"},{"type":"null"}]},"follow_up_preset":{"anyOf":[{"$ref":"#/components/schemas/FollowUpPreset"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"visit":{"anyOf":[{"type":"object","properties":{"scheduled_at":{"$ref":"#/components/schemas/ZonedDateTimeInput"},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"unit_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"meeting_point":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["scheduled_at"]},{"type":"null"}]},"lost_reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"deal":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"fields":{"description":"Values the status requires (requirement fields, language, amount …) and custom fields.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"call_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"override_guard":{"description":"Override the process guard (F-04): needs the override permission; audited with the reason.","anyOf":[{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]},{"type":"null"}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}},"required":["status_id"]},"ChangeLeadStatusResult":{"type":"object","properties":{"lead":{"$ref":"#/components/schemas/LeadDetail"},"task_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"visit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"call_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"The deal a won lead opened from the deal form."},"deal_existing":{"type":"boolean","description":"The deal form was applied to a deal the lead already had instead of opening a new one."},"marked_unreachable":{"type":"boolean"}},"required":["lead","task_ids","visit_id","call_id","deal_id","deal_existing","marked_unreachable"],"additionalProperties":false},"ChangePropertyStatusInput":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/ListingStatus"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["status"]},"ChangeReceiptStatusInput":{"type":"object","properties":{"status":{"type":"string","enum":["cleared","bounced","cancelled"]},"date":{"description":"Clearing date (default today).","anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["status"]},"ChangeSequenceEnrollmentInput":{"type":"object","properties":{"action":{"type":"string","enum":["pause","resume","remove"]}},"required":["action"]},"ChangeSubscriptionInput":{"type":"object","properties":{"plan_code":{"type":"string","minLength":1,"maxLength":32},"cycle":{"type":"string","enum":["monthly","yearly"]},"seats":{"type":"integer","minimum":1,"maximum":10000}},"required":["plan_code","cycle","seats"]},"ChannelAccount":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string"},"label":{"type":"string"},"address":{"type":"string"},"status":{"type":"string"},"external_id":{"type":["string","null"]},"owner_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"is_default":{"type":"boolean"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"last_seen_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","label","address","status","external_id","owner_member_id","is_default","details","last_seen_at","created_at","updated_at"],"additionalProperties":false},"ChargeHead":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"label":{"type":"string","minLength":1,"maxLength":60},"kind":{"type":"string","enum":["bsp","plc","floor_rise","parking","club","deposit","legal","other"]},"basis":{"default":"fixed","type":"string","enum":["per_area","fixed","percent_bsp"]},"gst_bp":{"default":0,"type":"integer","minimum":0,"maximum":2800},"in_agreement_value":{"default":true,"type":"boolean"},"months":{"description":"Months collected in advance (advance maintenance); the amount is the monthly figure × months.","anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]}},"required":["code","label","kind","basis","gst_bp","in_agreement_value"],"additionalProperties":false},"ChargeHeadInput":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"label":{"type":"string","minLength":1,"maxLength":60},"kind":{"type":"string","enum":["bsp","plc","floor_rise","parking","club","deposit","legal","other"]},"basis":{"default":"fixed","type":"string","enum":["per_area","fixed","percent_bsp"]},"gst_bp":{"default":0,"type":"integer","minimum":0,"maximum":2800},"in_agreement_value":{"default":true,"type":"boolean"},"months":{"description":"Months collected in advance (advance maintenance); the amount is the monthly figure × months.","anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]}},"required":["code","label","kind"]},"ChargeTemplate":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_default":{"type":"boolean"},"archived":{"type":"boolean"},"config":{"anyOf":[{"$ref":"#/components/schemas/ChargeTemplateConfig"},{"type":"null"}],"description":"null: an older format — save it again."},"price_lists":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","project_id","name","is_default","archived","config","price_lists","updated_at"],"additionalProperties":false},"ChargeTemplateConfig":{"type":"object","properties":{"area_basis":{"default":"carpet","type":"string","enum":["carpet","builtup","super"]},"heads":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/ChargeHead"}},"stamp":{"type":"object","properties":{"state":{"default":null,"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"include":{"default":true,"type":"boolean"},"stamp_duty_bp":{"default":0,"type":"integer","minimum":0,"maximum":1500},"registration_bp":{"default":0,"type":"integer","minimum":0,"maximum":500},"registration_cap":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":100000000000000},{"type":"null"}]}},"required":["state","include","stamp_duty_bp","registration_bp","registration_cap"],"additionalProperties":false}},"required":["area_basis","heads"],"additionalProperties":false,"description":"One basic sale price; at most one PLC, floor rise and parking."},"ChargeTemplateConfig2":{"type":"object","properties":{"area_basis":{"default":"carpet","type":"string","enum":["carpet","builtup","super"]},"heads":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/ChargeHeadInput"}},"stamp":{"type":"object","properties":{"state":{"default":null,"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"include":{"default":true,"type":"boolean"},"stamp_duty_bp":{"default":0,"type":"integer","minimum":0,"maximum":1500},"registration_bp":{"default":0,"type":"integer","minimum":0,"maximum":500},"registration_cap":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":100000000000000},{"type":"null"}]}}}},"required":["heads"],"description":"One basic sale price; at most one PLC, floor rise and parking."},"ChargeTemplateConfigInput":{"type":"object","properties":{"area_basis":{"default":"carpet","type":"string","enum":["carpet","builtup","super"]},"heads":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/ChargeHeadInput"}},"stamp":{"type":"object","properties":{"state":{"default":null,"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"include":{"default":true,"type":"boolean"},"stamp_duty_bp":{"default":0,"type":"integer","minimum":0,"maximum":1500},"registration_bp":{"default":0,"type":"integer","minimum":0,"maximum":500},"registration_cap":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":100000000000000},{"type":"null"}]}}}},"required":["heads"],"description":"One basic sale price; at most one PLC, floor rise and parking."},"CheckMessageInput":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"},"channel":{"default":"auto","type":"string","enum":["whatsapp_cloud","whatsapp_web","sms","email","auto"]},"purpose":{"$ref":"#/components/schemas/MessagePurpose"},"template_id":{"$ref":"#/components/schemas/Id"},"template_use_case":{"description":"e.g. visit_reminder_24h","type":"string","minLength":1,"maxLength":32},"language":{"type":"string","maxLength":8},"body":{"type":"string","maxLength":4096},"media":{"$ref":"#/components/schemas/SendMessageMedia"},"interactive":{"description":"Reply buttons (≤ 3, title ≤ 20) or a list (≤ 10 rows, title ≤ 24, description ≤ 72) under `body` — WhatsApp Cloud only, inside the 24-hour window; no template or media.","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"buttons"},"header":{"type":"string","minLength":1,"maxLength":60},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":256},"title":{"type":"string","minLength":1,"maxLength":20}},"required":["title"]}}},"required":["type","buttons"]},{"type":"object","properties":{"type":{"type":"string","const":"list"},"header":{"type":"string","minLength":1,"maxLength":60},"footer":{"type":"string","minLength":1,"maxLength":60},"button":{"type":"string","minLength":1,"maxLength":20},"sections":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":24},"rows":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":24},"description":{"type":"string","minLength":1,"maxLength":72}},"required":["title"]}}},"required":["title","rows"]}}},"required":["type","button","sections"]}]},"subject":{"type":"string","maxLength":250},"vars":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"additionalProperties":{"type":"string","maxLength":1000}},"property_id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"visit_id":{"$ref":"#/components/schemas/Id"},"channel_account_id":{"$ref":"#/components/schemas/Id"},"conversation_id":{"description":"The conversation being answered: a WhatsApp reply goes to its number and account.","$ref":"#/components/schemas/Id"},"reply_to_message_id":{"$ref":"#/components/schemas/Id"},"when_quiet":{"default":"block","type":"string","enum":["block","defer"]}},"required":["purpose"]},"CheckMessageResult":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"allowed"},"channel":{"$ref":"#/components/schemas/SendChannel"},"purpose":{"$ref":"#/components/schemas/MessagePurpose"},"cost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}},"preview":{"$ref":"#/components/schemas/MessagePreview"},"not_before":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["status","channel","purpose","cost","warnings","preview","not_before"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"blocked"},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/MessageGateBlock"}},"channel":{"anyOf":[{"$ref":"#/components/schemas/SendChannel"},{"type":"null"}]},"purpose":{"$ref":"#/components/schemas/MessagePurpose"},"tried":{"type":"array","items":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/SendChannel"},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/MessageGateBlock"}}},"required":["channel","blocks"],"additionalProperties":false}}},"required":["status","blocks","channel","purpose","tried"],"additionalProperties":false}]},"CheckoutResult":{"type":"object","properties":{"checkout_url":{"type":"string"},"gateway_subscription_id":{"type":"string"},"period_amount":{"$ref":"#/components/schemas/BillingAmount"},"starts_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"First charge after the trial; null = right away."}},"required":["checkout_url","gateway_subscription_id","period_amount","starts_at"],"additionalProperties":false},"CloseRentalOfferInput":{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}},"CloudCall":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"anyOf":[{"type":"string","enum":["queued","ringing","in_progress","completed","busy","no_answer","failed","canceled"]},{"type":"null"}]},"result":{"type":"string"},"direction":{"type":"string"},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"started_at":{"$ref":"#/components/schemas/DateTime"},"caller_id":{"description":"The virtual number the customer sees.","type":["string","null"]},"warnings":{"type":"array","items":{"type":"string"}},"replayed":{"type":"boolean","description":"The same Idempotency-Key placed this call before: nothing was dialled."}},"required":["id","status","result","direction","lead_id","started_at","caller_id","warnings","replayed"],"additionalProperties":false},"CloudCallAvailability":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["not_connected","not_in_plan","no_permission","no_agent_phone"]},{"type":"null"}]}},"required":["enabled","reason"],"additionalProperties":false},"CoBroke":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"side":{"type":"string","enum":["requester","owner"]},"status":{"type":"string","enum":["requested","negotiating","agreed","closed_won","closed_lost","declined","withdrawn","expired"]},"share_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"share":{"type":"object","properties":{"kind":{"type":"string","enum":["listing","requirement"]},"title":{"type":"string"},"deal_side":{"type":"string","enum":["sale","rent"]},"city":{"type":"string"},"localities":{"type":"array","items":{"type":"string"}},"price_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"live":{"type":"boolean"}},"required":["kind","title","deal_side","city","localities","price_min","price_max","live"],"additionalProperties":false},"partner":{"$ref":"#/components/schemas/NetworkBroker"},"message":{"type":["string","null"]},"terms":{"type":"object","properties":{"basis":{"anyOf":[{"type":"string","enum":["pooled","own_client"]},{"type":"null"}]},"requester_share_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"note":{"type":["string","null"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"proposed_by":{"anyOf":[{"type":"string","enum":["requester","owner"]},{"type":"null"}]},"requester_accepted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"owner_accepted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["basis","requester_share_bps","note","version","proposed_by","requester_accepted_at","owner_accepted_at"],"additionalProperties":false},"agreed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"my_deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"closed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"close_note":{"type":["string","null"]},"dispute":{"anyOf":[{"type":"object","properties":{"opened_at":{"$ref":"#/components/schemas/DateTime"},"opened_by":{"type":"string","enum":["requester","owner"]},"reason":{"type":"string"},"resolved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolution":{"type":["string","null"]}},"required":["opened_at","opened_by","reason","resolved_at","resolution"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"last_activity_at":{"$ref":"#/components/schemas/DateTime"},"esign":{"type":"object","properties":{"status":{"type":"string","enum":["none","queued","sent","signed","failed","declined","expired","cancelled"]},"requested_by":{"anyOf":[{"type":"string","enum":["me","partner"]},{"type":"null"}]},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"error":{"type":["string","null"]}},"required":["status","requested_by","sent_at","signed_at","expires_at","error"],"additionalProperties":false}},"required":["id","side","status","share_id","share","partner","message","terms","agreed_at","my_deal_id","closed_at","close_note","dispute","created_at","last_activity_at","esign"],"additionalProperties":false},"CoBrokeDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"side":{"type":"string","enum":["requester","owner"]},"status":{"type":"string","enum":["requested","negotiating","agreed","closed_won","closed_lost","declined","withdrawn","expired"]},"share_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"share":{"type":"object","properties":{"kind":{"type":"string","enum":["listing","requirement"]},"title":{"type":"string"},"deal_side":{"type":"string","enum":["sale","rent"]},"city":{"type":"string"},"localities":{"type":"array","items":{"type":"string"}},"price_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"live":{"type":"boolean"}},"required":["kind","title","deal_side","city","localities","price_min","price_max","live"],"additionalProperties":false},"partner":{"$ref":"#/components/schemas/NetworkBroker"},"message":{"type":["string","null"]},"terms":{"type":"object","properties":{"basis":{"anyOf":[{"type":"string","enum":["pooled","own_client"]},{"type":"null"}]},"requester_share_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"note":{"type":["string","null"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"proposed_by":{"anyOf":[{"type":"string","enum":["requester","owner"]},{"type":"null"}]},"requester_accepted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"owner_accepted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["basis","requester_share_bps","note","version","proposed_by","requester_accepted_at","owner_accepted_at"],"additionalProperties":false},"agreed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"my_deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"closed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"close_note":{"type":["string","null"]},"dispute":{"anyOf":[{"type":"object","properties":{"opened_at":{"$ref":"#/components/schemas/DateTime"},"opened_by":{"type":"string","enum":["requester","owner"]},"reason":{"type":"string"},"resolved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolution":{"type":["string","null"]}},"required":["opened_at","opened_by","reason","resolved_at","resolution"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"last_activity_at":{"$ref":"#/components/schemas/DateTime"},"esign":{"type":"object","properties":{"status":{"type":"string","enum":["none","queued","sent","signed","failed","declined","expired","cancelled"]},"requested_by":{"anyOf":[{"type":"string","enum":["me","partner"]},{"type":"null"}]},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"error":{"type":["string","null"]}},"required":["status","requested_by","sent_at","signed_at","expires_at","error"],"additionalProperties":false},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["message","event"]},"mine":{"type":"boolean"},"author_name":{"type":"string"},"body":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","mine","author_name","body","created_at"],"additionalProperties":false}},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"filename":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mine":{"type":"boolean"},"uploaded_by_name":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"},"scan_status":{"type":["string","null"]}},"required":["id","filename","content_type","size","mine","uploaded_by_name","created_at","scan_status"],"additionalProperties":false}},"registrations":{"type":"array","items":{"$ref":"#/components/schemas/NetworkRegistration"}},"partner_contact":{"anyOf":[{"type":"object","properties":{"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["phone","email"],"additionalProperties":false},{"type":"null"}]}},"required":["id","side","status","share_id","share","partner","message","terms","agreed_at","my_deal_id","closed_at","close_note","dispute","created_at","last_activity_at","esign","messages","documents","registrations","partner_contact"],"additionalProperties":false},"CollectionsBoard":{"type":"object","properties":{"ageing":{"type":"object","properties":{"not_due":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["amount","count"],"additionalProperties":false},"d0_30":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["amount","count"],"additionalProperties":false},"d31_60":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["amount","count"],"additionalProperties":false},"d61_90":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["amount","count"],"additionalProperties":false},"d90_plus":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["amount","count"],"additionalProperties":false}},"required":["not_due","d0_30","d31_60","d61_90","d90_plus"],"additionalProperties":false},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"status":{"type":"string"},"unit":{"type":"string"},"buyer":{"type":["string","null"]},"outstanding":{"$ref":"#/components/schemas/Paise"},"overdue":{"$ref":"#/components/schemas/Paise"},"oldest_overdue":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"bucket":{"type":"string","enum":["not_due","d0_30","d31_60","d61_90","d90_plus"]}},"required":["id","ref","status","unit","buyer","outstanding","overdue","oldest_overdue","bucket"],"additionalProperties":false}},"awaiting_form16b":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"},"booking_id":{"$ref":"#/components/schemas/Id"},"tds_amount":{"$ref":"#/components/schemas/Paise"},"section":{"type":["string","null"]},"received_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["id","number","booking_id","tds_amount","section","received_on"],"additionalProperties":false}},"claims":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"},"booking_id":{"$ref":"#/components/schemas/Id"},"amount":{"$ref":"#/components/schemas/Paise"},"utr":{"type":["string","null"]},"paid_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["id","number","booking_id","amount","utr","paid_on"],"additionalProperties":false},"description":"UPI payments buyers reported on their pay link, waiting for a member to confirm."},"queues":{"type":"object","properties":{"awaiting_form16b":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claims":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["awaiting_form16b","claims"],"additionalProperties":false,"description":"How many entries each queue holds in all (the lists stop at queue_limit)."}},"required":["ageing","bookings","awaiting_form16b","claims","queues"],"additionalProperties":false},"CollectionsPolicy":{"type":"object","properties":{"demand_days":{"type":"integer","minimum":0,"maximum":90,"description":"Days between a stage certificate (or the agreement / possession date) and the due date."},"reminder_days":{"maxItems":5,"type":"array","items":{"type":"integer","minimum":1,"maximum":30},"description":"Default 7, 3, 1."},"interest_bps":{"type":"integer","minimum":0,"maximum":3600,"description":"Late interest, basis points a year (0: none)."},"interest_grace_days":{"type":"integer","minimum":0,"maximum":60},"forfeit_bps":{"type":"integer","minimum":0,"maximum":5000,"description":"Forfeited of the agreement value."},"send_demands":{"type":"boolean"},"send_receipts":{"type":"boolean"},"demand_footer":{"type":"string","maxLength":1000},"upi_vpa":{"anyOf":[{"type":"string","const":""},{"type":"string","pattern":"^[A-Za-z0-9._-]{2,256}@[A-Za-z][A-Za-z0-9]{1,63}$"}],"description":"The collection account’s UPI id for the buyer’s pay link (empty: none)."},"payee_name":{"type":"string","maxLength":80},"gst_after_cc":{"type":"string","enum":["keep","drop"],"description":"Instalments demanded after the completion / occupancy certificate keep or drop their GST (BLD-10)."},"transfer_fee_blocks":{"type":"boolean","description":"A transfer with a fee completes only once the fee is paid (BLD-15)."},"booking_backdate_days":{"type":"integer","minimum":0,"maximum":90,"description":"Days a booking may be dated before its cost sheet was accepted (BLD-37)."}},"required":["demand_days","reminder_days","interest_bps","interest_grace_days","forfeit_bps","send_demands","send_receipts","demand_footer","upi_vpa","payee_name","gst_after_cc","transfer_fee_blocks","booking_backdate_days"],"additionalProperties":false},"CommissionBasis":{"type":"string","enum":["percent","fixed","days_rent","months_rent"],"description":"percent of the deal value · fixed amount · N days of rent · N months of rent."},"CommissionPayout":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deal":{"anyOf":[{"$ref":"#/components/schemas/DealLink"},{"type":"null"}]},"payee_type":{"$ref":"#/components/schemas/PayeeType"},"payee":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"gross":{"$ref":"#/components/schemas/Paise"},"gst_amount":{"description":"GST on the payee’s own invoice (registered payees).","$ref":"#/components/schemas/Paise"},"tds":{"$ref":"#/components/schemas/Paise"},"net":{"description":"gross + GST − TDS.","$ref":"#/components/schemas/Paise"},"status":{"$ref":"#/components/schemas/PayoutStatus"},"release_rule":{"$ref":"#/components/schemas/PayoutReleaseRule"},"releasable":{"description":"What may be paid now under the release rule.","$ref":"#/components/schemas/Paise"},"tds_status":{"type":"string","enum":["pending","deducted","none"]},"tds_section":{"type":["string","null"]},"tds_rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tds_reason":{"type":["string","null"]},"invoice_ref":{"type":["string","null"]},"approved_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"approved_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"paid_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"paid_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"payment_mode":{"type":["string","null"]},"payment_reference":{"type":["string","null"]},"hold_reason":{"type":["string","null"]},"cancel_reason":{"type":["string","null"]},"notes":{"type":["string","null"]},"parent_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"The payout this part was split from."},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","deal","payee_type","payee","gross","gst_amount","tds","net","status","release_rule","releasable","tds_status","tds_section","tds_rate_bps","tds_reason","invoice_ref","approved_on","approved_by","paid_on","paid_by","payment_mode","payment_reference","hold_reason","cancel_reason","notes","parent_id","created_at"],"additionalProperties":false},"CommissionSide":{"type":"object","properties":{"side":{"$ref":"#/components/schemas/DealPartyRole"},"basis":{"$ref":"#/components/schemas/CommissionBasis"},"rate":{"description":"Percent (percent), days (days_rent) or months (months_rent).","type":["string","null"]},"amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"The fixed amount (fixed basis)."},"expected":{"$ref":"#/components/schemas/Paise"}},"required":["side","basis","rate","amount","expected"],"additionalProperties":false},"CommissionSideInput":{"type":"object","properties":{"side":{"$ref":"#/components/schemas/DealPartyRole"},"basis":{"$ref":"#/components/schemas/CommissionBasis"},"rate":{"description":"Percent (percent), days (days_rent) or months.","anyOf":[{"$ref":"#/components/schemas/DecimalInput"},{"type":"null"}]},"amount":{"description":"The amount of a fixed basis.","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}},"required":["side","basis"]},"CommissionSummary":{"type":"object","properties":{"period":{"type":"string","enum":["month","quarter"]},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"},"deals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Deals whose commission falls in the period."},"expected":{"$ref":"#/components/schemas/Paise"},"received":{"$ref":"#/components/schemas/Paise"},"outstanding":{"description":"Expected in the period less what those deals already received.","$ref":"#/components/schemas/Paise"},"outstanding_all":{"description":"Everything still due on open and won deals.","$ref":"#/components/schemas/Paise"}},"required":["period","from","to","deals","expected","received","outstanding","outstanding_all"],"additionalProperties":false},"CompanyExport":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"requested_at":{"$ref":"#/components/schemas/DateTime"},"requested_by":{"type":["string","null"]},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"tables":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":["string","null"]}},"required":["id","status","requested_at","requested_by","finished_at","expires_at","tables","rows","files","error"],"additionalProperties":false},"CompanyExportDownload":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"manifest":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"}},"required":["url","filename"],"additionalProperties":false},{"type":"null"}]},"files_index":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["url","filename","files"],"additionalProperties":false},{"type":"null"}]},"parts":{"type":"array","items":{"type":"object","properties":{"table":{"type":"string"},"part":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"csv_url":{"type":"string"},"json_url":{"type":"string"},"filename":{"type":"string"}},"required":["table","part","rows","csv_url","json_url","filename"],"additionalProperties":false}}},"required":["id","expires_at","manifest","files_index","parts"],"additionalProperties":false},"CompanyNotificationSettings":{"type":"object","properties":{"rules":{"type":"object","propertyNames":{"type":"string","maxLength":48},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"in_app":{"type":"boolean"},"push":{"type":"boolean"}},"additionalProperties":false}},"quiet_hours":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]}},"additionalProperties":false},"CompanyProfile":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"slug":{"type":"string","description":"Workspace address; changed by PropZolo support only."},"type":{"$ref":"#/components/schemas/CompanyType"},"status":{"$ref":"#/components/schemas/CompanyStatus"},"legal_name":{"type":["string","null"]},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"pincode":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"gstin":{"type":["string","null"]},"pan":{"type":["string","null"]},"rera_numbers":{"type":"array","items":{"$ref":"#/components/schemas/CompanyReraRegistration"}},"timezone":{"type":"string","minLength":1,"maxLength":64,"description":"IANA time zone, e.g. Asia/Kolkata.","examples":["Asia/Kolkata"]},"locale":{"type":"string"},"currency":{"type":"string"},"financial_year_start":{"type":"integer","minimum":1,"maximum":12},"brand_color":{"type":["string","null"]},"logo_url":{"type":["string","null"]},"wordmark_url":{"type":["string","null"]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","slug","type","status","legal_name","address","city","state","pincode","phone","email","website","gstin","pan","rera_numbers","timezone","locale","currency","financial_year_start","brand_color","logo_url","wordmark_url","updated_at"],"additionalProperties":false},"CompanyReraRegistration":{"type":"object","properties":{"state":{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN state code, e.g. KA."},"number":{},"kind":{"type":"string","enum":["agent","promoter"]}},"required":["state","number","kind"],"additionalProperties":false},"CompanyReraRegistrationInput":{"type":"object","properties":{"state":{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN state code, e.g. KA."},"number":{"type":"string","maxLength":60},"kind":{"type":"string","enum":["agent","promoter"]}},"required":["state","number","kind"]},"CompanyStatus":{"type":"string","enum":["trial","active","past_due","suspended","cancelled"]},"CompanySummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"$ref":"#/components/schemas/CompanyType"},"status":{"$ref":"#/components/schemas/CompanyStatus"},"timezone":{"type":"string","minLength":1,"maxLength":64,"description":"IANA time zone, e.g. Asia/Kolkata.","examples":["Asia/Kolkata"]},"locale":{"type":"string"},"currency":{"type":"string"},"brand_color":{"type":["string","null"]},"logo_url":{"type":["string","null"]}},"required":["id","name","slug","type","status","timezone","locale","currency","brand_color","logo_url"],"additionalProperties":false},"CompanyType":{"type":"string","enum":["broker","hybrid","builder","channel_partner","property_manager"]},"CompleteSiteVisitInput":{"type":"object","properties":{"override_reason":{"description":"Finish without the required OTP (site_visits.override_otp, audited).","anyOf":[{"type":"string","minLength":3,"maxLength":300},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","minLength":10,"maxLength":40},{"type":"null"}]}}},"CompleteUploadInput":{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"kind":{"$ref":"#/components/schemas/MediaKind"},"key":{"description":"The key from the presigned upload.","type":"string","maxLength":300},"url":{"description":"External link instead of a file (YouTube, Matterport): video and virtual_tour only.","type":"string","maxLength":500,"format":"uri"},"content_type":{"type":"string","minLength":3,"maxLength":120},"filename":{"type":"string","maxLength":255},"caption":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"room_tag":{"anyOf":[{"$ref":"#/components/schemas/RoomTag"},{"type":"null"}]},"is_cover":{"type":"boolean"}},"required":["kind"]},"ComputedCostSheet":{"type":"object","properties":{"area_basis":{"type":"string","enum":["carpet","builtup","super"]},"area":{"type":"number"},"area_unit":{"type":"string"},"bsp_rate":{"$ref":"#/components/schemas/Paise"},"lines":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["bsp","plc","floor_rise","parking","club","deposit","legal","other"]},"basis":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"discount":{"$ref":"#/components/schemas/Paise"},"net":{"$ref":"#/components/schemas/Paise"},"gst_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gst":{"$ref":"#/components/schemas/Paise"},"in_agreement_value":{"type":"boolean"}},"required":["code","label","kind","basis","amount","discount","net","gst_bp","gst","in_agreement_value"],"additionalProperties":false}},"discounts":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","enum":["percent_bsp","per_area","lump_sum"]},"value":{"type":"integer","minimum":1,"maximum":100000000000000,"description":"percent_bsp: basis points · per_area: paise per area unit · lump_sum: paise."},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["label","kind","value","amount"],"additionalProperties":false}},"totals":{"type":"object","properties":{"list_value":{"$ref":"#/components/schemas/Paise"},"discount":{"$ref":"#/components/schemas/Paise"},"agreement_value":{"$ref":"#/components/schemas/Paise"},"other_charges":{"$ref":"#/components/schemas/Paise"},"gst":{"$ref":"#/components/schemas/Paise"},"stamp_duty":{"$ref":"#/components/schemas/Paise"},"registration":{"$ref":"#/components/schemas/Paise"},"grand_total":{"$ref":"#/components/schemas/Paise"},"all_in_rate":{"$ref":"#/components/schemas/Paise"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["list_value","discount","agreement_value","other_charges","gst","stamp_duty","registration","grand_total","all_in_rate","discount_bp"],"additionalProperties":false},"stamp":{"type":"object","properties":{"state":{"type":["string","null"]},"include":{"type":"boolean"},"stamp_duty_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registration_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["state","include","stamp_duty_bp","registration_bp"],"additionalProperties":false}},"required":["area_basis","area","area_unit","bsp_rate","lines","discounts","totals","stamp"],"additionalProperties":false},"ConditionRating":{"type":"string","enum":["excellent","good","fair","poor","damaged","na"]},"ConnectionHealth":{"type":"string","enum":["ok","degraded","error","disconnected","pending"]},"Connector":{"type":"object","properties":{"key":{"type":"string"},"provider":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"auth_kind":{"type":"string","enum":["oauth","api_key","inbound_webhook","email","qr","none"]},"capabilities":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["ga","beta","planned"]},"logo":{"type":"string"},"docs":{"type":"object","properties":{"summary":{"type":"string"},"readme":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["summary","readme","url"],"additionalProperties":false},"available":{"type":"boolean","description":"It can be connected in this deployment now (see connect_modes)."},"connect_modes":{"type":"array","items":{"type":"string"},"description":"How it can be connected now: its own flow (the auth kind, e.g. `oauth`) once PropZolo’s account for it is configured by the platform admin, and/or `own_app` (the tenant’s own app credentials)."},"notice":{"description":"Why a connect flow is missing, for the connect screen.","type":["string","null"]},"multiple":{"type":"boolean"},"task":{"description":"Roadmap task that builds a planned connector.","type":["string","null"]},"connections":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationConnection"}}},"required":["key","provider","name","category","description","auth_kind","capabilities","status","logo","docs","available","connect_modes","notice","multiple","task","connections"],"additionalProperties":false},"Consent":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"phone_e164":{"type":["string","null"]},"email":{"type":["string","null"]},"channel":{"type":"string"},"purpose":{"type":"string"},"status":{"type":"string"},"basis":{"type":"string"},"source":{"type":"string"},"proof_ref":{"type":["string","null"]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"dlt_consent_ref":{"type":["string","null"]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"withdrawn_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"captured_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","contact_id","phone_e164","email","channel","purpose","status","basis","source","proof_ref","evidence","dlt_consent_ref","expires_at","withdrawn_at","captured_at"],"additionalProperties":false},"ConsentBadge":{"type":"object","properties":{"channel":{"type":"string"},"purpose":{"type":"string"},"status":{"type":"string","enum":["granted","withdrawn","expired"]},"basis":{"type":"string"},"captured_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["channel","purpose","status","basis","captured_at","expires_at"],"additionalProperties":false,"description":"Latest consent per channel and purpose from the ledger."},"ConsentBasis":{"type":"string","enum":["consent","enquiry","legitimate_use","contract","legacy_registered"],"description":"consent = explicit opt-in · enquiry = TRAI enquiry window (expires 7 days after the enquiry) · legitimate_use = DPDP §7 · contract = existing customer · legacy_registered = older consent registered on the operators’ platform."},"ConsentChannel":{"type":"string","enum":["whatsapp","sms","call","email","all"]},"ConsentPanel":{"type":"object","properties":{"contact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"dnd":{"type":"boolean"},"blocked":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"e164":{"type":["string","null"]},"is_primary":{"type":"boolean"},"is_whatsapp":{"type":["boolean","null"]}},"required":["e164","is_primary","is_whatsapp"],"additionalProperties":false}},"email":{"type":["string","null"]}},"required":["id","name","dnd","blocked","phones","email"],"additionalProperties":false},"enquiry_window":{"type":"object","properties":{"last_enquiry_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"ends_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"open":{"type":"boolean"}},"required":["last_enquiry_at","ends_at","open"],"additionalProperties":false},"matrix":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","sms","call","email"]},"purpose":{"type":"string","enum":["service","promotional"]},"state":{"type":"string","enum":["granted","withdrawn","expired","none"]},"basis":{"type":["string","null"]},"source":{"type":["string","null"]},"consent_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"captured_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"withdrawn_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"dlt_consent_ref":{"type":["string","null"]}},"required":["channel","purpose","state","basis","source","consent_id","captured_at","expires_at","withdrawn_at","dlt_consent_ref"],"additionalProperties":false}},"suppressions":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}},"history":{"type":"array","items":{"$ref":"#/components/schemas/Consent"}}},"required":["contact","enquiry_window","matrix","suppressions","history"],"additionalProperties":false},"ConsentProof":{"type":"object","properties":{"ref":{"description":"Storage key / record id of the raw proof.","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"form_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"text_version":{"description":"Version or hash of the consent text shown.","anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"ip":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"user_agent":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"message_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},"ConsentPurpose":{"type":"string","enum":["transactional","service","promotional","all"]},"ConsentSource":{"type":"string","enum":["form","portal","landing_page","enquiry","call","whatsapp_keyword","sms_keyword","email_keyword","unsubscribe_link","import","manual","api","provider"]},"ConstructionStage":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"stage":{"type":"string"},"tower":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The tower certified (BLD-03); null: the whole project."},"name":{"type":["string","null"]},"certified_on":{"$ref":"#/components/schemas/LocalDate"},"certificate_ref":{"type":["string","null"]},"notes":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","stage","tower","name","certified_on","certificate_ref","notes","created_at"],"additionalProperties":false},"ContactDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"phone":{"type":["string","null"]},"phones":{"type":"array","items":{"type":"string"}},"phone_details":{"type":"array","items":{"$ref":"#/components/schemas/PhoneDetail"}},"email":{"type":["string","null"]},"alternate_email":{"type":["string","null"]},"kinds":{"type":"array","items":{"type":"string"}},"gender":{"type":["string","null"]},"dob":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"anniversary":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"occupation":{"type":["string","null"]},"employer":{"type":["string","null"]},"designation":{"type":["string","null"]},"income_band":{"type":["string","null"]},"is_nri":{"type":"boolean"},"country":{"type":["string","null"]},"city":{"type":["string","null"]},"address":{"type":["string","null"]},"pincode":{"type":["string","null"]},"language":{"type":["string","null"]},"aadhaar_last4":{"type":["string","null"]},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"dnd":{"type":"boolean"},"blocked":{"type":"boolean"},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"identities":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string"},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","channel_account_id","verified_at"],"additionalProperties":false}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/ConsentBadge"}},"counts":{"type":"object","properties":{"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open_leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listings_owned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["leads","open_leads","listings_owned","deals","conversations"],"additionalProperties":false},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string"},"lead_type":{"type":"string"},"status":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"category":{"$ref":"#/components/schemas/StatusCategory"}},"required":["id","key","name","color","category"],"additionalProperties":false},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","number","ref","lead_type","status","owner","received_at"],"additionalProperties":false}},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"archived":{"type":"boolean"}},"required":["id","name","first_name","last_name","phone_details","kinds","gender","dob","anniversary","occupation","employer","designation","income_band","is_nri","country","city","pincode","language","aadhaar_last4","owner","source_id","tags","dnd","blocked","custom","identities","consents","counts","leads","created_at","updated_at","archived"],"additionalProperties":false},"ContactKind":{"type":"string","enum":["buyer","tenant","owner","landlord","investor","broker","channel_partner","builder","vendor"]},"ContactOwnerReport":{"type":"object","properties":{"owner_contact_id":{"$ref":"#/components/schemas/Id"},"listings":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"managed":{"type":"boolean"}},"required":["id","ref_code","title","status","managed"],"additionalProperties":false}},"owner_wide":{"type":"boolean"},"stopped":{"type":"boolean"},"digest_enabled":{"type":"boolean"},"links":{"type":"array","items":{"$ref":"#/components/schemas/OwnerReportLink"}},"sends":{"type":"array","items":{"$ref":"#/components/schemas/OwnerReportSend"}}},"required":["owner_contact_id","listings","owner_wide","stopped","digest_enabled","links","sends"],"additionalProperties":false},"ContactSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"kinds":{"type":"array","items":{"type":"string"}},"city":{"type":["string","null"]},"is_nri":{"type":"boolean"},"country":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"dnd":{"type":"boolean"},"blocked":{"type":"boolean"},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"lead_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"archived":{"type":"boolean"}},"required":["id","name","kinds","city","is_nri","country","tags","dnd","blocked","owner","lead_count","created_at","updated_at","archived"],"additionalProperties":false},"Conversation":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"channel":{"type":"string"},"channel_account_id":{"$ref":"#/components/schemas/Id"},"contact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"address":{"type":["string","null"]}},"required":["id","name","address"],"additionalProperties":false},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"assignee_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"status":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unread_for_me":{"type":"boolean","description":"News for the viewer: the unread count for the assignee (or on an unassigned chat); for anyone else, a customer message after their own last look."},"last_message_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_inbound_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_message_preview":{"type":["string","null"]},"window":{"anyOf":[{"type":"object","properties":{"open":{"type":"boolean"},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["open","expires_at"],"additionalProperties":false},{"type":"null"}],"description":"WhatsApp 24-hour customer-service window (null for other channels)."},"is_archived":{"type":"boolean"},"is_pinned":{"type":"boolean"},"snoozed_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"can_note":{"type":"boolean","description":"Whether the caller may add a note here: edit access to the lead, or to the contact when there is none."},"ai":{"anyOf":[{"type":"object","properties":{"label":{"anyOf":[{"type":"string","enum":["needs_attention","site_visit","qualified","price_enquiry"]},{"type":"null"}]},"state":{"type":["string","null"]},"intent":{"type":["string","null"]},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["label","state","intent","score"],"additionalProperties":false},{"type":"null"}],"description":"What the WhatsApp AI agent recorded (state, latest intent) read as one label, and the lead score; null when the AI never handled the chat."}},"required":["id","channel","channel_account_id","contact","lead_id","assignee_id","status","labels","unread_count","unread_for_me","last_message_at","last_inbound_at","last_message_preview","window","is_archived","is_pinned","snoozed_until","created_at","can_note","ai"],"additionalProperties":false},"CopyAgreementTemplateInput":{"type":"object","properties":{"from":{"type":"string","pattern":"^[a-z][a-z0-9_]{2,63}$"},"key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{2,63}$"},{"type":"null"}]},"title":{"anyOf":[{"type":"string","minLength":3,"maxLength":160},{"type":"null"}]}},"required":["from"]},"CostSheet":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string"},"status":{"type":"string","enum":["draft","issued","accepted","expired","cancelled"],"description":"An issued sheet past its validity, or an accepted one not booked by its book-by date, reads expired."},"project":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"unit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"},"label":{"type":"string"},"floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string"}},"required":["id","unit_no","label","floor","status"],"additionalProperties":false},"price_list":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","version","name","status"],"additionalProperties":false},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"}},"required":["id","number","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"discounts":{"type":"array","items":{"$ref":"#/components/schemas/CostSheetDiscount"}},"note":{"type":["string","null"]},"sheet":{"anyOf":[{"$ref":"#/components/schemas/ComputedCostSheet"},{"type":"null"}],"description":"Frozen once issued; a draft’s live computation."},"error":{"type":["string","null"]},"cap":{"type":"object","properties":{"cap_bp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"null: not capped."},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"above_cap":{"type":"boolean"}},"required":["cap_bp","discount_bp","above_cap"],"additionalProperties":false},"content_hash":{"type":["string","null"]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"issued_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"shared_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"share_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"name":{"type":["string","null"]},"ip":{"type":["string","null"]},"user_agent":{"type":["string","null"]},"channel":{"type":["string","null"]}},"required":["at","name","ip","user_agent","channel"],"additionalProperties":false},{"type":"null"}]},"competing_acceptances":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"},"name":{"type":["string","null"]}},"required":["id","ref","at","name"],"additionalProperties":false},"description":"Other sheets on the same unit accepted and not booked yet (still inside their book-by date)."},"cancelled":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"reason":{"type":["string","null"]}},"required":["at","reason"],"additionalProperties":false},{"type":"null"}]},"approval":{"anyOf":[{"type":"object","properties":{"chain_id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"}},"required":["chain_id","status"],"additionalProperties":false},{"type":"null"}]},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","number","ref","status","project","unit","price_list","lead","contact","discounts","note","sheet","error","cap","content_hash","valid_until","issued_at","shared_at","share_count","accepted","competing_acceptances","cancelled","approval","created_by","created_at","updated_at"],"additionalProperties":false},"CostSheetDiscount":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","enum":["percent_bsp","per_area","lump_sum"]},"value":{"type":"integer","minimum":1,"maximum":100000000000000,"description":"percent_bsp: basis points · per_area: paise per area unit · lump_sum: paise."}},"required":["label","kind","value"],"additionalProperties":false},"CostSheetDiscountInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","enum":["percent_bsp","per_area","lump_sum"]},"value":{"type":"integer","minimum":1,"maximum":100000000000000,"description":"percent_bsp: basis points · per_area: paise per area unit · lump_sum: paise."}},"required":["label","kind","value"]},"CostSheetPolicy":{"type":"object","properties":{"default_cap_bp":{"type":"integer","minimum":0,"maximum":10000},"role_caps_bp":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"type":"integer","minimum":0,"maximum":10000}},"validity_days":{"type":"integer","minimum":1,"maximum":90},"book_within_days":{"description":"Days an accepted sheet keeps its price for the booking; null: as many as validity_days.","anyOf":[{"type":"integer","minimum":1,"maximum":90},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["default_cap_bp","role_caps_bp","validity_days","terms"],"additionalProperties":false},"CreateApiKeyInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"scopes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z_]+:[a-z_]+$"}},"expires_at":{"description":"When the key stops working (within two years); unset → 90 days from now.","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"never_expires":{"description":"A key that never expires — allowed, but flagged in the audit log. Not with expires_at.","type":"boolean"}},"required":["name","scopes"]},"CreateAssignmentRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"is_active":{"type":"boolean"},"method":{"$ref":"#/components/schemas/AssignmentMethod"},"conditions":{"type":"object","properties":{"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"match":{"type":"object","properties":{"language":{"$ref":"#/components/schemas/CandidateMatchMode"},"locality":{"$ref":"#/components/schemas/CandidateMatchMode"},"specialization":{"$ref":"#/components/schemas/CandidateMatchMode"}}},"hourly_cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]}}},"only_available":{"type":"boolean"},"active_app_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":1440},{"type":"null"}]},"outside_shift":{"type":"string","enum":["assign","hold"]},"daily_cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"max_untouched":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"rotation_enabled":{"type":"boolean"},"rotation_minutes":{"type":"integer","minimum":1,"maximum":1440},"rotation_max":{"type":"integer","minimum":0,"maximum":20},"rotation_final":{"type":"string","enum":["pool","keep"]},"rotation_scope":{"type":"string","enum":["auto","all","off"]},"second_chance_enabled":{"type":"boolean"},"second_chance_hours":{"type":"integer","minimum":1,"maximum":720},"second_chance_attempts":{"type":"integer","minimum":1,"maximum":50},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"members":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"enabled":{"type":"boolean"},"weight":{"type":"integer","minimum":0,"maximum":100},"daily_cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]}},"required":["member_id"]}}},"required":["name"]},"CreateBroadcastInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"channel":{"type":"string","enum":["whatsapp_cloud","sms","email"]},"template_id":{"$ref":"#/components/schemas/Id"},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"audience":{"$ref":"#/components/schemas/BroadcastAudienceInput"},"scheduled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"throttle_per_min":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},{"type":"null"}]},"vars":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"additionalProperties":{"type":"string","maxLength":1000}},{"type":"null"}]},"send_mode":{"description":"best_time: each contact at their best hour (engagement history) within best_time_hours.","anyOf":[{"type":"string","enum":["now","best_time"]},{"type":"null"}]},"best_time_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":168},{"type":"null"}]},"personalize_with_ai":{"type":["boolean","null"]},"personalization":{"description":"The template variables AI writes per recipient (up to 3) and the creator’s instructions.","anyOf":[{"type":"object","properties":{"instructions":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"variables":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"hint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["key"]}}},"required":["variables"]},{"type":"null"}]}},"required":["name","channel","template_id","audience"]},"CreateCommissionPayoutInput":{"type":"object","properties":{"deal_id":{"$ref":"#/components/schemas/Id"},"payee_type":{"$ref":"#/components/schemas/PayeeType"},"payee_id":{"description":"A member, partner or contact (co-broker, referrer) id.","$ref":"#/components/schemas/Id"},"gross":{"$ref":"#/components/schemas/PaiseInput"},"release_rule":{"description":"Default: the company’s finance setting.","anyOf":[{"$ref":"#/components/schemas/PayoutReleaseRule"},{"type":"null"}]},"invoice_ref":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["deal_id","payee_type","payee_id","gross"]},"CreateContactInput":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"first_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"alternate_email":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"phones":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/PhoneInput"}},"kinds":{"maxItems":9,"type":"array","items":{"$ref":"#/components/schemas/ContactKind"}},"gender":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"dob":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"anniversary":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"occupation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"employer":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"designation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"income_band":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"is_nri":{"type":"boolean"},"country":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"language":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]},"aadhaar_last4":{"description":"Only the last 4 digits of an Aadhaar number.","anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tags":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":40}},"blocked":{"type":"boolean"},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"CreateCustomFieldInput":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/CustomFieldEntity"},"label":{"type":"string","minLength":1,"maxLength":80},"key":{"description":"Stable key; derived from the label when absent.","anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]},"type":{"$ref":"#/components/schemas/CustomFieldKind"},"choices":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/CustomFieldChoice"}},"is_required":{"type":"boolean"},"section":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"help_text":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"visible_to":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"editable_by":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["entity","label","type"]},"CreateDealInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"contact_id":{"description":"The primary client; default: the lead’s contact or the first party.","$ref":"#/components/schemas/Id"},"parties":{"$ref":"#/components/schemas/DealPartiesInput"},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"unit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"agreed_value":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"token_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"token_mode":{"anyOf":[{"$ref":"#/components/schemas/PaymentMode"},{"type":"null"}]},"token_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"agreement_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"registration_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"handover_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"commission":{"anyOf":[{"$ref":"#/components/schemas/DealCommissionInput"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"type":{"description":"Default from the lead: buy / sell / invest → sale.","$ref":"#/components/schemas/DealType"},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"CreateEnquiryForm":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"is_active":{"type":"boolean"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"fields":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FormFieldInput"}},"consent_text":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"consent_required":{"type":"boolean"},"otp_required":{"type":"boolean"},"spam_protection":{"$ref":"#/components/schemas/FormSpamProtection"},"success_action":{"$ref":"#/components/schemas/FormSuccessActionInput"},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"submit_label":{"type":"string","minLength":1,"maxLength":40},"allowed_origins":{"examples":[["https://www.example.com"]],"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]}},"required":["name"]},"CreateImportResult":{"type":"object","properties":{"import":{"$ref":"#/components/schemas/ImportJob"},"upload":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","method","headers","expires_at"],"additionalProperties":false},{"type":"null"}]},"profile":{"type":"boolean"}},"required":["import","upload","profile"],"additionalProperties":false},"CreateInspectionInput":{"type":"object","properties":{"kind":{"type":"string","enum":["move_in","move_out"]},"template_key":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"scheduled_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["kind"]},"CreateInvitationInput":{"type":"object","properties":{"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"phone":{"description":"Any format; NRI numbers keep their code.","anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"role_id":{"$ref":"#/components/schemas/Id"},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reports_to_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["role_id"]},"CreateInvoiceInput":{"type":"object","properties":{"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"description":"Who is billed; default the deal party of party_role.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"party_role":{"anyOf":[{"type":"string","enum":["buyer","seller","tenant","landlord","developer","other"]},{"type":"null"}]},"sides":{"description":"Commission sides to bill; default the party’s side, else every side with something left.","anyOf":[{"maxItems":4,"type":"array","items":{"type":"string","enum":["buyer","seller","tenant","landlord"]}},{"type":"null"}]},"lines":{"description":"Free lines (replace the deal’s).","anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":300},"sac":{"anyOf":[{"type":"string","pattern":"^99\\d{4}$"},{"type":"null"}]},"side":{"anyOf":[{"type":"string","enum":["buyer","seller","tenant","landlord"]},{"type":"null"}]},"taxable":{"$ref":"#/components/schemas/PaiseInput"}},"required":["description","taxable"]}},{"type":"null"}]},"bill_to":{"anyOf":[{"type":"object","properties":{"legal_name":{"type":"string","minLength":1,"maxLength":200},"gstin":{"anyOf":[{"description":"15-character GSTIN (validated with its check character).","type":"string","maxLength":32},{"type":"null"}]},"pan":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"state":{"anyOf":[{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN state code, e.g. KA."},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{5}$"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]}}},{"type":"null"}]},"place_of_supply":{"description":"Set by hand; default by the rules.","anyOf":[{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN state code, e.g. KA."},{"type":"null"}]},"due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},"CreateKiosk":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"site_name":{"type":"string","minLength":1,"maxLength":80},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"settings":{"type":"object","properties":{"welcome_title":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"welcome_text":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"accent":{"anyOf":[{"type":"string","maxLength":7},{"type":"null"}]},"language":{"type":"string","enum":["en","hi","both"]},"otp":{"type":"string","enum":["required","optional","off"]},"ask_lead_type":{"type":"boolean"},"configurations":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}},"budget_bands":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40},"label":{"type":"string","maxLength":60},"min":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"max":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key"]}},"came_via":{"minItems":1,"type":"array","items":{"type":"string","enum":["walk_in","cp","ad","referral","other"]}},"ask_email":{"type":"boolean"},"ask_notes":{"type":"boolean"},"notify_member_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"default_owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"idle_reset_sec":{"type":"integer","minimum":30,"maximum":600}},"additionalProperties":false}},"required":["name","site_name"]},"CreateLandingPage":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{1,58}[a-z0-9])$"},"template":{"$ref":"#/components/schemas/LandingTemplate"},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"form_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"domain_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"blocks":{"minItems":1,"maxItems":16,"type":"array","items":{"$ref":"#/components/schemas/LandingBlockInput"}},"theme":{"type":"object","properties":{"preset":{"type":"string","enum":["clean","bold","minimal"]},"appearance":{"type":"string","enum":["auto","light","dark"]},"accent":{"type":"string","enum":["brand","indigo","emerald","amber","rose","teal","slate"]},"corners":{"type":"string","enum":["soft","sharp","round"]}}},"settings":{"type":"object","properties":{"price_policy":{"type":"string","enum":["show","from","on_request"]}}},"seo":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":70},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"noindex":{"type":"boolean"},"image_media_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"tracking":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom","off"]},"meta_pixel_id":{"anyOf":[{"type":"string","pattern":"^\\d{10,20}$"},{"type":"null"}]},"ga4_id":{"anyOf":[{"type":"string","pattern":"^G-[A-Z0-9]{4,16}$"},{"type":"null"}]},"gtm_id":{"anyOf":[{"type":"string","pattern":"^GTM-[A-Z0-9]{4,12}$"},{"type":"null"}]},"google_ads_id":{"anyOf":[{"type":"string","pattern":"^AW-\\d{6,14}$"},{"type":"null"}]},"google_ads_label":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{4,64}$"},{"type":"null"}]}}},"experiment":{"anyOf":[{"$ref":"#/components/schemas/LandingExperimentInput"},{"type":"null"}]}},"description":"A project, listing or agent page names it; blocks start from the template."},"CreateLeadInput":{"type":"object","properties":{"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"phones":{"maxItems":5,"type":"array","items":{"anyOf":[{"type":"string","maxLength":32},{"$ref":"#/components/schemas/PhoneInput"}]}},"email":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]}},"required":["phones"]},"lead_type":{"$ref":"#/components/schemas/LeadType"},"pipeline_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sub_status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"requirement":{"$ref":"#/components/schemas/RequirementInput"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"campaign_ref":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"sub_source":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"utm":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":300}},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"presales_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"temperature":{"anyOf":[{"$ref":"#/components/schemas/Temperature"},{"type":"null"}]},"expected_value":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"received_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"duplicate_mode":{"description":"`policy` (default): a known person follows the duplicate policy; `new_lead`: always a new lead.","type":"string","enum":["policy","new_lead"]}}},"CreateLeadResult":{"type":"object","properties":{"outcome":{"$ref":"#/components/schemas/EnquiryOutcome"},"lead_id":{"$ref":"#/components/schemas/Id"},"contact_id":{"$ref":"#/components/schemas/Id"},"duplicate_of_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"needs_assignment":{"type":"boolean"},"lead":{"anyOf":[{"$ref":"#/components/schemas/LeadDetail"},{"type":"null"}],"description":"Null when the enquiry went to a lead outside your scope."}},"required":["outcome","lead_id","contact_id","duplicate_of_id","needs_assignment","lead"],"additionalProperties":false},"CreateLeadSource":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"$ref":"#/components/schemas/LeadSourceType"},"provider":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_]{0,31}$"},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$","description":"Hex colour.","examples":["#6D5DFC"]},{"type":"null"}]},"monthly_cost":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"default_pipeline_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"assignment_rule_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"default_lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"expected_every_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":720},{"type":"null"}]},"alarm_member_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"allowed_ips":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}},"field_mapping":{"anyOf":[{"$ref":"#/components/schemas/FieldMapping"},{"type":"null"}]},"is_active":{"type":"boolean"}},"required":["name","type"]},"CreateManualCallInput":{"type":"object","properties":{"client_key":{"type":"string","minLength":8,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","description":"The app’s id for this call attempt; with the member, the idempotency key."},"phone":{"type":"string","minLength":3,"maxLength":40,"description":"The number dialled."},"lead_id":{"description":"The lead the call was placed from; matched by number when absent.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"started_at":{"description":"When the Phone app was opened (UTC); within the last 24 hours.","$ref":"#/components/schemas/DateTime"},"verdict":{"$ref":"#/components/schemas/ManualCallVerdict"},"duration_sec":{"description":"Time away from the app, an estimate of talk time; kept for connected calls only.","anyOf":[{"type":"integer","minimum":0,"maximum":14400},{"type":"null"}]}},"required":["client_key","phone","started_at","verdict"]},"CreateManualCallResult":{"type":"object","properties":{"call":{"$ref":"#/components/schemas/CallDetail"},"created":{"type":"boolean"}},"required":["call","created"],"additionalProperties":false},"CreateMicrosite":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"listing"},"property_id":{"$ref":"#/components/schemas/Id"},"publish":{"default":false,"type":"boolean"}},"required":["kind","property_id"]},{"type":"object","properties":{"kind":{"type":"string","const":"agent"},"member_id":{"$ref":"#/components/schemas/Id"},"publish":{"default":false,"type":"boolean"}},"required":["kind","member_id"]}]},"CreateNoteInput":{"type":"object","properties":{"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"body":{"type":"string","minLength":1,"maxLength":10000},"mention_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"pinned":{"type":"boolean"}},"required":["body"]},"CreatePipelineInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"lead_types":{"minItems":1,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/LeadType"}},"is_default":{"type":"boolean"},"copy_from_id":{"description":"Copy the statuses of this pipeline (else a starter set).","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["name","lead_types"]},"CreatePipelineStatusInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"key":{"description":"Stable key; derived from the name when absent.","anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"category":{"$ref":"#/components/schemas/StatusCategory"},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"is_default":{"type":"boolean"},"is_active":{"type":"boolean"},"sla_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":43200},{"type":"null"}]},"requirements":{"anyOf":[{"type":"object","properties":{"follow_up":{"$ref":"#/components/schemas/RequirementLevel"},"site_visit":{"$ref":"#/components/schemas/RequirementLevel"},"note":{"$ref":"#/components/schemas/RequirementLevel"},"deal":{"$ref":"#/components/schemas/RequirementLevel"},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}}},{"type":"null"}]}},"required":["name","category","color"]},"CreatePipelineSubStatusInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"key":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"requirements":{"anyOf":[{"type":"object","properties":{"follow_up":{"$ref":"#/components/schemas/RequirementLevel"},"site_visit":{"$ref":"#/components/schemas/RequirementLevel"},"note":{"$ref":"#/components/schemas/RequirementLevel"},"deal":{"$ref":"#/components/schemas/RequirementLevel"},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}}},{"type":"null"}]},"auto_follow_up_minutes":{"description":"Automatic retry call after this many minutes (working hours apply), e.g. RNR → 120.","anyOf":[{"type":"integer","minimum":1,"maximum":43200},{"type":"null"}]},"counts_as_contact":{"description":"false when no conversation happened (RNR, switched off).","type":"boolean"},"is_active":{"type":"boolean"}},"required":["name"]},"CreateProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"developer_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"is_own":{"type":"boolean"},"status":{"$ref":"#/components/schemas/ProjectStatus"},"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_types":{"maxItems":22,"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"rera_numbers":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ReraNumber"}},"launch_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"locality_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"state":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","pattern":"^\\d{6}$"},{"type":"null"}]},"latitude":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"land_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"land_area_unit":{"anyOf":[{"$ref":"#/components/schemas/AreaUnit"},{"type":"null"}]},"open_area_pct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"towers_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":500},{"type":"null"}]},"units_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"floors_max":{"anyOf":[{"type":"integer","minimum":0,"maximum":250},{"type":"null"}]},"amenity_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"approvals":{"anyOf":[{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"boolean"}},{"type":"null"}]},"approved_banks":{"maxItems":40,"type":"array","items":{"type":"string","maxLength":60}},"usps":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"cp_brokerage_pct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"offers":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"video_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"virtual_tour_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"is_published":{"type":"boolean"},"configurations":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/ProjectConfigurationInput"}}},"required":["name","status"]},"CreatePropertyInput":{"type":"object","properties":{"listing_type":{"$ref":"#/components/schemas/ListingType"},"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_type":{"$ref":"#/components/schemas/PropertyType"},"title":{"description":"Generated from the facts when left out.","type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner_contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"owner":{"anyOf":[{"$ref":"#/components/schemas/PropertyOwnerInput"},{"type":"null"}]},"mandate":{"anyOf":[{"$ref":"#/components/schemas/MandateType"},{"type":"null"}]},"mandate_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"owner_expected_price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"brokerage_from_owner":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"brokerage_from_client":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"key_with":{"anyOf":[{"type":"string","enum":["owner","agent","office","security","tenant","other"]},{"type":"null"}]},"visit_instructions":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"society_name":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"building":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"unit_no":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"floor":{"anyOf":[{"type":"integer","minimum":-5,"maximum":250},{"type":"null"}]},"total_floors":{"anyOf":[{"type":"integer","minimum":0,"maximum":250},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"locality_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sub_locality":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"landmark":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"city":{"description":"Defaults to the company's city.","type":"string","maxLength":80},"state":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","pattern":"^\\d{6}$"},{"type":"null"}]},"latitude":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"bedrooms":{"anyOf":[{"type":"integer","minimum":0,"maximum":50},{"type":"null"}]},"bathrooms":{"anyOf":[{"type":"integer","minimum":0,"maximum":50},{"type":"null"}]},"layout":{"anyOf":[{"$ref":"#/components/schemas/Layout"},{"type":"null"}]},"balconies":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"extra_rooms":{"maxItems":4,"type":"array","items":{"type":"string","enum":["study","servant","pooja","store"]}},"carpet_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"builtup_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"super_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"plot_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"plot_length":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"plot_breadth":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"road_width_ft":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000},{"type":"null"}]},"frontage_ft":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"facing":{"anyOf":[{"$ref":"#/components/schemas/Facing"},{"type":"null"}]},"is_corner":{"type":"boolean"},"overlooking":{"maxItems":5,"type":"array","items":{"type":"string","enum":["park","main_road","pool","club","garden"]}},"vastu_compliant":{"type":["boolean","null"]},"furnishing":{"anyOf":[{"$ref":"#/components/schemas/Furnishing"},{"type":"null"}]},"furnishing_items":{"maxItems":12,"type":"array","items":{"type":"string","enum":["ac","wardrobe","modular_kitchen","geyser","fridge","washing_machine","tv","beds","sofa","dining_table","microwave","water_purifier"]}},"possession_status":{"anyOf":[{"$ref":"#/components/schemas/PossessionStatus"},{"type":"null"}]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"year_built":{"anyOf":[{"type":"integer","minimum":1800,"maximum":2100},{"type":"null"}]},"transaction_type":{"anyOf":[{"$ref":"#/components/schemas/TransactionType"},{"type":"null"}]},"ownership":{"anyOf":[{"$ref":"#/components/schemas/Ownership"},{"type":"null"}]},"approvals":{"description":"State-aware approvals, e.g. { \"khata\": \"A\", \"oc\": true, \"authority\": \"BBMP\" }.","anyOf":[{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string","maxLength":60}]}},{"type":"null"}]},"rera_number":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"loan_banks":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":60}},"covered_parking":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"open_parking":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"two_wheeler_parking":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"amenity_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"water_supply":{"anyOf":[{"type":"string","enum":["corporation","borewell","both","tanker"]},{"type":"null"}]},"power_backup":{"anyOf":[{"type":"string","enum":["none","partial","full"]},{"type":"null"}]},"gated_community":{"type":["boolean","null"]},"price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"price_negotiable":{"type":"boolean"},"price_on_request":{"type":"boolean"},"all_inclusive":{"type":["boolean","null"]},"maintenance_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"maintenance_period":{"anyOf":[{"type":"string","enum":["monthly","quarterly","yearly","one_time"]},{"type":"null"}]},"token_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"rent_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"maintenance_included":{"type":["boolean","null"]},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"deposit_months":{"anyOf":[{"type":"number","minimum":0,"maximum":60},{"type":"null"}]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":240},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":24},{"type":"null"}]},"agreement_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":240},{"type":"null"}]},"escalation_pct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"rent_floor":{"description":"The lowest monthly rent the owner accepts (paise).","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"deposit_floor":{"description":"The lowest deposit the owner accepts (paise).","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"lock_in_max_months":{"description":"The longest lock-in the owner accepts (months).","anyOf":[{"type":"integer","minimum":0,"maximum":120},{"type":"null"}]},"available_from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"tenant_preferences":{"maxItems":5,"type":"array","items":{"type":"string","enum":["family","bachelor_male","bachelor_female","company","students"]}},"pets_allowed":{"type":["boolean","null"]},"non_veg_allowed":{"type":["boolean","null"]},"listed_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"co_broking":{"type":"boolean"},"network_visibility":{"type":"string","enum":["private","company","network","public"]},"is_featured":{"type":"boolean"},"expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{}},"status":{"default":"draft","type":"string","enum":["draft","active"]}},"required":["listing_type","property_type"]},"CreateQrCode":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"target":{"$ref":"#/components/schemas/QrTargetInput"},"short_code":{"description":"A custom code (\"orr-hoarding\"); generated when absent. Fixed once created.","anyOf":[{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{1,30}[a-z0-9])$"},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"placement":{"$ref":"#/components/schemas/QrPlacement"},"sub_source":{"description":"The exact spot (\"ORR junction, facing the flyover\") → leads.sub_source.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"campaign_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"utm_campaign":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"utm_content":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"valid_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"valid_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"is_active":{"type":"boolean"}},"required":["name","target"]},"CreateQuickReplyInput":{"type":"object","properties":{"shortcut":{"description":"Typed after \"/\" in the composer; a leading \"/\" is dropped and letters are lower-cased.","type":"string"},"title":{"type":"string","minLength":1,"maxLength":80},"body":{"type":"string","minLength":1,"maxLength":4096},"shared":{"default":false,"type":"boolean"}},"required":["shortcut","title","body"]},"CreateRenewalInput":{"type":"object","properties":{"escalation_pct":{"description":"Default: the agreement’s escalation.","anyOf":[{"$ref":"#/components/schemas/DecimalInput"},{"type":"null"}]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"CreateRentalAgreementInput":{"type":"object","properties":{"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"maintenance_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"maintenance_period":{"anyOf":[{"$ref":"#/components/schemas/MaintenancePeriod"},{"type":"null"}]},"landlord_contact_id":{"$ref":"#/components/schemas/Id"},"tenant_contact_id":{"$ref":"#/components/schemas/Id"},"start_date":{"$ref":"#/components/schemas/LocalDate"},"end_date":{"$ref":"#/components/schemas/LocalDate"},"rent_amount":{"$ref":"#/components/schemas/PaiseInput"},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"escalation_pct":{"anyOf":[{"$ref":"#/components/schemas/DecimalInput"},{"type":"null"}]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":120},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":24},{"type":"null"}]},"rent_due_day":{"anyOf":[{"type":"integer","minimum":1,"maximum":28},{"type":"null"}]},"police_verification":{"anyOf":[{"$ref":"#/components/schemas/PoliceVerificationStatus"},{"type":"null"}]},"agreement_type":{"anyOf":[{"$ref":"#/components/schemas/AgreementType"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","renewed","terminated"]}},"description":"With `deal_id`, the listing, parties, rent and start date default from the rental deal."},"CreateRoleInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"permissions":{"description":"Omitted: a copy, or no access at all.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/PermissionValue"}}},"copy_from_role_id":{"description":"Duplicate this role’s permissions.","$ref":"#/components/schemas/Id"},"requires_two_factor":{"type":"boolean"}},"required":["name"]},"CreateSavedViewInput":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/SavedViewEntity"},"name":{"type":"string","minLength":1,"maxLength":60},"visibility":{"$ref":"#/components/schemas/SavedViewVisibility"},"filters":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"columns":{"anyOf":[{"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]},"sort":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"layout":{"$ref":"#/components/schemas/SavedViewLayout"},"is_pinned":{"type":"boolean"}},"required":["entity","name"]},"CreateSequenceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"steps":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/SequenceStepInput"}},"entry":{"anyOf":[{"$ref":"#/components/schemas/SequenceEntryRule"},{"type":"null"}]},"settings":{"type":"object","properties":{"pause_on":{"type":"object","properties":{"reply":{"type":"boolean"},"call":{"type":"boolean"},"visit":{"type":"boolean"}}}}}},"required":["name"]},"CreateShareInput":{"type":"object","properties":{"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_ids":{"default":[],"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel":{"default":"copy","$ref":"#/components/schemas/ShareChannel"},"expires_in_days":{"description":"Default 30 days.","type":"integer","minimum":1,"maximum":365},"message":{"description":"Intro line for the WhatsApp draft.","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},"CreateSiteVisitInput":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"scheduled_at":{"type":"string","minLength":10,"maxLength":40},"duration_min":{"anyOf":[{"type":"integer","minimum":15,"maximum":480},{"type":"null"}]},"agent_id":{"description":"Default: you, else the lead’s owner.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"presales_id":{"description":"Default: the lead’s pre-sales owner.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"stops":{"description":"The tour, in visiting order.","maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/SiteVisitStopInput"}},"meeting_point":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"pickup":{"anyOf":[{"type":"object","properties":{"address":{"type":"string","minLength":3,"maxLength":300},"at":{"anyOf":[{"type":"string","minLength":10,"maxLength":40},{"type":"null"}]}},"required":["address"]},{"type":"null"}]},"partner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["lead_id","scheduled_at"]},"CreateSupportGrantInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500},"hours":{"type":"integer","minimum":1,"maximum":72},"mode":{"default":"read","type":"string","enum":["read","full"]}},"required":["reason","hours"]},"CreateSupportTicketInput":{"type":"object","properties":{"subject":{"type":"string","minLength":5,"maxLength":150},"body":{"type":"string","minLength":10,"maxLength":10000},"category":{"$ref":"#/components/schemas/SupportTicketCategory"},"priority":{"default":"normal","$ref":"#/components/schemas/SupportTicketPriority"},"attachments":{"default":[],"maxItems":5,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":300},"filename":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf"]}},"required":["key","filename","content_type"]}},"context":{"description":"Where you were when you asked (filled in by the app).","type":"object","properties":{"path":{"type":"string","maxLength":300},"app_version":{"type":"string","maxLength":40},"user_agent":{"type":"string","maxLength":300}}}},"required":["subject","body","category"]},"CreateTaskInput":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/TaskType"},"title":{"type":"string","minLength":1,"maxLength":160},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"due_at":{"type":"string","minLength":10,"maxLength":40},"remind_at":{"anyOf":[{"type":"string","minLength":10,"maxLength":40},{"type":"null"}]},"priority":{"$ref":"#/components/schemas/TaskPriority"},"assignee_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"recurrence":{"anyOf":[{"$ref":"#/components/schemas/TaskRecurrenceInput"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["title","due_at"]},"CreateTemplateInput":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/TemplateChannel"},"name":{"type":"string","minLength":1,"maxLength":64},"language":{"default":"en","type":"string","maxLength":8},"display_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"category":{"type":"string","minLength":1,"maxLength":24},"use_case":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"header":{"description":"email: { type: \"email\", subject, text? } · WhatsApp: { type, text? }"},"body":{"type":"string","minLength":1,"maxLength":200000},"footer":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"buttons":{},"variables":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/TemplateVariableInput"}},"dlt_template_id":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}]},"dlt_header":{"anyOf":[{"type":"string","maxLength":11},{"type":"null"}]},"provider_template_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["channel","name","category","body"]},"CreateTowerInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"floors":{"type":"integer","minimum":0,"maximum":200},"basement_levels":{"anyOf":[{"type":"integer","minimum":0,"maximum":10},{"type":"null"}]},"units_per_floor":{"anyOf":[{"type":"integer","minimum":1,"maximum":50},{"type":"null"}]},"stage":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"sort_order":{"type":"integer","minimum":0,"maximum":1000},"layout":{"type":"object","properties":{"numbering":{"type":"object","properties":{"floor_from":{"type":"integer","minimum":-5,"maximum":200},"floor_to":{"type":"integer","minimum":-5,"maximum":200},"units_per_floor":{"type":"integer","minimum":1,"maximum":50},"prefix":{"type":"string","maxLength":10},"stack_digits":{"type":"integer","minimum":1,"maximum":3},"skip_floors":{"maxItems":50,"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"ground":{"type":"string","enum":["0","G"]}},"required":["floor_from","floor_to","units_per_floor"]},"defaults":{"type":"object","properties":{"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"carpet_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"super_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"base_rate":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"status":{"type":"string","enum":["available","not_released"]}}}},"required":["numbering"]}},"required":["name","floors"]},"CreateUnitInput":{"type":"object","properties":{"unit_no":{"type":"string","minLength":1,"maxLength":30},"floor":{"anyOf":[{"type":"integer","minimum":-10,"maximum":200},{"type":"null"}]},"stack":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"carpet_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"builtup_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"super_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"facing":{"anyOf":[{"$ref":"#/components/schemas/Facing"},{"type":"null"}]},"view":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"is_corner":{"type":"boolean"},"base_rate":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"floor_rise":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"total_price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}},"required":["unit_no"]},"CreatedShare":{"type":"object","properties":{"share":{"$ref":"#/components/schemas/Share"},"message_text":{"type":"string","description":"Ready-to-send text with the link."},"whatsapp_url":{"description":"wa.me draft with the message. Carries the lead’s number only when the caller may see it (field rules); otherwise the draft has no number and WhatsApp asks whom to send it to.","type":["string","null"]}},"required":["share","message_text","whatsapp_url"],"additionalProperties":false},"CreditNote":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"},"financial_year":{"type":"string"},"invoice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":["string","null"]},"issued_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","number","issued_on"],"additionalProperties":false},"deal":{"anyOf":[{"$ref":"#/components/schemas/DealLink"},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"reason":{"type":"string"},"reason_note":{"type":["string","null"]},"gst_reversed":{"type":"boolean","description":"False: a commercial credit (no GST reduced)."},"bill_to":{"$ref":"#/components/schemas/FinanceParty"},"place_of_supply":{"type":["string","null"]},"supply_regime":{"type":"string","enum":["intra","inter","none"]},"gst_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lines":{"type":"array","items":{"$ref":"#/components/schemas/FinanceLine"}},"subtotal":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"issued_on":{"$ref":"#/components/schemas/LocalDate"},"issued_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","number","financial_year","invoice","deal","contact","reason","reason_note","gst_reversed","bill_to","place_of_supply","supply_regime","gst_rate_bps","lines","subtotal","cgst","sgst","igst","total","issued_on","issued_by","created_at"],"additionalProperties":false},"CtwaReport":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"from_day":{"$ref":"#/components/schemas/LocalDate"},"to_day":{"$ref":"#/components/schemas/LocalDate"},"days":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from","to","from_day","to_day","days"],"additionalProperties":false},"costs_visible":{"type":"boolean"},"totals":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991},"spend_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cpl_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_qualified_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_deal_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"conversions_sent":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","qualified","qualified_pct","visited","deals","spend_paise","cpl_paise","cost_per_qualified_paise","cost_per_deal_paise","conversions_sent"],"additionalProperties":false},"ads":{"type":"array","items":{"type":"object","properties":{"ad_id":{"type":["string","null"]},"headline":{"type":["string","null"]},"source_url":{"type":["string","null"]},"ad_type":{"type":["string","null"]},"campaign_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"conversions_sent":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991},"spend_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cpl_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_qualified_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_deal_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["ad_id","headline","source_url","ad_type","campaign_ids","conversions_sent","leads","qualified","qualified_pct","visited","deals","spend_paise","cpl_paise","cost_per_qualified_paise","cost_per_deal_paise"],"additionalProperties":false}}},"required":["range","costs_visible","totals","ads"],"additionalProperties":false},"CustomFieldAdmin":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"entity":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"is_required":{"type":"boolean"},"section":{"type":["string","null"]},"help_text":{"type":["string","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visible_to":{"type":"array","items":{"type":"string"},"description":"Role ids that see the field; empty = every role."},"editable_by":{"type":"array","items":{"type":"string"},"description":"Role ids that may change it (among those who see it); empty = everyone who sees it."},"is_active":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","entity","key","label","type","choices","is_required","section","help_text","sort_order","visible_to","editable_by","is_active","created_at"],"additionalProperties":false},"CustomFieldChoice":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["value","label"]},"CustomFieldDefinition":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"entity":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"options":{"description":"Choices and dependent-on rules (select / multiselect)."},"is_required":{"type":"boolean"},"section":{"type":["string","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","entity","key","label","type","options","is_required","section","sort_order"],"additionalProperties":false},"CustomFieldEntity":{"type":"string","enum":["lead","contact","property"]},"CustomFieldKind":{"type":"string","enum":["text","textarea","number","currency","area","date","datetime","select","multiselect","checkbox","phone","email","url"]},"CustomReport":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"description":{"type":["string","null"]},"entity":{"type":"string"},"visibility":{"type":"string","enum":["private","team","company"]},"team":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"spec":{"anyOf":[{"$ref":"#/components/schemas/ReportSpec"},{"type":"null"}],"description":"null for a built-in report (preset)."},"preset":{"type":["string","null"]},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"author":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"mine":{"type":"boolean"},"editable":{"type":"boolean"},"schedules":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","description","entity","visibility","team","spec","preset","version","author","mine","editable","schedules","created_at","updated_at"],"additionalProperties":false},"CustomReportVersion":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string"},"spec":{"anyOf":[{"$ref":"#/components/schemas/ReportSpec"},{"type":"null"}]},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"current":{"type":"boolean"}},"required":["version","name","spec","created_by","created_at","current"],"additionalProperties":false},"CustomerStatement":{"type":"object","properties":{"contact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"billing":{"type":"object","properties":{"legal_name":{"type":"string"},"gstin":{"type":["string","null"]}},"required":["legal_name","gstin"],"additionalProperties":false},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"},"opening":{"$ref":"#/components/schemas/Paise"},"lines":{"type":"array","items":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/LocalDate"},"kind":{"type":"string","enum":["invoice","credit_note","receipt","tds"]},"ref":{"type":"string"},"id":{"type":"string"},"description":{"type":"string"},"debit":{"$ref":"#/components/schemas/Paise"},"credit":{"$ref":"#/components/schemas/Paise"},"balance":{"$ref":"#/components/schemas/Paise"}},"required":["date","kind","ref","id","description","debit","credit","balance"],"additionalProperties":false}},"debit":{"$ref":"#/components/schemas/Paise"},"credit":{"$ref":"#/components/schemas/Paise"},"closing":{"$ref":"#/components/schemas/Paise"},"outstanding":{"$ref":"#/components/schemas/Paise"}},"required":["contact","billing","from","to","opening","lines","debit","credit","closing","outstanding"],"additionalProperties":false},"DailyBriefing":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"day":{"type":"string"},"role":{"type":"string","enum":["agent","manager"]},"content":{"type":"object","properties":{"version":{"type":"number","const":1},"role":{"type":"string","enum":["agent","manager"]},"day":{"type":"string"},"day_label":{"type":"string"},"headline":{"type":"string"},"stats":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value":{"type":"string"},"tone":{"anyOf":[{"type":"string","enum":["danger","warning","success","info"]},{"type":"null"}]},"hint":{"type":["string","null"]}},"required":["key","label","value","tone","hint"],"additionalProperties":false}},"sections":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ref":{"type":["string","null"]},"title":{"type":"string"},"detail":{"type":"string"},"link":{"type":"string"},"tone":{"anyOf":[{"type":"string","enum":["danger","warning","success","info"]},{"type":"null"}]}},"required":["id","ref","title","detail","link","tone"],"additionalProperties":false}},"more":{"type":"integer","minimum":0,"maximum":9007199254740991},"link":{"type":["string","null"]}},"required":["key","title","items","more","link"],"additionalProperties":false}}},"required":["version","role","day","day_label","headline","stats","sections"],"additionalProperties":false},"summary":{"anyOf":[{"type":"object","properties":{"summary":{"type":"string"},"focus":{"type":"string"},"source":{"type":"string","enum":["ai","fallback"]}},"required":["summary","focus","source"],"additionalProperties":false},{"type":"null"}]},"summary_status":{"type":"string","enum":["none","ready","fallback","unavailable","off"]},"ai_summary":{"type":"boolean"},"generated_at":{"$ref":"#/components/schemas/DateTime"},"acknowledged_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"show":{"type":"boolean","description":"Open the “your day” modal: not started from yet today, something to show."}},"required":["id","day","role","content","summary","summary_status","ai_summary","generated_at","acknowledged_at","show"],"additionalProperties":false},"DailyCallTargets":{"type":"object","properties":{"daily_calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"daily_talk_min":{"type":"integer","minimum":0,"maximum":9007199254740991},"is_default":{"type":"boolean"},"source":{"type":"string","enum":["member","team","company","default"]}},"required":["daily_calls","daily_talk_min","is_default","source"],"additionalProperties":false},"DashboardKpi":{"type":"object","properties":{"key":{"type":"string","enum":["new_leads","calls","connected_pct","talk_time","first_response","visits_done","deals_closed","revenue"]},"unit":{"type":"string","enum":["count","percent","seconds","minutes","paise"]},"value":{"description":"null: no base (connected %, first response) or masked.","type":["number","null"]},"previous":{"type":["number","null"]},"change_pct":{"description":"Percent with one decimal; null without a base.","type":["number","null"]},"series":{"type":"array","items":{"type":["number","null"]},"description":"One value per day of `period.days`."},"lower_is_better":{"type":"boolean"},"masked":{"type":"boolean","description":"Money the caller may not see (value, previous and series are null)."},"truncated":{"description":"Computed from the latest leads only: the period had more leads than the sample cap.","type":"boolean"}},"required":["key","unit","value","previous","change_pct","series","lower_is_better","masked"],"additionalProperties":false},"DashboardOverview":{"type":"object","properties":{"period":{"type":"object","properties":{"key":{"type":"string","enum":["today","7d","30d","this_month","last_month"]},"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"previous_from":{"$ref":"#/components/schemas/DateTime"},"previous_to":{"$ref":"#/components/schemas/DateTime"},"days":{"type":"array","items":{"$ref":"#/components/schemas/LocalDate"}}},"required":["key","from","to","previous_from","previous_to","days"],"additionalProperties":false},"scope":{"type":"object","properties":{"kind":{"type":"string","enum":["team","me","member"]},"member":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"can_view_team":{"type":"boolean","description":"Show the scope control (the caller reaches others)."}},"required":["kind","member","can_view_team"],"additionalProperties":false},"members_in_scope":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Active staff in the lens (1 = a solo view: no team board)."},"features":{"type":"object","properties":{"calls":{"type":"boolean"},"call_log":{"type":"boolean"},"call_list":{"type":"boolean"},"visits":{"type":"boolean"},"deals":{"type":"boolean"},"revenue":{"type":"boolean"},"source_costs":{"type":"boolean"},"sla":{"type":"boolean"},"accountability":{"type":"boolean"},"attendance":{"type":"boolean"},"team":{"type":"boolean"}},"required":["calls","call_log","call_list","visits","deals","revenue","source_costs","sla","accountability","attendance","team"],"additionalProperties":false,"description":"Sections the plan and the caller’s permissions allow; hide the others."},"your_day":{"anyOf":[{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"follow_ups_due":{"type":"integer","minimum":0,"maximum":9007199254740991},"follow_ups_overdue":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"new_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"unassigned":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Open leads without an owner (members who assign)."}},"required":["member_id","calls","connected","talk_sec","follow_ups_due","follow_ups_overdue","visits","visits_done","new_leads","unassigned"],"additionalProperties":false},{"type":"null"}],"description":"The caller’s own today, whatever the period and lens (null for API keys)."},"kpis":{"type":"array","items":{"$ref":"#/components/schemas/DashboardKpi"}},"generated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["period","scope","members_in_scope","features","your_day","kpis","generated_at"],"additionalProperties":false},"DashboardPipeline":{"type":"object","properties":{"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_default":{"type":"boolean"}},"required":["id","name","is_default"],"additionalProperties":false}},"pipeline":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"period":{"type":"object","properties":{"key":{"type":"string","enum":["today","7d","30d","this_month","last_month"]},"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"previous_from":{"$ref":"#/components/schemas/DateTime"},"previous_to":{"$ref":"#/components/schemas/DateTime"}},"required":["key","from","to","previous_from","previous_to"],"additionalProperties":false},"totals":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"open":{"type":"integer","minimum":0,"maximum":9007199254740991},"won":{"type":"integer","minimum":0,"maximum":9007199254740991},"lost":{"type":"integer","minimum":0,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":0,"maximum":9007199254740991},"stuck":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","open","won","lost","invalid","stuck"],"additionalProperties":false},"statuses":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"category":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Leads in the status now (live, unmerged, in the lens)."},"share_pct":{"description":"Percent with one decimal; null without a base.","type":["number","null"]},"deal_value_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Open + won deal value; null without deals."},"stuck":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Open leads with no activity for `stuck_days` days or more."}},"required":["id","key","name","color","category","count","share_pct","deal_value_paise","stuck"],"additionalProperties":false}},"funnel":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["leads","contacted","qualified","visited","deals"]},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"previous":{"type":"integer","minimum":0,"maximum":9007199254740991},"conversion_pct":{"description":"Of the stage before.","type":["number","null"]},"of_leads_pct":{"description":"Percent with one decimal; null without a base.","type":["number","null"]}},"required":["key","count","previous","conversion_pct","of_leads_pct"],"additionalProperties":false}},"funnel_out":{"type":"object","properties":{"junk":{"type":"integer","minimum":0,"maximum":9007199254740991},"lost":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["junk","lost"],"additionalProperties":false},"stuck_days":{"type":"integer","minimum":0,"maximum":9007199254740991},"deal_value_visible":{"type":"boolean"}},"required":["pipelines","pipeline","period","totals","statuses","funnel","funnel_out","stuck_days","deal_value_visible"],"additionalProperties":false},"DashboardTeam":{"type":"object","properties":{"period":{"type":"object","properties":{"key":{"type":"string","enum":["today","7d","30d","this_month","last_month"]},"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"}},"required":["key","from","to"],"additionalProperties":false},"attendance_on":{"type":"boolean"},"phones_visible":{"type":"boolean"},"score_day":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}],"description":"Day of the scores (null before the first run)."},"rows":{"type":"array","items":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"role":{"type":"string"},"branch":{"type":["string","null"]},"is_me":{"type":"boolean"}},"required":["id","name","role","branch","is_me"],"additionalProperties":false},"live":{"type":"object","properties":{"status":{"type":"string","enum":["calling","idle","on_break","off","not_in","not_started"],"description":"`calling`: a call ended in the last 10 minutes; `idle` since `since`; with attendance on: `not_in`, `on_break`, `off` (punched out); without it `not_started` = no call yet today."},"since":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["status","since"],"additionalProperties":false},"attendance":{"anyOf":[{"type":"object","properties":{"punch_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"punch_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"on_break":{"type":"boolean"},"late":{"type":"boolean"}},"required":["punch_in_at","punch_out_at","on_break","late"],"additionalProperties":false},{"type":"null"}]},"today":{"type":"object","properties":{"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_call_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_call_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["calls","first_call_at","last_call_at"],"additionalProperties":false},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"follow_ups":{"type":"object","properties":{"done":{"type":"integer","minimum":0,"maximum":9007199254740991},"done_on_time":{"type":"integer","minimum":0,"maximum":9007199254740991},"overdue":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["done","done_on_time","overdue"],"additionalProperties":false},"visits_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals_won":{"type":"integer","minimum":0,"maximum":9007199254740991},"score":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"band":{"anyOf":[{"type":"string","enum":["strong","steady","attention"]},{"type":"null"}]},"trend":{"type":"object","properties":{"delta":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"direction":{"anyOf":[{"type":"string","enum":["up","down","flat"]},{"type":"null"}]}},"required":["delta","direction"],"additionalProperties":false},"weakest":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","enum":["first_response","follow_ups","callbacks","call_notes","stale_leads","hygiene"]},"label":{"type":"string"},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","label","value"],"additionalProperties":false},{"type":"null"}]}},"required":["value","band","trend","weakest"],"additionalProperties":false},{"type":"null"}]},"phone":{"anyOf":[{"type":"object","properties":{"health":{"$ref":"#/components/schemas/DeviceHealthState"},"tracking_enabled":{"type":"boolean"},"last_seen_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"calls":{"$ref":"#/components/schemas/CallHealth"}},"required":["health","tracking_enabled","last_seen_at","calls"],"additionalProperties":false},{"type":"null"}]}},"required":["member","live","attendance","today","calls","connected","talk_sec","follow_ups","visits_done","deals_won","score","phone"],"additionalProperties":false}},"attention":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"reasons":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["low_score","overdue_follow_ups","phone_tracking","calls_failing","quiet_day"]},"message":{"type":"string"}},"required":["key","message"],"additionalProperties":false}}},"required":["member_id","name","reasons"],"additionalProperties":false}},"generated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["period","attendance_on","phones_visible","score_day","rows","attention","generated_at"],"additionalProperties":false},"DateTime":{"type":"string","format":"date-time","description":"Instant in ISO 8601, e.g. 2026-10-03T04:30:00.000Z."},"DeactivateMemberInput":{"type":"object","properties":{"reassign_reports_to_id":{"description":"New manager for their direct reports; default: the leaving member’s own manager.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"DealCapabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"approve":{"type":"boolean","description":"Splits, reopening a closed deal, reversing receipts."},"commission":{"$ref":"#/components/schemas/DealFieldMode"},"splits":{"$ref":"#/components/schemas/DealFieldMode"},"record_receipts":{"type":"boolean"},"payouts":{"type":"boolean"}},"required":["edit","delete","approve","commission","splits","record_receipts","payouts"],"additionalProperties":false},"DealCommission":{"type":"object","properties":{"sides":{"type":"array","items":{"$ref":"#/components/schemas/CommissionSide"}},"gross":{"description":"Expected from both sides.","$ref":"#/components/schemas/Paise"},"co_broker":{"anyOf":[{"type":"object","properties":{"contact":{"anyOf":[{"$ref":"#/components/schemas/DealContactRef"},{"type":"null"}]},"share_pct":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["contact","share_pct","amount"],"additionalProperties":false},{"type":"null"}]},"net":{"description":"Gross less the co-broker share: what the internal splits divide.","$ref":"#/components/schemas/Paise"},"received":{"$ref":"#/components/schemas/Paise"},"outstanding":{"$ref":"#/components/schemas/Paise"}},"required":["sides","gross","co_broker","net","received","outstanding"],"additionalProperties":false},"DealCommissionInput":{"type":"object","properties":{"sides":{"maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/CommissionSideInput"}},"co_broker_contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"co_broker_share_pct":{"description":"Percent of the gross commission.","anyOf":[{"$ref":"#/components/schemas/DecimalInput"},{"type":"null"}]}},"required":["sides"]},"DealContactRef":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"DealDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string","examples":["D-1024"]},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"$ref":"#/components/schemas/DealType"},"kind":{"$ref":"#/components/schemas/DealKind"},"stage":{"$ref":"#/components/schemas/DealStage"},"title":{"type":"string"},"contact":{"$ref":"#/components/schemas/DealContactRef"},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"}},"required":["id","ref"],"additionalProperties":false},{"type":"null"}]},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"}},"required":["id","ref_code","title"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"unit":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"}},"required":["id","unit_no"],"additionalProperties":false},{"type":"null"}]},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"agreed_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Sale price, or the monthly rent of a rental."},"token_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"token_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"agreement_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"registration_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"handover_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"commission_amount":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},{"type":"string"}]},"commission_received":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"string"}]},"lost_reason":{"type":["string","null"]},"closed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"parties":{"type":"array","items":{"$ref":"#/components/schemas/DealParty"}},"token_mode":{"anyOf":[{"$ref":"#/components/schemas/PaymentMode"},{"type":"null"}]},"commission_basis":{"type":["string","null"]},"commission_rate":{"type":["string","null"]},"commission":{"description":"Field rule deal.commission: absent when hidden, null when masked.","anyOf":[{"$ref":"#/components/schemas/DealCommission"},{"type":"null"}]},"splits":{"description":"Field rule deal.splits: absent when hidden, null when masked.","anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/DealSplit"}},{"type":"null"}]},"documents":{"type":"array","items":{"$ref":"#/components/schemas/DealDocument"}},"notes":{"type":["string","null"]},"renewal_of_agreement_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"capabilities":{"$ref":"#/components/schemas/DealCapabilities"}},"required":["id","ref","number","type","kind","stage","title","contact","lead","property","project","unit","owner","agreed_value","token_amount","token_date","agreement_date","registration_date","handover_date","lost_reason","closed_at","created_at","updated_at","parties","token_mode","commission_basis","documents","notes","renewal_of_agreement_id","capabilities"],"additionalProperties":false},"DealDocument":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"$ref":"#/components/schemas/DealDocumentKind"},"name":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receipt_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"uploaded_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"uploaded_at":{"$ref":"#/components/schemas/DateTime"},"scan_status":{"anyOf":[{"$ref":"#/components/schemas/FileScanStatus"},{"type":"null"}]}},"required":["id","kind","name","content_type","size","receipt_id","uploaded_by","uploaded_at","scan_status"],"additionalProperties":false},"DealDocumentKind":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"DealDocumentPresignInput":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/DealDocumentKind"},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","filename","content_type","size"]},"DealFieldMode":{"type":"string","enum":["hidden","masked","visible"]},"DealFinance":{"type":"object","properties":{"deal":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"title":{"type":"string"},"stage":{"type":"string"}},"required":["id","ref","title","stage"],"additionalProperties":false},"commission":{"type":"object","properties":{"expected":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"received":{"$ref":"#/components/schemas/Paise"},"outstanding":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["expected","received","outstanding"],"additionalProperties":false},"sides":{"type":"array","items":{"type":"object","properties":{"side":{"type":"string"},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_name":{"type":["string","null"]},"expected":{"$ref":"#/components/schemas/Paise"},"invoiced":{"$ref":"#/components/schemas/Paise"},"remaining":{"$ref":"#/components/schemas/Paise"}},"required":["side","contact_id","contact_name","expected","invoiced","remaining"],"additionalProperties":false}},"invoices":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"credit_notes":{"type":"array","items":{"$ref":"#/components/schemas/CreditNote"}},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/Receipt"}},"payouts":{"type":"array","items":{"$ref":"#/components/schemas/CommissionPayout"}},"timeline":{"type":"array","items":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/LocalDate"},"kind":{"type":"string","enum":["invoice","credit_note","receipt","payout"]},"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"title":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string"}},"required":["date","kind","id","ref","title","amount","status"],"additionalProperties":false}},"capabilities":{"type":"object","properties":{"invoice":{"type":"boolean"},"payout":{"type":"boolean"}},"required":["invoice","payout"],"additionalProperties":false}},"required":["deal","commission","sides","invoices","credit_notes","receipts","payouts","timeline","capabilities"],"additionalProperties":false},"DealGuard":{"type":"object","properties":{"enabled":{"type":"boolean"},"sale":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/StageRule"}},"rent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/StageRule"}},"stages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","name","category","order"],"additionalProperties":false}},"rent_stages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","name","category","order"],"additionalProperties":false},"description":"Rental deals add the offer stages and move-in (R-01)."},"recommended":{"type":"object","properties":{"sale":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/StageRule"}},"rent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/StageRule"}}},"required":["sale","rent"],"additionalProperties":false}},"required":["enabled","sale","rent","stages","rent_stages","recommended"],"additionalProperties":false},"DealKind":{"type":"string","enum":["resale","new_booking","rental"],"description":"resale (a listing), new_booking (a project or unit, CP brokerage) or rental (rent / lease)."},"DealLink":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"title":{"type":"string"}},"required":["id","ref","title"],"additionalProperties":false},"DealNextSteps":{"type":"object","properties":{"guard_enabled":{"type":"boolean"},"current":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false},"checklist":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"required":{"type":"boolean"},"done":{"type":"boolean"},"source":{"anyOf":[{"type":"string","enum":["manual","evidence"]},{"type":"null"}]},"manual":{"type":"boolean","description":"Ticked by hand (items with evidence tick themselves)."}},"required":["key","label","required","done","source","manual"],"additionalProperties":false}},"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"allowed":{"type":"boolean"},"needs_approval":{"type":"boolean","description":"Only an approval is missing: the move can be asked for."},"reasons":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"Why not (empty when allowed)."}},"required":["key","name","category","allowed","needs_approval","reasons"],"additionalProperties":false}},"can_override":{"type":"boolean"}},"required":["guard_enabled","current","checklist","steps","can_override"],"additionalProperties":false},"DealPartiesInput":{"type":"object","properties":{"buyer_contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"seller_contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tenant_contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"landlord_contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"DealParty":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/DealPartyRole"},"contact":{"$ref":"#/components/schemas/DealContactRef"}},"required":["role","contact"],"additionalProperties":false},"DealPartyRole":{"type":"string","enum":["buyer","seller","tenant","landlord"]},"DealSplit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"member":{"$ref":"#/components/schemas/MemberRef"},"role":{"anyOf":[{"$ref":"#/components/schemas/SplitRole"},{"type":"null"}]},"share_pct":{"type":"string"},"amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["id","member","role","share_pct","amount"],"additionalProperties":false},"DealSplitsInput":{"type":"object","properties":{"splits":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"role":{"anyOf":[{"$ref":"#/components/schemas/SplitRole"},{"type":"null"}]},"share_pct":{"$ref":"#/components/schemas/DecimalInput"}},"required":["member_id","share_pct"]}}},"required":["splits"]},"DealStage":{"type":"string","enum":["negotiation","offer_made","owner_review","accepted","token","agreement","registration","move_in","closed_won","closed_lost"],"description":"offer_made, owner_review, accepted and move_in belong to rental deals only (R-01)."},"DealStageSummary":{"type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/DealStage"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value":{"description":"Sale values of the stage’s sale deals.","$ref":"#/components/schemas/Paise"},"rent":{"description":"Monthly rents of the stage’s rental deals (R-01).","$ref":"#/components/schemas/Paise"},"commission":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Null unless deal.commission is visible."}},"required":["stage","count","value","rent","commission"],"additionalProperties":false}}},"required":["stages"],"additionalProperties":false},"DealSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string","examples":["D-1024"]},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"$ref":"#/components/schemas/DealType"},"kind":{"$ref":"#/components/schemas/DealKind"},"stage":{"$ref":"#/components/schemas/DealStage"},"title":{"type":"string"},"contact":{"$ref":"#/components/schemas/DealContactRef"},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"}},"required":["id","ref"],"additionalProperties":false},{"type":"null"}]},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"}},"required":["id","ref_code","title"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"unit":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"}},"required":["id","unit_no"],"additionalProperties":false},{"type":"null"}]},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"agreed_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Sale price, or the monthly rent of a rental."},"token_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"token_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"agreement_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"registration_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"handover_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"commission_amount":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},{"type":"string"}]},"commission_received":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"string"}]},"lost_reason":{"type":["string","null"]},"closed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","ref","number","type","kind","stage","title","contact","lead","property","project","unit","owner","agreed_value","token_amount","token_date","agreement_date","registration_date","handover_date","lost_reason","closed_at","created_at","updated_at"],"additionalProperties":false},"DealType":{"type":"string","enum":["sale","rent","lease"]},"DecimalInput":{"description":"A decimal such as 2 or 2.5 (number or string).","anyOf":[{"type":"number","minimum":0},{"type":"string","pattern":"^\\d{1,4}(?:\\.\\d{1,3})?$"}]},"DeductionResponseInput":{"type":"object","properties":{"response":{"type":"string","enum":["accept","dispute"]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["response"]},"DeletedLead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string","examples":["L-10234"]},"lead_type":{"$ref":"#/components/schemas/LeadType"},"temperature":{"anyOf":[{"$ref":"#/components/schemas/Temperature"},{"type":"null"}]},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"score_probability":{"description":"The company’s model: chance of a site visit or booking within 14 days (null: rules score).","anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"probability_band":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"pipeline_id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/LeadStatusRef"},"sub_status":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"}},"required":["id","key","name"],"additionalProperties":false},{"type":"null"}]},"status_changed_at":{"$ref":"#/components/schemas/DateTime"},"contact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"city":{"type":["string","null"]},"is_nri":{"type":"boolean"},"country":{"type":["string","null"]}},"required":["id","name","city","is_nri","country"],"additionalProperties":false},"tags":{"type":"array","items":{"type":"string"}},"flags":{"description":"One-click attention flags (CMP-02).","type":"array","items":{"type":"string","enum":["escalate","about_to_convert","highlight"]}},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"presales":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"},"last_enquiry_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"next_follow_up_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_activity_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_contacted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"enquiry_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"call_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connected_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate_kind":{"type":["string","null"]},"duplicate_of_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"expected_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"requirement":{"anyOf":[{"type":"object","properties":{"budget_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"budget_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"bhk":{"type":"array","items":{"type":"number"}},"property_types":{"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"locality_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"location_text":{"type":["string","null"]}},"required":["budget_min","budget_max","bhk","property_types","locality_ids","location_text"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"deleted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"deleted_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"delete_reason":{"anyOf":[{"type":"string","enum":["manual","bulk","merge","erasure","import_rollback"]},{"type":"null"}],"description":"manual or bulk (null: deleted before reasons were recorded)."}},"required":["id","number","ref","lead_type","temperature","score","pipeline_id","status","sub_status","status_changed_at","contact","tags","owner","presales","source","project_id","property_id","received_at","last_enquiry_at","next_follow_up_at","last_activity_at","last_contacted_at","enquiry_count","call_attempts","connected_calls","duplicate_kind","duplicate_of_id","expected_value","requirement","created_at","updated_at","deleted_at","deleted_by","delete_reason"],"additionalProperties":false},"DepositDeduction":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source":{"type":"string","enum":["damage","missing_item","utilities","cleaning","keys","unpaid_rent","repair","other"]},"source_label":{"type":"string"},"ref":{"description":"The comparison difference (item:<room>.<item>, meter:<k> …).","type":["string","null"]},"inspection_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"label":{"type":"string"},"detail":{"type":["string","null"]},"basis":{"type":["string","null"]},"proposed_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"amount":{"$ref":"#/components/schemas/Paise"},"counted":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Decided: accepted amount, resolved amount, 0 when waived."},"status":{"type":"string","enum":["draft","proposed","accepted","disputed","resolved","waived"]},"status_label":{"type":"string"},"tenant_note":{"type":["string","null"]},"responded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"responded_via":{"type":["string","null"]},"final_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"resolution_note":{"type":["string","null"]},"resolved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"waive_reason":{"type":["string","null"]},"proposed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"needs_amount":{"type":"boolean"},"can":{"type":"object","properties":{"edit":{"type":"boolean"},"waive":{"type":"boolean"},"respond":{"type":"boolean"},"resolve":{"type":"boolean"}},"required":["edit","waive","respond","resolve"],"additionalProperties":false}},"required":["id","source","source_label","ref","inspection_id","label","detail","basis","proposed_amount","amount","counted","status","status_label","tenant_note","responded_at","responded_via","final_amount","resolution_note","resolved_at","waive_reason","proposed_at","needs_amount","can"],"additionalProperties":false},"DepositEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["received","retained","refund","reversal"]},"kind_label":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"holder":{"type":"string"},"mode":{"type":["string","null"]},"reference":{"type":["string","null"]},"occurred_on":{"$ref":"#/components/schemas/LocalDate"},"note":{"type":["string","null"]},"source":{"type":"string","description":"member | escrow | system"},"reversed":{"type":"boolean"},"reverses_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"recorded_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"can_reverse":{"type":"boolean"}},"required":["id","kind","kind_label","amount","holder","mode","reference","occurred_on","note","source","reversed","reverses_id","recorded_by","created_at","can_reverse"],"additionalProperties":false},"DepositEscrowInput":{"type":"object","properties":{"action":{"type":"string","enum":["open","release","sync"]}},"required":["action"]},"DescribedLead":{"type":"object","properties":{"lead_type":{"type":"string","enum":["buy","rent","sell","let_out","invest"]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"campaign_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sub_source":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"channel":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"team_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"temperature":{"anyOf":[{"type":"string","enum":["hot","warm","cold"]},{"type":"null"}]},"budget_min":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"budget_max":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"bhk":{"maxItems":10,"type":"array","items":{"type":"number","minimum":0.5,"maximum":20}},"property_types":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}},"locality_ids":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"category":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"language":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]},"is_nri":{"type":"boolean"},"tags":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":60}}}},"Developer":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"website":{"type":["string","null"]},"rera_promoter_numbers":{"type":"array","items":{"type":"string"}},"logo_url":{"type":["string","null"]},"notes":{"type":["string","null"]},"projects_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","website","rera_promoter_numbers","logo_url","notes","projects_count"],"additionalProperties":false},"DeveloperInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"website":{"anyOf":[{"type":"string","maxLength":300,"format":"uri"},{"type":"null"}]},"rera_promoter_numbers":{"maxItems":20,"type":"array","items":{"type":"string","minLength":3,"maxLength":80}},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["name"]},"DeviceHealthState":{"type":"string","enum":["healthy","stale","permission","tracking_off","not_installed"]},"DialPick":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"lane":{"type":"string","enum":["callback","due","fresh","smart"]},"score":{"type":"number"},"p_answer":{"type":"number"},"reasons":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["red","amber","blue","green","grey","violet"]}},"required":["key","text","tone"],"additionalProperties":false}},"attempt":{"type":"integer","minimum":0,"maximum":9007199254740991},"unanswered":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected_before":{"type":"boolean"},"better_hour":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","lane","score","p_answer","reasons","attempt","unanswered","connected_before","better_hour"],"additionalProperties":false},"DltSetup":{"type":"object","properties":{"configured":{"type":"boolean"},"entity_id":{"type":["string","null"]},"entity_name":{"type":["string","null"]},"provider":{"type":"string","const":"msg91"},"api":{"type":"string","enum":["flow","sendsms"]},"has_auth_key":{"type":"boolean"},"webhook_configured":{"type":"boolean"},"headers":{"type":"array","items":{"$ref":"#/components/schemas/ChannelAccount"}}},"required":["configured","entity_id","entity_name","provider","api","has_auth_key","webhook_configured","headers"],"additionalProperties":false},"DnsRecord":{"type":"object","properties":{"type":{"type":"string","enum":["TXT","CNAME","MX"]},"host":{"type":"string"},"value":{"type":"string"},"purpose":{"type":"string","enum":["spf","dkim","dmarc"]},"required":{"type":"boolean"},"note":{"type":"string"},"status":{"type":"string"}},"required":["type","host","value","purpose","required","note"],"additionalProperties":false},"DownloadUrl":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["url","expires_at"],"additionalProperties":false,"description":"A short-lived signed download URL."},"ESignEnvelope":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["preparing","sent","partially_signed","signed","declined","expired","cancelled","failed"]},"provider":{"type":"string"},"signing_order":{"type":"string"},"document_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"estamp":{"anyOf":[{"type":"object","properties":{"state":{"type":"string"},"denomination":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string"},"certificate_no":{"type":["string","null"]}},"required":["state","denomination","status","certificate_no"],"additionalProperties":false},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"cancel_reason":{"type":["string","null"]},"has_signed_pdf":{"type":"boolean"},"has_audit_trail":{"type":"boolean"},"signers":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"role":{"type":"string"},"name":{"type":"string"},"phone":{"description":"Masked.","type":["string","null"]},"sign_type":{"type":"string"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"aadhaar_masked":{"description":"\"XXXX XXXX 1234\" — never the number.","type":["string","null"]},"certificate_name":{"type":["string","null"]},"link_status":{"type":"string"},"invited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"blocked_reason":{"type":["string","null"]}},"required":["id","role","name","phone","sign_type","order","status","signed_at","aadhaar_masked","certificate_name","link_status","invited_at","opened_at","blocked_reason"],"additionalProperties":false}},"events":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"source":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["kind","source","created_at"],"additionalProperties":false}}},"required":["id","status","provider","signing_order","document_version","estamp","expires_at","sent_at","completed_at","last_error","cancel_reason","has_signed_pdf","has_audit_trail","signers","events"],"additionalProperties":false},"ESignSettings":{"type":"object","properties":{"configured":{"type":"boolean","description":"PropZolo’s partner keys are set in the console."},"provider":{"type":["string","null"]},"credits":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string"},"denomination":{"$ref":"#/components/schemas/Paise"},"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["state","denomination","available"],"additionalProperties":false}},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"state":{"type":"string"},"denomination":{"$ref":"#/components/schemas/Paise"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string"},"note":{"type":["string","null"]},"balance_after":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","state","denomination","quantity","kind","note","balance_after","created_at"],"additionalProperties":false}}},"required":["configured","provider","credits","entries"],"additionalProperties":false},"EffectivePermissions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/PermissionValue"},"description":"Flattened permissions after owner, grant and API-key rules."},"EmailReplySettings":{"type":"object","properties":{"capture":{"type":"boolean","description":"Replies come back to PropZolo (the inbound email domain is set up)."},"forward_to_agent":{"type":"boolean"}},"required":["capture","forward_to_agent"],"additionalProperties":false},"EmailReputation":{"type":"object","properties":{"paused":{"type":"boolean"},"reason":{"type":["string","null"]},"pause_reason":{"anyOf":[{"type":"string","enum":["bounce_rate","complaint_rate"]},{"type":"null"}]},"paused_at":{"type":["string","null"]},"resumed_at":{"type":["string","null"]},"checked_at":{"type":["string","null"]},"window_from":{"type":["string","null"]},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bounces":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"complaints":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bounce_rate":{"type":"number"},"complaint_rate":{"type":"number"},"limits":{"type":"object","properties":{"bounce_rate":{"type":"number"},"complaint_rate":{"type":"number"},"min_sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["bounce_rate","complaint_rate","min_sent"],"additionalProperties":false},"sending_quota":{"description":"INT-39: the daily cap for non-transactional email and the warm-up of new domains.","type":"object","properties":{"day":{"type":"string","description":"The company’s local date the counts are for (YYYY-MM-DD)."},"used":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Non-transactional emails counted today."},"cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resets_at":{"type":"string"},"warmup":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"used":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ends_at":{"type":"string"}},"required":["domain","day","days","cap","used","ends_at"],"additionalProperties":false}}},"required":["day","used","cap","resets_at","warmup"],"additionalProperties":false},"replies":{"$ref":"#/components/schemas/EmailReplySettings"}},"required":["paused","reason","pause_reason","paused_at","resumed_at","checked_at","window_from","sent","bounces","complaints","bounce_rate","complaint_rate","limits"],"additionalProperties":false},"EmailSyncOverview":{"type":"object","properties":{"policy":{"type":"object","properties":{"enabled":{"type":"boolean"},"providers":{"type":"object","properties":{"google":{"type":"boolean"},"microsoft":{"type":"boolean"}},"required":["google","microsoft"],"additionalProperties":false},"window_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days a newly connected mailbox reaches back (0–90)."},"content":{"type":"string","enum":["full","headers"],"description":"full: text and HTML bodies · headers: subject, participants and a short preview."}},"required":["enabled","providers","window_days","content"],"additionalProperties":false},"platform":{"type":"object","properties":{"google":{"type":"boolean"},"microsoft":{"type":"boolean"}},"required":["google","microsoft"],"additionalProperties":false,"description":"PropZolo’s OAuth app for the provider is set up (super-admin console)."},"can_connect":{"type":"boolean","description":"The caller holds inbox.sync_email."},"consent":{"type":"object","properties":{"version":{"type":"string"},"points":{"type":"array","items":{"type":"string"}}},"required":["version","points"],"additionalProperties":false},"mailboxes":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}}},"required":["policy","platform","can_connect","consent","mailboxes"],"additionalProperties":false},"EmailSyncPolicy":{"type":"object","properties":{"enabled":{"type":"boolean"},"providers":{"type":"object","properties":{"google":{"type":"boolean"},"microsoft":{"type":"boolean"}},"required":["google","microsoft"],"additionalProperties":false},"window_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days a newly connected mailbox reaches back (0–90)."},"content":{"type":"string","enum":["full","headers"],"description":"full: text and HTML bodies · headers: subject, participants and a short preview."},"internal_domains":{"type":"array","items":{"type":"string"},"description":"The company’s own domains: colleagues, never contacts."},"excluded":{"type":"array","items":{"type":"string"},"description":"Addresses and domains whose emails are never synced."},"changed_at":{"type":["string","null"]},"changed_by_id":{"type":["string","null"]}},"required":["enabled","providers","window_days","content","internal_domains","excluded","changed_at","changed_by_id"],"additionalProperties":false},"EmailSyncPolicyInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"providers":{"type":"object","properties":{"google":{"type":"boolean"},"microsoft":{"type":"boolean"}},"required":["google","microsoft"]},"window_days":{"type":"integer","minimum":0,"maximum":90},"content":{"type":"string","enum":["full","headers"]},"internal_domains":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":260}},"excluded":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":260}}},"required":["enabled","providers","window_days","content","internal_domains","excluded"]},"EmailSyncPolicyView":{"type":"object","properties":{"policy":{"$ref":"#/components/schemas/EmailSyncPolicy"},"platform":{"type":"object","properties":{"google":{"type":"boolean"},"microsoft":{"type":"boolean"}},"required":["google","microsoft"],"additionalProperties":false,"description":"PropZolo’s OAuth app for the provider is set up (super-admin console)."},"retention":{"type":"object","properties":{"enabled":{"type":"boolean"},"keep_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","keep_days"],"additionalProperties":false},"mailboxes":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}}},"required":["policy","platform","retention","mailboxes"],"additionalProperties":false},"EmailSyncProvider":{"type":"string","enum":["google","microsoft"],"description":"google (Gmail) or microsoft (Microsoft 365 / Outlook)."},"EngagementReport":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"shares":{"type":"object","properties":{"sent":{"type":"integer","minimum":0,"maximum":9007199254740991},"opened":{"type":"integer","minimum":0,"maximum":9007199254740991},"views":{"type":"integer","minimum":0,"maximum":9007199254740991},"view_seconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"hot":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits_after":{"type":"integer","minimum":0,"maximum":9007199254740991},"open_rate":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"avg_seconds_per_open":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"view_to_visit_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]}},"required":["sent","opened","views","view_seconds","hot","visits_after","open_rate","avg_seconds_per_open","view_to_visit_pct"],"additionalProperties":false},"by_channel":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string"},"sent":{"type":"integer","minimum":0,"maximum":9007199254740991},"opened":{"type":"integer","minimum":0,"maximum":9007199254740991},"views":{"type":"integer","minimum":0,"maximum":9007199254740991},"view_seconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"hot":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits_after":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["channel","sent","opened","views","view_seconds","hot","visits_after"],"additionalProperties":false}},"by_member":{"type":"array","items":{"type":"object","properties":{"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"sent":{"type":"integer","minimum":0,"maximum":9007199254740991},"opened":{"type":"integer","minimum":0,"maximum":9007199254740991},"views":{"type":"integer","minimum":0,"maximum":9007199254740991},"view_seconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"hot":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits_after":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["member_id","name","sent","opened","views","view_seconds","hot","visits_after"],"additionalProperties":false}},"matching":{"type":"object","properties":{"suggested":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_matched":{"type":"integer","minimum":0,"maximum":9007199254740991},"by_status":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["status","count"],"additionalProperties":false}}},"required":["suggested","leads_matched","by_status"],"additionalProperties":false}},"required":["range","shares","by_channel","by_member","matching"],"additionalProperties":false},"EnquiryForm":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_active":{"type":"boolean"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FormField"}},"consent_text":{"type":["string","null"]},"consent_version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Bumped whenever the consent text changes."},"consent_required":{"type":"boolean"},"otp_required":{"type":"boolean"},"spam_protection":{"$ref":"#/components/schemas/FormSpamProtection"},"success_action":{"$ref":"#/components/schemas/FormSuccessAction"},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"submit_label":{"type":"string"},"allowed_origins":{"type":"array","items":{"type":"string"},"description":"Websites allowed to embed the form (CSP frame-ancestors)."},"lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"submissions":{"type":"integer","minimum":0,"maximum":9007199254740991},"public_url":{"type":"string"},"embed_url":{"type":"string","description":"The iframe URL (allowed websites signed in)."},"embed_snippet":{"type":"string"},"landing_pages":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"},"slug":{"type":"string"}},"required":["id","title","slug"],"additionalProperties":false}},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","is_active","source_id","project_id","fields","consent_text","consent_version","consent_required","otp_required","spam_protection","success_action","title","description","submit_label","allowed_origins","lead_type","submissions","public_url","embed_url","embed_snippet","landing_pages","created_at","updated_at"],"additionalProperties":false},"EnquiryOutcome":{"type":"string","enum":["created","reenquiry","duplicate_labelled","reopened"]},"ErrorCode":{"type":"string","enum":["UNAUTHENTICATED","FORBIDDEN","STEP_UP_REQUIRED","NOT_FOUND","VALIDATION","CONFLICT","RATE_LIMITED","PLAN_LIMIT","UPGRADE_REQUIRED","INTEGRATION","INTERNAL"],"description":"UNAUTHENTICATED 401 · FORBIDDEN 403 · NOT_FOUND 404 · VALIDATION 422 · CONFLICT 409 · RATE_LIMITED 429 · PLAN_LIMIT 402 · INTEGRATION 502 · INTERNAL 500"},"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"Safe to show to the user."},"fields":{"description":"Field path → message, e.g. { \"phones.0.e164\": \"Invalid phone number\" }.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"request_id":{"type":"string","description":"Echoed in the X-Request-Id header; quote it to support."}},"required":["code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"Facing":{"type":"string","enum":["north","south","east","west","north_east","north_west","south_east","south_west"]},"FcmToken":{"type":"string","pattern":"^(?:[A-Za-z0-9:_.-]{32,4096}|Expo(?:nent)?PushToken\\[[A-Za-z0-9_-]{8,200}\\])$","description":"Push token of this install: an FCM registration token (Android) or an Expo push token (iPhone)."},"Features":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"},"description":"Plan features after per-tenant overrides."},"FieldMapping":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":200},"additionalProperties":{"$ref":"#/components/schemas/MappingTarget"},"description":"Incoming key (dotted for nested JSON / XML, matched case-insensitively) → PropZolo field.","examples":[{"SenderMobile":"phone","QueryInfo":"message","lead.budget":"budget","remarks":"ignore"}]},"FieldReport":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"},"rows":{"type":"array","items":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/LocalDate"},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"branch":{"type":["string","null"]}},"required":["id","name","branch"],"additionalProperties":false},"punch_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"punch_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"worked_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits_planned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits_done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits_with_gps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits_flagged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"distance_m":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"idle_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["date","member","punch_in_at","punch_out_at","worked_minutes","visits_planned","visits_done","visits_with_gps","visits_flagged","distance_m","idle_minutes"],"additionalProperties":false}},"totals":{"type":"object","properties":{"visits_planned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits_done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits_with_gps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"distance_m":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["visits_planned","visits_done","visits_with_gps","distance_m"],"additionalProperties":false}},"required":["from","to","rows","totals"],"additionalProperties":false},"FileScanStatus":{"type":"string","enum":["pending","clean","infected","not_scanned","failed"]},"FilterNode":{"description":"PropZolo filter: { all: [...] } | { any: [...] } | { not: … } | { field, op, value }"},"FinanceDashboard":{"type":"object","properties":{"period":{"type":"string","enum":["month","quarter","fy"]},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"},"invoiced":{"$ref":"#/components/schemas/Paise"},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credited":{"$ref":"#/components/schemas/Paise"},"net_invoiced":{"$ref":"#/components/schemas/Paise"},"gst_output":{"type":"object","properties":{"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"}},"required":["cgst","sgst","igst","total"],"additionalProperties":false},"collected":{"$ref":"#/components/schemas/Paise"},"tds_by_customers":{"$ref":"#/components/schemas/Paise"},"receivables":{"type":"object","properties":{"buckets":{"type":"object","properties":{"not_due":{"$ref":"#/components/schemas/Paise"},"d1_30":{"$ref":"#/components/schemas/Paise"},"d31_60":{"$ref":"#/components/schemas/Paise"},"d61_90":{"$ref":"#/components/schemas/Paise"},"d90_plus":{"$ref":"#/components/schemas/Paise"}},"required":["not_due","d1_30","d31_60","d61_90","d90_plus"],"additionalProperties":false},"counts":{"type":"object","properties":{"not_due":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"d1_30":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"d31_60":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"d61_90":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"d90_plus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["not_due","d1_30","d31_60","d61_90","d90_plus"],"additionalProperties":false},"outstanding":{"$ref":"#/components/schemas/Paise"},"overdue":{"$ref":"#/components/schemas/Paise"},"credit":{"$ref":"#/components/schemas/Paise"}},"required":["buckets","counts","outstanding","overdue","credit"],"additionalProperties":false},"drafts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payouts":{"type":"object","properties":{"pending":{"$ref":"#/components/schemas/Paise"},"approved":{"$ref":"#/components/schemas/Paise"},"releasable":{"$ref":"#/components/schemas/Paise"},"paid":{"$ref":"#/components/schemas/Paise"},"tds_deducted":{"$ref":"#/components/schemas/Paise"}},"required":["pending","approved","releasable","paid","tds_deducted"],"additionalProperties":false},"tds":{"type":"object","properties":{"payable":{"$ref":"#/components/schemas/Paise"},"next_due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["payable","next_due_on"],"additionalProperties":false},"loan_commissions":{"anyOf":[{"type":"object","properties":{"accrued":{"$ref":"#/components/schemas/Paise"},"received":{"$ref":"#/components/schemas/Paise"},"pending":{"$ref":"#/components/schemas/Paise"}},"required":["accrued","received","pending"],"additionalProperties":false},{"type":"null"}]}},"required":["period","from","to","invoiced","invoices","credited","net_invoiced","gst_output","collected","tds_by_customers","receivables","drafts","payouts","tds","loan_commissions"],"additionalProperties":false},"FinanceLine":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":{"type":"string"},"sac":{"type":"string"},"side":{"type":["string","null"]},"taxable":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"}},"required":["index","description","sac","side","taxable","cgst","sgst","igst","total"],"additionalProperties":false},"FinanceParty":{"type":"object","properties":{"legal_name":{"type":"string"},"gstin":{"type":["string","null"]},"pan":{"type":["string","null"]},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"pincode":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["legal_name"],"additionalProperties":false},"FinanceSettings":{"type":"object","properties":{"gst":{"type":"object","properties":{"registration":{"type":"string","enum":["regular","composition","unregistered"]},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sac_sale":{"type":"string"},"sac_rent":{"type":"string"},"sac_land":{"type":"string"}},"required":["registration","rate_bps","sac_sale","sac_rent","sac_land"],"additionalProperties":false},"invoice":{"type":"object","properties":{"prefix":{"type":"string"},"credit_note_prefix":{"type":"string"},"pad":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"due_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"backdate_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"round_total":{"type":"boolean"},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"signatory_name":{"type":["string","null"]},"signatory_designation":{"type":["string","null"]},"show_upi_qr":{"type":"boolean"},"upi_vpa":{"type":["string","null"]}},"required":["prefix","credit_note_prefix","pad","due_days","backdate_days","round_total","terms","notes","signatory_name","signatory_designation","show_upi_qr","upi_vpa"],"additionalProperties":false},"bank":{"anyOf":[{"type":"object","properties":{"account_name":{"type":"string"},"account_number":{"type":"string"},"ifsc":{"type":"string"},"bank_name":{"type":"string"},"branch":{"type":["string","null"]}},"required":["account_name","account_number","ifsc","bank_name","branch"],"additionalProperties":false},{"type":"null"}]},"payouts":{"type":"object","properties":{"release_rule":{"$ref":"#/components/schemas/PayoutReleaseRule"},"payee_gst_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["release_rule","payee_gst_rate_bps"],"additionalProperties":false},"tds":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"reminders":{"type":"object","properties":{"customer":{"type":"boolean"},"days_after_due":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["customer","days_after_due"],"additionalProperties":false},"company":{"type":"object","properties":{"legal_name":{"type":"string"},"gstin":{"type":["string","null"]},"pan":{"type":["string","null"]},"state":{"type":["string","null"]}},"required":["legal_name","gstin","pan","state"],"additionalProperties":false,"description":"From the company profile (Settings → Company → RERA & GST)."},"can_edit":{"type":"boolean"}},"required":["gst","invoice","bank","payouts","tds","reminders","company","can_edit"],"additionalProperties":false},"FirstResponseSlaSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"default_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":10080},{"type":"null"}]},"per_source":{"type":"object","propertyNames":{"$ref":"#/components/schemas/Id"},"additionalProperties":{"anyOf":[{"type":"integer","minimum":1,"maximum":10080},{"type":"null"}]}},"at_risk_percent":{"type":"integer","minimum":10,"maximum":99},"clock":{"type":"string","enum":["business","calendar"]},"notify_manager":{"type":"boolean"},"digest_enabled":{"type":"boolean"},"digest_time":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}},"required":["enabled","default_minutes","per_source","at_risk_percent","clock","notify_manager","digest_enabled","digest_time"],"additionalProperties":false},"FollowUpPreset":{"type":"string","enum":["in_1h","this_evening","tomorrow_9am","tomorrow_10am","next_monday_10am"]},"FollowupAgentSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"channels":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]}},"autopilot_allowed":{"type":"boolean"},"autopilot_goals":{"maxItems":4,"type":"array","items":{"type":"string","enum":["site_visit","documents","decision","revive"]}},"window":{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false,"description":"Sending hours, company clock (09:00–21:00 at most)."},"working_days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"1 = Monday … 7 = Sunday."},"cool_down_hours":{"type":"integer","minimum":12,"maximum":336},"max_touches":{"type":"integer","minimum":1,"maximum":10},"default_deadline_days":{"type":"integer","minimum":1,"maximum":60},"approval_ttl_hours":{"type":"integer","minimum":1,"maximum":72},"call_after":{"type":"integer","minimum":1,"maximum":5},"templates":{"type":"object","properties":{"whatsapp_cloud":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sms":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["whatsapp_cloud","sms"],"additionalProperties":false}},"required":["enabled","channels","autopilot_allowed","autopilot_goals","window","working_days","cool_down_hours","max_touches","default_deadline_days","approval_ttl_hours","call_after","templates"],"additionalProperties":false},"FollowupApproval":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"goal_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"channel":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]},"status":{"type":"string","enum":["drafting","pending_approval","approved","sent","task_created","rejected","expired","blocked","cancelled"]},"planned_at":{"$ref":"#/components/schemas/DateTime"},"text":{"description":"What went (or will go): the person’s edit, else the AI draft.","type":["string","null"]},"draft_text":{"type":["string","null"]},"edited":{"type":"boolean"},"language":{"type":["string","null"]},"ai_status":{"description":"pending | done | flagged | fallback","type":["string","null"]},"ai_note":{"type":["string","null"]},"auto":{"type":"boolean","description":"Approved by autopilot (or a call task), not a person."},"decided_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decision_note":{"type":["string","null"]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"message_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"task_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"block_reason":{"type":["string","null"]},"cost_paise":{"$ref":"#/components/schemas/Paise"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"goal":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["site_visit","documents","decision","revive"]},"label":{"type":"string"},"mode":{"type":"string","enum":["cowork","autopilot"]},"owner_id":{"$ref":"#/components/schemas/Id"},"touches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_touches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deadline_at":{"$ref":"#/components/schemas/DateTime"},"instructions":{"type":["string","null"]}},"required":["id","kind","label","mode","owner_id","touches","max_touches","deadline_at","instructions"],"additionalProperties":false},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"template":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"problems":{"type":"array","items":{"type":"string"}}},"required":["text","problems"],"additionalProperties":false},{"type":"null"}],"description":"Set when the touch goes as the company’s template (SMS; WhatsApp outside the 24-hour window): the text that will be sent and what blocks approval (an empty variable, no approved template). It cannot be edited."}},"required":["id","goal_id","lead_id","seq","channel","status","planned_at","text","draft_text","edited","language","ai_status","ai_note","auto","decided_by_id","decided_at","decision_note","expires_at","message_id","task_id","block_reason","cost_paise","sent_at","created_at","goal","lead","template"],"additionalProperties":false},"FollowupGoal":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["site_visit","documents","decision","revive"]},"label":{"type":"string"},"status":{"type":"string","enum":["active","paused","met","stopped","expired","exhausted"]},"mode":{"type":"string","enum":["cowork","autopilot"]},"owner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"source":{"type":"string","enum":["member","automation"]},"instructions":{"type":["string","null"]},"documents":{"type":"array","items":{"type":"string"}},"channels":{"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]}},"max_touches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"touches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deadline_at":{"$ref":"#/components/schemas/DateTime"},"next_step_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_touch_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"stop_reason":{"type":["string","null"]},"stop_detail":{"type":["string","null"]},"met_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"stopped_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"handoff_task_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"ai_credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_paise":{"$ref":"#/components/schemas/Paise"},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/FollowupStep"}}},"required":["id","lead_id","kind","label","status","mode","owner","source","instructions","documents","channels","max_touches","touches","deadline_at","next_step_at","last_touch_at","stop_reason","stop_detail","met_at","stopped_at","handoff_task_id","ai_credits","cost_paise","created_by_id","created_at","updated_at","steps"],"additionalProperties":false},"FollowupStep":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"goal_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"channel":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]},"status":{"type":"string","enum":["drafting","pending_approval","approved","sent","task_created","rejected","expired","blocked","cancelled"]},"planned_at":{"$ref":"#/components/schemas/DateTime"},"text":{"description":"What went (or will go): the person’s edit, else the AI draft.","type":["string","null"]},"draft_text":{"type":["string","null"]},"edited":{"type":"boolean"},"language":{"type":["string","null"]},"ai_status":{"description":"pending | done | flagged | fallback","type":["string","null"]},"ai_note":{"type":["string","null"]},"auto":{"type":"boolean","description":"Approved by autopilot (or a call task), not a person."},"decided_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decision_note":{"type":["string","null"]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"message_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"task_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"block_reason":{"type":["string","null"]},"cost_paise":{"$ref":"#/components/schemas/Paise"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","goal_id","lead_id","seq","channel","status","planned_at","text","draft_text","edited","language","ai_status","ai_note","auto","decided_by_id","decided_at","decision_note","expires_at","message_id","task_id","block_reason","cost_paise","sent_at","created_at"],"additionalProperties":false},"FormField":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"kind":{"$ref":"#/components/schemas/FormFieldKind"},"label":{"type":"string","minLength":1,"maxLength":120},"required":{"default":false,"type":"boolean"},"placeholder":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"help":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"options":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["key","kind","label","required","placeholder","help","options"],"additionalProperties":false},"FormFieldInput":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"kind":{"$ref":"#/components/schemas/FormFieldKind"},"label":{"type":"string","minLength":1,"maxLength":120},"required":{"default":false,"type":"boolean"},"placeholder":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"help":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"options":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["key","kind","label"]},"FormFieldKind":{"type":"string","enum":["name","phone","email","city","budget","bhk","locality","project","lead_type","message","text","textarea","select","checkbox"],"description":"Standard kinds fill the lead field of that name; text / textarea / select / checkbox are custom questions."},"FormSpamProtection":{"type":"string","enum":["turnstile","none"]},"FormSuccessAction":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"message":{"type":"string","minLength":1,"maxLength":300}},"required":["type","message"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"redirect"},"url":{"type":"string","maxLength":500}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"whatsapp"},"number":{"default":null,"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"text":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["type","number","text"],"additionalProperties":false}],"description":"Thank-you message, a redirect (https) or a WhatsApp chat."},"FormSuccessActionInput":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"message":{"type":"string","minLength":1,"maxLength":300}},"required":["type","message"]},{"type":"object","properties":{"type":{"type":"string","const":"redirect"},"url":{"type":"string","maxLength":500}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","const":"whatsapp"},"number":{"default":null,"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"text":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["type"]}],"description":"Thank-you message, a redirect (https) or a WhatsApp chat."},"ForwardingConfirmation":{"type":"object","properties":{"provider":{"type":"string","enum":["gmail","outlook"]},"requested_by":{"type":["string","null"]},"code":{"type":["string","null"]},"link":{"type":["string","null"]},"authenticated":{"type":"boolean"}},"required":["provider","requested_by","code","link","authenticated"],"additionalProperties":false},"FunnelCounts":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"junk":{"type":"integer","minimum":0,"maximum":9007199254740991},"lost":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified":{"type":"integer","minimum":0,"maximum":9007199254740991},"visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","junk","lost","contacted","qualified","visited","deals"],"additionalProperties":false,"description":"Leads received in the range and how far they have got (at least)."},"Furnishing":{"type":"string","enum":["unfurnished","semi_furnished","fully_furnished"]},"GoogleConversionsSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"customer_id":{"type":["string","null"]},"customer_name":{"type":["string","null"]},"login_customer_id":{"type":["string","null"]},"account_email":{"type":["string","null"]},"mapping":{"type":"object","propertyNames":{"$ref":"#/components/schemas/AdMilestone"},"additionalProperties":{"type":"object","properties":{"action_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["action_id","name"],"additionalProperties":false},"required":["lead_created","qualified","visit_scheduled","visit_done","booked"]},"enhanced_conversions":{"type":"boolean"},"test_mode":{"type":"boolean"},"value":{"type":"string","enum":["commission","agreed_value","none"],"description":"What a booking is worth to the ads: the deal’s expected commission, its agreed value, or none."}},"required":["enabled","customer_id","customer_name","login_customer_id","account_email","mapping","enhanced_conversions","test_mode","value"],"additionalProperties":false},"GoogleFormConfig":{"type":"object","properties":{"name":{"type":["string","null"]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"consents":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/LeadFormConsentMapping"}}},"required":["name","source_id","project_id","lead_type","mapping","consents"],"additionalProperties":false},"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok","unavailable"]},"time":{"$ref":"#/components/schemas/DateTime"},"uptime_s":{"type":"integer","minimum":0,"maximum":9007199254740991},"checks":{"description":"Only with ?ready=1.","type":"object","properties":{"database":{"type":"object","properties":{"ok":{"type":"boolean"},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Probe duration in milliseconds."}},"required":["ok","ms"],"additionalProperties":false},"redis":{"type":"object","properties":{"ok":{"type":"boolean"},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Probe duration in milliseconds."}},"required":["ok","ms"],"additionalProperties":false}},"required":["database","redis"],"additionalProperties":false}},"required":["status","time","uptime_s"],"additionalProperties":false},"HelpArticle":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"category":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"}},"required":["key","title"],"additionalProperties":false},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"updated":{"$ref":"#/components/schemas/LocalDate"},"needs":{"type":"array","items":{"type":"string"},"description":"What you need before you start."},"blocks":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string"}},"required":["t"],"additionalProperties":{}},"description":"The article body as blocks (headings, paragraphs, steps, callouts, tables, code)."},"related":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"category":{"type":"string"}},"required":["slug","title","summary","category"],"additionalProperties":false}}},"required":["slug","title","summary","category","version","updated","needs","blocks","related"],"additionalProperties":false},"HelpFeedback":{"type":"object","properties":{"article":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"helpful":{"type":"boolean"},"comment":{"type":["string","null"]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["article","version","helpful","comment","updated_at"],"additionalProperties":false},"HelpFeedbackInput":{"type":"object","properties":{"helpful":{"type":"boolean"},"comment":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["helpful"]},"HelpTips":{"type":"object","properties":{"dismissed":{"type":"array","items":{"type":"string"},"description":"Keys of the tips you closed."}},"required":["dismissed"],"additionalProperties":false},"Holiday":{"type":"object","properties":{"date":{"type":"string","format":"date"},"name":{"type":"string","minLength":1,"maxLength":80}},"required":["date","name"],"additionalProperties":false},"HolidayInput":{"type":"object","properties":{"date":{"type":"string","format":"date"},"name":{"type":"string","minLength":1,"maxLength":80}},"required":["date","name"]},"Id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$","description":"Opaque record id.","examples":["cmusrceel0000q7kaafxqi1om"]},"ImageUploadInput":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":5242880}},"required":["filename","content_type","size"]},"ImageUploadTicket":{"type":"object","properties":{"key":{"type":"string","description":"Send it back to attach the file once the PUT succeeded."},"url":{"type":"string","description":"Presigned URL: PUT the file there with exactly these headers."},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["key","url","method","headers","expires_at"],"additionalProperties":false},"ImportEntity":{"type":"string","enum":["leads","contacts","properties","deals","activities","tasks","bookings","instalments","booking_receipts"]},"ImportJob":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"entity":{"type":"string"},"template":{"type":["string","null"]},"file_name":{"type":["string","null"]},"status":{"type":"string","enum":["pending","profiling","ready","validating","validated","queued","running","done","failed","rolling_back","rolled_back","previewed"]},"mapping":{"anyOf":[{"$ref":"#/components/schemas/ImportMapping"},{"type":"null"}]},"options":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"totals":{"$ref":"#/components/schemas/ImportTotals"},"created_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"has_skipped_rows":{"type":"boolean"},"has_report":{"type":"boolean"},"progress":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["done","total"],"additionalProperties":false},{"type":"null"}]},"needs_dry_run":{"type":"boolean"},"rollback_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"rolled_back_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","entity","template","file_name","status","mapping","options","totals","created_by","created_at","finished_at","has_skipped_rows","has_report","progress","needs_dry_run","rollback_until","rolled_back_at"],"additionalProperties":false},"ImportMapping":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Field key (or custom.<key>) → column index (0-based)."},"ImportOptions":{"type":"object","properties":{"mode":{"type":"string","enum":["enquiries","migration"]},"lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"status":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"assignment":{"type":"string","enum":["unassigned","me","round_robin"]},"member_ids":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"unknown_owner":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}},"duplicate_mode":{"type":"string","enum":["policy","new_lead"]},"consent":{"type":"object","properties":{"basis":{"type":"string","enum":["unknown","enquiry","consent"]},"date":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["basis"]},"existing_contacts":{"type":"string","enum":["skip","fill_empty"]},"date_order":{"type":"string","enum":["auto","dmy","mdy"]},"area_unit":{"anyOf":[{"$ref":"#/components/schemas/AreaUnit"},{"type":"null"}]},"listing_type":{"anyOf":[{"$ref":"#/components/schemas/ListingType"},{"type":"null"}]},"property_type":{"anyOf":[{"$ref":"#/components/schemas/PropertyType"},{"type":"null"}]},"follow_up_tasks":{"type":"boolean"},"values":{"$ref":"#/components/schemas/ImportValueMaps"}}},"ImportPreview":{"type":"object","properties":{"import":{"$ref":"#/components/schemas/ImportJob"},"profile":{"anyOf":[{"$ref":"#/components/schemas/ImportProfile"},{"type":"null"}]},"entity":{"$ref":"#/components/schemas/ImportEntity"},"template":{"type":"string"},"detected":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"verify":{"type":"boolean"}},"required":["id","label","score","verify"],"additionalProperties":false}},"looks_like":{"anyOf":[{"$ref":"#/components/schemas/ImportEntity"},{"type":"null"}]},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]}},"required":["key","label","kind","required","description"],"additionalProperties":false}},"required_one_of":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"suggested_mapping":{"$ref":"#/components/schemas/ImportMapping"},"mapping":{"$ref":"#/components/schemas/ImportMapping"},"suggestions":{"type":"object","properties":{"owner":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]}},"status":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]}},"source":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]}}},"required":["owner","status","source"],"additionalProperties":false},"options":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"date_order":{"type":"object","properties":{"detected":{"anyOf":[{"type":"string","enum":["dmy","mdy"]},{"type":"null"}]},"template":{"type":"string","enum":["dmy","mdy"]}},"required":["detected","template"],"additionalProperties":false},"catalog":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"statuses":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"pipelines":{"type":"array","items":{"type":"string"}},"subs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}}},"required":["key","name","category","pipelines","subs"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"template_source":{"type":["string","null"]}},"required":["members","statuses","sources","template_source"],"additionalProperties":false}},"required":["import","profile","entity","template","detected","looks_like","fields","required_one_of","suggested_mapping","mapping","suggestions","options","date_order","catalog"],"additionalProperties":false},"ImportProfile":{"type":"object","properties":{"header_row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"headers":{"type":"array","items":{"type":"string"}},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sample":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"columns":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"header":{"type":"string"},"filled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"values":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["value","count"],"additionalProperties":false}},{"type":"null"}]},"parts":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["value","count"],"additionalProperties":false}},{"type":"null"}]},"date_order":{"anyOf":[{"type":"string","enum":["dmy","mdy"]},{"type":"null"}]}},"required":["index","header","filled","values","parts","date_order"],"additionalProperties":false}}},"required":["header_row","headers","width","rows","sample","columns"],"additionalProperties":false},"ImportRollbackCheck":{"type":"object","properties":{"decision":{"type":"object","properties":{"allowed":{"type":"boolean"},"refusal":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["allowed","refusal","message"],"additionalProperties":false},"until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blockers":{"type":"array","items":{"type":"object","properties":{"entity":{"type":"string"},"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"samples":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["entity","reason","label","count","samples"],"additionalProperties":false}}},"required":["decision","until","counts","blocked","blockers"],"additionalProperties":false},"ImportTemplate":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"vendor":{"type":"string"},"kind":{"type":"string"},"lead_mode":{"type":"string"},"date_order":{"type":"string"},"verify":{"type":"boolean"},"entities":{"type":"array","items":{"$ref":"#/components/schemas/ImportEntity"}},"export_steps":{"type":"array","items":{"type":"string"}}},"required":["id","label","vendor","kind","lead_mode","date_order","verify","entities","export_steps"],"additionalProperties":false},"ImportTotals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"rows · dry_run (the report summary) · import (counters, failed rows) · rollback · error"},"ImportValueMaps":{"type":"object","properties":{"owner":{"description":"Owner value → member id; null: the default assignment.","type":"object","propertyNames":{"type":"string","maxLength":120},"additionalProperties":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"status":{"description":"Status value → status_key or status_key/sub_status_key; null: the default status.","type":"object","propertyNames":{"type":"string","maxLength":120},"additionalProperties":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"source":{"description":"Source value → lead source id or new:<name>; null: the default.","type":"object","propertyNames":{"type":"string","maxLength":120},"additionalProperties":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"tags":{"description":"Tag → the tag to write; null or empty: left out.","type":"object","propertyNames":{"type":"string","maxLength":120},"additionalProperties":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}}}},"InboundEmail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"connection_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"to_address":{"type":"string"},"from_address":{"type":"string"},"subject":{"type":["string","null"]},"transport":{"type":"string"},"kind":{"type":"string","enum":["lead","forwarding","other"]},"status":{"type":"string","enum":["received","ingested","review","rejected","ignored","failed"]},"review_reason":{"type":["string","null"]},"authenticated":{"type":"boolean"},"auth":{"anyOf":[{"type":"object","properties":{"receiver":{"type":["string","null"]},"spf":{"type":["string","null"]},"dmarc":{"type":["string","null"]},"arc":{"type":["string","null"]},"dkim":{"type":"array","items":{"type":"string"}},"arc_dkim":{"type":"array","items":{"type":"string"}},"authenticated_for":{"type":["string","null"]},"via":{"anyOf":[{"type":"string","enum":["dkim","arc"]},{"type":"null"}]}},"required":["receiver","spf","dmarc","arc","dkim","arc_dkim","authenticated_for","via"],"additionalProperties":false},{"type":"null"}]},"parser":{"type":["string","null"]},"confidence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_raw":{"type":"boolean"},"ingest_event_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reviewed_by_id":{"type":["string","null"]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"},"processed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"suggestion":{"anyOf":[{"type":"object","properties":{"portal":{"type":["string","null"]},"lead_id":{"type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"answers":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"submitted_at":{"type":["string","null"]},"text":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}},"ai":{"anyOf":[{"type":"object","properties":{"confidence":{"type":"number"},"credits":{"type":"number"},"request_id":{"type":["string","null"]}},"required":["confidence","credits","request_id"],"additionalProperties":false},{"type":"null"}]},"forwarding":{"anyOf":[{"$ref":"#/components/schemas/ForwardingConfirmation"},{"type":"null"}]}},"required":["portal","lead_id","fields","answers","submitted_at","text","notes"],"additionalProperties":false},{"type":"null"}]}},"required":["id","source_id","connection_id","to_address","from_address","subject","transport","kind","status","review_reason","authenticated","auth","parser","confidence","error","size_bytes","has_raw","ingest_event_id","lead_id","reviewed_by_id","reviewed_at","received_at","processed_at","suggestion"],"additionalProperties":false},"InboxOptions":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"$ref":"#/components/schemas/SendChannel"},"label":{"type":"string"},"address":{"type":"string"},"is_default":{"type":"boolean"}},"required":["id","kind","label","address","is_default"],"additionalProperties":false},"description":"Connected sending identities; a linked WhatsApp number only for its own agent."},"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"description":"Active members, A → Z."},"labels":{"type":"array","items":{"type":"string"},"description":"Labels already used on the company’s conversations."}},"required":["channels","members","labels"],"additionalProperties":false},"InboxUpload":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"},"kind":{"type":"string","enum":["image","video","audio","document"]}},"required":["key","url","method","headers","expires_at","kind"],"additionalProperties":false},"InboxUploadInput":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp","video/mp4","video/3gpp","audio/ogg","audio/webm","audio/mp4","audio/mpeg","audio/aac","application/pdf"]},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["filename","content_type","size"]},"IncomingFieldDescription":{"type":"object","properties":{"key":{"type":"string"},"sample":{"type":"string"},"mapped_to":{"type":["string","null"]},"suggested":{"type":["string","null"]},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["key","sample","mapped_to","suggested","confidence"],"additionalProperties":false},"IndianStateCode":{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN (TS = Telangana)."},"IngestLogDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel":{"type":"string"},"provider":{"type":["string","null"]},"external_id":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/IngestStatus"},"error":{"type":["string","null"]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"},"processed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"replays":{"type":"integer","minimum":0,"maximum":9007199254740991},"outcome":{"type":["string","null"]},"reject_reason":{"type":["string","null"]},"latency_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"dead_letter":{"type":"boolean"},"summary":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","phone","email"],"additionalProperties":false},"payload":{"description":"The archived request (minus credentials)."},"normalized":{"description":"Normalised values and processing metadata."}},"required":["id","source_id","channel","provider","external_id","status","error","lead_id","received_at","processed_at","attempts","replays","outcome","reject_reason","latency_ms","dead_letter","summary","payload","normalized"],"additionalProperties":false},"IngestLogEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel":{"type":"string"},"provider":{"type":["string","null"]},"external_id":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/IngestStatus"},"error":{"type":["string","null"]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"},"processed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"replays":{"type":"integer","minimum":0,"maximum":9007199254740991},"outcome":{"type":["string","null"]},"reject_reason":{"type":["string","null"]},"latency_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"dead_letter":{"type":"boolean"},"summary":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","phone","email"],"additionalProperties":false}},"required":["id","source_id","channel","provider","external_id","status","error","lead_id","received_at","processed_at","attempts","replays","outcome","reject_reason","latency_ms","dead_letter","summary"],"additionalProperties":false},"IngestStatus":{"type":"string","enum":["received","processed","duplicate","rejected","failed"]},"IngestionStats":{"type":"object","properties":{"window":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"days":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["from","to","days"],"additionalProperties":false},"totals":{"type":"object","properties":{"events":{"type":"integer","minimum":0,"maximum":9007199254740991},"processed":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["events","processed","duplicate","rejected","failed","pending"],"additionalProperties":false},"latency":{"type":"object","properties":{"samples":{"type":"integer","minimum":0,"maximum":9007199254740991},"p50_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"p95_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ingest_p95_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"slo_ms":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["samples","p50_ms","p95_ms","ingest_p95_ms","slo_ms"],"additionalProperties":false},"by_day":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"events":{"type":"integer","minimum":0,"maximum":9007199254740991},"processed":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["date","events","processed","duplicate","rejected","failed","pending"],"additionalProperties":false}},"by_source":{"type":"array","items":{"type":"object","properties":{"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":["string","null"]},"type":{"type":["string","null"]},"provider":{"type":["string","null"]},"is_active":{"type":["boolean","null"]},"last_event_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_lead_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"health_status":{"anyOf":[{"type":"string","enum":["ok","silent","failing","idle","inactive"]},{"type":"null"}]},"silent_for_hours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expected_every_hours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"events":{"type":"integer","minimum":0,"maximum":9007199254740991},"processed":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["source_id","name","type","provider","is_active","last_event_at","last_lead_at","health_status","silent_for_hours","expected_every_hours","events","processed","duplicate","rejected","failed","pending"],"additionalProperties":false}}},"required":["window","totals","latency","by_day","by_source"],"additionalProperties":false},"InspectionAnswers":{"type":"object","properties":{"items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rating":{"anyOf":[{"$ref":"#/components/schemas/ConditionRating"},{"type":"null"}]},"note":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["rating","note","at"],"additionalProperties":false},"description":"`<room>.<item>` → the rating and note."},"rooms":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"clean":{"type":["boolean","null"]},"note":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["clean","note","at"],"additionalProperties":false}},"meters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"reading":{"type":["string","null"]},"na":{"type":"boolean"},"last_bill_reading":{"type":["string","null"]},"note":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["reading","na","last_bill_reading","note","at"],"additionalProperties":false}},"inventory":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rating":{"anyOf":[{"$ref":"#/components/schemas/ConditionRating"},{"type":"null"}]},"note":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["count","rating","note","at"],"additionalProperties":false}},"keys":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"note":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["count","note","at"],"additionalProperties":false}},"general":{"anyOf":[{"type":"object","properties":{"note":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["note","at"],"additionalProperties":false},{"type":"null"}]}},"required":["items","rooms","meters","inventory","keys","general"],"additionalProperties":false},"InspectionChecklist":{"type":"object","properties":{"rooms":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"type":{"type":"string","enum":["entrance","living","dining","kitchen","bedroom","bathroom","balcony","utility","study","pooja","servant","store","terrace","garden","parking","exterior","common","other"]},"label":{"type":"string"},"custom":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"photo":{"type":"boolean"},"custom":{"type":"boolean"}},"required":["key","label","photo","custom"],"additionalProperties":false}}},"required":["key","type","label","custom","items"],"additionalProperties":false}},"meters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"type":{"type":"string","enum":["electricity","water","gas"]},"label":{"type":"string"},"unit":{"type":"string","enum":["kWh","kL","m3","L","SCM"]},"custom":{"type":"boolean"}},"required":["key","type","label","unit","custom"],"additionalProperties":false}},"inventory":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"category":{"type":"string","enum":["furniture","appliance","fixture","furnishing","other"]},"room_type":{"anyOf":[{"type":"string","enum":["entrance","living","dining","kitchen","bedroom","bathroom","balcony","utility","study","pooja","servant","store","terrace","garden","parking","exterior","common","other"]},{"type":"null"}]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The count expected (the move-in count for a move-out)."},"replacement_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"custom":{"type":"boolean"}},"required":["key","label","category","room_type","quantity","replacement_value","custom"],"additionalProperties":false}},"keys":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"custom":{"type":"boolean"}},"required":["key","label","count","custom"],"additionalProperties":false}}},"required":["rooms","meters","inventory","keys"],"additionalProperties":false},"InspectionComparison":{"type":"object","properties":{"rooms":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"clean":{"type":"object","properties":{"before":{"type":["boolean","null"]},"after":{"type":["boolean","null"]}},"required":["before","after"],"additionalProperties":false},"needs_cleaning":{"type":"boolean"},"note":{"type":"object","properties":{"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["before","after"],"additionalProperties":false},"media":{"type":"object","properties":{"before":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"after":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["before","after"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"before":{"anyOf":[{"type":"object","properties":{"rating":{"anyOf":[{"$ref":"#/components/schemas/ConditionRating"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["rating","note"],"additionalProperties":false},{"type":"null"}]},"after":{"anyOf":[{"type":"object","properties":{"rating":{"anyOf":[{"$ref":"#/components/schemas/ConditionRating"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["rating","note"],"additionalProperties":false},{"type":"null"}]},"change":{"type":"string","description":"same · better · wear · damage · major_damage · missing · added · not_inspected"},"media":{"type":"object","properties":{"before":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"after":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["before","after"],"additionalProperties":false}},"required":["key","label","before","after","change","media"],"additionalProperties":false}},"flagged":{"type":"boolean"},"only_in":{"anyOf":[{"type":"string","enum":["move_in","move_out"]},{"type":"null"}]}},"required":["key","label","clean","needs_cleaning","note","media","items","flagged","only_in"],"additionalProperties":false}},"meters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["electricity","water","gas"]},"unit":{"type":"string","enum":["kWh","kL","m3","L","SCM"]},"before":{"type":["string","null"]},"after":{"type":["string","null"]},"last_bill":{"type":["string","null"]},"consumed":{"type":["string","null"]},"unbilled":{"type":["string","null"]},"problem":{"anyOf":[{"type":"string","enum":["missing_reading","went_back"]},{"type":"null"}]},"na":{"type":"object","properties":{"before":{"type":"boolean"},"after":{"type":"boolean"}},"required":["before","after"],"additionalProperties":false},"media":{"type":"object","properties":{"before":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"after":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["before","after"],"additionalProperties":false}},"required":["key","label","type","unit","before","after","last_bill","consumed","unbilled","problem","na","media"],"additionalProperties":false}},"inventory":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"before":{"anyOf":[{"type":"object","properties":{"count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rating":{"anyOf":[{"$ref":"#/components/schemas/ConditionRating"},{"type":"null"}]}},"required":["count","rating"],"additionalProperties":false},{"type":"null"}]},"after":{"anyOf":[{"type":"object","properties":{"count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rating":{"anyOf":[{"$ref":"#/components/schemas/ConditionRating"},{"type":"null"}]}},"required":["count","rating"],"additionalProperties":false},{"type":"null"}]},"missing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"change":{"type":"string"},"replacement_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"media":{"type":"object","properties":{"before":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"after":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["before","after"],"additionalProperties":false}},"required":["key","label","before","after","missing","change","replacement_value","media"],"additionalProperties":false}},"keys":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"after":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"missing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","label","before","after","missing"],"additionalProperties":false}},"summary":{"type":"object","properties":{"items_changed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"damaged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_keys":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rooms_to_clean":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unbilled_meters":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["items_changed","damaged","missing_items","missing_keys","rooms_to_clean","unbilled_meters"],"additionalProperties":false}},"required":["rooms","meters","inventory","keys","summary"],"additionalProperties":false},"InspectionMedia":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"target":{"type":"string","description":"room:<k> · item:<room>.<item> · meter:<k> · inventory:<k> · keys:<k> · general"},"target_label":{"type":"string"},"kind":{"type":"string","enum":["photo","video"]},"status":{"type":"string","enum":["processing","ready","failed"]},"content_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"duration_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"caption":{"type":["string","null"]},"captured_at":{"$ref":"#/components/schemas/DateTime"},"time_source":{"type":"string"},"time_flags":{"type":"array","items":{"type":"string"}},"had_location":{"type":"boolean","description":"The original carried a location; the copy shown has none."},"exif_taken_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"failure":{"type":["string","null"]},"preview_url":{"description":"The EXIF/GPS-free copy (short-lived signed URL).","type":["string","null"]},"thumb_url":{"type":["string","null"]},"urls_expire_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","target","target_label","kind","status","content_type","size_bytes","width","height","duration_ms","caption","captured_at","time_source","time_flags","had_location","exif_taken_at","failure","preview_url","thumb_url","urls_expire_at"],"additionalProperties":false},"InspectionMediaUpload":{"type":"object","properties":{"target":{"type":"string","minLength":1,"maxLength":120},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]}},"required":["target","content_type","size"]},"InspectionOp":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","const":"item"},"room":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"item":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"rating":{"anyOf":[{"$ref":"#/components/schemas/ConditionRating"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"at":{"type":"string","format":"date-time"}},"required":["op","room","item","at"]},{"type":"object","properties":{"op":{"type":"string","const":"room"},"room":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"clean":{"type":["boolean","null"]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"at":{"type":"string","format":"date-time"}},"required":["op","room","at"]},{"type":"object","properties":{"op":{"type":"string","const":"meter"},"meter":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"reading":{"anyOf":[{"type":"string","pattern":"^\\d{1,9}(\\.\\d{1,3})?$"},{"type":"null"}]},"na":{"type":"boolean"},"last_bill_reading":{"anyOf":[{"type":"string","pattern":"^\\d{1,9}(\\.\\d{1,3})?$"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"at":{"type":"string","format":"date-time"}},"required":["op","meter","at"]},{"type":"object","properties":{"op":{"type":"string","const":"inventory"},"line":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"count":{"anyOf":[{"type":"integer","minimum":0,"maximum":999},{"type":"null"}]},"rating":{"anyOf":[{"$ref":"#/components/schemas/ConditionRating"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"at":{"type":"string","format":"date-time"}},"required":["op","line","at"]},{"type":"object","properties":{"op":{"type":"string","const":"keys"},"set":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"count":{"anyOf":[{"type":"integer","minimum":0,"maximum":999},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"at":{"type":"string","format":"date-time"}},"required":["op","set","at"]},{"type":"object","properties":{"op":{"type":"string","const":"general"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"at":{"type":"string","format":"date-time"}},"required":["op","note","at"]},{"type":"object","properties":{"op":{"type":"string","const":"add_room"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["entrance","living","dining","kitchen","bedroom","bathroom","balcony","utility","study","pooja","servant","store","terrace","garden","parking","exterior","common","other"]},"label":{"type":"string","minLength":1,"maxLength":80},"with_items":{"default":true,"type":"boolean"},"at":{"type":"string","format":"date-time"}},"required":["op","key","type","label","at"]},{"type":"object","properties":{"op":{"type":"string","const":"add_item"},"room":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"at":{"type":"string","format":"date-time"}},"required":["op","room","key","label","at"]},{"type":"object","properties":{"op":{"type":"string","const":"add_meter"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["electricity","water","gas"]},"label":{"type":"string","minLength":1,"maxLength":80},"unit":{"type":"string","enum":["kWh","kL","m3","L","SCM"]},"at":{"type":"string","format":"date-time"}},"required":["op","key","type","label","unit","at"]},{"type":"object","properties":{"op":{"type":"string","const":"add_inventory"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"category":{"type":"string","enum":["furniture","appliance","fixture","furnishing","other"]},"quantity":{"type":"integer","minimum":0,"maximum":999},"at":{"type":"string","format":"date-time"}},"required":["op","key","label","category","quantity","at"]},{"type":"object","properties":{"op":{"type":"string","const":"add_key_set"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"count":{"type":"integer","minimum":0,"maximum":50},"at":{"type":"string","format":"date-time"}},"required":["op","key","label","count","at"]},{"type":"object","properties":{"op":{"type":"string","const":"remove"},"target":{"type":"string","enum":["room","item","meter","inventory","keys"]},"room":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"at":{"type":"string","format":"date-time"}},"required":["op","target","key","at"]}],"description":"One change from the capture screen, stamped with the phone’s time (`at`): answers merge per answer, the newer time wins; structure changes add with phone-made keys or remove what was added and has no answer or file."},"InspectionOtpRequest":{"type":"object","properties":{"status":{"type":"string","enum":["sent","blocked"]},"channel":{"type":["string","null"]},"reason":{"type":["string","null"]},"resend_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status","channel","reason","resend_in_sec"],"additionalProperties":false},"InspectionProgress":{"type":"object","properties":{"rated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"meters_done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"meters":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"counted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"countable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"photos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["rated","items","meters_done","meters","counted","countable","photos"],"additionalProperties":false},"InspectionReasonInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]},"InspectionSignature":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"party":{"type":"string","enum":["landlord","tenant"]},"round":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"status":{"type":"string","enum":["pending","sent","opened","signed","revoked"]},"status_label":{"type":"string"},"method":{"anyOf":[{"type":"string","enum":["link","in_person"]},{"type":"null"}]},"phone":{"description":"Masked.","type":["string","null"]},"reachable":{"type":"boolean"},"link":{"type":"object","properties":{"status":{"type":"string","description":"none | pending | sent | opened | revoked | expired | blocked"},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"invited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"blocked_reason":{"type":["string","null"]}},"required":["status","expires_at","invited_at","opened_at","blocked_reason"],"additionalProperties":false},"otp":{"type":"object","properties":{"phase":{"type":"string","description":"none | waiting | live | expired | locked"},"channel":{"type":["string","null"]},"resend_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attempts_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"via":{"type":["string","null"]}},"required":["phase","channel","resend_in_sec","attempts_left","via"],"additionalProperties":false},"typed_name":{"type":["string","null"]},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"otp_channel":{"type":["string","null"]},"drawn":{"type":"boolean","description":"A drawn signature is kept (privately) with the typed name."}},"required":["id","party","round","name","status","status_label","method","phone","reachable","link","otp","typed_name","signed_at","otp_channel","drawn"],"additionalProperties":false},"InspectionTemplate":{"type":"object","properties":{"key":{"type":"string"},"origin":{"type":"string","enum":["system","edited","company"]},"property_kind":{"type":"string","enum":["1rk","1bhk","2bhk","3bhk","4bhk","villa","commercial"]},"title":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","archived"]},"body":{"$ref":"#/components/schemas/InspectionTemplateBody"},"rooms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["key","origin","property_kind","title","version","status","body","rooms","items","updated_at"],"additionalProperties":false},"InspectionTemplateBody":{"type":"object","properties":{"rooms":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["entrance","living","dining","kitchen","bedroom","bathroom","balcony","utility","study","pooja","servant","store","terrace","garden","parking","exterior","common","other"]},"label":{"type":"string","minLength":1,"maxLength":80},"items":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"photo":{"default":false,"type":"boolean"}},"required":["key","label","photo"],"additionalProperties":false}}},"required":["key","type","label","items"],"additionalProperties":false}},"meters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["electricity","water","gas"]},"label":{"type":"string","minLength":1,"maxLength":80},"unit":{"type":"string","enum":["kWh","kL","m3","L","SCM"]}},"required":["key","type","label","unit"],"additionalProperties":false}},"inventory":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"category":{"type":"string","enum":["furniture","appliance","fixture","furnishing","other"]},"room_type":{"default":null,"anyOf":[{"type":"string","enum":["entrance","living","dining","kitchen","bedroom","bathroom","balcony","utility","study","pooja","servant","store","terrace","garden","parking","exterior","common","other"]},{"type":"null"}]},"quantity":{"type":"integer","minimum":0,"maximum":999},"per":{"default":"home","type":"string","enum":["home","bedroom","bathroom"]},"furnishing":{"default":"any","type":"string","enum":["any","semi","full"]},"replacement_value":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key","label","category","room_type","quantity","per","furnishing","replacement_value"],"additionalProperties":false}},"keys":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"count":{"type":"integer","minimum":0,"maximum":50},"per":{"default":"home","type":"string","enum":["home","bedroom","bathroom"]}},"required":["key","label","count","per"],"additionalProperties":false}}},"required":["rooms","meters","inventory","keys"],"additionalProperties":false},"InspectionTemplateBodyInput":{"type":"object","properties":{"rooms":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["entrance","living","dining","kitchen","bedroom","bathroom","balcony","utility","study","pooja","servant","store","terrace","garden","parking","exterior","common","other"]},"label":{"type":"string","minLength":1,"maxLength":80},"items":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"photo":{"default":false,"type":"boolean"}},"required":["key","label"]}}},"required":["key","type","label","items"]}},"meters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["electricity","water","gas"]},"label":{"type":"string","minLength":1,"maxLength":80},"unit":{"type":"string","enum":["kWh","kL","m3","L","SCM"]}},"required":["key","type","label","unit"]}},"inventory":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"category":{"type":"string","enum":["furniture","appliance","fixture","furnishing","other"]},"room_type":{"default":null,"anyOf":[{"type":"string","enum":["entrance","living","dining","kitchen","bedroom","bathroom","balcony","utility","study","pooja","servant","store","terrace","garden","parking","exterior","common","other"]},{"type":"null"}]},"quantity":{"type":"integer","minimum":0,"maximum":999},"per":{"default":"home","type":"string","enum":["home","bedroom","bathroom"]},"furnishing":{"default":"any","type":"string","enum":["any","semi","full"]},"replacement_value":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key","label","category","quantity"]}},"keys":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"count":{"type":"integer","minimum":0,"maximum":50},"per":{"default":"home","type":"string","enum":["home","bedroom","bathroom"]}},"required":["key","label","count"]}}},"required":["rooms","meters","inventory","keys"]},"InstallableAppBuild":{"type":"object","properties":{"flavor":{"$ref":"#/components/schemas/BuildFlavor"},"version":{"type":"string","description":"Version name, e.g. 0.3.0.","examples":["0.3.0"]},"version_code":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Android versionCode; the app compares it with its own."},"url":{"type":"string","description":"Where to install it: the signed download link of the enterprise APK (works for two hours, always the newest file) or the Play Store listing."},"notes":{"description":"What changed; absent when the build has no notes.","type":"string"},"required":{"type":"boolean","description":"The app should not let the member dismiss it: the build is marked required, or this phone is below the minimum supported version."},"min_supported_version_code":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"size_bytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sha256":{"description":"SHA-256 (hex) of the APK file, when it is hosted by PropZolo.","type":["string","null"]},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"url_expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"When `url` stops working (signed links only)."}},"required":["flavor","version","version_code","url","required","min_supported_version_code","size_bytes","sha256","published_at","url_expires_at"],"additionalProperties":false},"InstallationId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{16,64}$","description":"Stable per-install id generated by the app (survives sign-out, not a reinstall).","examples":["pz-3f0c8a52-1b7e-4c11-9a52-0d1c2e3f4a5b"]},"IntegrationConnection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string"},"connector_key":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":"string","enum":["pending","connected","error","disconnected"]},"health":{"$ref":"#/components/schemas/ConnectionHealth"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Non-secret settings of the connector."},"has_secret":{"type":"boolean"},"secret_hints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Last four characters of long tokens."},"inbound_url":{"description":"Webhook URL the provider calls (secret).","type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"connected_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"connected_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"last_ok_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"error_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","provider","connector_key","name","status","health","config","has_secret","secret_hints","inbound_url","scopes","connected_at","connected_by_id","last_ok_at","last_error","error_count","created_at","updated_at"],"additionalProperties":false},"IntegrationConnectionCreated":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/IntegrationConnection"},"revealed_secrets":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Generated secrets, shown once (copy them now)."}},"required":["connection","revealed_secrets"],"additionalProperties":false},"IntegrationHealthRow":{"type":"object","properties":{"key":{"type":"string","description":"`<kind>:<id>`, stable across reloads."},"kind":{"type":"string","enum":["connection","source","channel","email_sending","webhooks"]},"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"provider":{"type":["string","null"]},"category":{"type":"string","description":"What the row is, in words (\"Property portals\", \"Lead source\" …)."},"status":{"$ref":"#/components/schemas/IntegrationHealthStatus"},"summary":{"type":"string","description":"The most important finding in plain words."},"issues":{"type":"array","items":{"type":"string"}},"last_success_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"volume_24h":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"volume_7d":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"errors_24h":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error_rate_24h":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"parked_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parked_oldest_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"token_expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"package_ends_on":{"description":"yyyy-mm-dd on the company calendar.","type":["string","null"]},"action":{"type":"object","properties":{"kind":{"type":"string","enum":["reconnect","rotate","replay","verify_domain","resume_email","check_source","update_package","finish_setup","open"]},"label":{"type":"string"},"href":{"type":"string","description":"Workspace path of the screen that fixes it."}},"required":["kind","label","href"],"additionalProperties":false}},"required":["key","kind","id","name","provider","category","status","summary","issues","last_success_at","last_error","volume_24h","volume_7d","errors_24h","error_rate_24h","parked_count","parked_oldest_at","token_expires_at","package_ends_on","action"],"additionalProperties":false},"IntegrationHealthStatus":{"type":"string","enum":["broken","paused","silent","degraded","setup","ok"]},"IntegrationsOverview":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"connectors":{"type":"array","items":{"$ref":"#/components/schemas/Connector"}}},"required":["key","label","connectors"],"additionalProperties":false}}},"required":["categories"],"additionalProperties":false},"IntegrityAlert":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"member":{"$ref":"#/components/schemas/MemberRef"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"kind":{"type":"string"},"kind_label":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"title":{"type":"string"},"detail":{"type":["string","null"]},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"status":{"type":"string","enum":["open","reviewed","dismissed","cleared"]},"review_note":{"type":["string","null"]},"reviewed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_seen_at":{"$ref":"#/components/schemas/DateTime"},"last_seen_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","member","day","kind","kind_label","severity","title","detail","count","status","review_note","reviewed_by","reviewed_at","first_seen_at","last_seen_at"],"additionalProperties":false},"IntegrityAlertDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"member":{"$ref":"#/components/schemas/MemberRef"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"kind":{"type":"string"},"kind_label":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"title":{"type":"string"},"detail":{"type":["string","null"]},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"status":{"type":"string","enum":["open","reviewed","dismissed","cleared"]},"review_note":{"type":["string","null"]},"reviewed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_seen_at":{"$ref":"#/components/schemas/DateTime"},"last_seen_at":{"$ref":"#/components/schemas/DateTime"},"evidence":{"description":"What the rule found: calls, leads, visits (rule-specific)."}},"required":["id","member","day","kind","kind_label","severity","title","detail","count","status","review_note","reviewed_by","reviewed_at","first_seen_at","last_seen_at","evidence"],"additionalProperties":false},"InventoryAvailability":{"type":"object","properties":{"by_tower":{"type":"object","properties":{"buckets":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"]},"label":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"by_status":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"available_value":{"$ref":"#/components/schemas/Paise"},"sold_pct":{"type":"number"}},"required":["key","total","by_status","available_value","sold_pct"],"additionalProperties":false}},"total":{"type":"object","properties":{"key":{"type":["string","null"]},"label":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"by_status":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"available_value":{"$ref":"#/components/schemas/Paise"},"sold_pct":{"type":"number"}},"required":["key","total","by_status","available_value","sold_pct"],"additionalProperties":false}},"required":["buckets","total"],"additionalProperties":false},"by_configuration":{"type":"object","properties":{"buckets":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"]},"label":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"by_status":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"available_value":{"$ref":"#/components/schemas/Paise"},"sold_pct":{"type":"number"}},"required":["key","total","by_status","available_value","sold_pct"],"additionalProperties":false}},"total":{"type":"object","properties":{"key":{"type":["string","null"]},"label":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"by_status":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"available_value":{"$ref":"#/components/schemas/Paise"},"sold_pct":{"type":"number"}},"required":["key","total","by_status","available_value","sold_pct"],"additionalProperties":false}},"required":["buckets","total"],"additionalProperties":false},"parking":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_hold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allocated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","total","available","on_hold","booked","allocated"],"additionalProperties":false}}},"required":["by_tower","by_configuration"],"additionalProperties":false},"InventoryCapture":{"type":"object","properties":{"link":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"phone":{"type":["string","null"]}},"required":["id","status","phone"],"additionalProperties":false},{"type":"null"}]},"bridge":{"type":"string","enum":["ok","unavailable","not_configured"]},"groups":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"name":{"type":"string"},"participants":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"announce":{"type":"boolean"},"selected":{"type":"boolean"},"consented_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"messages_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_message_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"left":{"type":"boolean"}},"required":["jid","name","participants","announce","selected","consented_at","messages_count","last_message_at","left"],"additionalProperties":false}},"consent":{"type":"object","properties":{"version":{"type":"string"},"text":{"type":"string"},"hash":{"type":"string"}},"required":["version","text","hash"],"additionalProperties":false}},"required":["link","bridge","groups","consent"],"additionalProperties":false},"InventoryCard":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["listing","requirement","noise"]},"transaction":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"property_type":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"bhk":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"area":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"price_rupees":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"price_min_rupees":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"rent_rupees":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"deposit_rupees":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"price_terms":{"type":"array","items":{"type":"string"}},"furnishing":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"floor":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"facing":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"parking":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"possession":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"possession_date":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"oc_received":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"rera_number":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"project":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"locality":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"landmark":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"city":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"tenant_preference":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"available_from":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"co_broke_terms":{"type":"object","properties":{"value":{},"confidence":{"type":"number"}},"required":["value","confidence"],"additionalProperties":false},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","phone"],"additionalProperties":false}},"amenities":{"type":"array","items":{"type":"string"}},"raw_excerpt":{"type":"string"},"review_fields":{"type":"array","items":{"type":"string"}},"confidence":{"type":"number"},"review":{"type":"object","properties":{"state":{"type":"string","enum":["pending","accepted","rejected"]},"created":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["property","lead"]},"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":["string","null"]}},"required":["type","id","ref"],"additionalProperties":false},{"type":"null"}]},"status":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]}},"required":["state","created","status","decided_by","decided_at"],"additionalProperties":false}},"required":["index","kind","transaction","property_type","bhk","area","price_rupees","price_min_rupees","rent_rupees","deposit_rupees","price_terms","furnishing","floor","facing","parking","possession","possession_date","oc_received","rera_number","project","locality","landmark","city","tenant_preference","available_from","co_broke_terms","contacts","amenities","raw_excerpt","review_fields","confidence","review"],"additionalProperties":false},"InventoryCardEdits":{"type":"object","properties":{"kind":{"type":"string","enum":["listing","requirement"]},"transaction":{"type":"string","enum":["sale","rent","lease","pg"]},"property_type":{"type":"string","maxLength":32},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"area_value":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"area_unit":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"area_basis":{"anyOf":[{"type":"string","enum":["carpet","built_up","super_built_up","plot","unspecified"]},{"type":"null"}]},"price_rupees":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"rent_rupees":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"deposit_rupees":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"locality":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"project":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"furnishing":{"anyOf":[{"type":"string","enum":["unfurnished","semi_furnished","fully_furnished"]},{"type":"null"}]},"contact_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"contact_phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]}}},"InventoryCluster":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["listing","requirement"]},"status":{"type":"string"},"title":{"type":"string"},"transaction":{"type":["string","null"]},"property_type":{"type":["string","null"]},"bhk":{"type":["number","null"]},"area":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"basis":{"type":"string"},"sqft":{"type":["number","null"]}},"required":["value","unit","basis","sqft"],"additionalProperties":false},{"type":"null"}]},"price":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"price_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"rent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"deposit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"price_terms":{"type":"array","items":{"type":"string"}},"locality":{"type":["string","null"]},"project":{"type":["string","null"]},"city":{"type":["string","null"]},"floor":{"type":["string","null"]},"furnishing":{"type":["string","null"]},"possession":{"type":["string","null"]},"tenant_preference":{"type":["string","null"]},"co_broke_terms":{"type":["string","null"]},"amenities":{"type":"array","items":{"type":"string"}},"excerpt":{"type":"string"},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"masked":{"type":"boolean"}},"required":["name","phone","masked"],"additionalProperties":false}},"confidence":{"type":"number"},"review_fields":{"type":"array","items":{"type":"string"}},"flags":{"type":"array","items":{"type":"string"}},"missing":{"type":"array","items":{"type":"string"}},"bulk_ready":{"type":"boolean"},"freshness":{"type":"object","properties":{"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string","enum":["fresh","recent","aging","stale"]}},"required":["score","label"],"additionalProperties":false},"first_seen_at":{"$ref":"#/components/schemas/DateTime"},"last_seen_at":{"$ref":"#/components/schemas/DateTime"},"posts_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"groups_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senders_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"group_names":{"type":"array","items":{"type":"string"}},"demand_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price_change":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","to"],"additionalProperties":false},{"type":"null"}]},"duplicate":{"anyOf":[{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"},"ref":{"type":["string","null"]},"title":{"type":["string","null"]},"manual":{"type":"boolean"}},"required":["property_id","ref","title","manual"],"additionalProperties":false},{"type":"null"}]},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":["string","null"]},"status":{"type":["string","null"]}},"required":["id","ref","status"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":["string","null"]}},"required":["id","ref"],"additionalProperties":false},{"type":"null"}]},"edits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"imported_by_me":{"type":"boolean"},"media_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","status","title","transaction","property_type","bhk","area","price","price_min","rent","deposit","price_terms","locality","project","city","floor","furnishing","possession","tenant_preference","co_broke_terms","amenities","excerpt","contacts","confidence","review_fields","flags","missing","bulk_ready","freshness","first_seen_at","last_seen_at","posts_count","groups_count","senders_count","group_names","demand_count","price_change","duplicate","property","lead","edits","decided_at","decided_by","imported_by_me","media_count"],"additionalProperties":false},"InventoryClusterDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["listing","requirement"]},"status":{"type":"string"},"title":{"type":"string"},"transaction":{"type":["string","null"]},"property_type":{"type":["string","null"]},"bhk":{"type":["number","null"]},"area":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"basis":{"type":"string"},"sqft":{"type":["number","null"]}},"required":["value","unit","basis","sqft"],"additionalProperties":false},{"type":"null"}]},"price":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"price_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"rent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"deposit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"price_terms":{"type":"array","items":{"type":"string"}},"locality":{"type":["string","null"]},"project":{"type":["string","null"]},"city":{"type":["string","null"]},"floor":{"type":["string","null"]},"furnishing":{"type":["string","null"]},"possession":{"type":["string","null"]},"tenant_preference":{"type":["string","null"]},"co_broke_terms":{"type":["string","null"]},"amenities":{"type":"array","items":{"type":"string"}},"excerpt":{"type":"string"},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"masked":{"type":"boolean"}},"required":["name","phone","masked"],"additionalProperties":false}},"confidence":{"type":"number"},"review_fields":{"type":"array","items":{"type":"string"}},"flags":{"type":"array","items":{"type":"string"}},"missing":{"type":"array","items":{"type":"string"}},"bulk_ready":{"type":"boolean"},"freshness":{"type":"object","properties":{"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string","enum":["fresh","recent","aging","stale"]}},"required":["score","label"],"additionalProperties":false},"first_seen_at":{"$ref":"#/components/schemas/DateTime"},"last_seen_at":{"$ref":"#/components/schemas/DateTime"},"posts_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"groups_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"senders_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"group_names":{"type":"array","items":{"type":"string"}},"demand_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price_change":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","to"],"additionalProperties":false},{"type":"null"}]},"duplicate":{"anyOf":[{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"},"ref":{"type":["string","null"]},"title":{"type":["string","null"]},"manual":{"type":"boolean"}},"required":["property_id","ref","title","manual"],"additionalProperties":false},{"type":"null"}]},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":["string","null"]},"status":{"type":["string","null"]}},"required":["id","ref","status"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":["string","null"]}},"required":["id","ref"],"additionalProperties":false},{"type":"null"}]},"edits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"imported_by_me":{"type":"boolean"},"media_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"posts":{"type":"array","items":{"type":"object","properties":{"card_id":{"$ref":"#/components/schemas/Id"},"post_id":{"$ref":"#/components/schemas/Id"},"posted_at":{"$ref":"#/components/schemas/DateTime"},"source":{"type":"string"},"group_name":{"type":["string","null"]},"sender":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"masked":{"type":"boolean"}},"required":["name","phone","masked"],"additionalProperties":false},"text":{"type":"string"},"excerpt":{"type":"string"},"amount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Paise (₹1 = 100)."},"confidence":{"type":"number"},"flags":{"type":"array","items":{"type":"string"}},"imported_by_me":{"type":"boolean"}},"required":["card_id","post_id","posted_at","source","group_name","sender","text","excerpt","amount","confidence","flags","imported_by_me"],"additionalProperties":false}},"price_history":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["at","amount"],"additionalProperties":false}},"demand":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"},"last_seen_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","title","last_seen_at"],"additionalProperties":false}}},"required":["id","kind","status","title","transaction","property_type","bhk","area","price","price_min","rent","deposit","price_terms","locality","project","city","floor","furnishing","possession","tenant_preference","co_broke_terms","amenities","excerpt","contacts","confidence","review_fields","flags","missing","bulk_ready","freshness","first_seen_at","last_seen_at","posts_count","groups_count","senders_count","group_names","demand_count","price_change","duplicate","property","lead","edits","decided_at","decided_by","imported_by_me","media_count","posts","price_history","demand"],"additionalProperties":false},"InventoryInboxSettings":{"type":"object","properties":{"forwards":{"type":"boolean"},"export_since_days":{"type":"integer","minimum":1,"maximum":365}},"required":["forwards","export_since_days"],"additionalProperties":false},"InventoryIngest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"channel":{"type":"string","enum":["chat_export","paste","share"]},"status":{"type":"string","enum":["uploading","pending","reading","parsing","done","failed","cancelled"]},"group_name":{"type":["string","null"]},"file_name":{"type":["string","null"]},"file_size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"platform":{"type":["string","null"]},"messages":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"new":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","new","duplicate","skipped"],"additionalProperties":false},"progress":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parsing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"noise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cards":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["queued","parsing","parsed","noise","failed","skipped","cards"],"additionalProperties":false},"error":{"type":["string","null"]},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"cancellable":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"started_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","channel","status","group_name","file_name","file_size","platform","messages","progress","error","member","cancellable","created_at","started_at","finished_at"],"additionalProperties":false},"InventoryItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"kind":{"$ref":"#/components/schemas/InventoryItemKind"},"code":{"type":"string"},"parking_type":{"type":["string","null"]},"level":{"type":["string","null"]},"area":{"type":["number","null"]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"price":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"unit":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"}},"required":["id","unit_no"],"additionalProperties":false},{"type":"null"}]},"status":{"$ref":"#/components/schemas/UnitStatus"},"notes":{"type":["string","null"]},"hold":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"holder_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["id","expires_at","holder_member_id","lead_id"],"additionalProperties":false},{"type":"null"}]}},"required":["id","project_id","kind","code","parking_type","level","area","area_unit","price","unit","status","notes","hold"],"additionalProperties":false},"InventoryItemKind":{"type":"string","enum":["parking","storeroom"]},"InventoryPost":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source":{"type":"string"},"poster":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","phone"],"additionalProperties":false},"raw_text":{"type":"string"},"kind":{"type":["string","null"]},"status":{"type":"string"},"confidence":{"type":["number","null"]},"language":{"type":"string"},"noise_reason":{"type":["string","null"]},"property_id":{"type":["string","null"]},"posted_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"items":{"type":"array","items":{"$ref":"#/components/schemas/InventoryCard"}}},"required":["id","source","poster","raw_text","kind","status","confidence","language","noise_reason","property_id","posted_at","created_at","items"],"additionalProperties":false},"Invitation":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"branch":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"reports_to":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"invited_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"expired":{"type":"boolean"}},"required":["id","email","phone","role","branch","reports_to","invited_by","expires_at","created_at","expired"],"additionalProperties":false},"InvitationCreated":{"type":"object","properties":{"invitation":{"$ref":"#/components/schemas/Invitation"},"url":{"type":"string","description":"The invite link — shown once (only its hash is stored); valid 7 days."},"share":{"type":"object","properties":{"message":{"type":"string"},"whatsapp_url":{"description":"wa.me link with the message, for phone invites.","type":["string","null"]},"email_url":{"description":"mailto: link with the message, for email invites.","type":["string","null"]}},"required":["message","whatsapp_url","email_url"],"additionalProperties":false}},"required":["invitation","url","share"],"additionalProperties":false},"Invoice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"description":"Null on a draft; INV/26-27/0001 once issued.","type":["string","null"]},"document_type":{"type":"string","enum":["tax_invoice","bill_of_supply"]},"status":{"type":"string","enum":["draft","issued","part_paid","paid","cancelled"]},"financial_year":{"type":["string","null"]},"deal":{"anyOf":[{"$ref":"#/components/schemas/DealLink"},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"party_role":{"type":["string","null"]},"bill_to":{"$ref":"#/components/schemas/FinanceParty"},"place_of_supply":{"description":"ISO state code (IGST Act s.12(3): the property).","type":["string","null"]},"pos_basis":{"type":["string","null"]},"supply_regime":{"type":"string","enum":["intra","inter","none"]},"gst_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lines":{"type":"array","items":{"$ref":"#/components/schemas/FinanceLine"}},"subtotal":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"round_off":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"amount_received":{"$ref":"#/components/schemas/Paise"},"amount_tds":{"$ref":"#/components/schemas/Paise"},"amount_credited":{"$ref":"#/components/schemas/Paise"},"balance":{"$ref":"#/components/schemas/Paise"},"issued_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"days_overdue":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ageing":{"anyOf":[{"type":"string","enum":["not_due","d1_30","d31_60","d61_90","d90_plus"]},{"type":"null"}]},"notes":{"type":["string","null"]},"terms":{"type":["string","null"]},"cancelled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cancel_reason":{"type":["string","null"]},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"issued_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"issue":{"type":"boolean"},"cancel":{"type":"boolean"},"credit":{"type":"boolean"},"send":{"type":"boolean"},"allocate":{"type":"boolean"}},"required":["edit","issue","cancel","credit","send","allocate"],"additionalProperties":false}},"required":["id","number","document_type","status","financial_year","deal","contact","party_role","bill_to","place_of_supply","pos_basis","supply_regime","gst_rate_bps","lines","subtotal","cgst","sgst","igst","round_off","total","amount_received","amount_tds","amount_credited","balance","issued_on","due_on","days_overdue","ageing","notes","terms","cancelled_at","cancel_reason","sent_at","created_by","issued_by","created_at","updated_at","capabilities"],"additionalProperties":false},"InvoiceDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"description":"Null on a draft; INV/26-27/0001 once issued.","type":["string","null"]},"document_type":{"type":"string","enum":["tax_invoice","bill_of_supply"]},"status":{"type":"string","enum":["draft","issued","part_paid","paid","cancelled"]},"financial_year":{"type":["string","null"]},"deal":{"anyOf":[{"$ref":"#/components/schemas/DealLink"},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"party_role":{"type":["string","null"]},"bill_to":{"$ref":"#/components/schemas/FinanceParty"},"place_of_supply":{"description":"ISO state code (IGST Act s.12(3): the property).","type":["string","null"]},"pos_basis":{"type":["string","null"]},"supply_regime":{"type":"string","enum":["intra","inter","none"]},"gst_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lines":{"type":"array","items":{"$ref":"#/components/schemas/FinanceLine"}},"subtotal":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"round_off":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"amount_received":{"$ref":"#/components/schemas/Paise"},"amount_tds":{"$ref":"#/components/schemas/Paise"},"amount_credited":{"$ref":"#/components/schemas/Paise"},"balance":{"$ref":"#/components/schemas/Paise"},"issued_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"days_overdue":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ageing":{"anyOf":[{"type":"string","enum":["not_due","d1_30","d31_60","d61_90","d90_plus"]},{"type":"null"}]},"notes":{"type":["string","null"]},"terms":{"type":["string","null"]},"cancelled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cancel_reason":{"type":["string","null"]},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"issued_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"issue":{"type":"boolean"},"cancel":{"type":"boolean"},"credit":{"type":"boolean"},"send":{"type":"boolean"},"allocate":{"type":"boolean"}},"required":["edit","issue","cancel","credit","send","allocate"],"additionalProperties":false},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"tds_amount":{"$ref":"#/components/schemas/Paise"},"gst_amount":{"$ref":"#/components/schemas/Paise"},"excess_amount":{"$ref":"#/components/schemas/Paise"},"mode":{"type":"string"},"reference":{"type":["string","null"]},"received_on":{"$ref":"#/components/schemas/LocalDate"},"status":{"type":"string"}},"required":["id","number","amount","tds_amount","gst_amount","excess_amount","mode","reference","received_on","status"],"additionalProperties":false}},"credit_notes":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"},"total":{"$ref":"#/components/schemas/Paise"},"issued_on":{"$ref":"#/components/schemas/LocalDate"},"reason":{"type":"string"},"gst_reversed":{"type":"boolean"}},"required":["id","number","total","issued_on","reason","gst_reversed"],"additionalProperties":false}},"payment_links":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"},"amount_paid":{"$ref":"#/components/schemas/Paise"},"short_url":{"type":["string","null"]},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","amount","amount_paid","short_url","expires_at"],"additionalProperties":false}},"creditable":{"description":"Taxable value still creditable.","$ref":"#/components/schemas/Paise"},"gst_reversal_until":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}],"description":"The last day a credit note may still reduce its GST (CGST s.34(2))."}},"required":["id","number","document_type","status","financial_year","deal","contact","party_role","bill_to","place_of_supply","pos_basis","supply_regime","gst_rate_bps","lines","subtotal","cgst","sgst","igst","round_off","total","amount_received","amount_tds","amount_credited","balance","issued_on","due_on","days_overdue","ageing","notes","terms","cancelled_at","cancel_reason","sent_at","created_by","issued_by","created_at","updated_at","capabilities","receipts","credit_notes","payment_links","creditable","gst_reversal_until"],"additionalProperties":false},"KeyMovement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"action":{"type":"string","enum":["check_out","check_in"]},"holder":{"type":"string"},"holder_member":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"holder_name":{"type":["string","null"]},"due_back_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":["string","null"]},"by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","action","holder","holder_member","holder_name","due_back_at","note","by","at"],"additionalProperties":false},"KeyMovementInput":{"type":"object","properties":{"action":{"type":"string","enum":["check_out","check_in"]},"holder":{"type":"string","enum":["owner","agent","office","security","tenant","other"],"description":"Who holds the keys after this movement."},"holder_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"holder_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"due_back_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["action","holder"]},"KeyRegister":{"type":"object","properties":{"key_with":{"type":["string","null"]},"movements":{"type":"array","items":{"$ref":"#/components/schemas/KeyMovement"}}},"required":["key_with","movements"],"additionalProperties":false},"Kiosk":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"site_name":{"type":"string"},"status":{"type":"string","enum":["pending","active","revoked"]},"token_prefix":{"type":"string","description":"Letter of its queue tokens (\"A\" → A-1, A-2 …)."},"token_hint":{"description":"Last characters of the device token.","type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"settings":{"$ref":"#/components/schemas/KioskSettings"},"notify_members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"default_owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"paired_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_seen_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"app_version":{"type":["string","null"]},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"pairing_expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"A pairing code waits to be used until then."},"kiosk_url":{"type":"string","description":"Where the tablet opens the kiosk."},"walk_ins_today":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","site_name","status","token_prefix","token_hint","project","source","settings","notify_members","default_owner","paired_at","last_seen_at","app_version","revoked_at","pairing_expires_at","kiosk_url","walk_ins_today","created_at","updated_at"],"additionalProperties":false},"KioskEnrolment":{"type":"object","properties":{"kiosk":{"$ref":"#/components/schemas/Kiosk"},"pairing":{"$ref":"#/components/schemas/KioskPairing"}},"required":["kiosk","pairing"],"additionalProperties":false},"KioskPairing":{"type":"object","properties":{"code":{"type":"string","description":"ABCD-EFGH — typed on the tablet; shown once."},"expires_at":{"$ref":"#/components/schemas/DateTime"},"pair_url":{"type":"string","description":"The kiosk page with the code in its fragment (scan with the tablet)."}},"required":["code","expires_at","pair_url"],"additionalProperties":false},"KioskSettings":{"type":"object","properties":{"welcome_title":{"type":["string","null"]},"welcome_text":{"type":["string","null"]},"accent":{"description":"#RRGGBB; null: the company’s brand colour.","type":["string","null"]},"language":{"type":"string","enum":["en","hi","both"]},"otp":{"type":"string","enum":["required","optional","off"]},"ask_lead_type":{"type":"boolean"},"configurations":{"type":"array","items":{"type":"string"},"description":"Empty: the project’s configurations."},"budget_bands":{"type":"array","items":{"$ref":"#/components/schemas/BudgetBand"},"description":"Empty: the defaults (sale / rent)."},"came_via":{"type":"array","items":{"type":"string","enum":["walk_in","cp","ad","referral","other"]}},"ask_email":{"type":"boolean"},"ask_notes":{"type":"boolean"},"notify_member_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"default_owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"idle_reset_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["welcome_title","welcome_text","accent","language","otp","ask_lead_type","configurations","budget_bands","came_via","ask_email","ask_notes","notify_member_ids","default_owner_id","idle_reset_sec"],"additionalProperties":false},"KycCheck":{"type":"string","enum":["aadhaar","pan","photo"]},"KycDecisionInput":{"type":"object","properties":{"decision":{"type":"string","enum":["accept","reject"]},"note":{"type":"string","minLength":1,"maxLength":300}},"required":["decision","note"]},"KycParty":{"type":"string","enum":["landlord","tenant","co_tenant"]},"KycPartyView":{"type":"object","properties":{"party":{"$ref":"#/components/schemas/KycParty"},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"phone":{"description":"Masked.","type":["string","null"]},"reachable":{"type":"boolean"},"request":{"anyOf":[{"$ref":"#/components/schemas/KycRequest"},{"type":"null"}]},"earlier":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["party","contact_id","name","phone","reachable","request","earlier"],"additionalProperties":false},"KycRequest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"party":{"$ref":"#/components/schemas/KycParty"},"name":{"type":"string"},"status":{"type":"string","enum":["created","link_sent","opened","consented","in_progress","review","verified","failed","expired","cancelled"]},"status_label":{"type":"string"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/KycCheck"}},"link":{"type":"object","properties":{"status":{"type":"string","description":"none | pending | sent | opened | revoked | expired | blocked"},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"invited_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"blocked_reason":{"type":["string","null"]}},"required":["status","expires_at","invited_at","blocked_reason"],"additionalProperties":false},"consent":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["version","at"],"additionalProperties":false},{"type":"null"}],"description":"The notice the person agreed to (its version) and when."},"result":{"anyOf":[{"type":"object","properties":{"verified_name":{"type":["string","null"]},"dob_year":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Only the year of birth is kept."},"aadhaar_masked":{"description":"\"XXXX XXXX 1234\" — never the number.","type":["string","null"]},"aadhaar_source":{"description":"digilocker | offline_xml","type":["string","null"]},"pan_masked":{"description":"\"XXXXXX234F\" — never the full PAN.","type":["string","null"]},"pan_status":{"description":"valid | inoperative | invalid | not_found","type":["string","null"]},"pan_name":{"type":["string","null"]},"name_match":{"description":"match | partial | mismatch","type":["string","null"]},"name_match_score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pan_name_match_score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"review_reasons":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"failure":{"type":["string","null"]},"has_photo":{"type":"boolean"},"purged":{"type":"boolean","description":"The photo and the partner’s answer were deleted (retention)."}},"required":["verified_name","dob_year","aadhaar_masked","aadhaar_source","pan_masked","pan_status","pan_name","name_match","name_match_score","pan_name_match_score","review_reasons","failure","has_photo","purged"],"additionalProperties":false},{"type":"null"}]},"decision":{"anyOf":[{"type":"object","properties":{"by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"note":{"type":"string"}},"required":["by","note"],"additionalProperties":false},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"last_error":{"type":["string","null"]},"can":{"type":"object","properties":{"resend":{"type":"boolean"},"cancel":{"type":"boolean"},"decide":{"type":"boolean"}},"required":["resend","cancel","decide"],"additionalProperties":false}},"required":["id","party","name","status","status_label","checks","link","consent","result","decision","expires_at","completed_at","created_at","last_error","can"],"additionalProperties":false},"LandingAnalytics":{"type":"object","properties":{"totals":{"type":"object","properties":{"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visitors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["views","visitors","conversions"],"additionalProperties":false},"from":{"type":"string"},"to":{"type":"string"},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visitors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","views","visitors","conversions","contacts"],"additionalProperties":false}},"experiment":{"anyOf":[{"type":"object","properties":{"round":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"started_at":{"type":["string","null"]},"live":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/LandingVariantKey"},"name":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visitors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate":{"type":"number"},"comparison":{"anyOf":[{"type":"object","properties":{"rate":{"type":"number"},"control_rate":{"type":"number"},"lift":{"type":["number","null"]},"z":{"type":["number","null"]},"p_value":{"type":["number","null"]},"probability_better":{"type":["number","null"]},"hint":{"type":"string","enum":["not_enough_data","no_clear_difference","leaning_better","leaning_worse","better","worse"]}},"required":["rate","control_rate","lift","z","p_value","probability_better","hint"],"additionalProperties":false},{"type":"null"}]},"hint":{"type":["string","null"]}},"required":["key","name","weight","views","visitors","conversions","rate","comparison","hint"],"additionalProperties":false}}},"required":["round","started_at","live","variants"],"additionalProperties":false},{"type":"null"}]}},"required":["totals","from","to","daily","experiment"],"additionalProperties":false},"LandingBlock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"hero"},"heading":{"type":"string","minLength":1,"maxLength":120},"subheading":{"default":null,"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"cta_label":{"default":"Enquire now","type":"string","minLength":1,"maxLength":40},"show_price":{"default":true,"type":"boolean"},"layout":{"default":"stacked","type":"string","enum":["stacked","overlay"]}},"required":["type","heading","subheading","cta_label","show_price","layout"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"highlights"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"items":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}},"required":["type","title","items"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"gallery"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"limit":{"default":12,"type":"integer","minimum":1,"maximum":24}},"required":["type","title","limit"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"pricing"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"show_areas":{"default":true,"type":"boolean"},"show_availability":{"default":false,"type":"boolean"},"note":{"default":null,"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]}},"required":["type","title","show_areas","show_availability","note"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"floor_plans"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"limit":{"default":6,"type":"integer","minimum":1,"maximum":12}},"required":["type","title","limit"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"video"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"url":{"type":"string","minLength":1,"maxLength":300,"description":"A YouTube or Vimeo link."},"caption":{"default":null,"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]}},"required":["type","title","url","caption"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"amenities"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"items":{"default":[],"maxItems":40,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}}},"required":["type","title","items"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"location"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"show_map":{"default":true,"type":"boolean"},"note":{"default":null,"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]}},"required":["type","title","show_map","note"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"testimonials"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"items":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"object","properties":{"quote":{"type":"string","minLength":1,"maxLength":400},"name":{"type":"string","minLength":1,"maxLength":60},"detail":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]}},"required":["quote","name","detail"],"additionalProperties":false}}},"required":["type","title","items"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"faq"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"items":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":160},"answer":{"type":"string","minLength":1,"maxLength":800}},"required":["question","answer"],"additionalProperties":false}}},"required":["type","title","items"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"cta"},"heading":{"type":"string","minLength":1,"maxLength":120},"text":{"default":null,"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"button_label":{"default":"Enquire now","type":"string","minLength":1,"maxLength":40},"action":{"default":"form","type":"string","enum":["form","whatsapp","call","link"]},"url":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["type","heading","text","button_label","action","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"agent"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"member_id":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"rera_number":{"default":null,"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"show_call":{"default":true,"type":"boolean"},"show_whatsapp":{"default":true,"type":"boolean"}},"required":["type","title","member_id","rera_number","show_call","show_whatsapp"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"listings"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"limit":{"default":6,"type":"integer","minimum":1,"maximum":12}},"required":["type","title","limit"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"form"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"description":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["type","title","description"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"rera"},"disclaimer":{"default":null,"anyOf":[{"type":"string","maxLength":600},{"type":"null"}]},"authority_url":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["type","disclaimer","authority_url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"whatsapp"},"number":{"default":null,"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"text":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["type","number","text"],"additionalProperties":false}],"description":"Each block type appears at most once; a page needs a hero (or an agent card)."},"LandingBlockInput":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"hero"},"heading":{"type":"string","minLength":1,"maxLength":120},"subheading":{"default":null,"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"cta_label":{"default":"Enquire now","type":"string","minLength":1,"maxLength":40},"show_price":{"default":true,"type":"boolean"},"layout":{"default":"stacked","type":"string","enum":["stacked","overlay"]}},"required":["type","heading"]},{"type":"object","properties":{"type":{"type":"string","const":"highlights"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"items":{"default":[],"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"gallery"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"limit":{"default":12,"type":"integer","minimum":1,"maximum":24}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"pricing"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"show_areas":{"default":true,"type":"boolean"},"show_availability":{"default":false,"type":"boolean"},"note":{"default":null,"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"floor_plans"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"limit":{"default":6,"type":"integer","minimum":1,"maximum":12}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"video"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"url":{"type":"string","minLength":1,"maxLength":300,"description":"A YouTube or Vimeo link."},"caption":{"default":null,"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","const":"amenities"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"items":{"default":[],"maxItems":40,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"location"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"show_map":{"default":true,"type":"boolean"},"note":{"default":null,"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"testimonials"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"items":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"object","properties":{"quote":{"type":"string","minLength":1,"maxLength":400},"name":{"type":"string","minLength":1,"maxLength":60},"detail":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]}},"required":["quote","name"]}}},"required":["type","items"]},{"type":"object","properties":{"type":{"type":"string","const":"faq"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"items":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":160},"answer":{"type":"string","minLength":1,"maxLength":800}},"required":["question","answer"]}}},"required":["type","items"]},{"type":"object","properties":{"type":{"type":"string","const":"cta"},"heading":{"type":"string","minLength":1,"maxLength":120},"text":{"default":null,"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"button_label":{"default":"Enquire now","type":"string","minLength":1,"maxLength":40},"action":{"default":"form","type":"string","enum":["form","whatsapp","call","link"]},"url":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["type","heading"]},{"type":"object","properties":{"type":{"type":"string","const":"agent"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"member_id":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"rera_number":{"default":null,"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"show_call":{"default":true,"type":"boolean"},"show_whatsapp":{"default":true,"type":"boolean"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"listings"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"limit":{"default":6,"type":"integer","minimum":1,"maximum":12}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"form"},"title":{"default":null,"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"description":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"rera"},"disclaimer":{"default":null,"anyOf":[{"type":"string","maxLength":600},{"type":"null"}]},"authority_url":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"whatsapp"},"number":{"default":null,"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"text":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["type"]}],"description":"Each block type appears at most once; a page needs a hero (or an agent card)."},"LandingExperiment":{"type":"object","properties":{"round":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"started_at":{"default":null,"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"variants":{"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/LandingVariantKey"},"name":{"type":"string","minLength":1,"maxLength":40},"weight":{"type":"integer","minimum":0,"maximum":100},"blocks":{"default":null,"anyOf":[{"minItems":1,"maxItems":16,"type":"array","items":{"$ref":"#/components/schemas/LandingBlock"}},{"type":"null"}]}},"required":["key","name","weight","blocks"],"additionalProperties":false}}},"required":["round","started_at","variants"],"additionalProperties":false,"description":"An A/B test: the original (`a`, the page’s blocks) first, then up to three variants with their blocks."},"LandingExperiment2":{"type":"object","properties":{"round":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"started_at":{"default":null,"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"variants":{"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/LandingVariantKey"},"name":{"type":"string","minLength":1,"maxLength":40},"weight":{"type":"integer","minimum":0,"maximum":100},"blocks":{"default":null,"anyOf":[{"minItems":1,"maxItems":16,"type":"array","items":{"$ref":"#/components/schemas/LandingBlockInput"}},{"type":"null"}]}},"required":["key","name","weight"]}}},"required":["variants"],"description":"An A/B test: the original (`a`, the page’s blocks) first, then up to three variants with their blocks."},"LandingExperimentInput":{"type":"object","properties":{"round":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"started_at":{"default":null,"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"variants":{"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/LandingVariantKey"},"name":{"type":"string","minLength":1,"maxLength":40},"weight":{"type":"integer","minimum":0,"maximum":100},"blocks":{"default":null,"anyOf":[{"minItems":1,"maxItems":16,"type":"array","items":{"$ref":"#/components/schemas/LandingBlockInput"}},{"type":"null"}]}},"required":["key","name","weight"]}}},"required":["variants"],"description":"An A/B test: the original (`a`, the page’s blocks) first, then up to three variants with their blocks."},"LandingPage":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"},"slug":{"type":"string"},"template":{"$ref":"#/components/schemas/LandingTemplate"},"status":{"$ref":"#/components/schemas/LandingStatus"},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"}},"required":["id","ref_code","title"],"additionalProperties":false},{"type":"null"}]},"member":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"form":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_active":{"type":"boolean"}},"required":["id","name","is_active"],"additionalProperties":false},{"type":"null"}]},"domain":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"hostname":{"type":"string"}},"required":["id","hostname"],"additionalProperties":false},{"type":"null"}]},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/LandingBlock"}},"theme":{"$ref":"#/components/schemas/LandingTheme"},"settings":{"$ref":"#/components/schemas/LandingSettings"},"seo":{"$ref":"#/components/schemas/LandingSeo"},"tracking":{"$ref":"#/components/schemas/LandingTracking"},"experiment":{"anyOf":[{"$ref":"#/components/schemas/LandingExperiment"},{"type":"null"}]},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"live_version":{"anyOf":[{"type":"object","properties":{"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"published_at":{"$ref":"#/components/schemas/DateTime"}},"required":["number","published_at"],"additionalProperties":false},{"type":"null"}]},"version_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"has_unpublished_changes":{"type":"boolean"},"views":{"type":"integer","minimum":0,"maximum":9007199254740991},"visitors":{"type":"integer","minimum":0,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":0,"maximum":9007199254740991},"public_url":{"type":"string"},"issues":{"type":"array","items":{"type":"string"},"description":"What stops the draft from being published (empty: ready)."},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","title","slug","template","status","project","property","member","form","domain","blocks","theme","settings","seo","tracking","experiment","published_at","live_version","version_count","has_unpublished_changes","views","visitors","conversions","public_url","issues","created_at","updated_at"],"additionalProperties":false},"LandingSeo":{"type":"object","properties":{"title":{"default":null,"anyOf":[{"type":"string","maxLength":70},{"type":"null"}]},"description":{"default":null,"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"noindex":{"default":false,"type":"boolean"},"image_media_id":{"default":null,"description":"Link-preview photo; default the cover.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["title","description","noindex","image_media_id"],"additionalProperties":false},"LandingSettings":{"type":"object","properties":{"price_policy":{"default":"show","description":"show · from (\"from ₹X\" only) · on_request (no price anywhere on the page).","type":"string","enum":["show","from","on_request"]}},"required":["price_policy"],"additionalProperties":false},"LandingStatus":{"type":"string","enum":["draft","published","archived"]},"LandingTemplate":{"type":"string","enum":["project","listing","campaign","agent"]},"LandingTheme":{"type":"object","properties":{"preset":{"default":"clean","type":"string","enum":["clean","bold","minimal"]},"appearance":{"default":"auto","type":"string","enum":["auto","light","dark"]},"accent":{"default":"brand","type":"string","enum":["brand","indigo","emerald","amber","rose","teal","slate"]},"corners":{"default":"soft","type":"string","enum":["soft","sharp","round"]}},"required":["preset","appearance","accent","corners"],"additionalProperties":false},"LandingTracking":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom","off"]},"meta_pixel_id":{"anyOf":[{"type":"string","pattern":"^\\d{10,20}$"},{"type":"null"}]},"ga4_id":{"anyOf":[{"type":"string","pattern":"^G-[A-Z0-9]{4,16}$"},{"type":"null"}]},"gtm_id":{"anyOf":[{"type":"string","pattern":"^GTM-[A-Z0-9]{4,12}$"},{"type":"null"}]},"google_ads_id":{"anyOf":[{"type":"string","pattern":"^AW-\\d{6,14}$"},{"type":"null"}]},"google_ads_label":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{4,64}$"},{"type":"null"}]}},"required":["mode","meta_pixel_id","ga4_id","gtm_id","google_ads_id","google_ads_label"],"additionalProperties":false,"description":"inherit: the company’s tags · custom: this page’s own · off: none. Tags load only after the visitor’s consent."},"LandingVariantKey":{"type":"string","enum":["a","b","c","d"]},"LandingVersion":{"type":"object","properties":{"number":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"published_at":{"$ref":"#/components/schemas/DateTime"},"published_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"note":{"type":["string","null"]},"is_live":{"type":"boolean"},"ab_test":{"type":"boolean"}},"required":["number","published_at","published_by","note","is_live","ab_test"],"additionalProperties":false},"Launch":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"project_name":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","eoi_open","eoi_closed","drawn","live","closed"]},"method":{"type":"string","enum":["lottery","first_come"]},"eoi_amount":{"$ref":"#/components/schemas/Paise"},"eoi_opens_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"eoi_closes_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"launch_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"hold_hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"seed_commitment":{"description":"SHA-256 of the draw seed, published when EOIs first open (before any EOI).","type":["string","null"]},"seed":{"description":"The draw seed, shown once the draw ran (verify the commitment).","type":["string","null"]},"seed_committed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"participants_hash":{"description":"SHA-256 of the sorted ids of the EOIs in the draw (one per line), published at close.","type":["string","null"]},"participants_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"beacon_round":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The public randomness beacon (drand) round mixed into the draw, announced in advance."},"beacon_value":{"description":"That round’s published randomness (hex), at the draw.","type":["string","null"]},"recipe":{"type":"array","items":{"type":"string"},"description":"How anyone recomputes the order from what is published."},"drawn_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"notes":{"type":["string","null"]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","project_id","project_name","name","status","method","eoi_amount","eoi_opens_at","eoi_closes_at","launch_at","hold_hours","seed_commitment","seed","seed_committed_at","participants_hash","participants_count","beacon_round","beacon_value","recipe","drawn_at","notes","created_by_id","created_at","updated_at"],"additionalProperties":false},"LaunchBoard":{"type":"object","properties":{"launch":{"$ref":"#/components/schemas/Launch"},"eois":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"units":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"configurations":{"type":"array","items":{"type":"object","properties":{"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["configuration_id","name","available","total"],"additionalProperties":false}},"called":{"type":"array","items":{"$ref":"#/components/schemas/LaunchEoi"}},"next":{"type":"array","items":{"$ref":"#/components/schemas/LaunchEoi"}},"rules":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["launch","eois","units","configurations","called","next","rules"],"additionalProperties":false},"LaunchEoi":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"launch_id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"$ref":"#/components/schemas/Id"},"contact_name":{"type":["string","null"]},"amount":{"$ref":"#/components/schemas/Paise"},"payment_mode":{"type":["string","null"]},"payment_ref":{"type":["string","null"]},"status":{"type":"string","enum":["submitted","verified","checked_in","called","allotted","waitlisted","cancelled","refunded"]},"preferences":{"type":"array","items":{"type":"object","properties":{"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"floor_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"floor_max":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_price":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"additionalProperties":false}},"priority":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"checked_in_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"called_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"allotted_unit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"unit_no":{"type":["string","null"]},"hold_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"allotted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"allotted_pref":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"cancelled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cancel_reason":{"type":["string","null"]},"refunded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"refund_ref":{"type":["string","null"]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","launch_id","number","lead_id","contact_id","contact_name","amount","payment_mode","payment_ref","status","preferences","priority","verified_at","checked_in_at","called_at","allotted_unit_id","unit_no","hold_id","allotted_at","allotted_pref","cancelled_at","cancel_reason","refunded_at","refund_ref","created_by_id","created_at","updated_at"],"additionalProperties":false},"LaunchPriceRule":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"launch_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"threshold_pct":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"increase_per_area":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"increase_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["armed","triggered","applied","dismissed"]},"triggered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"taken_pct_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"applied_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"applied_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"price_list_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","launch_id","name","tower_id","configuration_id","threshold_pct","increase_per_area","increase_bps","status","triggered_at","taken_pct_at","applied_at","applied_by_id","price_list_id","created_by_id","created_at","updated_at"],"additionalProperties":false},"Layout":{"type":"string","enum":["simplex","duplex","triplex"]},"LeadContactItem":{"type":"object","properties":{"k":{"type":"string","description":"Stable key of the phone contact: the contact’s id (one phone contact per person)."},"n":{"type":"string","description":"Display name, \"Lead - Priya Sharma\" (the number when the person has no usable name)."},"p":{"minItems":1,"type":"array","items":{"type":"string"},"description":"The person’s numbers in E.164, the primary one first."},"c":{"type":"string","description":"Organisation line: \"<company> lead\"."},"t":{"type":"string","description":"Note: one line per open lead (type · BHK · budget · place), source and when it was given."},"h":{"type":"string","description":"Hash of n, p, c and t: the phone rewrites a contact only when it changes."}},"required":["k","n","p","c","t","h"],"additionalProperties":false},"LeadDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string","examples":["L-10234"]},"lead_type":{"$ref":"#/components/schemas/LeadType"},"temperature":{"anyOf":[{"$ref":"#/components/schemas/Temperature"},{"type":"null"}]},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"score_probability":{"description":"The company’s model: chance of a site visit or booking within 14 days (null: rules score).","anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"probability_band":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"pipeline_id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/LeadStatusRef"},"sub_status":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"}},"required":["id","key","name"],"additionalProperties":false},{"type":"null"}]},"status_changed_at":{"$ref":"#/components/schemas/DateTime"},"contact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"city":{"type":["string","null"]},"is_nri":{"type":"boolean"},"country":{"type":["string","null"]},"phones":{"type":"array","items":{"type":"string"}},"phone_details":{"type":"array","items":{"$ref":"#/components/schemas/PhoneDetail"}},"alternate_email":{"type":["string","null"]},"kinds":{"type":"array","items":{"type":"string"}},"language":{"type":["string","null"]},"dnd":{"type":"boolean"},"blocked":{"type":"boolean"}},"required":["id","name","city","is_nri","country","phone_details","kinds","language","dnd","blocked"],"additionalProperties":false},"tags":{"type":"array","items":{"type":"string"}},"flags":{"description":"One-click attention flags (CMP-02).","type":"array","items":{"type":"string","enum":["escalate","about_to_convert","highlight"]}},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"presales":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"},"last_enquiry_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"next_follow_up_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_activity_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_contacted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"enquiry_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"call_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connected_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate_kind":{"type":["string","null"]},"duplicate_of_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"expected_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"requirement":{"anyOf":[{"$ref":"#/components/schemas/Requirement"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"pipeline":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"sub_source":{"type":["string","null"]},"utm":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"campaign_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"team_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"partner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"partner_tag_expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"assigned_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"assigned_via":{"type":["string","null"]},"rotation_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expected_close_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"first_response_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"site_visits_done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"won_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"lost_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"lost_note":{"type":["string","null"]},"phone_verified":{"type":"boolean"},"ai_handled":{"type":"boolean"},"score_reasons":{},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"open_tasks":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"type":{"type":"string"},"title":{"type":"string"},"due_at":{"$ref":"#/components/schemas/DateTime"},"assignee_id":{"$ref":"#/components/schemas/Id"},"is_system":{"type":"boolean"}},"required":["id","type","title","due_at","assignee_id","is_system"],"additionalProperties":false}},"enquiries":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"sub_source":{"type":["string","null"]},"campaign_ref":{"type":["string","null"]},"message":{"type":["string","null"]},"is_reenquiry":{"type":"boolean"},"received_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","source","sub_source","campaign_ref","message","is_reenquiry","received_at"],"additionalProperties":false}},"permissions":{"type":"object","properties":{"can_edit":{"type":"boolean"},"can_assign":{"type":"boolean"},"can_delete":{"type":"boolean"}},"required":["can_edit","can_assign","can_delete"],"additionalProperties":false}},"required":["id","number","ref","lead_type","temperature","score","pipeline_id","status","sub_status","status_changed_at","contact","tags","owner","presales","source","project_id","property_id","received_at","last_enquiry_at","next_follow_up_at","last_activity_at","last_contacted_at","enquiry_count","call_attempts","connected_calls","duplicate_kind","duplicate_of_id","expected_value","requirement","created_at","updated_at","pipeline","sub_source","utm","campaign_id","team_id","branch_id","partner_id","partner_tag_expires_at","assigned_at","assigned_via","rotation_count","expected_close_on","first_response_at","site_visits_done","won_at","lost_at","lost_note","phone_verified","ai_handled","score_reasons","custom","open_tasks","enquiries","permissions"],"additionalProperties":false},"LeadDocument":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"$ref":"#/components/schemas/DealDocumentKind"},"name":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receipt_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"uploaded_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"uploaded_at":{"$ref":"#/components/schemas/DateTime"},"scan_status":{"anyOf":[{"$ref":"#/components/schemas/FileScanStatus"},{"type":"null"}]},"deal":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"title":{"type":"string"}},"required":["id","ref","title"],"additionalProperties":false}},"required":["id","kind","name","content_type","size","receipt_id","uploaded_by","uploaded_at","scan_status","deal"],"additionalProperties":false},"LeadDuplicateCheck":{"type":"object","properties":{"match":{"anyOf":[{"type":"string","enum":["phone","email"]},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"ref":{"type":"string"},"lead_type":{"type":"string"},"status":{"type":"object","properties":{"name":{"type":"string"},"category":{"type":"string"},"color":{"type":"string"}},"required":["name","category","color"],"additionalProperties":false},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"},"visible":{"type":"boolean"}},"required":["id","ref","lead_type","status","owner","received_at","visible"],"additionalProperties":false}}},"required":["match","contact","leads"],"additionalProperties":false},"LeadEnquiry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"sub_source":{"type":["string","null"]},"campaign_ref":{"type":["string","null"]},"utm":{},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"message":{"type":["string","null"]},"is_reenquiry":{"type":"boolean"},"received_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","source","sub_source","campaign_ref","utm","project_id","property_id","message","is_reenquiry","received_at"],"additionalProperties":false},"LeadField":{"type":"string","enum":["name","first_name","last_name","phone","alt_phone","email","city","address","pincode","message","budget","budget_min","budget_max","bhk","property_type","lead_type","locality","project","possession","buy_within","purpose","loan","external_id","received_at","campaign","sub_source","utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","fbclid","is_test"]},"LeadFlags":{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"},"flags":{"type":"array","items":{"type":"string","enum":["escalate","about_to_convert","highlight"]}},"secondary_owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"can_flag":{"type":"boolean"},"can_assign":{"type":"boolean"}},"required":["lead_id","flags","secondary_owner","can_flag","can_assign"],"additionalProperties":false},"LeadFormConsentMapping":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":200,"description":"Meta: the custom disclaimer checkbox key. Google: the consent question’s column id."},"channels":{"minItems":1,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ConsentChannel"}},"purpose":{"type":"string","enum":["promotional","service"]},"text":{"type":"string","minLength":1,"maxLength":4000,"description":"The consent text shown on the form, word for word (its hash is the ledger proof)."},"text_version":{"default":null,"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["key","channels","purpose","text","text_version"],"additionalProperties":false},"LeadFormConsentMappingInput":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":200,"description":"Meta: the custom disclaimer checkbox key. Google: the consent question’s column id."},"channels":{"minItems":1,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ConsentChannel"}},"purpose":{"type":"string","enum":["promotional","service"]},"text":{"type":"string","minLength":1,"maxLength":4000,"description":"The consent text shown on the form, word for word (its hash is the ledger proof)."},"text_version":{"default":null,"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["key","channels","purpose","text"]},"LeadMatch":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"score":{"type":"integer","minimum":0,"maximum":100},"status":{"$ref":"#/components/schemas/MatchStatus"},"reasons":{"$ref":"#/components/schemas/MatchReasons"},"lead":{"$ref":"#/components/schemas/MatchedLead"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","score","status","reasons","lead","updated_at"],"additionalProperties":false},"LeadNextSteps":{"type":"object","properties":{"guard_enabled":{"type":"boolean"},"current":{"type":"object","properties":{"status_id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"}},"required":["status_id","key","name"],"additionalProperties":false},"checklist":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"required":{"type":"boolean"},"done":{"type":"boolean"},"source":{"anyOf":[{"type":"string","enum":["manual","evidence"]},{"type":"null"}]},"manual":{"type":"boolean","description":"Ticked by hand (items with evidence tick themselves)."}},"required":["key","label","required","done","source","manual"],"additionalProperties":false}},"steps":{"type":"array","items":{"type":"object","properties":{"status_id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"allowed":{"type":"boolean"},"needs_approval":{"type":"boolean","description":"Only an approval is missing: the move can be asked for."},"reasons":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"Why not (empty when allowed)."}},"required":["status_id","key","name","category","allowed","needs_approval","reasons"],"additionalProperties":false}},"can_override":{"type":"boolean"}},"required":["guard_enabled","current","checklist","steps","can_override"],"additionalProperties":false},"LeadPool":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"name":{"type":"string","minLength":1,"maxLength":80},"branch_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"team_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"source_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"claim_daily_limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"max_open_leads":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"auto_return_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":720},{"type":"null"}]},"low_alert_below":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"claimer_member_ids":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"fresh":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Never called."},"mine":{"anyOf":[{"type":"object","properties":{"may_claim":{"type":"boolean"},"claimed_today":{"type":"integer","minimum":0,"maximum":9007199254740991},"remaining_today":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"capacity_left":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["may_claim","claimed_today","remaining_today","capacity_left"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","branch_ids","team_ids","source_ids","claim_daily_limit","max_open_leads","auto_return_hours","low_alert_below","claimer_member_ids","count","fresh","mine"],"additionalProperties":false},"LeadPoolDefinition":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"name":{"type":"string","minLength":1,"maxLength":80},"branch_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"team_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"source_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"claim_daily_limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"max_open_leads":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"auto_return_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":720},{"type":"null"}]},"low_alert_below":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"claimer_member_ids":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["id","name","branch_ids","team_ids","source_ids","claim_daily_limit","max_open_leads","auto_return_hours","low_alert_below","claimer_member_ids"],"additionalProperties":false},"LeadPoolInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"name":{"type":"string","minLength":1,"maxLength":80},"branch_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"team_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"source_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"claim_daily_limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"max_open_leads":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"auto_return_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":720},{"type":"null"}]},"low_alert_below":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"claimer_member_ids":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["id","name"]},"LeadPoolLead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"},"lead_type":{"type":"string"},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"budget_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"budget_max":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bhk":{"type":"array","items":{"type":"number"}},"locality_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"city":{"type":["string","null"]},"call_attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"enquiry_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"received_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"waiting":{"anyOf":[{"type":"object","properties":{"via":{"type":"string"},"reason":{"type":["string","null"]},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["via","reason","at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","ref","name","lead_type","source","project","budget_min","budget_max","bhk","locality_ids","city","call_attempts","enquiry_count","received_at","created_at","waiting"],"additionalProperties":false},"LeadPushAccepted":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"event_id":{"$ref":"#/components/schemas/Id"},"duplicate":{"type":"boolean","description":"The same lead (same id, or phone + project within 10 min) was already received."}},"required":["ok","event_id","duplicate"],"additionalProperties":false},"LeadScore":{"type":"object","properties":{"score":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"band":{"anyOf":[{"type":"string","enum":["hot","warm","cold"]},{"type":"null"}]},"computed_at":{"type":["string","null"]},"reasons":{"type":"array","items":{"type":"object","properties":{"factor":{"type":"string"},"points":{"type":"number"},"text":{"type":"string"}},"required":["factor","points","text"],"additionalProperties":false}},"intents":{"type":"array","items":{"type":"object","properties":{"intent":{"type":"string"},"confidence":{"type":"number"},"at":{"type":"string"},"message_id":{"type":["string","null"]}},"required":["intent","confidence","at"],"additionalProperties":false}},"source":{"description":"`rules`, or the company’s predictive model that gave the score (`model:v3`).","type":"string"},"probability":{"description":"The model’s chance of a site visit or booking within 14 days (null: rules score).","anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["score","band","computed_at","reasons","intents"],"additionalProperties":false,"description":"0–100 score: the rules with recency decay, or the company’s predictive model once it passed its checks; closed leads have no score."},"LeadSource":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"type":{"type":"string"},"provider":{"type":["string","null"]},"color":{"type":["string","null"]},"is_active":{"type":"boolean"},"default_pipeline_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["id","name","type","provider","color","is_active","default_pipeline_id"],"additionalProperties":false},"LeadSourceDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/LeadSourceType"},"provider":{"type":["string","null"]},"color":{"type":["string","null"]},"is_active":{"type":"boolean"},"monthly_cost":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"default_pipeline_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_tags":{"type":"array","items":{"type":"string"}},"assignment_rule_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"expected_every_hours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Silent-source alarm cadence (hours)."},"expected_every_hours_learned":{"description":"The cadence was learned from the source’s lead history, not set by a member.","type":"boolean"},"alarm_member_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"allowed_ips":{"description":"Lead Push callers allowed by IP address or CIDR block; empty = any caller.","type":"array","items":{"type":"string"}},"connection_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"field_mapping":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"endpoints":{"type":"object","properties":{"lead_push_url":{"description":"Secret URL; only for members who manage lead routing.","type":["string","null"]},"email_address":{"type":["string","null"]},"email_status":{"type":"string","enum":["on","off","unavailable"]},"qr_codes":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"short_code":{"type":"string"},"url":{"type":"string"},"scans":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","short_code","url","scans"],"additionalProperties":false}}},"required":["lead_push_url","email_address","email_status","qr_codes"],"additionalProperties":false},"health":{"$ref":"#/components/schemas/LeadSourceHealth"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","type","provider","color","is_active","monthly_cost","default_pipeline_id","default_project_id","default_tags","assignment_rule_id","default_owner_id","default_lead_type","expected_every_hours","alarm_member_ids","connection_id","field_mapping","endpoints","health","created_at","updated_at"],"additionalProperties":false},"LeadSourceHealth":{"type":"object","properties":{"status":{"type":"string","enum":["ok","silent","failing","idle","inactive"]},"last_lead_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_event_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"leads_24h":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_7d":{"type":"integer","minimum":0,"maximum":9007199254740991},"events_24h":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed_24h":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejected_24h":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicates_7d":{"type":"integer","minimum":0,"maximum":9007199254740991},"error_rate_24h":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"silent_for_hours":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["status","last_lead_at","last_event_at","leads_24h","leads_7d","events_24h","failed_24h","rejected_24h","duplicates_7d","error_rate_24h","silent_for_hours"],"additionalProperties":false},"LeadSourceType":{"type":"string","enum":["portal","social_ads","search_ads","website","landing_page","whatsapp","ivr","missed_call","referral","partner","walk_in","event","print","outdoor","cold_call","import","manual","api","other"]},"LeadStatus":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"category":{"$ref":"#/components/schemas/StatusCategory"},"color":{"type":"string"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_default":{"type":"boolean"},"is_active":{"type":"boolean"},"sla_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"requirements":{"anyOf":[{"$ref":"#/components/schemas/StatusRequirements"},{"type":"null"}]},"sub_statuses":{"type":"array","items":{"$ref":"#/components/schemas/LeadSubStatus"}}},"required":["id","key","name","category","color","sort_order","is_default","is_active","sla_minutes","requirements","sub_statuses"],"additionalProperties":false},"LeadStatusRef":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"category":{"$ref":"#/components/schemas/StatusCategory"}},"required":["id","key","name","color","category"],"additionalProperties":false},"LeadSubStatus":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_active":{"type":"boolean"},"requirements":{"anyOf":[{"$ref":"#/components/schemas/StatusRequirements"},{"type":"null"}]},"auto_follow_up_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"counts_as_contact":{"type":"boolean"}},"required":["id","key","name","sort_order","is_active","requirements","auto_follow_up_minutes","counts_as_contact"],"additionalProperties":false},"LeadSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string","examples":["L-10234"]},"lead_type":{"$ref":"#/components/schemas/LeadType"},"temperature":{"anyOf":[{"$ref":"#/components/schemas/Temperature"},{"type":"null"}]},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"score_probability":{"description":"The company’s model: chance of a site visit or booking within 14 days (null: rules score).","anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"probability_band":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"pipeline_id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/LeadStatusRef"},"sub_status":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"}},"required":["id","key","name"],"additionalProperties":false},{"type":"null"}]},"status_changed_at":{"$ref":"#/components/schemas/DateTime"},"contact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"city":{"type":["string","null"]},"is_nri":{"type":"boolean"},"country":{"type":["string","null"]}},"required":["id","name","city","is_nri","country"],"additionalProperties":false},"tags":{"type":"array","items":{"type":"string"}},"flags":{"description":"One-click attention flags (CMP-02).","type":"array","items":{"type":"string","enum":["escalate","about_to_convert","highlight"]}},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"presales":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"received_at":{"$ref":"#/components/schemas/DateTime"},"last_enquiry_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"next_follow_up_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_activity_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_contacted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"enquiry_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"call_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connected_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate_kind":{"type":["string","null"]},"duplicate_of_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"expected_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"requirement":{"anyOf":[{"type":"object","properties":{"budget_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"budget_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"bhk":{"type":"array","items":{"type":"number"}},"property_types":{"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"locality_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"location_text":{"type":["string","null"]}},"required":["budget_min","budget_max","bhk","property_types","locality_ids","location_text"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","number","ref","lead_type","temperature","score","pipeline_id","status","sub_status","status_changed_at","contact","tags","owner","presales","source","project_id","property_id","received_at","last_enquiry_at","next_follow_up_at","last_activity_at","last_contacted_at","enquiry_count","call_attempts","connected_calls","duplicate_kind","duplicate_of_id","expected_value","requirement","created_at","updated_at"],"additionalProperties":false},"LeadType":{"type":"string","enum":["buy","rent","sell","let_out","invest"]},"LeadView":{"type":"string","enum":["all","mine","unassigned","new","reenquired","follow_ups_today","overdue","open","closed"],"description":"Smart-list presets."},"LegalHold":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"entity_type":{"type":"string"},"entity_id":{"type":"string"},"entity_label":{"type":"string"},"contact_id":{"$ref":"#/components/schemas/Id"},"contact_name":{"type":["string","null"]},"reason":{"type":"string"},"active":{"type":"boolean"},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"placed_at":{"$ref":"#/components/schemas/DateTime"},"placed_by":{"type":["string","null"]},"released_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"released_by":{"type":["string","null"]},"release_note":{"type":["string","null"]}},"required":["id","entity_type","entity_id","entity_label","contact_id","contact_name","reason","active","expires_at","placed_at","placed_by","released_at","released_by","release_note"],"additionalProperties":false},"LegalHoldEntity":{"type":"string","enum":["contact","lead","deal"]},"LinkedWhatsappDevice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"member_id":{"$ref":"#/components/schemas/Id"},"member_name":{"type":["string","null"]},"status":{"type":"string","enum":["linking","connected","disconnected","banned_risk","logged_out"]},"status_reason":{"type":["string","null"]},"status_at":{"$ref":"#/components/schemas/DateTime"},"phone":{"description":"E.164 of the linked number (once paired).","type":["string","null"]},"push_name":{"type":["string","null"]},"platform":{"type":["string","null"]},"frozen":{"type":"boolean","description":"Sending frozen (temporary ban, auto-throttle) until an admin resumes."},"banned_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"day":{"type":"string"},"messages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"message_cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"new_chats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"new_chat_cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queue_capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"at":{"type":["string","null"]}},"required":["day","messages","message_cap","new_chats","new_chat_cap","queued","queue_capacity","at"],"additionalProperties":false},{"type":"null"}],"description":"Today’s use of the per-device caps (the phone’s local day), as of `at`."},"linked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"connected_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_seen_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"logged_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"prompt":{"anyOf":[{"type":"object","properties":{"tone":{"type":"string","enum":["info","warning","danger"]},"title":{"type":"string"},"body":{"type":"string"},"action":{"anyOf":[{"type":"string","enum":["relink","wait","admin"]},{"type":"null"}]}},"required":["tone","title","body","action"],"additionalProperties":false},{"type":"null"}],"description":"What needs attention (re-link, phone offline, frozen), or null."}},"required":["id","member_id","member_name","status","status_reason","status_at","phone","push_name","platform","frozen","banned_until","usage","linked_at","connected_at","last_seen_at","logged_out_at","created_at","prompt"],"additionalProperties":false},"LinkedWhatsappOverview":{"type":"object","properties":{"platform":{"type":"object","properties":{"configured":{"type":"boolean"},"mode":{"type":"string"}},"required":["configured","mode"],"additionalProperties":false},"plan":{"type":"boolean"},"policy":{"type":"object","properties":{"enabled":{"type":"boolean"},"unknown_numbers":{"type":"string","enum":["ignore","enquiry"]},"history_sync_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_first_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changed_at":{"type":["string","null"]},"accepted":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"$ref":"#/components/schemas/DateTime"},"by":{"type":["string","null"]},"current":{"type":"boolean"}},"required":["version","accepted_at","by","current"],"additionalProperties":false},{"type":"null"}]}},"required":["enabled","unknown_numbers","history_sync_days","reply_first_days","changed_at","accepted"],"additionalProperties":false},"can_link":{"type":"boolean"},"can_manage":{"type":"boolean"},"blockers":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"texts":{"type":"object","properties":{"company":{"$ref":"#/components/schemas/LinkedWhatsappRiskText"},"member":{"$ref":"#/components/schemas/LinkedWhatsappRiskText"}},"required":["company","member"],"additionalProperties":false},"me":{"type":"object","properties":{"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"$ref":"#/components/schemas/DateTime"},"current":{"type":"boolean"}},"required":["version","accepted_at","current"],"additionalProperties":false},{"type":"null"}]},"link":{"anyOf":[{"$ref":"#/components/schemas/LinkedWhatsappDevice"},{"type":"null"}]},"history":{"type":"array","items":{"$ref":"#/components/schemas/LinkedWhatsappDevice"}}},"required":["acceptance","link","history"],"additionalProperties":false},"devices":{"type":"array","items":{"$ref":"#/components/schemas/LinkedWhatsappDevice"}}},"required":["platform","plan","policy","can_link","can_manage","blockers","texts","me","devices"],"additionalProperties":false},"LinkedWhatsappRiskText":{"type":"object","properties":{"scope":{"type":"string","enum":["company","member"]},"version":{"type":"string"},"hash":{"type":"string","description":"SHA-256 of the exact text; sent back with the acceptance."},"title":{"type":"string"},"paragraphs":{"type":"array","items":{"type":"string"}},"confirm":{"type":"string"}},"required":["scope","version","hash","title","paragraphs","confirm"],"additionalProperties":false},"ListingBadge":{"type":"object","properties":{"status":{"type":"string","enum":["verified","expired","revoked","invalidated"],"description":"A verified badge past its expiry reads expired."},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}],"description":"The last day the badge counts (company calendar)."}},"required":["status","verified_at","expires_at","valid_until"],"additionalProperties":false},"ListingFreshnessSettings":{"type":"object","properties":{"mode":{"type":"string","enum":["off","built_in","automation"],"description":"off · built_in (PropZolo pings owners) · automation (workflows ask, on property.reconfirm_due)"},"ping_interval_days":{"type":"integer","minimum":7,"maximum":90},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]},"max_pings_per_day":{"type":"integer","minimum":1,"maximum":500},"stale_after_days":{"type":"integer","minimum":7,"maximum":180},"hide_stale_from_matching":{"type":"boolean"},"hide_stale_from_shares":{"type":"boolean"},"notify_agent":{"type":"boolean"},"price_nudge_days":{"type":"integer","minimum":0,"maximum":365,"description":"0 = no price-revision nudges."},"price_nudge_max_enquiries":{"type":"integer","minimum":0,"maximum":100},"mandate_notice":{"type":"boolean","description":"Emit property.mandate_expiring for the mandate-renewal recipe."}},"required":["mode","ping_interval_days","channel","max_pings_per_day","stale_after_days","hide_stale_from_matching","hide_stale_from_shares","notify_agent","price_nudge_days","price_nudge_max_enquiries","mandate_notice"],"additionalProperties":false},"ListingOwnerReport":{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"reportable":{"type":"boolean"},"owner":{"type":"object","properties":{"present":{"type":"boolean"},"name":{"description":"Field rule property.owner: the name, masked, or null.","type":["string","null"]},"stopped":{"type":"boolean"},"owner_wide":{"type":"boolean"}},"required":["present","name","stopped","owner_wide"],"additionalProperties":false},"settings":{"type":"object","properties":{"digest_opt_out":{"type":"boolean"},"opted_out_by":{"type":["string","null"]},"opted_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"sections":{"$ref":"#/components/schemas/OwnerReportSections"},"overrides":{"type":"object","properties":{"price":{"type":"boolean"},"views":{"type":"boolean"},"enquiries":{"type":"boolean"},"visits":{"type":"boolean"},"feedback":{"type":"boolean"},"offers":{"type":"boolean"},"matches":{"type":"boolean"},"activity":{"type":"boolean"}},"additionalProperties":false}},"required":["digest_opt_out","opted_out_by","opted_out_at","sections","overrides"],"additionalProperties":false},"company":{"type":"object","properties":{"digest_enabled":{"type":"boolean"},"schedule":{"type":"string"},"channel":{"type":"string"},"sections":{"$ref":"#/components/schemas/OwnerReportSections"}},"required":["digest_enabled","schedule","channel","sections"],"additionalProperties":false},"links":{"type":"array","items":{"$ref":"#/components/schemas/OwnerReportLink"}},"entries":{"type":"array","items":{"$ref":"#/components/schemas/OwnerReportEntry"}},"visit_feedback":{"type":"array","items":{"type":"object","properties":{"visit_item_id":{"$ref":"#/components/schemas/Id"},"visited_on":{"$ref":"#/components/schemas/LocalDate"},"reaction":{"type":["string","null"]},"reasons":{"type":"array","items":{"type":"string"}},"remarks":{"type":["string","null"]},"suggested_text":{"type":"string"},"added":{"type":"boolean"}},"required":["visit_item_id","visited_on","reaction","reasons","remarks","suggested_text","added"],"additionalProperties":false}},"sends":{"type":"array","items":{"$ref":"#/components/schemas/OwnerReportSend"}}},"required":["property_id","ref_code","title","status","reportable","owner","settings","company","links","entries","visit_feedback","sends"],"additionalProperties":false},"ListingSettings":{"type":"object","properties":{"watermark":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"description":"Drawn when there is no logo (default: company name).","anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"use_logo":{"type":"boolean"},"position":{"type":"string","enum":["bottom_right","bottom_left","top_right","top_left","center"]},"opacity":{"type":"number","minimum":0.05,"maximum":1}},"required":["enabled","use_logo","position","opacity"],"additionalProperties":false},"price_per_sqft_basis":{"type":"string","enum":["super","builtup","carpet"]},"mandate_reminder_days":{"type":"integer","minimum":1,"maximum":90},"matching":{"type":"object","properties":{"radius_km":{"type":"number","minimum":0.5,"maximum":50},"budget_tolerance_pct":{"type":"number","minimum":0,"maximum":50},"min_score":{"type":"integer","minimum":0,"maximum":100},"max_per_lead":{"type":"integer","minimum":1,"maximum":200},"max_per_property":{"type":"integer","minimum":1,"maximum":500}},"required":["radius_km","budget_tolerance_pct","min_score","max_per_lead","max_per_property"],"additionalProperties":false},"shares":{"type":"object","properties":{"expiry_days":{"type":"integer","minimum":1,"maximum":365},"session_gap_minutes":{"type":"integer","minimum":5,"maximum":1440},"long_dwell_seconds":{"type":"integer","minimum":15,"maximum":3600},"hot_task":{"type":"boolean"}},"required":["expiry_days","session_gap_minutes","long_dwell_seconds","hot_task"],"additionalProperties":false}},"required":["watermark","price_per_sqft_basis","mandate_reminder_days","matching","shares"],"additionalProperties":false},"ListingStatus":{"type":"string","enum":["draft","active","on_hold","under_offer","sold","rented","withdrawn","expired"],"description":"`active` is shown as \"Available\"."},"ListingSyndication":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"portal":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]},"status":{"type":"string","enum":["queued","submitted","live","rejected","failed","expired","deactivating","deactivated"]},"op":{"type":"string","enum":["publish","update","deactivate"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price_display":{"type":"string","enum":["exact","on_request"]},"contact_mode":{"type":"string","enum":["agent","company"]},"external_id":{"type":["string","null"]},"external_url":{"type":["string","null"]},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"message":{"type":"string"}},"required":["code","field","severity","message"],"additionalProperties":false}},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error_code":{"type":["string","null"]},"last_error":{"type":["string","null"]},"last_synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"deactivated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"views_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"responses_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leads_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_lead_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","portal","status","op","version","price_display","contact_mode","external_id","external_url","issues","attempts","next_attempt_at","last_error_code","last_error","last_synced_at","published_at","deactivated_at","views_count","responses_count","leads_count","last_lead_at","updated_at"],"additionalProperties":false},"ListingSyndicationOverview":{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"can_publish":{"type":"boolean"},"defaults":{"type":"object","properties":{"portals":{"type":"array","items":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]}},"price_display":{"type":"string","enum":["exact","on_request"]},"contact_mode":{"type":"string","enum":["agent","company"]}},"required":["portals","price_display","contact_mode"],"additionalProperties":false},"portals":{"type":"array","items":{"type":"object","properties":{"portal":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]},"label":{"type":"string"},"account_state":{"type":"string","enum":["not_connected","ok","degraded","error","disconnected","pending"]},"broker_posting":{"type":"boolean"},"verified":{"type":"boolean"},"available":{"type":"boolean","description":"Whether PropZolo publishes to this portal yet (false: coming)"},"row":{"anyOf":[{"$ref":"#/components/schemas/ListingSyndication"},{"type":"null"}]},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"message":{"type":"string"}},"required":["code","field","severity","message"],"additionalProperties":false}},"quota":{"$ref":"#/components/schemas/SyndicationQuota"}},"required":["portal","label","account_state","broker_posting","verified","available","row","issues","quota"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"portal":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"action":{"type":"string"},"outcome":{"type":"string"},"status":{"type":["string","null"]},"error_code":{"type":["string","null"]},"message":{"type":["string","null"]},"lead_id":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","portal","version","action","outcome","status","error_code","message","lead_id","created_at"],"additionalProperties":false}}},"required":["property_id","ref_code","can_publish","defaults","portals","history"],"additionalProperties":false},"ListingType":{"type":"string","enum":["sale","rent","lease","pg"]},"ListingVerificationCounts":{"type":"object","properties":{"to_review":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"in_progress":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiring":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lapsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Listings whose badge expired, was revoked or was invalidated."}},"required":["to_review","in_progress","verified","expiring","lapsed"],"additionalProperties":false},"ListingVerificationDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property_id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/VerificationStatus"},"method":{"type":"string","description":"visit_documents: an agent visit plus ownership documents."},"visit_result":{"anyOf":[{"$ref":"#/components/schemas/VisitResult"},{"type":"null"}]},"started_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"started_at":{"$ref":"#/components/schemas/DateTime"},"visit_started_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"visit_ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"submitted_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"return_note":{"description":"Why a reviewer sent the visit back for retakes.","type":["string","null"]},"reviewed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"review_note":{"type":["string","null"]},"self_reviewed":{"type":"boolean"},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"end_reason":{"type":["string","null"]},"end_note":{"type":["string","null"]},"listing":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"listing_type":{"type":"string"},"status":{"type":"string"},"city":{"type":"string"},"society_name":{"type":["string","null"]},"building":{"type":["string","null"]},"unit_no":{"description":"Field rule property.unit_no.","type":["string","null"]},"address":{"description":"Field rule property.address.","type":["string","null"]},"pincode":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"location_precision":{"type":"string","enum":["exact","approximate"]},"pinned":{"type":"boolean"},"owner_name":{"description":"Field rule property.owner.","type":["string","null"]}},"required":["id","ref_code","title","listing_type","status","city","society_name","building","unit_no","address","pincode","latitude","longitude","location_precision","pinned","owner_name"],"additionalProperties":false},"rule":{"type":"object","properties":{"radius_m":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_accuracy_m":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["radius_m","max_accuracy_m"],"additionalProperties":false},"checklist":{"type":"array","items":{"$ref":"#/components/schemas/VerificationChecklistItem"}},"evaluation":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/VisitResult"},"reasons":{"type":"array","items":{"$ref":"#/components/schemas/VerificationReason"}},"centre":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"}},"required":["lat","lng"],"additionalProperties":false},{"type":"null"}]},"against":{"anyOf":[{"type":"string","enum":["listing","visit_centre"]},{"type":"null"}]},"missing":{"type":"array","items":{"type":"string"}}},"required":["result","reasons","centre","against","missing"],"additionalProperties":false},"location_confirmed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"location_confirmed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"photos":{"type":"array","items":{"$ref":"#/components/schemas/VerificationPhoto"}},"replaced_photos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"documents":{"type":"array","items":{"$ref":"#/components/schemas/VerificationDocument"}},"document_counts":{"type":"object","properties":{"approved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["approved","pending","rejected"],"additionalProperties":false},"document_kinds":{"type":"array","items":{"type":"string","enum":["sale_deed","index_ii","property_tax","electricity_bill","society_noc","authority_letter","other"]}},"min_documents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visitors":{"type":"array","items":{"$ref":"#/components/schemas/MemberRef"}},"grant_refusal":{"description":"Why the badge cannot be granted yet (reviewers).","type":["string","null"]},"can":{"type":"object","properties":{"capture":{"type":"boolean"},"add_documents":{"type":"boolean"},"submit":{"type":"boolean"},"cancel":{"type":"boolean"},"review_documents":{"type":"boolean"},"decide":{"type":"boolean"},"send_back":{"type":"boolean"},"confirm_location":{"type":"boolean"},"open_documents":{"type":"boolean"},"revoke":{"type":"boolean"}},"required":["capture","add_documents","submit","cancel","review_documents","decide","send_back","confirm_location","open_documents","revoke"],"additionalProperties":false}},"required":["id","property_id","status","method","visit_result","started_by","started_at","visit_started_at","visit_ended_at","submitted_at","submitted_by","return_note","reviewed_by","reviewed_at","review_note","self_reviewed","verified_at","expires_at","valid_until","ended_at","end_reason","end_note","listing","rule","checklist","evaluation","location_confirmed_at","location_confirmed_by","photos","replaced_photos","documents","document_counts","document_kinds","min_documents","visitors","grant_refusal","can"],"additionalProperties":false},"ListingVerificationOverview":{"type":"object","properties":{"enabled":{"type":"boolean"},"badge":{"anyOf":[{"$ref":"#/components/schemas/ListingBadge"},{"type":"null"}]},"current":{"anyOf":[{"$ref":"#/components/schemas/ListingVerificationSummary"},{"type":"null"}],"description":"The open (draft / submitted) verification."},"history":{"type":"array","items":{"$ref":"#/components/schemas/ListingVerificationSummary"}},"can":{"type":"object","properties":{"start":{"type":"boolean"},"review":{"type":"boolean"},"revoke":{"type":"boolean"}},"required":["start","review","revoke"],"additionalProperties":false}},"required":["enabled","badge","current","history","can"],"additionalProperties":false},"ListingVerificationQueueItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property_id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/VerificationStatus"},"method":{"type":"string","description":"visit_documents: an agent visit plus ownership documents."},"visit_result":{"anyOf":[{"$ref":"#/components/schemas/VisitResult"},{"type":"null"}]},"started_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"started_at":{"$ref":"#/components/schemas/DateTime"},"visit_started_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"visit_ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"submitted_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"return_note":{"description":"Why a reviewer sent the visit back for retakes.","type":["string","null"]},"reviewed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"review_note":{"type":["string","null"]},"self_reviewed":{"type":"boolean"},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"end_reason":{"type":["string","null"]},"end_note":{"type":["string","null"]},"listing":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"city":{"type":"string"},"society_name":{"type":["string","null"]}},"required":["id","ref_code","title","city","society_name"],"additionalProperties":false},"visitors":{"type":"array","items":{"$ref":"#/components/schemas/MemberRef"}},"photos":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"flagged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","flagged"],"additionalProperties":false},"documents":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["pending","approved","rejected"],"additionalProperties":false}},"required":["id","property_id","status","method","visit_result","started_by","started_at","visit_started_at","visit_ended_at","submitted_at","submitted_by","return_note","reviewed_by","reviewed_at","review_note","self_reviewed","verified_at","expires_at","valid_until","ended_at","end_reason","end_note","listing","visitors","photos","documents"],"additionalProperties":false},"ListingVerificationSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"radius_m":{"type":"integer","minimum":100,"maximum":1000},"max_accuracy_m":{"type":"integer","minimum":10,"maximum":500},"checklist":{"minItems":1,"maxItems":12,"type":"array","items":{"$ref":"#/components/schemas/VerificationChecklistItem"}},"document_kinds":{"minItems":1,"type":"array","items":{"type":"string","enum":["sale_deed","index_ii","property_tax","electricity_bill","society_noc","authority_letter","other"]}},"min_documents":{"type":"integer","minimum":0,"maximum":5},"validity_days":{"type":"integer","minimum":30,"maximum":730},"price_change_pct":{"type":"integer","minimum":1,"maximum":100},"remind_days":{"type":"integer","minimum":0,"maximum":60},"allow_self_review":{"type":"boolean"}},"required":["enabled","radius_m","max_accuracy_m","checklist","document_kinds","min_documents","validity_days","price_change_pct","remind_days","allow_self_review"],"additionalProperties":false},"ListingVerificationSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property_id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/VerificationStatus"},"method":{"type":"string","description":"visit_documents: an agent visit plus ownership documents."},"visit_result":{"anyOf":[{"$ref":"#/components/schemas/VisitResult"},{"type":"null"}]},"started_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"started_at":{"$ref":"#/components/schemas/DateTime"},"visit_started_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"visit_ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"submitted_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"return_note":{"description":"Why a reviewer sent the visit back for retakes.","type":["string","null"]},"reviewed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"review_note":{"type":["string","null"]},"self_reviewed":{"type":"boolean"},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"end_reason":{"type":["string","null"]},"end_note":{"type":["string","null"]}},"required":["id","property_id","status","method","visit_result","started_by","started_at","visit_started_at","visit_ended_at","submitted_at","submitted_by","return_note","reviewed_by","reviewed_at","review_note","self_reviewed","verified_at","expires_at","valid_until","ended_at","end_reason","end_note"],"additionalProperties":false},"LiveLocationState":{"type":"object","properties":{"enabled":{"type":"boolean"},"interval_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"consented":{"type":"boolean"},"notice_version":{"type":"string"},"sharing":{"type":"boolean","description":"Positions are being shared now (consented, on duty, not on a break)."}},"required":["enabled","interval_minutes","consented","notice_version","sharing"],"additionalProperties":false},"LoanCase":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"status":{"type":"string","enum":["logged","submitted","sanctioned","part_disbursed","disbursed","closed","rejected","withdrawn"]},"loan_type":{"type":"string","enum":["home_purchase","construction","plot","plot_construction","balance_transfer","top_up","lap"]},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"deal":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"title":{"type":"string"}},"required":["id","ref","title"],"additionalProperties":false},{"type":"null"}]},"owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lender":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"kind":{"type":"string"}},"required":["id","name","kind"],"additionalProperties":false},{"type":"null"}]},"agent":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"property_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"requested_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"tenure_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sanctioned_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"sanctioned_rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sanctioned_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"sanction_valid_until":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"bank_reference":{"type":["string","null"]},"disbursed_total":{"$ref":"#/components/schemas/Paise"},"documents":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","done"],"additionalProperties":false},"commission":{"anyOf":[{"type":"object","properties":{"rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"cap":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"payer":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"accrued":{"$ref":"#/components/schemas/Paise"},"received":{"$ref":"#/components/schemas/Paise"}},"required":["rate_bps","cap","payer","accrued","received"],"additionalProperties":false},{"type":"null"}],"description":"Null when commission figures are not visible to the caller."},"rejection_reason":{"type":["string","null"]},"notes":{"type":["string","null"]},"status_changed_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"commissions":{"type":"boolean"}},"required":["edit","commissions"],"additionalProperties":false}},"required":["id","ref","status","loan_type","lead","deal","owner","lender","agent","property_value","requested_amount","tenure_months","rate_bps","sanctioned_amount","sanctioned_rate_bps","sanctioned_on","sanction_valid_until","bank_reference","disbursed_total","documents","commission","rejection_reason","notes","status_changed_at","created_at","updated_at","capabilities"],"additionalProperties":false},"LoanCaseDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"status":{"type":"string","enum":["logged","submitted","sanctioned","part_disbursed","disbursed","closed","rejected","withdrawn"]},"loan_type":{"type":"string","enum":["home_purchase","construction","plot","plot_construction","balance_transfer","top_up","lap"]},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"deal":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"title":{"type":"string"}},"required":["id","ref","title"],"additionalProperties":false},{"type":"null"}]},"owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lender":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"kind":{"type":"string"}},"required":["id","name","kind"],"additionalProperties":false},{"type":"null"}]},"agent":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"property_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"requested_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"tenure_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sanctioned_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"sanctioned_rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sanctioned_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"sanction_valid_until":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"bank_reference":{"type":["string","null"]},"disbursed_total":{"$ref":"#/components/schemas/Paise"},"documents":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","done"],"additionalProperties":false},"commission":{"anyOf":[{"type":"object","properties":{"rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"cap":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"payer":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"accrued":{"$ref":"#/components/schemas/Paise"},"received":{"$ref":"#/components/schemas/Paise"}},"required":["rate_bps","cap","payer","accrued","received"],"additionalProperties":false},{"type":"null"}],"description":"Null when commission figures are not visible to the caller."},"rejection_reason":{"type":["string","null"]},"notes":{"type":["string","null"]},"status_changed_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"commissions":{"type":"boolean"}},"required":["edit","commissions"],"additionalProperties":false},"applicants":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"relation":{"type":"string"},"is_primary":{"type":"boolean"},"employment":{"type":"string","enum":["salaried","self_employed","professional","other"]},"employer":{"type":["string","null"]},"monthly_income":{"$ref":"#/components/schemas/Paise"},"monthly_obligations":{"$ref":"#/components/schemas/Paise"},"age":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","contact_id","name","relation","is_primary","employment","employer","monthly_income","monthly_obligations","age"],"additionalProperties":false}},"eligibility":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"documents_list":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","aadhaar","photo","address_proof","bank_statements","salary_slips","form16","employment_proof","itr","financials","business_proof","qualification_proof","sale_agreement","allotment_letter","title_documents","approved_plan","construction_estimate","existing_loan_statement","foreclosure_letter","own_contribution_receipt","other"]},"label":{"type":["string","null"]},"status":{"type":"string","enum":["pending","received","verified","waived"]},"file_name":{"type":["string","null"]},"content_type":{"type":["string","null"]},"size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"uploaded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["id","kind","label","status","file_name","content_type","size","uploaded_at","verified_at","note"],"additionalProperties":false}},"handoffs":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"lender":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"channel":{"type":"string","enum":["email","whatsapp","link"]},"status":{"type":"string","enum":["sent","blocked","link","revoked"]},"blocked_reason":{"type":["string","null"]},"documents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"document_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"expires_at":{"$ref":"#/components/schemas/DateTime"},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"open_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"live":{"type":"boolean"},"consent_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","lender","channel","status","blocked_reason","documents","document_ids","expires_at","revoked_at","first_opened_at","last_opened_at","open_count","live","consent_id","created_at"],"additionalProperties":false}},"disbursals":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"amount":{"$ref":"#/components/schemas/Paise"},"disbursed_on":{"$ref":"#/components/schemas/LocalDate"},"reference":{"type":["string","null"]},"note":{"type":["string","null"]},"reverses_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"Set on a reversal entry (negative amount)."},"reversed":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","amount","disbursed_on","reference","note","reverses_id","reversed","created_at"],"additionalProperties":false}},"consents":{"type":"array","items":{"$ref":"#/components/schemas/LoanConsent"}},"commissions":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"disbursal_id":{"$ref":"#/components/schemas/Id"},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"base_amount":{"$ref":"#/components/schemas/Paise"},"amount":{"$ref":"#/components/schemas/Paise"},"received_amount":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["pending","received","written_off"]},"accrued_on":{"$ref":"#/components/schemas/LocalDate"},"received_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"reference":{"type":["string","null"]}},"required":["id","disbursal_id","rate_bps","base_amount","amount","received_amount","status","accrued_on","received_on","reference"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","ref","status","loan_type","lead","deal","owner","lender","agent","property_value","requested_amount","tenure_months","rate_bps","sanctioned_amount","sanctioned_rate_bps","sanctioned_on","sanction_valid_until","bank_reference","disbursed_total","documents","commission","rejection_reason","notes","status_changed_at","created_at","updated_at","capabilities","applicants","eligibility","documents_list","handoffs","disbursals","consents","commissions"],"additionalProperties":false},"LoanCommission":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"case_id":{"$ref":"#/components/schemas/Id"},"case_ref":{"type":"string"},"payer":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"payer_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"base_amount":{"$ref":"#/components/schemas/Paise"},"amount":{"$ref":"#/components/schemas/Paise"},"received_amount":{"$ref":"#/components/schemas/Paise"},"outstanding":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["pending","received","written_off"]},"accrued_on":{"$ref":"#/components/schemas/LocalDate"},"received_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"reference":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["id","case_id","case_ref","payer","payer_id","rate_bps","base_amount","amount","received_amount","outstanding","status","accrued_on","received_on","reference","note"],"additionalProperties":false},"LoanCommissionRule":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"partner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"Null: the company default."},"slabs":{"type":"array","items":{"type":"object","properties":{"up_to":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["up_to","rate_bps"],"additionalProperties":false}},"cap":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"notes":{"type":["string","null"]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","partner_id","slabs","cap","notes","updated_at"],"additionalProperties":false},"LoanConsent":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"lender_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"lender_names":{"type":"array","items":{"type":"string"}},"purpose":{"type":"string"},"notice_version":{"type":"string"},"method":{"type":"string","enum":["otp","written"]},"status":{"type":"string","enum":["pending","given","withdrawn"]},"evidence":{"type":["string","null"]},"given_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"withdrawn_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","lender_ids","lender_names","purpose","notice_version","method","status","evidence","given_at","withdrawn_at","created_at"],"additionalProperties":false},"LoanEligibility":{"type":"object","properties":{"total_income":{"$ref":"#/components/schemas/Paise"},"total_obligations":{"$ref":"#/components/schemas/Paise"},"foir_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_emi":{"$ref":"#/components/schemas/Paise"},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tenure_months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tenure_capped":{"type":"boolean"},"loan_by_income":{"$ref":"#/components/schemas/Paise"},"loan_by_ltv":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"ltv_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"eligible":{"$ref":"#/components/schemas/Paise"},"emi":{"$ref":"#/components/schemas/Paise"},"limited_by":{"type":"string","enum":["income","ltv","tenure"]},"own_contribution":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["total_income","total_obligations","foir_bps","max_emi","rate_bps","tenure_months","tenure_capped","loan_by_income","loan_by_ltv","ltv_bps","eligible","emi","limited_by","own_contribution"],"additionalProperties":false},"LoanExport":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"file_name":{"type":["string","null"]},"rows":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","status","file_name","rows","created_at","finished_at"],"additionalProperties":false},"LoanPartner":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["bank","nbfc","hfc","dsa"]},"name":{"type":"string"},"branch":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"phone_e164":{"type":["string","null"]},"email":{"type":["string","null"]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"foir_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ltv_cap_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","name","branch","contact_name","phone_e164","email","contact_id","rate_bps","foir_bps","ltv_cap_bps","notes","status","created_at","updated_at"],"additionalProperties":false},"LoanSettings":{"type":"object","properties":{"foir_bps":{"type":"integer","minimum":1000,"maximum":8000},"default_rate_bps":{"type":"integer","minimum":100,"maximum":3000},"default_tenure_months":{"type":"integer","minimum":12,"maximum":360},"retirement_age":{"type":"object","properties":{"salaried":{"type":"integer","minimum":45,"maximum":80},"self_employed":{"type":"integer","minimum":45,"maximum":80},"professional":{"type":"integer","minimum":45,"maximum":80},"other":{"type":"integer","minimum":45,"maximum":80}},"required":["salaried","self_employed","professional","other"],"additionalProperties":false},"handoff_link_days":{"type":"integer","minimum":1,"maximum":60},"sanction_alert_days":{"type":"integer","minimum":1,"maximum":60},"commission_overdue_days":{"type":"integer","minimum":7,"maximum":365}},"required":["foir_bps","default_rate_bps","default_tenure_months","retirement_age","handoff_link_days","sanction_alert_days","commission_overdue_days"],"additionalProperties":false},"LoanSettingsInput":{"type":"object","properties":{"foir_bps":{"type":"integer","minimum":1000,"maximum":8000},"default_rate_bps":{"type":"integer","minimum":100,"maximum":3000},"default_tenure_months":{"type":"integer","minimum":12,"maximum":360},"retirement_age":{"type":"object","properties":{"salaried":{"type":"integer","minimum":45,"maximum":80},"self_employed":{"type":"integer","minimum":45,"maximum":80},"professional":{"type":"integer","minimum":45,"maximum":80},"other":{"type":"integer","minimum":45,"maximum":80}},"required":["salaried","self_employed","professional","other"]},"handoff_link_days":{"type":"integer","minimum":1,"maximum":60},"sanction_alert_days":{"type":"integer","minimum":1,"maximum":60},"commission_overdue_days":{"type":"integer","minimum":7,"maximum":365}},"required":["foir_bps","default_rate_bps","default_tenure_months","retirement_age","handoff_link_days","sanction_alert_days","commission_overdue_days"]},"LocalDate":{"type":"string","format":"date","description":"Calendar date YYYY-MM-DD in the company time zone."},"LocalityOption":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"pincode":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]}},"required":["id","name","city","state","pincode","latitude","longitude"],"additionalProperties":false},"LocalityRef":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"city":{"type":"string"}},"required":["id","name","city"],"additionalProperties":false},"LogCallOutcomeInput":{"type":"object","properties":{"outcome":{"description":"For calls without a lead: personal · colleague · not_a_lead · wrong_number · spam · other.","anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"lead_status":{"description":"The lead’s new status / sub-status and what it requires (the status sheet).","anyOf":[{"type":"object","properties":{"status_id":{"$ref":"#/components/schemas/Id"},"sub_status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"follow_up_at":{"anyOf":[{"$ref":"#/components/schemas/ZonedDateTimeInput"},{"type":"null"}]},"follow_up_preset":{"anyOf":[{"$ref":"#/components/schemas/FollowUpPreset"},{"type":"null"}]},"visit":{"anyOf":[{"type":"object","properties":{"scheduled_at":{"$ref":"#/components/schemas/ZonedDateTimeInput"},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"unit_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"meeting_point":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["scheduled_at"]},{"type":"null"}]},"lost_reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"deal":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"fields":{"description":"Values the status requires (requirement fields, language, amount …) and custom fields.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"override_guard":{"description":"Override the process guard (F-04): needs the override permission; audited with the reason.","anyOf":[{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]},{"type":"null"}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}},"required":["status_id"]},{"type":"null"}]}}},"LogCallOutcomeResult":{"type":"object","properties":{"call":{"$ref":"#/components/schemas/CallDetail"},"status_changed":{"type":"boolean"},"task_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"visit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["call","status_changed","task_ids","visit_id"],"additionalProperties":false},"LoginApproval":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"device":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["web","mobile"]},"label":{"type":["string","null"]}},"required":["id","kind","label"],"additionalProperties":false},"reason":{"type":"string","enum":["new_device","device_limit","revoked"]},"admins_only":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","expired","cancelled","used"]},"requested_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"ip_address":{"type":["string","null"]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decided_by":{"type":["string","null"]},"decided_via":{"type":["string","null"]},"code":{"description":"Read it to the member — only on requests you may decide.","type":["string","null"]},"can_decide":{"type":"boolean"},"approved_devices":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"label":{"type":["string","null"]},"last_seen_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","label","last_seen_at"],"additionalProperties":false}}},"required":["id","member","device","reason","admins_only","status","requested_at","expires_at","ip_address","decided_at","decided_by","decided_via","code","can_decide","approved_devices"],"additionalProperties":false},"LoginPolicyView":{"type":"object","properties":{"approval_required":{"type":"boolean","description":"Sign-ins from devices not yet approved wait for approval."},"max_web_devices":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}],"description":"Approved browsers per member; null: no limit."},"max_mobile_devices":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}],"description":"Approved phones per member; null: no limit."},"approval_minutes":{"type":"integer","minimum":5,"maximum":60},"secure_screens":{"type":"boolean","description":"Block screenshots and screen recording on the app’s sensitive screens (Android)."},"pending_approvals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["approval_required","max_web_devices","max_mobile_devices","approval_minutes","secure_screens","pending_approvals"],"additionalProperties":false},"Mailbox":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"$ref":"#/components/schemas/EmailSyncProvider"},"email":{"type":"string"},"status":{"type":"string","enum":["active","paused","error","disconnected"]},"status_reason":{"description":"auth (reconnect) · member / admin (paused or disconnected by) · provider.","type":["string","null"]},"member":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"connected_at":{"$ref":"#/components/schemas/DateTime"},"consent_at":{"$ref":"#/components/schemas/DateTime"},"window_start":{"description":"The first sync reads mail sent from here on.","$ref":"#/components/schemas/DateTime"},"last_sync_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_ok_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"next_sync_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"synced_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"backfilling":{"type":"boolean","description":"The first sync of the window is still running."},"excluded":{"type":"array","items":{"type":"string"},"description":"The member’s own excluded addresses and domains."}},"required":["id","provider","email","status","status_reason","member","connected_at","consent_at","window_start","last_sync_at","last_ok_at","next_sync_at","last_error","synced_count","backfilling","excluded"],"additionalProperties":false},"MaintenancePeriod":{"type":"string","enum":["monthly","quarterly","yearly","one_time"]},"MaintenanceSettings":{"type":"object","properties":{"categories":{"minItems":1,"type":"array","items":{"type":"string","enum":["plumbing","electrical","appliance","carpentry","pest","painting","society","other"]}},"sla":{"type":"object","properties":{"emergency":{"type":"object","properties":{"respond_hours":{"type":"integer","minimum":1,"maximum":1440},"resolve_hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["respond_hours","resolve_hours"],"additionalProperties":false},"high":{"type":"object","properties":{"respond_hours":{"type":"integer","minimum":1,"maximum":1440},"resolve_hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["respond_hours","resolve_hours"],"additionalProperties":false},"normal":{"type":"object","properties":{"respond_hours":{"type":"integer","minimum":1,"maximum":1440},"resolve_hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["respond_hours","resolve_hours"],"additionalProperties":false},"low":{"type":"object","properties":{"respond_hours":{"type":"integer","minimum":1,"maximum":1440},"resolve_hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["respond_hours","resolve_hours"],"additionalProperties":false}},"required":["emergency","high","normal","low"],"additionalProperties":false},"approval":{"type":"object","properties":{"default_threshold":{"$ref":"#/components/schemas/Paise"},"link_days":{"type":"integer","minimum":1,"maximum":14}},"required":["default_threshold","link_days"],"additionalProperties":false},"lifecycle":{"type":"object","properties":{"auto_close_days":{"type":"integer","minimum":0,"maximum":30},"reopen_days":{"type":"integer","minimum":0,"maximum":90}},"required":["auto_close_days","reopen_days"],"additionalProperties":false},"intake":{"type":"object","properties":{"whatsapp":{"type":"boolean"},"ai_triage":{"type":"boolean"},"auto_reply":{"type":"boolean"},"tenant_link_days":{"type":"integer","minimum":1,"maximum":365}},"required":["whatsapp","ai_triage","auto_reply","tenant_link_days"],"additionalProperties":false},"notify_tenant":{"type":"boolean"}},"required":["categories","sla","approval","lifecycle","intake","notify_tenant"],"additionalProperties":false},"MaintenanceSettingsInput":{"type":"object","properties":{"categories":{"minItems":1,"type":"array","items":{"type":"string","enum":["plumbing","electrical","appliance","carpentry","pest","painting","society","other"]}},"sla":{"type":"object","properties":{"emergency":{"type":"object","properties":{"respond_hours":{"type":"integer","minimum":1,"maximum":1440},"resolve_hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["respond_hours","resolve_hours"]},"high":{"type":"object","properties":{"respond_hours":{"type":"integer","minimum":1,"maximum":1440},"resolve_hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["respond_hours","resolve_hours"]},"normal":{"type":"object","properties":{"respond_hours":{"type":"integer","minimum":1,"maximum":1440},"resolve_hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["respond_hours","resolve_hours"]},"low":{"type":"object","properties":{"respond_hours":{"type":"integer","minimum":1,"maximum":1440},"resolve_hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["respond_hours","resolve_hours"]}},"required":["emergency","high","normal","low"]},"approval":{"type":"object","properties":{"default_threshold":{"$ref":"#/components/schemas/Paise"},"link_days":{"type":"integer","minimum":1,"maximum":14}},"required":["default_threshold","link_days"]},"lifecycle":{"type":"object","properties":{"auto_close_days":{"type":"integer","minimum":0,"maximum":30},"reopen_days":{"type":"integer","minimum":0,"maximum":90}},"required":["auto_close_days","reopen_days"]},"intake":{"type":"object","properties":{"whatsapp":{"type":"boolean"},"ai_triage":{"type":"boolean"},"auto_reply":{"type":"boolean"},"tenant_link_days":{"type":"integer","minimum":1,"maximum":365}},"required":["whatsapp","ai_triage","auto_reply","tenant_link_days"]},"notify_tenant":{"type":"boolean"}},"required":["categories","sla","approval","lifecycle","intake","notify_tenant"]},"MaintenanceTicket":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string","description":"MT-12"},"agreement_id":{"$ref":"#/components/schemas/Id"},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false},{"type":"null"}]},"tenant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"source":{"type":"string","enum":["whatsapp","agent","tenant_form"]},"title":{"type":"string"},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"urgency":{"type":"string","enum":["emergency","high","normal","low"]},"status":{"type":"string","enum":["new","triaged","assigned","scheduled","in_progress","resolved","closed","cancelled"]},"triage":{"anyOf":[{"type":"object","properties":{"category":{"type":["string","null"]},"urgency":{"type":["string","null"]},"vendor_trade":{"type":["string","null"]},"summary":{"type":["string","null"]},"clarifying_question":{"type":["string","null"]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"model":{"type":["string","null"]},"at":{"type":["string","null"]}},"required":["category","urgency","vendor_trade","summary","clarifying_question","confidence","flags","model","at"],"additionalProperties":false},{"type":"null"}],"description":"The AI proposal as proposed (an agent confirms it)."},"triage_confirmed":{"type":"boolean"},"vendor":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"vendor_trade":{"type":["string","null"]},"scheduled_for":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"closed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"closed_via":{"type":["string","null"]},"reopened_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sla":{"type":"object","properties":{"respond_due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolve_due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"state":{"type":"string","enum":["met","on_track","at_risk","breached"]}},"required":["respond_due_at","resolve_due_at","state"],"additionalProperties":false},"cost_estimate":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"estimate_note":{"type":["string","null"]},"final_cost":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"payer":{"anyOf":[{"type":"string","enum":["owner","tenant","deposit","company"]},{"type":"null"}]},"approval":{"type":"object","properties":{"status":{"type":"string","enum":["none","not_needed","pending","approved","rejected","question"]},"threshold":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"approved_estimate":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["status","threshold","approved_estimate","decided_at","note"],"additionalProperties":false},"deposit_charge_status":{"type":"string","enum":["none","pending","recorded"],"description":"A deposit-paid repair waits for the deposit ledger (R-04) while pending."},"resolution_note":{"type":["string","null"]},"cancel_reason":{"type":["string","null"]},"assignee_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"}},"required":["edit"],"additionalProperties":false}},"required":["id","number","ref","agreement_id","property","tenant","source","title","description","category","urgency","status","triage","triage_confirmed","vendor","vendor_trade","scheduled_for","resolved_at","closed_at","closed_via","reopened_count","sla","cost_estimate","estimate_note","final_cost","payer","approval","deposit_charge_status","resolution_note","cancel_reason","assignee_id","created_at","updated_at","capabilities"],"additionalProperties":false},"MaintenanceTicketDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ref":{"type":"string","description":"MT-12"},"agreement_id":{"$ref":"#/components/schemas/Id"},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false},{"type":"null"}]},"tenant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"source":{"type":"string","enum":["whatsapp","agent","tenant_form"]},"title":{"type":"string"},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"urgency":{"type":"string","enum":["emergency","high","normal","low"]},"status":{"type":"string","enum":["new","triaged","assigned","scheduled","in_progress","resolved","closed","cancelled"]},"triage":{"anyOf":[{"type":"object","properties":{"category":{"type":["string","null"]},"urgency":{"type":["string","null"]},"vendor_trade":{"type":["string","null"]},"summary":{"type":["string","null"]},"clarifying_question":{"type":["string","null"]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"model":{"type":["string","null"]},"at":{"type":["string","null"]}},"required":["category","urgency","vendor_trade","summary","clarifying_question","confidence","flags","model","at"],"additionalProperties":false},{"type":"null"}],"description":"The AI proposal as proposed (an agent confirms it)."},"triage_confirmed":{"type":"boolean"},"vendor":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"vendor_trade":{"type":["string","null"]},"scheduled_for":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"closed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"closed_via":{"type":["string","null"]},"reopened_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sla":{"type":"object","properties":{"respond_due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolve_due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"state":{"type":"string","enum":["met","on_track","at_risk","breached"]}},"required":["respond_due_at","resolve_due_at","state"],"additionalProperties":false},"cost_estimate":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"estimate_note":{"type":["string","null"]},"final_cost":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"payer":{"anyOf":[{"type":"string","enum":["owner","tenant","deposit","company"]},{"type":"null"}]},"approval":{"type":"object","properties":{"status":{"type":"string","enum":["none","not_needed","pending","approved","rejected","question"]},"threshold":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"approved_estimate":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["status","threshold","approved_estimate","decided_at","note"],"additionalProperties":false},"deposit_charge_status":{"type":"string","enum":["none","pending","recorded"],"description":"A deposit-paid repair waits for the deposit ledger (R-04) while pending."},"resolution_note":{"type":["string","null"]},"cancel_reason":{"type":["string","null"]},"assignee_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"}},"required":["edit"],"additionalProperties":false},"events":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string"},"actor":{"type":"string"},"actor_name":{"type":"string"},"body":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","actor","actor_name","body","created_at"],"additionalProperties":false}},"media":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source":{"type":"string"},"role":{"type":"string","enum":["issue","work_done","invoice"]},"kind":{"type":"string","enum":["photo","video","document"]},"status":{"type":"string","enum":["processing","ready","failed"]},"content_type":{"type":"string"},"failure":{"type":["string","null"]},"preview_url":{"description":"The EXIF-free copy, a 5-minute signed URL.","type":["string","null"]},"thumb_url":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","source","role","kind","status","content_type","failure","preview_url","thumb_url","created_at"],"additionalProperties":false}},"links":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"party":{"type":"string","enum":["tenant","vendor","owner"]},"status":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"used_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decision":{"type":["string","null"]},"blocked_reason":{"type":["string","null"]}},"required":["id","party","status","expires_at","used_at","decision","blocked_reason"],"additionalProperties":false}},"vendor_phone":{"type":["string","null"]}},"required":["id","number","ref","agreement_id","property","tenant","source","title","description","category","urgency","status","triage","triage_confirmed","vendor","vendor_trade","scheduled_for","resolved_at","closed_at","closed_via","reopened_count","sla","cost_estimate","estimate_note","final_cost","payer","approval","deposit_charge_status","resolution_note","cancel_reason","assignee_id","created_at","updated_at","capabilities","events","media","links","vendor_phone"],"additionalProperties":false},"MaintenanceVendor":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"trades":{"type":"array","items":{"type":"string"}},"areas":{"type":"array","items":{"type":"string"}},"phone_e164":{"type":"string"},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"rates_note":{"type":["string","null"]},"notes":{"type":["string","null"]},"rating":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["active","archived"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","trades","areas","phone_e164","contact_id","rates_note","notes","rating","status","created_at","updated_at"],"additionalProperties":false},"MakeRentalOfferInput":{"type":"object","properties":{"monthly_rent":{"$ref":"#/components/schemas/PaiseInput"},"maintenance_included":{"type":["boolean","null"]},"maintenance_amount":{"description":"A month, when maintenance is extra.","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"deposit_months":{"anyOf":[{"anyOf":[{"type":"number","minimum":0,"maximum":24},{"type":"string","pattern":"^\\d{1,4}(?:\\.\\d{1,2})?$"}]},{"type":"null"}]},"deposit_amount":{"description":"Wins over deposit_months when both are given.","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"escalation_pct":{"anyOf":[{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"string","pattern":"^\\d{1,4}(?:\\.\\d{1,2})?$"}]},{"type":"null"}]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":120},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":120},{"type":"null"}]},"agreement_months":{"description":"Default 11 (company setting).","anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]},"move_in_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"inclusions":{"anyOf":[{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},{"type":"null"}]},"special_conditions":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"tenant_profile":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"side":{"description":"Default: the tenant, or — with an offer on the table — the other side (a counter).","anyOf":[{"$ref":"#/components/schemas/RentalOfferSide"},{"type":"null"}]},"expires_in_hours":{"description":"0: the offer never lapses.","anyOf":[{"type":"integer","minimum":0,"maximum":720},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["monthly_rent"]},"MandateType":{"type":"string","enum":["exclusive","non_exclusive","open"]},"ManualCallVerdict":{"type":"string","enum":["connected","rnr","busy","switched_off","wrong_number"],"description":"What the agent says happened: connected · rnr (ringing, no response) · busy · switched_off · wrong_number."},"MappingTarget":{"anyOf":[{"$ref":"#/components/schemas/LeadField"},{"type":"string","const":"ignore"},{"type":"string","pattern":"^custom\\.[a-z][a-z0-9_]{0,39}$"}],"description":"A PropZolo field, `custom.<key>` (a custom field) or `ignore`."},"MarketingAudience":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"description":{"type":["string","null"]},"segment":{"$ref":"#/components/schemas/AudienceSegment"},"destinations":{"type":"array","items":{"type":"string","enum":["meta","google"]}},"schedule":{"type":"string","enum":["manual","daily","weekly"]},"status":{"type":"string","enum":["active","paused","archived"]},"last_synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_counts":{"anyOf":[{"type":"object","properties":{"segment":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"eligible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"excluded":{"type":"object","propertyNames":{"type":"string","enum":["deleted","booked_buyer","consent_withdrawn","suppressed","no_lawful_basis","no_identifier","ads_objection"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"by_destination":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["added","removed","size"],"additionalProperties":false}}},"required":["segment","eligible","excluded","by_destination"],"additionalProperties":false},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","description","segment","destinations","schedule","status","last_synced_at","last_counts","created_by_id","created_at","updated_at"],"additionalProperties":false},"MarketingAudienceDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"description":{"type":["string","null"]},"segment":{"$ref":"#/components/schemas/AudienceSegment"},"destinations":{"type":"array","items":{"type":"string","enum":["meta","google"]}},"schedule":{"type":"string","enum":["manual","daily","weekly"]},"status":{"type":"string","enum":["active","paused","archived"]},"last_synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_counts":{"anyOf":[{"type":"object","properties":{"segment":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"eligible":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"excluded":{"type":"object","propertyNames":{"type":"string","enum":["deleted","booked_buyer","consent_withdrawn","suppressed","no_lawful_basis","no_identifier","ads_objection"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"by_destination":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["added","removed","size"],"additionalProperties":false}}},"required":["segment","eligible","excluded","by_destination"],"additionalProperties":false},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"syncs":{"type":"array","items":{"$ref":"#/components/schemas/AudienceSync"}}},"required":["id","name","description","segment","destinations","schedule","status","last_synced_at","last_counts","created_by_id","created_at","updated_at","syncs"],"additionalProperties":false},"MarketingCampaign":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"source":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"],"additionalProperties":false},"external_id":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"spend":{"$ref":"#/components/schemas/Paise"},"starts_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"ends_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","source","external_id","project","spend","starts_on","ends_on","leads","created_at"],"additionalProperties":false},"MarketingConnections":{"type":"object","properties":{"can_manage":{"type":"boolean"},"meta":{"anyOf":[{"type":"object","properties":{"connection_id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["pending","connected","error","disconnected"]},"health":{"type":"string","enum":["ok","degraded","error","disconnected","pending"]},"ad_account_id":{"type":["string","null"]},"ad_account_name":{"type":["string","null"]},"page_id":{"type":["string","null"]},"page_name":{"type":["string","null"]},"instagram_user_id":{"type":["string","null"]},"instagram_username":{"type":["string","null"]},"secret_hints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"last_error":{"type":["string","null"]},"last_ok_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"connected_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["connection_id","status","health","ad_account_id","ad_account_name","page_id","page_name","instagram_user_id","instagram_username","secret_hints","last_error","last_ok_at","connected_at"],"additionalProperties":false},{"type":"null"}]},"google":{"anyOf":[{"type":"object","properties":{"connection_id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["pending","connected","error","disconnected"]},"health":{"type":"string","enum":["ok","degraded","error","disconnected","pending"]},"customer_id":{"type":["string","null"]},"customer_name":{"type":["string","null"]},"account_email":{"type":["string","null"]},"last_error":{"type":["string","null"]},"audiences_ready":{"type":"boolean","description":"Customer Match can run: connected, an account, the developer token."}},"required":["connection_id","status","health","customer_id","customer_name","account_email","last_error","audiences_ready"],"additionalProperties":false},{"type":"null"}]},"google_app_ready":{"type":"boolean","description":"PropZolo’s Google Ads developer token is configured."},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string","enum":["facebook_page","instagram_business","google_business"]},"external_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","needs_reconnect","disconnected"]},"last_error":{"type":["string","null"]},"connected_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","provider","external_id","name","status","last_error","connected_at"],"additionalProperties":false}}},"required":["can_manage","meta","google","google_app_ready","accounts"],"additionalProperties":false},"MarketingCreative":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"set_id":{"$ref":"#/components/schemas/Id"},"variant_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"source_media_id":{"$ref":"#/components/schemas/Id"},"template":{"type":"string","enum":["classic","bold_band","minimal"]},"format":{"type":"string","enum":["square","portrait","story","landscape"]},"text":{"type":"object","properties":{"headline":{"type":"string"},"price":{"type":["string","null"]},"place":{"type":["string","null"]},"rera":{"type":["string","null"]},"brand":{"type":"string"}},"required":["headline","price","place","rera","brand"],"additionalProperties":false},"status":{"type":"string","enum":["pending","ready","failed"]},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"failure":{"type":["string","null"]},"url":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"rendered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","set_id","variant_id","source_media_id","template","format","text","status","width","height","failure","url","created_at","rendered_at"],"additionalProperties":false,"description":"A branded image; `url` once rendered (no EXIF/GPS)."},"MarketingStudioSettings":{"type":"object","properties":{"disclaimer":{"anyOf":[{"type":"string","minLength":1,"maxLength":300},{"type":"null"}]},"brand_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"default_platforms":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["meta_feed","instagram","google_search","google_display","whatsapp_status","portal"]}},"default_languages":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["en","hi","hinglish"]}},"default_template":{"type":"string","enum":["classic","bold_band","minimal"]},"audiences":{"type":"object","properties":{"allowed_bases":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["consent","contract","legitimate_use"]}},"destinations":{"maxItems":2,"type":"array","items":{"type":"string","enum":["meta","google"]}}},"required":["allowed_bases","destinations"],"additionalProperties":false}},"required":["disclaimer","brand_color","default_platforms","default_languages","default_template","audiences"],"additionalProperties":false},"MarketingStudioSettingsInput":{"type":"object","properties":{"disclaimer":{"anyOf":[{"type":"string","minLength":1,"maxLength":300},{"type":"null"}]},"brand_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"default_platforms":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["meta_feed","instagram","google_search","google_display","whatsapp_status","portal"]}},"default_languages":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["en","hi","hinglish"]}},"default_template":{"type":"string","enum":["classic","bold_band","minimal"]},"audiences":{"type":"object","properties":{"allowed_bases":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["consent","contract","legitimate_use"]}},"destinations":{"maxItems":2,"type":"array","items":{"type":"string","enum":["meta","google"]}}},"required":["allowed_bases","destinations"]}},"required":["disclaimer","brand_color","default_platforms","default_languages","default_template","audiences"]},"MatchReason":{"type":"object","properties":{"score":{"type":"number","minimum":0,"maximum":1},"weight":{"type":"number"},"text":{"type":"string","examples":["Budget fits (₹1.35 Cr within ₹1.2–1.5 Cr)"]}},"required":["score","weight","text"],"additionalProperties":false},"MatchReasons":{"type":"object","propertyNames":{"type":"string","enum":["budget","location","type","bhk","area","possession","furnishing","transaction","tenant_profile","facing"]},"additionalProperties":{"$ref":"#/components/schemas/MatchReason"},"description":"Only the factors the requirement mentions."},"MatchStatus":{"type":"string","enum":["suggested","shared","liked","rejected","visited","dismissed"]},"MatchedLead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string","examples":["L-10234"]},"name":{"type":"string"},"lead_type":{"$ref":"#/components/schemas/LeadType"},"temperature":{"anyOf":[{"type":"string","enum":["hot","warm","cold"]},{"type":"null"}]},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"budget_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"budget_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"bhk":{"type":"array","items":{"type":"number"}},"status_name":{"type":"string"}},"required":["id","ref","name","lead_type","temperature","owner","budget_min","budget_max","bhk","status_name"],"additionalProperties":false},"McpCallLog":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"tool":{"type":"string"},"outcome":{"type":"string","description":"ok | error | denied | drafted | invalid | rate_limited"},"autonomy":{"type":["string","null"]},"error_code":{"type":["string","null"]},"http_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"latency_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"arguments_hash":{"description":"SHA-256 of the arguments; they are never stored.","type":["string","null"]},"pending_action_id":{"type":["string","null"]},"request_id":{"type":"string"},"member":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","tool","outcome","autonomy","error_code","http_status","latency_ms","arguments_hash","pending_action_id","request_id","member","client","created_at"],"additionalProperties":false},"McpConnection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"client":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"client_id":{"type":"string"},"name":{"type":"string"},"verified":{"type":"boolean"},"client_uri":{"type":["string","null"]}},"required":["id","client_id","name","verified","client_uri"],"additionalProperties":false},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"scopes":{"type":"array","items":{"type":"string"}},"autonomy":{"type":"string"},"status":{"type":"string"},"consented_at":{"$ref":"#/components/schemas/DateTime"},"last_used_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","client","member","scopes","autonomy","status","consented_at","last_used_at","revoked_at"],"additionalProperties":false},"McpDraft":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"tool":{"type":"string"},"summary":{"type":"string"},"arguments":{},"status":{"type":"string","enum":["pending","executing","executed","failed","rejected","cancelled","expired"]},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"client":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decided_by_name":{"type":["string","null"]},"decision_note":{"type":["string","null"]},"result":{}},"required":["id","tool","summary","arguments","status","member","client","created_at","expires_at","decided_at","decided_by_name","decision_note","result"],"additionalProperties":false},"McpOverview":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/McpSettings"},"members":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"autonomy":{"type":"string","enum":["off","read","draft","execute"]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["member_id","name","autonomy","updated_at"],"additionalProperties":false}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"client_id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["allowed","blocked"]},{"type":"null"}]},"pending":{"type":"boolean","description":"A member asked to connect it while self-registered clients are off; no decision yet."},"requested_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"redirects":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["web","loopback","app"]},"host":{"type":"string"}},"required":["kind","host"],"additionalProperties":false},"description":"Where its authorization codes are sent, one entry per distinct target."},"claimed_site":{"description":"The website it declares about itself (unverified).","type":["string","null"]},"connections":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_used_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","client_id","name","source","status","pending","requested_at","redirects","claimed_site","connections","last_used_at"],"additionalProperties":false}},"usage":{"type":"object","properties":{"since":{"$ref":"#/components/schemas/DateTime"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"by_outcome":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"by_tool":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tool","calls"],"additionalProperties":false}},"active_connections":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open_drafts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["since","calls","by_outcome","by_tool","active_connections","open_drafts"],"additionalProperties":false},"endpoint":{"type":"string","description":"The MCP server URL members add to their assistant."}},"required":["settings","members","clients","usage","endpoint"],"additionalProperties":false},"McpSettings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Off: every assistant token is refused on its next request."},"default_autonomy":{"type":"string","enum":["read","draft","execute"]},"group_caps":{"type":"object","properties":{"leads":{"type":"string","enum":["read","draft","execute"]},"properties":{"type":"string","enum":["read","draft","execute"]},"site_visits":{"type":"string","enum":["read","draft","execute"]},"tasks":{"type":"string","enum":["read","draft","execute"]}},"additionalProperties":false,"description":"The most any assistant may do per tool group (absent: the default applies)."},"allow_dynamic_clients":{"type":"boolean","description":"Self-registered clients may connect; off: only clients an admin allowed."}},"required":["enabled","default_autonomy","group_caps","allow_dynamic_clients"],"additionalProperties":false},"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"image_url":{"type":["string","null"]},"two_factor_enabled":{"type":"boolean"}},"required":["id","name","email","phone","image_url","two_factor_enabled"],"additionalProperties":false},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/MemberStatus"},"designation":{"type":["string","null"]},"employee_code":{"type":["string","null"]},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reports_to_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"languages":{"type":"array","items":{"type":"string"}},"role":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"is_owner":{"type":"boolean"}},"required":["id","key","name","is_owner"],"additionalProperties":false}},"required":["id","status","designation","employee_code","branch_id","reports_to_id","languages","role"],"additionalProperties":false},"company":{"$ref":"#/components/schemas/CompanySummary"},"workspaces":{"type":"array","items":{"type":"object","properties":{"company_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"slug":{"type":"string"},"logo_url":{"type":["string","null"]},"role_name":{"type":"string"},"current":{"type":"boolean"}},"required":["company_id","name","slug","logo_url","role_name","current"],"additionalProperties":false}},"session":{"type":"object","properties":{"via":{"type":"string","enum":["web","mobile"]}},"required":["via"],"additionalProperties":false},"permissions":{"$ref":"#/components/schemas/EffectivePermissions"},"features":{"$ref":"#/components/schemas/Features"}},"required":["user","member","company","workspaces","session","permissions","features"],"additionalProperties":false},"Media":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"$ref":"#/components/schemas/MediaKind"},"status":{"type":"string","enum":["processing","ready","failed"]},"failure":{"type":["string","null"]},"filename":{"type":["string","null"]},"mime_type":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"caption":{"type":["string","null"]},"room_tag":{"type":["string","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_cover":{"type":"boolean"},"is_private":{"type":"boolean"},"url":{"description":"External link (video, virtual tour).","type":["string","null"]},"thumb_url":{"type":["string","null"]},"medium_url":{"type":["string","null"]},"large_url":{"type":["string","null"]},"watermarked_url":{"type":["string","null"]},"scan_status":{"anyOf":[{"$ref":"#/components/schemas/FileScanStatus"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","status","failure","filename","mime_type","size_bytes","width","height","caption","room_tag","sort_order","is_cover","is_private","url","thumb_url","medium_url","large_url","watermarked_url","scan_status","created_at"],"additionalProperties":false},"MediaKind":{"type":"string","enum":["photo","floor_plan","master_plan","video","brochure","price_list","document","virtual_tour"]},"Member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"user_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"image_url":{"type":["string","null"]},"two_factor_enabled":{"type":"boolean"},"role":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"is_owner":{"type":"boolean"},"requires_two_factor":{"type":"boolean"}},"required":["id","key","name","is_owner","requires_two_factor"],"additionalProperties":false},"branch":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"reports_to":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"status":{"$ref":"#/components/schemas/MemberStatus"},"designation":{"type":["string","null"]},"employee_code":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"string"}},"specializations":{"type":"array","items":{"type":"string"}},"service_locality_ids":{"type":"array","items":{"type":"string"}},"lead_capacity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"shift":{"anyOf":[{"type":"object","properties":{"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["days","start","end"],"additionalProperties":false},{"type":"null"}]},"call_tracking_enabled":{"type":"boolean"},"devices":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Registered phones that are not revoked."},"joined_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_active_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"deactivated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"is_self":{"type":"boolean"},"can_manage":{"type":"boolean","description":"The caller may edit or deactivate this member (never someone with more access)."}},"required":["id","user_id","name","email","phone","image_url","two_factor_enabled","role","branch","reports_to","teams","status","designation","employee_code","languages","specializations","service_locality_ids","lead_capacity","shift","call_tracking_enabled","devices","joined_at","last_active_at","deactivated_at","created_at","is_self","can_manage"],"additionalProperties":false},"MemberAccountability":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_me":{"type":"boolean"}},"required":["id","name","is_me"],"additionalProperties":false},"latest":{"type":"object","properties":{"d7":{"anyOf":[{"$ref":"#/components/schemas/AccountabilitySnapshot"},{"type":"null"}]},"d30":{"anyOf":[{"$ref":"#/components/schemas/AccountabilitySnapshot"},{"type":"null"}]}},"required":["d7","d30"],"additionalProperties":false},"trend":{"type":"object","properties":{"d7":{"type":"object","properties":{"delta":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"direction":{"anyOf":[{"type":"string","enum":["up","down","flat"]},{"type":"null"}]}},"required":["delta","direction"],"additionalProperties":false},"d30":{"type":"object","properties":{"delta":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"direction":{"anyOf":[{"type":"string","enum":["up","down","flat"]},{"type":"null"}]}},"required":["delta","direction"],"additionalProperties":false}},"required":["d7","d30"],"additionalProperties":false},"history":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["day","score"],"additionalProperties":false},"description":"The 30-day score per day, the last 30 days."},"weekly":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["day","score"],"additionalProperties":false},"description":"The 7-day score every week, the last 8 weeks."},"rotation":{"type":"object","properties":{"enabled":{"type":"boolean"},"min_score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["d7","d30"]},"eligible":{"type":"boolean"},"reason":{"type":"string","enum":["off","no_score","stale_score","at_or_above","below"]}},"required":["enabled","min_score","period","eligible","reason"],"additionalProperties":false}},"required":["member","latest","trend","history","weekly","rotation"],"additionalProperties":false},"MemberBusy":{"type":"object","properties":{"connected":{"type":"boolean","description":"The member shares busy times from a connected calendar."},"synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"blocks":{"type":"array","items":{"type":"object","properties":{"start":{"$ref":"#/components/schemas/DateTime"},"end":{"$ref":"#/components/schemas/DateTime"}},"required":["start","end"],"additionalProperties":false}}},"required":["connected","synced_at","blocks"],"additionalProperties":false,"description":"Busy blocks of a member’s own calendar: times only."},"MemberCounters":{"type":"object","properties":{"notifications.unread":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unread notifications (the bell)."},"inbox.unread":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Conversations assigned to the member with unread messages."},"tasks.overdue":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The member’s open tasks due before now."},"followups.pending":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Follow-up agent drafts waiting for the member’s approval."}},"required":["notifications.unread","inbox.unread","tasks.overdue","followups.pending"],"additionalProperties":false},"MemberDeactivated":{"type":"object","properties":{"member":{"$ref":"#/components/schemas/MemberDetail"},"sessions_revoked":{"type":"integer","minimum":0,"maximum":9007199254740991},"reportees_moved":{"type":"integer","minimum":0,"maximum":9007199254740991},"open_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"reassign_url":{"type":"string","description":"The staff-exit wizard that hands their leads and tasks over."}},"required":["member","sessions_revoked","reportees_moved","open_leads","reassign_url"],"additionalProperties":false},"MemberDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"user_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"image_url":{"type":["string","null"]},"two_factor_enabled":{"type":"boolean"},"role":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"is_owner":{"type":"boolean"},"requires_two_factor":{"type":"boolean"}},"required":["id","key","name","is_owner","requires_two_factor"],"additionalProperties":false},"branch":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"reports_to":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"status":{"$ref":"#/components/schemas/MemberStatus"},"designation":{"type":["string","null"]},"employee_code":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"string"}},"specializations":{"type":"array","items":{"type":"string"}},"service_locality_ids":{"type":"array","items":{"type":"string"}},"lead_capacity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"shift":{"anyOf":[{"type":"object","properties":{"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["days","start","end"],"additionalProperties":false},{"type":"null"}]},"call_tracking_enabled":{"type":"boolean"},"devices":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Registered phones that are not revoked."},"joined_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_active_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"deactivated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"is_self":{"type":"boolean"},"can_manage":{"type":"boolean","description":"The caller may edit or deactivate this member (never someone with more access)."},"direct_reports":{"type":"integer","minimum":0,"maximum":9007199254740991},"open_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"service_localities":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"city":{"type":"string"}},"required":["id","name","city"],"additionalProperties":false}}},"required":["id","user_id","name","email","phone","image_url","two_factor_enabled","role","branch","reports_to","teams","status","designation","employee_code","languages","specializations","service_locality_ids","lead_capacity","shift","call_tracking_enabled","devices","joined_at","last_active_at","deactivated_at","created_at","is_self","can_manage","direct_reports","open_leads","service_localities"],"additionalProperties":false},"MemberDevice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"kind":{"type":"string","enum":["web","mobile"]},"label":{"type":["string","null"]},"status":{"type":"string","enum":["approved","pending","rejected","revoked"]},"approved_via":{"type":["string","null"]},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"approved_by":{"type":["string","null"]},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_seen_at":{"$ref":"#/components/schemas/DateTime"},"last_seen_at":{"$ref":"#/components/schemas/DateTime"},"last_ip":{"type":["string","null"]},"current":{"type":"boolean"}},"required":["id","member","kind","label","status","approved_via","approved_at","approved_by","revoked_at","first_seen_at","last_seen_at","last_ip","current"],"additionalProperties":false},"MemberOption":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"active":{"type":"boolean","description":"false: deactivated or not joined yet."}},"required":["id","name","active"],"additionalProperties":false},"MemberPhones":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"branch":{"type":["string","null"]},"role":{"type":"string"},"tracking_enabled":{"type":"boolean"}},"required":["id","name","branch","role","tracking_enabled"],"additionalProperties":false},"status":{"$ref":"#/components/schemas/DeviceHealthState"},"issues":{"type":"array","items":{"type":"string"}},"devices":{"type":"array","items":{"$ref":"#/components/schemas/AgentPhone"}},"call_health":{"$ref":"#/components/schemas/CallHealth"}},"required":["member","status","issues","devices","call_health"],"additionalProperties":false},"MemberRef":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"MemberShift":{"type":"object","properties":{"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}},"required":["days","start","end"],"additionalProperties":false,"description":"ISO weekdays (1 = Monday); end ≤ start runs past midnight."},"MemberShiftInput":{"type":"object","properties":{"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}},"required":["days","start","end"],"description":"ISO weekdays (1 = Monday); end ≤ start runs past midnight."},"MemberStatus":{"type":"string","enum":["invited","active","inactive","suspended"]},"MergeLeadsInput":{"type":"object","properties":{"winner_id":{"$ref":"#/components/schemas/Id"},"loser_id":{"$ref":"#/components/schemas/Id"},"take_from_loser":{"maxItems":9,"type":"array","items":{"type":"string","enum":["owner","presales","source","requirement","temperature","expected_value","project","property","custom"]}},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["winner_id","loser_id"]},"MergeLeadsResult":{"type":"object","properties":{"lead":{"$ref":"#/components/schemas/LeadDetail"},"moved":{"type":"object","properties":{"enquiries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activities":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"other":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enquiries","activities","tasks","calls","visits","conversations","other"],"additionalProperties":false}},"required":["lead","moved"],"additionalProperties":false},"Message":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"conversation_id":{"$ref":"#/components/schemas/Id"},"channel":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"type":{"type":"string"},"body":{"type":["string","null"]},"subject":{"type":["string","null"]},"media":{"type":"array","items":{"$ref":"#/components/schemas/MessageMedia"}},"interactive":{"description":"Outbound WhatsApp Cloud only (INT-40): the reply buttons or list sent under the body.","anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"buttons"},"header":{"type":"string","minLength":1,"maxLength":60},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":256},"title":{"type":"string","minLength":1,"maxLength":20}},"required":["title"],"additionalProperties":false}}},"required":["type","buttons"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"list"},"header":{"type":"string","minLength":1,"maxLength":60},"footer":{"type":"string","minLength":1,"maxLength":60},"button":{"type":"string","minLength":1,"maxLength":20},"sections":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":24},"rows":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":24},"description":{"type":"string","minLength":1,"maxLength":72}},"required":["title"],"additionalProperties":false}}},"required":["title","rows"],"additionalProperties":false}}},"required":["type","button","sections"],"additionalProperties":false}]},{"type":"null"}]},"status":{"type":"string","enum":["queued","sending","sent","delivered","read","failed","cancelled"]},"error":{"type":["string","null"]},"blocked_reason":{"type":["string","null"]},"purpose":{"type":["string","null"]},"to":{"description":"Recipient address, masked by the caller’s field rules.","type":["string","null"]},"template_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sent_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sent_by_ai":{"type":"boolean"},"automation_run_id":{"type":["string","null"]},"broadcast_id":{"type":["string","null"]},"reply_to_id":{"type":["string","null"]},"cost":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"paise"},"created_at":{"$ref":"#/components/schemas/DateTime"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"delivered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"read_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"failed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"sender_verified":{"description":"Captured email replies only (INT-39): the sender passed DKIM/DMARC and is the address emailed.","type":"boolean"}},"required":["id","conversation_id","channel","direction","type","body","subject","media","status","error","blocked_reason","purpose","to","template_id","sent_by_id","sent_by_ai","automation_run_id","broadcast_id","reply_to_id","cost","created_at","sent_at","delivered_at","read_at","failed_at"],"additionalProperties":false},"MessageBlockReason":{"type":"string","enum":["kill_switch","email_paused","no_channel_account","channel_disconnected","channel_not_allowed","channel_unavailable","linked_agent_typed_only","linked_reply_first","contact_blocked","contact_deleted","no_address","invalid_address","suppressed","opted_out","no_consent","consent_expired","enquiry_window_expired","dnd","quiet_hours","frequency_cap","whatsapp_window_closed","template_required","template_not_found","template_not_approved","template_channel_mismatch","dlt_not_configured","dlt_header_mismatch","dlt_mismatch","dlt_variable_invalid","content_invalid","rera_footer_missing","media_not_supported","media_invalid","wallet_insufficient","wallet_disabled","no_wallet"]},"MessageGateBlock":{"type":"object","properties":{"reason":{"$ref":"#/components/schemas/MessageBlockReason"},"detail":{"type":"string"},"retry_at":{"description":"When the same send would pass (quiet hours end, caps).","$ref":"#/components/schemas/DateTime"}},"required":["reason"],"additionalProperties":false},"MessageMedia":{"type":"object","properties":{"kind":{"type":"string","description":"image · video · audio · document"},"mime":{"type":["string","null"]},"name":{"type":["string","null"]},"size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"caption":{"type":["string","null"]},"voice":{"type":"boolean"},"url":{"description":"Presigned, valid for minutes; null while the file is not stored, or quarantined.","type":["string","null"]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"scan":{"anyOf":[{"type":"string","enum":["pending","clean","infected","not_scanned","failed"]},{"type":"null"}],"description":"Malware scan of a document a customer sent (null for photos, audio, video and own uploads). An infected file has no link."}},"required":["kind","mime","name","size","caption","voice","url","expires_at","scan"],"additionalProperties":false},"MessagePreview":{"type":"object","properties":{"text":{"type":"string"},"subject":{"type":["string","null"]},"html":{"type":["string","null"]},"sms":{"anyOf":[{"type":"object","properties":{"encoding":{"type":"string","enum":["gsm","unicode"]},"segments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["encoding","segments"],"additionalProperties":false},{"type":"null"}]}},"required":["text","subject","html","sms"],"additionalProperties":false},"MessagePurpose":{"type":"string","enum":["transactional","service","promotional"],"description":"transactional: OTPs, receipts (not subject to consent) · service: visit reminders, documents (unless opted out) · promotional: launches, matches, price drops (consent or the TRAI 7-day enquiry window, quiet hours, DND)."},"MessageTemplate":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"channel":{"$ref":"#/components/schemas/TemplateChannel"},"name":{"type":"string"},"display_name":{"type":["string","null"]},"language":{"type":"string"},"category":{"type":"string"},"use_case":{"type":["string","null"]},"header":{},"body":{"type":"string"},"footer":{"type":["string","null"]},"buttons":{},"variables":{"type":"array","items":{"$ref":"#/components/schemas/TemplateVariable"}},"provider_template_id":{"type":["string","null"]},"dlt_template_id":{"type":["string","null"]},"dlt_header":{"type":["string","null"]},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/TemplateStatus"},"rejection_reason":{"type":["string","null"]},"quality":{"type":["string","null"]},"last_synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"placeholders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sms":{"anyOf":[{"type":"object","properties":{"encoding":{"type":"string","enum":["gsm","unicode"]},"parts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["encoding","parts"],"additionalProperties":false},{"type":"null"}]}},"required":["id","channel","name","display_name","language","category","use_case","header","body","footer","buttons","variables","provider_template_id","dlt_template_id","dlt_header","channel_account_id","status","rejection_reason","quality","last_synced_at","created_at","updated_at","placeholders","sms"],"additionalProperties":false},"MessagingReport":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"totals":{"type":"object","properties":{"queued":{"type":"integer","minimum":0,"maximum":9007199254740991},"sent":{"type":"integer","minimum":0,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":0,"maximum":9007199254740991},"read":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"replied":{"type":"integer","minimum":0,"maximum":9007199254740991},"cost_paise":{"$ref":"#/components/schemas/Paise"},"delivered_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"read_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"replied_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]}},"required":["queued","sent","delivered","read","failed","replied","cost_paise","delivered_pct","read_pct","replied_pct"],"additionalProperties":false},"by_channel":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string"},"queued":{"type":"integer","minimum":0,"maximum":9007199254740991},"sent":{"type":"integer","minimum":0,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":0,"maximum":9007199254740991},"read":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"replied":{"type":"integer","minimum":0,"maximum":9007199254740991},"cost_paise":{"$ref":"#/components/schemas/Paise"}},"required":["channel","queued","sent","delivered","read","failed","replied","cost_paise"],"additionalProperties":false}},"by_template":{"type":"array","items":{"type":"object","properties":{"template_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"channel":{"type":"string"},"category":{"type":["string","null"]},"queued":{"type":"integer","minimum":0,"maximum":9007199254740991},"sent":{"type":"integer","minimum":0,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":0,"maximum":9007199254740991},"read":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"replied":{"type":"integer","minimum":0,"maximum":9007199254740991},"cost_paise":{"$ref":"#/components/schemas/Paise"}},"required":["template_id","name","channel","category","queued","sent","delivered","read","failed","replied","cost_paise"],"additionalProperties":false}},"opt_outs":{"anyOf":[{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"by_channel":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["channel","count"],"additionalProperties":false}}},"required":["total","by_channel"],"additionalProperties":false},{"type":"null"}],"description":"Consent withdrawals in the range; company-wide scope only."}},"required":["range","totals","by_channel","by_template","opt_outs"],"additionalProperties":false},"MessagingRules":{"type":"object","properties":{"kill_switch":{"type":"object","properties":{"paused":{"type":"boolean"},"channels":{"type":"array","items":{"type":"string"},"description":"Empty while paused: every channel."},"reason":{"type":["string","null"]},"billing_hold":{"type":"boolean","description":"Paused by billing (suspended / read-only): lifted only by reactivating the company."}},"required":["paused","channels","reason","billing_hold"],"additionalProperties":false},"quiet_hours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false,"description":"Company time zone; at least 21:00–09:00 (TRAI)."},"quiet_hours_service":{"type":"boolean","description":"Service messages wait out quiet hours too."},"sms_promotional_window":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false,"description":"Inside the operators’ 10:00–21:00 band."},"frequency_caps":{"type":"object","properties":{"promotional":{"anyOf":[{"type":"object","properties":{"per_day":{"type":"integer","minimum":1,"maximum":50},"per_week":{"type":"integer","minimum":1,"maximum":200}},"required":["per_day","per_week"],"additionalProperties":false},{"type":"null"}]},"service":{"anyOf":[{"type":"object","properties":{"per_day":{"type":"integer","minimum":1,"maximum":50},"per_week":{"type":"integer","minimum":1,"maximum":200}},"required":["per_day","per_week"],"additionalProperties":false},{"type":"null"}]}},"required":["promotional","service"],"additionalProperties":false},"channel_priority":{"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email"]}},"rera_footer":{"type":"boolean"},"email_tracking":{"type":"object","properties":{"opens":{"type":"boolean"},"clicks":{"type":"boolean"}},"required":["opens","clicks"],"additionalProperties":false}},"required":["kill_switch","quiet_hours","quiet_hours_service","sms_promotional_window","frequency_caps","channel_priority","rera_footer","email_tracking"],"additionalProperties":false},"MetaConversionsSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"dataset_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,32}$"},{"type":"null"}]},"dataset_name":{"type":["string","null"]},"test_event_code":{"type":["string","null"]},"whatsapp_datasets":{"type":"array","items":{"type":"object","properties":{"waba_id":{"type":"string","pattern":"^\\d{1,32}$"},"dataset_id":{"type":"string","pattern":"^\\d{1,32}$"},"linked_at":{"type":["string","null"]}},"required":["waba_id","dataset_id","linked_at"],"additionalProperties":false}},"mapping":{"type":"object","propertyNames":{"$ref":"#/components/schemas/AdMilestone"},"additionalProperties":{"type":"object","properties":{"crm":{"anyOf":[{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_-]{0,39}$"},{"type":"null"}]},"messaging":{"anyOf":[{"type":"string","enum":["LeadSubmitted","QualifiedLead","Purchase","InitiateCheckout","AddToCart","ViewContent","OrderCreated","OrderShipped","OrderDelivered","OrderCanceled","OrderReturned","CartAbandoned","RatingProvided","ReviewProvided"]},{"type":"null"}]}},"required":["crm","messaging"],"additionalProperties":false},"required":["lead_created","qualified","visit_scheduled","visit_done","booked"]},"hashed_identifiers":{"type":"boolean"},"send_client_ip":{"type":"boolean"},"value":{"type":"string","enum":["commission","agreed_value","none"],"description":"What a booking is worth to the ads: the deal’s expected commission, its agreed value, or none."}},"required":["enabled","dataset_id","dataset_name","test_event_code","whatsapp_datasets","mapping","hashed_identifiers","send_client_ip","value"],"additionalProperties":false},"MetaFormConfig":{"type":"object","properties":{"page_id":{"type":"string"},"name":{"type":["string","null"]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"consents":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/LeadFormConsentMapping"}},"enabled":{"type":"boolean"},"watermark":{"type":["string","null"]}},"required":["page_id","name","source_id","project_id","lead_type","mapping","consents","enabled","watermark"],"additionalProperties":false},"MobileConfig":{"type":"object","properties":{"min_app_version":{"type":"string"},"backfill_days":{"type":"integer","minimum":0,"maximum":9007199254740991},"sync_interval_min":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"require_tracking":{"type":"boolean"}},"required":["min_app_version","backfill_days","sync_interval_min","require_tracking"],"additionalProperties":false,"description":"Company rules for the app (Settings → Mobile app)."},"MobileDiagnosticsBody":{"type":"object","properties":{"reports":{"type":"array","items":{}}},"additionalProperties":{},"description":"Either `{ reports: [...] }` (the native tracker sends what it saved, oldest first, at most 15) or one report (the JS fallback); at most 25 reports are read. A report: `rid` (its id — a resend is stored once), `source` (js | native), `kind` (fatal | handled | boundary | promise | manual | native_crash | native_error), `name`, `message`, `stack`, `component_stack`, `route`, `occurred_at` (epoch ms), `app_version`, `build`, `update_id`, `runtime_version`, `device`, `extra`. Unknown or oversized fields are dropped, not refused."},"MobileDiagnosticsResult":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"ignored":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Resends, unusable reports and the ones over the phone’s hourly budget."}},"required":["accepted","ignored"],"additionalProperties":false},"MobileLeadContacts":{"type":"object","properties":{"enabled":{"type":"boolean","description":"false: the phone must remove every lead contact it made."},"reason":{"type":"string","enum":["ok","masked","off"],"description":"`masked`: the member’s phone-number field rule is not \"visible\", so no number may leave the CRM; `off`: the company switched lead contacts off (`mobile.lead_contacts`)."},"mode":{"type":"string","enum":["snapshot","delta"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/LeadContactItem"},"description":"Snapshot: exactly the contacts the phone keeps. Delta: contacts to add or rewrite."},"removed":{"type":"array","items":{"type":"string"},"description":"Delta: keys of contacts to delete (no open lead of the member is left on them). Always empty in a snapshot."},"sync_token":{"description":"Pass as `updated_since` next time (valid once the run’s last page was applied).","$ref":"#/components/schemas/DateTime"},"truncated":{"type":"boolean","description":"Snapshot: more contacts qualified than the cap lets through."}},"required":["enabled","reason","mode","items","removed","sync_token","truncated"],"additionalProperties":false},"MobileNotification":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"event":{"type":"string","description":"What happened. The tracker’s own vocabulary where it has one (`lead_assigned`, `lead_reassigned`, `follow_up_due`, `missed_lead_call`), otherwise the server’s dotted key (`visit.scheduled`)."},"title":{"type":"string"},"body":{"type":"string","description":"Empty when the notification has no text (never null: the Android JSON parser would print \"null\")."},"link":{"description":"In-app path (`/leads/…`); the phone opens it through `propzolo://open?link=…`.","type":["string","null"]}},"required":["id","event","title","body","link"],"additionalProperties":false},"MobileNotificationBatch":{"type":"object","properties":{"items":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/MobileNotification"}}},"required":["items"],"additionalProperties":false},"NetProblem":{"type":"string","enum":["airplane","no_sim","sim_locked","no_service","weak_signal"]},"NetworkAvailabilityCheck":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"direction":{"type":"string","enum":["inbound","outbound"]},"share":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false},"status":{"type":"string","enum":["pending","available","unavailable","expired"]},"asked_at":{"$ref":"#/components/schemas/DateTime"},"answered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"answer_note":{"type":["string","null"]},"broker":{"$ref":"#/components/schemas/NetworkBroker"}},"required":["id","direction","share","status","asked_at","answered_at","answer_note","broker"],"additionalProperties":false},"NetworkBroker":{"type":"object","properties":{"profile_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"display_name":{"type":"string"},"city":{"type":["string","null"]},"rera_badge":{"type":"string","enum":["verified","declared","expired","none"]},"kyc_verified":{"type":"boolean"},"trust_level":{"type":"string","enum":["new","established","trusted"]}},"required":["profile_id","display_name","city","rera_badge","kyc_verified","trust_level"],"additionalProperties":false},"NetworkCircle":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"kind":{"type":"string","enum":["micro_market","association","custom"]},"city":{"type":["string","null"]},"description":{"type":["string","null"]},"discoverable":{"type":"boolean"},"status":{"type":"string","enum":["active","archived"]},"owner":{"$ref":"#/components/schemas/NetworkBroker"},"is_owner":{"type":"boolean"},"membership":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["invited","requested","active","declined","left","removed"]}},"required":["id","status"],"additionalProperties":false},{"type":"null"}]},"members":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["invited","requested","active","declined","left","removed"]},"broker":{"$ref":"#/components/schemas/NetworkBroker"},"joined_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","status","broker","joined_at"],"additionalProperties":false}},{"type":"null"}]},"active_members":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","name","kind","city","description","discoverable","status","owner","is_owner","membership","members","active_members"],"additionalProperties":false},"NetworkDirectoryEntry":{"type":"object","properties":{"profile_id":{"$ref":"#/components/schemas/Id"},"display_name":{"type":"string"},"about":{"type":["string","null"]},"city":{"type":"string"},"areas":{"type":"array","items":{"type":"string"}},"specialities":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"rera":{"type":"object","properties":{"number":{"type":["string","null"]},"state":{"type":["string","null"]},"expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"badge":{"type":"string","enum":["verified","declared","expired","none"]}},"required":["number","state","expires_on","badge"],"additionalProperties":false},"kyc_verified":{"type":"boolean"},"trust":{"type":"object","properties":{"level":{"type":"string","enum":["new","established","trusted"]},"response_rate_pct":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"median_response_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"co_brokes_closed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"co_brokes_disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified_listings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active_shares":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refreshed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["level","response_rate_pct","median_response_minutes","co_brokes_closed","co_brokes_disputed","verified_listings","active_shares","refreshed_at"],"additionalProperties":false},"listed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"is_me":{"type":"boolean"}},"required":["profile_id","display_name","about","city","areas","specialities","languages","rera","kyc_verified","trust","listed_at","is_me"],"additionalProperties":false},"NetworkMatch":{"type":"object","properties":{"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasons":{"type":"array","items":{"type":"string","enum":["locality","city","property_type","bhk","budget","area"]}},"mine":{"$ref":"#/components/schemas/NetworkShare"},"theirs":{"$ref":"#/components/schemas/NetworkShare"}},"required":["score","reasons","mine","theirs"],"additionalProperties":false},"NetworkProfile":{"type":"object","properties":{"profile_id":{"$ref":"#/components/schemas/Id"},"display_name":{"type":"string"},"about":{"type":["string","null"]},"city":{"type":"string"},"areas":{"type":"array","items":{"type":"string"}},"specialities":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"rera":{"type":"object","properties":{"number":{"type":["string","null"]},"state":{"type":["string","null"]},"expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"badge":{"type":"string","enum":["verified","declared","expired","none"]}},"required":["number","state","expires_on","badge"],"additionalProperties":false},"kyc_verified":{"type":"boolean"},"trust":{"type":"object","properties":{"level":{"type":"string","enum":["new","established","trusted"]},"response_rate_pct":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"median_response_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"co_brokes_closed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"co_brokes_disputed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified_listings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active_shares":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refreshed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["level","response_rate_pct","median_response_minutes","co_brokes_closed","co_brokes_disputed","verified_listings","active_shares","refreshed_at"],"additionalProperties":false},"listed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"is_me":{"type":"boolean"},"status":{"type":"string","enum":["draft","listed","paused"]},"business_phone":{"type":["string","null"]},"business_email":{"type":["string","null"]},"kyc_status":{"type":"string","enum":["none","submitted","verified","rejected"]},"kyc_submitted_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"kyc_note":{"type":["string","null"]},"lock_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["profile_id","display_name","about","city","areas","specialities","languages","rera","kyc_verified","trust","listed_at","is_me","status","business_phone","business_email","kyc_status","kyc_submitted_at","kyc_note","lock_days"],"additionalProperties":false},"NetworkRegistration":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"client_label":{"type":"string"},"status":{"type":"string","enum":["active","disputed","expired","released","rejected","superseded"]},"mine":{"type":"boolean"},"registered_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"disputes_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"dispute_reason":{"type":["string","null"]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decided_note":{"type":["string","null"]}},"required":["id","client_label","status","mine","registered_at","expires_at","disputes_id","dispute_reason","decided_at","decided_note"],"additionalProperties":false},"NetworkShare":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["listing","requirement"]},"title":{"type":"string"},"deal_side":{"type":"string","enum":["sale","rent"]},"category":{"type":"string"},"property_types":{"type":"array","items":{"type":"string"}},"bhk":{"type":"array","items":{"type":"number"}},"city":{"type":"string"},"localities":{"type":"array","items":{"type":"string"}},"price_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"area_min_sqft":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"area_max_sqft":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"verified":{"type":"boolean"},"summary":{"type":"object","properties":{"furnishing":{"type":"array","items":{"type":"string"}},"possession":{"type":["string","null"]},"available_from":{"type":["string","null"]}},"required":["furnishing","possession","available_from"],"additionalProperties":false},"co_broke_terms":{"type":["string","null"]},"offered_split_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"visibility":{"type":"string","enum":["circle","network"]},"circle":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","expired","revoked","closed"]},"freshness":{"type":"string","enum":["fresh","due","stale"]},"last_confirmed_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"mine":{"type":"boolean"},"broker":{"anyOf":[{"$ref":"#/components/schemas/NetworkBroker"},{"type":"null"}]},"source":{"anyOf":[{"type":"object","properties":{"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"ref":{"type":["string","null"]}},"required":["property_id","lead_id","ref"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","title","deal_side","category","property_types","bhk","city","localities","price_min","price_max","area_min_sqft","area_max_sqft","verified","summary","co_broke_terms","offered_split_bps","visibility","circle","status","freshness","last_confirmed_at","expires_at","created_at","mine","broker","source"],"additionalProperties":false},"NetworkSuggestion":{"type":"object","properties":{"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasons":{"type":"array","items":{"type":"string","enum":["locality","city","property_type","bhk","budget","area"]}},"mine":{"type":"object","properties":{"kind":{"type":"string","enum":["lead","listing"]},"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"title":{"type":"string"}},"required":["kind","id","ref","title"],"additionalProperties":false},"theirs":{"$ref":"#/components/schemas/NetworkShare"}},"required":["score","reasons","mine","theirs"],"additionalProperties":false},"NoticeLanguage":{"type":"string","enum":["en","hi","mr","gu","ta","te","kn","ml","bn","pa","or","as","ur"],"description":"English or an Eighth Schedule language (ISO 639-1)."},"NoticePurpose":{"type":"string","enum":["general","enquiry","marketing"]},"Notification":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"event":{"type":"string","description":"What happened: lead.assigned, task.due, visit.scheduled, share.viewed …"},"title":{"type":"string"},"body":{"type":["string","null"]},"link":{"description":"In-app path to open, e.g. /leads/…","type":["string","null"]},"entity_type":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"is_read":{"type":"boolean"},"read_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","event","title","body","link","entity_type","entity_id","is_read","read_at","created_at"],"additionalProperties":false},"NotificationPreferences":{"type":"object","properties":{"push":{"description":"false: no push notifications at all.","type":"boolean"},"muted_events":{"description":"Events delivered in-app only (no push).","maxItems":200,"type":"array","items":{"type":"string","maxLength":48}},"quiet_hours":{"description":"Push quiet hours in the company time zone; null: none; omitted: the company’s.","anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]}},"additionalProperties":false},"NotificationPreferencesInput":{"type":"object","properties":{"push":{"description":"false: no push notifications at all.","type":"boolean"},"muted_events":{"description":"Events delivered in-app only (no push).","maxItems":200,"type":"array","items":{"type":"string","maxLength":48}},"quiet_hours":{"description":"Push quiet hours in the company time zone; null: none; omitted: the company’s.","anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["start","end"]},{"type":"null"}]}}},"NotificationPreferencesView":{"type":"object","properties":{"member":{"$ref":"#/components/schemas/NotificationPreferences"},"company":{"$ref":"#/components/schemas/CompanyNotificationSettings"},"effective":{"type":"object","properties":{"push":{"type":"boolean"},"quiet_hours":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"quiet_hours_source":{"type":"string","enum":["member","company","default"]}},"required":["push","quiet_hours","quiet_hours_source"],"additionalProperties":false}},"required":["member","company","effective"],"additionalProperties":false},"NumberLookup":{"type":"object","properties":{"known":{"type":"boolean","description":"The company already has a contact with this number."},"found":{"type":"boolean","description":"Same as `known`: the name the native call tracker already reads (`data.found`). Deprecated — it goes when the native side reads `known`.","deprecated":true},"holders":{"description":"Member session only (the device token never gets it): colleagues other than the caller who own or pre-sale an open lead on the number, then who called it in the last 30 days. Empty for pool, closed or non-lead numbers.","type":"object","properties":{"names":{"maxItems":5,"type":"array","items":{"type":"string"},"description":"Up to five colleagues by name — never numbers or leads."},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many colleagues in all."}},"required":["names","count"],"additionalProperties":false}},"required":["known","found"],"additionalProperties":false},"Onboarding":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["company_profile","invite_team","import_leads","connect_channel","lead_source","business_hours","first_automation"]},"label":{"type":"string"},"description":{"type":"string"},"href":{"type":"string"},"done":{"type":"boolean"}},"required":["key","label","description","href","done"],"additionalProperties":false}},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dismissed":{"type":"boolean"},"can_dismiss":{"type":"boolean"}},"required":["items","completed","total","dismissed","can_dismiss"],"additionalProperties":false},"OwnerDashboard":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"previous_range":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"}},"required":["from","to"],"additionalProperties":false},"costs_visible":{"type":"boolean"},"money_visible":{"type":"boolean","description":"false: commission expected / received, outstanding, ROI and receipts are null (masked)."},"funnel":{"$ref":"#/components/schemas/FunnelCounts"},"previous_funnel":{"$ref":"#/components/schemas/FunnelCounts"},"spend_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"previous_spend_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cpl_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"by_source":{"type":"array","items":{"$ref":"#/components/schemas/SourceFunnelRow"}},"revenue":{"type":"object","properties":{"deals_won":{"type":"integer","minimum":0,"maximum":9007199254740991},"won_value_paise":{"$ref":"#/components/schemas/Paise"},"commission_expected_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"commission_received_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"receipts":{"type":"integer","minimum":0,"maximum":9007199254740991},"outstanding_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"open_deals":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["deals_won","won_value_paise","commission_expected_paise","commission_received_paise","receipts","outstanding_paise","open_deals"],"additionalProperties":false},"previous_revenue":{"type":"object","properties":{"deals_won":{"type":"integer","minimum":0,"maximum":9007199254740991},"commission_received_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["deals_won","commission_received_paise"],"additionalProperties":false},"team":{"type":"object","properties":{"open_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"untouched":{"type":"integer","minimum":0,"maximum":9007199254740991},"overdue_follow_ups":{"type":"integer","minimum":0,"maximum":9007199254740991},"sla":{"$ref":"#/components/schemas/SpeedStats"},"members":{"type":"array","items":{"type":"object","properties":{"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"open_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"untouched":{"type":"integer","minimum":0,"maximum":9007199254740991},"overdue_follow_ups":{"type":"integer","minimum":0,"maximum":9007199254740991},"sla_breaches":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["member_id","name","open_leads","untouched","overdue_follow_ups","sla_breaches"],"additionalProperties":false}}},"required":["open_leads","untouched","overdue_follow_ups","sla","members"],"additionalProperties":false},"trend":{"type":"array","items":{"type":"object","properties":{"day":{"$ref":"#/components/schemas/LocalDate"},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991},"received_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["day","leads","visits","deals","received_paise"],"additionalProperties":false}}},"required":["range","previous_range","costs_visible","money_visible","funnel","previous_funnel","spend_paise","previous_spend_paise","cpl_paise","by_source","revenue","previous_revenue","team","trend"],"additionalProperties":false},"OwnerDigest":{"type":"object","properties":{"day":{"$ref":"#/components/schemas/LocalDate"},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":0,"maximum":9007199254740991},"junk":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_response":{"type":"object","properties":{"with_sla":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"integer","minimum":0,"maximum":9007199254740991},"late":{"type":"integer","minimum":0,"maximum":9007199254740991},"median_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["with_sla","met","late","median_minutes"],"additionalProperties":false},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"no_shows":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals_won":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"won_value_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"received_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"spend_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cpl_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"untouched":{"type":"integer","minimum":0,"maximum":9007199254740991},"overdue_follow_ups":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["day","leads","contacted","junk","first_response","calls","connected","talk_sec","visits_done","no_shows","deals_won","won_value_paise","received_paise","spend_paise","cpl_paise","untouched","overdue_follow_ups"],"additionalProperties":false},"OwnerDigestSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"time":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"email":{"type":"boolean","description":"Also by email when an email channel is connected."}},"required":["enabled","time","email"],"additionalProperties":false},"OwnerDigestView":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/OwnerDigestSettings"},"can_edit":{"type":"boolean"},"recipients":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Members who receive it (company-wide report readers)."},"preview":{"description":"Yesterday’s digest within your scope.","$ref":"#/components/schemas/OwnerDigest"},"text":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"}},"required":["title","body"],"additionalProperties":false}},"required":["settings","can_edit","recipients","preview","text"],"additionalProperties":false},"OwnerPingResult":{"type":"object","properties":{"status":{"type":"string","enum":["sent","blocked"]},"check_id":{"$ref":"#/components/schemas/Id"},"channel":{"type":"string"},"reason":{"description":"The compliance gate that blocked it.","type":"string"}},"required":["status","check_id"],"additionalProperties":false},"OwnerReportEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property_id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["feedback","action"]},"action_kind":{"anyOf":[{"type":"string","enum":["open_house","price_advice","marketing","photos","note"]},{"type":"null"}]},"text":{"type":"string"},"occurred_on":{"$ref":"#/components/schemas/LocalDate"},"status":{"type":"string","enum":["draft","published"]},"source":{"type":"string"},"visit_item_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","property_id","kind","action_kind","text","occurred_on","status","source","visit_item_id","published_at","created_at","updated_at"],"additionalProperties":false},"OwnerReportLink":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"scope":{"type":"string","enum":["owner","listing"]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"listing":{"anyOf":[{"type":"object","properties":{"ref_code":{"type":"string"},"title":{"type":"string"}},"required":["ref_code","title"],"additionalProperties":false},{"type":"null"}]},"state":{"type":"string","enum":["active","expired","revoked"]},"issued_via":{"type":"string"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"expires_text":{"type":"string"},"renewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"revoke_reason":{"type":["string","null"]},"replaced_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"open_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_device":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"url":{"description":"The link to copy — live links, for people who manage them.","type":["string","null"]}},"required":["id","scope","property_id","listing","state","issued_via","expires_at","expires_text","renewed_at","revoked_at","revoke_reason","replaced_by_id","open_count","first_opened_at","last_opened_at","last_device","created_at","url"],"additionalProperties":false},"OwnerReportPage":{"type":"object","properties":{"scope":{"type":"string","enum":["owner","listing"]},"preview":{"type":"boolean"},"company":{"type":"object","properties":{"name":{"type":"string"},"brand_color":{"type":["string","null"]},"logo_url":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","brand_color","logo_url","phone"],"additionalProperties":false},"owner_first_name":{"type":["string","null"]},"updated_text":{"type":"string"},"expires_text":{"type":["string","null"]},"weeks":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"listings":{"type":"array","items":{"type":"object","properties":{"ref_code":{"type":"string"},"title":{"type":"string"},"place":{"type":["string","null"]},"rental":{"type":"boolean"},"status":{"type":"string"},"status_label":{"type":"string"},"listed_on":{"type":["string","null"]},"days_on_market":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"price":{"anyOf":[{"type":"object","properties":{"amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"per_month":{"type":"boolean"},"on_request":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string"},"amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"previous":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["on","amount","previous"],"additionalProperties":false}}},"required":["amount","per_month","on_request","history"],"additionalProperties":false},{"type":"null"}]},"views":{"anyOf":[{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"by_week":{"type":"array","items":{"type":"integer","minimum":0,"maximum":9007199254740991}},"shared_with":{"type":"integer","minimum":0,"maximum":9007199254740991},"shared_by_week":{"type":"array","items":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["total","by_week","shared_with","shared_by_week"],"additionalProperties":false},{"type":"null"}]},"enquiries":{"anyOf":[{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"by_week":{"type":"array","items":{"type":"integer","minimum":0,"maximum":9007199254740991}},"sources":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["label","count"],"additionalProperties":false}}},"required":["total","by_week","sources"],"additionalProperties":false},{"type":"null"}]},"visits":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":0,"maximum":9007199254740991},"upcoming":{"type":"integer","minimum":0,"maximum":9007199254740991},"by_week":{"type":"array","items":{"type":"integer","minimum":0,"maximum":9007199254740991}},"next":{"type":["string","null"]}},"required":["done","upcoming","by_week","next"],"additionalProperties":false},{"type":"null"}]},"feedback":{"anyOf":[{"type":"object","properties":{"responses":{"type":"integer","minimum":0,"maximum":9007199254740991},"liked":{"type":"integer","minimum":0,"maximum":9007199254740991},"maybe":{"type":"integer","minimum":0,"maximum":9007199254740991},"disliked":{"type":"integer","minimum":0,"maximum":9007199254740991},"themes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["key","label","count"],"additionalProperties":false}},"lines":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string"},"text":{"type":"string"}},"required":["on","text"],"additionalProperties":false}}},"required":["responses","liked","maybe","disliked","themes","lines"],"additionalProperties":false},{"type":"null"}]},"offers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"status":{"type":"string"},"amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"per_month":{"type":"boolean"},"on":{"type":"string"}},"required":["title","status","amount","per_month","on"],"additionalProperties":false}},{"type":"null"}]},"matches":{"anyOf":[{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["count"],"additionalProperties":false},{"type":"null"}]},"activity":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"on":{"type":"string"},"label":{"type":"string"},"text":{"type":"string"}},"required":["on","label","text"],"additionalProperties":false}},{"type":"null"}]},"agent":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"designation":{"type":["string","null"]},"phone":{"type":["string","null"]},"photo_url":{"type":["string","null"]}},"required":["name","designation","phone","photo_url"],"additionalProperties":false},{"type":"null"}]}},"required":["ref_code","title","place","rental","status","status_label","listed_on","days_on_market","price","views","enquiries","visits","feedback","offers","matches","activity","agent"],"additionalProperties":false}},"digest":{"type":"object","properties":{"on":{"type":"boolean"},"schedule":{"type":["string","null"]},"stopped":{"type":"boolean"}},"required":["on","schedule","stopped"],"additionalProperties":false}},"required":["scope","preview","company","owner_first_name","updated_text","expires_text","weeks","listings","digest"],"additionalProperties":false},"OwnerReportSections":{"type":"object","properties":{"price":{"type":"boolean"},"views":{"type":"boolean"},"enquiries":{"type":"boolean"},"visits":{"type":"boolean"},"feedback":{"type":"boolean"},"offers":{"type":"boolean"},"matches":{"type":"boolean"},"activity":{"type":"boolean"}},"required":["price","views","enquiries","visits","feedback","offers","matches","activity"],"additionalProperties":false,"description":"Which sections the owner sees."},"OwnerReportSend":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string"},"period_key":{"type":["string","null"]},"status":{"type":"string"},"channel":{"type":["string","null"]},"blocked_reason":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","period_key","status","channel","blocked_reason","created_at"],"additionalProperties":false},"OwnerReportSendResult":{"type":"object","properties":{"status":{"type":"string","enum":["queued","blocked"]},"send_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel":{"type":["string","null"]},"reason":{"description":"The compliance gate that blocked it.","type":["string","null"]}},"required":["status","send_id","channel","reason"],"additionalProperties":false},"Ownership":{"type":"string","enum":["freehold","leasehold","cooperative_society","power_of_attorney"]},"PageMeta":{"type":"object","properties":{"next_cursor":{"description":"Opaque cursor of the next page; null on the last page.","type":["string","null"]},"has_more":{"type":"boolean"}},"required":["next_cursor","has_more"],"additionalProperties":false},"Paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Money in paise (₹1 = 100), an exact integer.","examples":[850000000]},"PaiseInput":{"description":"Money in paise (₹1 = 100): an integer, or a digit string for huge amounts.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"string","pattern":"^-?\\d{1,20}$"}]},"PaiseInputOutput":{"description":"Money in paise (₹1 = 100): an integer, or a digit string for huge amounts."},"ParkedWebhookItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string"},"kind":{"type":"string","description":"whatsapp_cloud: change | status | media_fetch"},"connection_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"summary":{"type":"string","description":"One line without personal data."},"reason":{"type":"string"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["parked","replayed","discarded"]},"next_attempt_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"Next automatic try (waiting items only)."},"last_attempt_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","provider","kind","connection_id","summary","reason","attempts","max_attempts","status","next_attempt_at","last_attempt_at","resolved_at","created_at"],"additionalProperties":false},"ParkingType":{"type":"string","enum":["covered","open","stilt","basement","podium","mechanical","ev"]},"PartnerKycShare":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"partner_id":{"$ref":"#/components/schemas/Id"},"source_company_name":{"type":"string"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"source_verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"source_pan_masked":{"type":["string","null"]},"consent_version":{"type":"string"},"status":{"type":"string","enum":["shared","accepted","rejected"]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decision_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","partner_id","source_company_name","kind","source_verified_at","source_pan_masked","consent_version","status","decided_at","decision_note","created_at"],"additionalProperties":false},"PartnerPortalKycReuse":{"type":"object","properties":{"consent_version":{"type":"string"},"consent_text":{"type":"string"},"candidates":{"type":"array","items":{"type":"object","properties":{"source_company_id":{"$ref":"#/components/schemas/Id"},"source_company_name":{"type":"string"},"document_id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["pan","gst","rera","cancelled_cheque","address_proof","agreement","other"]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"pan_masked":{"type":["string","null"]},"pan_matches":{"type":"boolean","description":"The source firm’s PAN equals this firm’s PAN — only then can it be shared."},"shared":{"type":"boolean"}},"required":["source_company_id","source_company_name","document_id","kind","verified_at","pan_masked","pan_matches","shared"],"additionalProperties":false}},"shares":{"type":"array","items":{"$ref":"#/components/schemas/PartnerKycShare"}}},"required":["consent_version","consent_text","candidates","shares"],"additionalProperties":false},"Payee":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"$ref":"#/components/schemas/PayeeType"},"ref_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"pan_status":{"type":"string","enum":["valid","missing","invalid"]},"pan_holder":{"type":["string","null"]},"pan":{"description":"In full for commissions.payout holders; else ••••1234.","type":["string","null"]},"bank":{"anyOf":[{"type":"object","properties":{"account_name":{"type":["string","null"]},"account_number":{"type":["string","null"]},"ifsc":{"type":["string","null"]},"bank_name":{"type":["string","null"]},"upi_vpa":{"type":["string","null"]}},"required":["account_name","account_number","ifsc","bank_name","upi_vpa"],"additionalProperties":false},{"type":"null"}]},"gstin":{"type":["string","null"]},"gst_registered":{"type":"boolean"},"employee":{"type":"boolean","description":"On the payroll: TDS through payroll, not on payouts."},"tds_exempt_reason":{"type":["string","null"]},"certificate":{"anyOf":[{"type":"object","properties":{"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"number":{"type":["string","null"]},"valid_from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"limit":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["rate_bps","number","valid_from","valid_to","limit"],"additionalProperties":false},{"type":"null"}],"description":"Lower-deduction certificate."},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"state":{"type":["string","null"]},"notes":{"type":["string","null"]},"kyc_visible":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","ref_id","name","pan_status","pan_holder","pan","bank","gstin","gst_registered","employee","tds_exempt_reason","certificate","email","phone","state","notes","kyc_visible","created_at","updated_at"],"additionalProperties":false},"PayeeStatement":{"type":"object","properties":{"payee":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayeeType"},"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["type","id","name"],"additionalProperties":false},"financial_year":{"type":"string"},"summary":{"type":"object","properties":{"earned":{"$ref":"#/components/schemas/Paise"},"pending":{"$ref":"#/components/schemas/Paise"},"tds":{"$ref":"#/components/schemas/Paise"},"paid":{"$ref":"#/components/schemas/Paise"},"due":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["earned","pending","tds","paid","due","count"],"additionalProperties":false},"payouts":{"type":"array","items":{"$ref":"#/components/schemas/CommissionPayout"}}},"required":["payee","financial_year","summary","payouts"],"additionalProperties":false},"PayeeType":{"type":"string","enum":["member","partner","co_broker","referrer"]},"PaymentLink":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"deal_id":{"$ref":"#/components/schemas/Id"},"invoice_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"The brokerage invoice it collects (I-01)."},"provider":{"type":"string","enum":["razorpay","cashfree"]},"purpose":{"type":"string","enum":["token","brokerage"],"description":"token: collected for the owner (not commission) · brokerage: commission."},"amount":{"$ref":"#/components/schemas/Paise"},"amount_paid":{"$ref":"#/components/schemas/Paise"},"accept_partial":{"type":"boolean"},"min_partial_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"description":{"type":"string"},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},{"type":"null"}],"description":"The payer; the phone follows the caller’s field rules."},"status":{"$ref":"#/components/schemas/PaymentLinkStatus"},"short_url":{"type":["string","null"]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"paid_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cancelled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expired_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"error":{"description":"Why the provider refused to create it (status failed).","type":["string","null"]},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"amount":{"$ref":"#/components/schemas/Paise"},"method":{"type":["string","null"]},"paid_at":{"$ref":"#/components/schemas/DateTime"},"receipt":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]}},"required":["id","amount","method","paid_at","receipt"],"additionalProperties":false}},"created_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","deal_id","invoice_id","provider","purpose","amount","amount_paid","accept_partial","min_partial_amount","description","contact","status","short_url","expires_at","sent_at","paid_at","cancelled_at","expired_at","error","payments","created_by","created_at"],"additionalProperties":false},"PaymentLinkSendResult":{"type":"object","properties":{"status":{"type":"string","enum":["queued","blocked"]},"channel":{"type":"string"},"message_id":{"$ref":"#/components/schemas/Id"},"reasons":{"description":"Compliance-gate reasons when blocked.","type":"array","items":{"type":"string"}}},"required":["status"],"additionalProperties":false},"PaymentLinkStatus":{"type":"string","enum":["creating","created","partially_paid","paid","expired","cancelled","failed"]},"PaymentMilestone":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"percent":{"type":"number","exclusiveMinimum":0,"maximum":100,"description":"Up to three decimals; the plan adds up to 100."},"trigger":{"type":"string","enum":["booking","days_after_booking","date","agreement","stage","possession"]},"days":{"anyOf":[{"type":"integer","minimum":0,"maximum":3650},{"type":"null"}]},"date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"stage":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]}},"required":["name","percent","trigger"],"additionalProperties":false},"PaymentMilestoneInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"percent":{"type":"number","exclusiveMinimum":0,"maximum":100,"description":"Up to three decimals; the plan adds up to 100."},"trigger":{"type":"string","enum":["booking","days_after_booking","date","agreement","stage","possession"]},"days":{"anyOf":[{"type":"integer","minimum":0,"maximum":3650},{"type":"null"}]},"date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"stage":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]}},"required":["name","percent","trigger"]},"PaymentMode":{"type":"string","enum":["upi","neft","rtgs","imps","cheque","dd","cash","card","gateway"]},"PaymentPlan":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"type":{"type":"string","enum":["clp","down_payment","subvention","flexi","possession_linked","custom"]},"milestones":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/PaymentMilestone"}},{"type":"null"}],"description":"null: the stored plan needs fixing."},"is_active":{"type":"boolean"},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","project_id","name","type","milestones","is_active","bookings"],"additionalProperties":false},"PayoutReleaseRule":{"type":"string","enum":["manual","on_receipt","on_closure"],"description":"manual: payable at once · on_receipt: as the brokerage comes in · on_closure: once the deal is won."},"PayoutStatus":{"type":"string","enum":["pending","approved","paid","on_hold","cancelled"]},"PendingCall":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"phone":{"description":"Masked or absent per the caller’s field rules.","type":"string"},"contact_name":{"description":"Name saved on the phone, else the visible lead’s.","type":["string","null"]},"direction":{"$ref":"#/components/schemas/CallDirection"},"result":{"$ref":"#/components/schemas/CallResult"},"started_at":{"$ref":"#/components/schemas/DateTime"},"duration_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"status":{"type":["string","null"]}},"required":["id","name","status"],"additionalProperties":false},{"type":"null"}],"description":"The lead when the caller may open it; null for no lead or one they may not see."},"has_lead":{"type":"boolean","description":"The number belongs to a lead (maybe a colleague’s)."}},"required":["id","contact_name","direction","result","started_at","duration_sec","lead","has_lead"],"additionalProperties":false},"PendingCallOutcome":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"device_call_id":{"type":"string"},"direction":{"type":"string"},"started_at":{"$ref":"#/components/schemas/DateTime"},"duration_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"client":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"client_name":{"type":"string"}},"required":["id","client_name"],"additionalProperties":false,"description":"The same lead for app builds before E11-02 (they read client.client_name)."}},"required":["id","device_call_id","direction","started_at","duration_sec","lead","client"],"additionalProperties":false},"PendingCalls":{"type":"object","properties":{"enabled":{"type":"boolean","description":"The rule binds the caller; false = never block a dial."},"min_remark_chars":{"type":"integer","minimum":0,"maximum":9007199254740991},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every call waiting (the list shows the newest 30)."},"items":{"type":"array","items":{"$ref":"#/components/schemas/PendingCall"}}},"required":["enabled","min_remark_chars","count","items"],"additionalProperties":false},"PermissionChange":{"type":"object","properties":{"key":{"type":"string","description":"`leads.view` or `fields.contact.phone`."},"label":{"type":"string"},"from":{"$ref":"#/components/schemas/PermissionValue"},"to":{"$ref":"#/components/schemas/PermissionValue"},"effect":{"type":"string","enum":["widened","narrowed"]},"dangerous":{"type":"boolean"}},"required":["key","label","from","to","effect","dangerous"],"additionalProperties":false},"PermissionValue":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["own","team","branch","all","hidden","masked","visible"]}]},"PhoneDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"label":{"type":["string","null"]},"is_primary":{"type":"boolean"},"is_whatsapp":{"type":["boolean","null"]},"country":{"type":["string","null"]}},"required":["id","label","is_primary","is_whatsapp","country"],"additionalProperties":false,"description":"One of the contact’s numbers, without its digits (see `phones`)."},"PhoneE164":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"Phone number in E.164 format.","examples":["+919812345678"]},"PhoneInput":{"type":"object","properties":{"number":{"type":"string","minLength":4,"maxLength":32},"label":{"anyOf":[{"$ref":"#/components/schemas/PhoneLabel"},{"type":"null"}]},"is_whatsapp":{"type":["boolean","null"]},"is_primary":{"type":"boolean"}},"required":["number"]},"PhoneLabel":{"type":"string","enum":["mobile","work","home","whatsapp","other"]},"PhoneRecordingClaim":{"type":"object","properties":{"outcome":{"type":"string","enum":["upload","duplicate","later","refused","disabled"],"description":"upload: PUT the file, then confirm · duplicate: the server has it (never upload it again) · later: the call is not synced yet · refused: it does not fit the call (never) · disabled: the company switched sync off"},"reason":{"type":["string","null"]},"upload":{"anyOf":[{"$ref":"#/components/schemas/PresignedAudioUpload"},{"type":"null"}]}},"required":["outcome","reason","upload"],"additionalProperties":false},"PhoneRecordingClaimInput":{"type":"object","properties":{"device_id":{"$ref":"#/components/schemas/InstallationId"},"device_call_id":{"type":"string","minLength":1,"maxLength":64,"description":"The call’s id in the phone’s call log."},"sha256":{"type":"string","pattern":"^[0-9a-fA-F]{64}$","description":"SHA-256 of the file’s bytes (hex): one call per file; a re-scan never uploads it again."},"content_type":{"type":"string","minLength":3,"maxLength":100},"size":{"type":"integer","minimum":1,"maximum":41943040},"file_name":{"type":"string","minLength":1,"maxLength":255,"description":"The recorder’s file name (it carries the number or the contact name and the time)."},"named_at":{"description":"Epoch ms: the start time in the file name, resolved on the phone’s clock.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"modified_at":{"description":"Epoch ms: the file’s last-modified time.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":86400000},{"type":"null"}]}},"required":["device_id","device_call_id","sha256","content_type","size","file_name"]},"PhoneRecordingConfirmInput":{"type":"object","properties":{"device_id":{"$ref":"#/components/schemas/InstallationId"},"device_call_id":{"type":"string","minLength":1,"maxLength":64},"key":{"type":"string","minLength":10,"maxLength":300},"sha256":{"type":"string","pattern":"^[0-9a-fA-F]{64}$","description":"SHA-256 of the file’s bytes (hex): one call per file; a re-scan never uploads it again."},"file_name":{"type":"string","minLength":1,"maxLength":255,"description":"The recorder’s file name (it carries the number or the contact name and the time)."},"named_at":{"description":"Epoch ms: the start time in the file name, resolved on the phone’s clock.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"modified_at":{"description":"Epoch ms: the file’s last-modified time.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":86400000},{"type":"null"}]}},"required":["device_id","device_call_id","key","sha256","file_name"]},"PhoneRecordingConfirmation":{"type":"object","properties":{"outcome":{"type":"string","enum":["accepted","duplicate"]}},"required":["outcome"],"additionalProperties":false},"Pipeline":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"lead_types":{"type":"array","items":{"$ref":"#/components/schemas/LeadType"}},"is_default":{"type":"boolean"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"statuses":{"type":"array","items":{"$ref":"#/components/schemas/LeadStatus"}}},"required":["id","name","lead_types","is_default","sort_order","statuses"],"additionalProperties":false},"PipelineDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"lead_types":{"type":"array","items":{"$ref":"#/components/schemas/LeadType"}},"is_default":{"type":"boolean"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lead_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Leads in it (deleted ones left out); null for members without settings access."},"statuses":{"type":"array","items":{"$ref":"#/components/schemas/PipelineStatus"}}},"required":["id","name","lead_types","is_default","sort_order","lead_count","statuses"],"additionalProperties":false},"PipelineGuard":{"type":"object","properties":{"pipeline":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"enabled":{"type":"boolean"},"kind":{"anyOf":[{"type":"string","enum":["buyers","tenants","owners","project_sales"]},{"type":"null"}]},"kind_label":{"type":["string","null"]}},"required":["id","name","enabled","kind","kind_label"],"additionalProperties":false},"statuses":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_active":{"type":"boolean"},"rule":{"$ref":"#/components/schemas/StageRule"},"sub_statuses":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"pauses_sla":{"type":"boolean"}},"required":["id","key","name","pauses_sla"],"additionalProperties":false}}},"required":["id","key","name","category","sort_order","is_active","rule","sub_statuses"],"additionalProperties":false}},"recommended":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/StageRule"}},{"type":"null"}]}},"required":["pipeline","statuses","recommended"],"additionalProperties":false},"PipelineStatus":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"pipeline_id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"category":{"$ref":"#/components/schemas/StatusCategory"},"color":{"type":"string"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_default":{"type":"boolean"},"is_active":{"type":"boolean"},"sla_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"requirements":{"$ref":"#/components/schemas/PipelineStatusRequirements"},"lead_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Leads in it (deleted ones left out); null for members without settings access."},"sub_statuses":{"type":"array","items":{"$ref":"#/components/schemas/PipelineSubStatus"}}},"required":["id","pipeline_id","key","name","category","color","sort_order","is_default","is_active","sla_minutes","requirements","lead_count","sub_statuses"],"additionalProperties":false},"PipelineStatusRequirements":{"type":"object","properties":{"follow_up":{"$ref":"#/components/schemas/RequirementLevel"},"site_visit":{"$ref":"#/components/schemas/RequirementLevel"},"note":{"$ref":"#/components/schemas/RequirementLevel"},"deal":{"$ref":"#/components/schemas/RequirementLevel"},"fields":{"type":"array","items":{"type":"string"},"description":"Fields to fill before entering: lead, requirement or custom field keys; \"a|b\" = either."}},"additionalProperties":false},"PipelineSubStatus":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status_id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"is_active":{"type":"boolean"},"requirements":{"$ref":"#/components/schemas/PipelineStatusRequirements"},"auto_follow_up_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"counts_as_contact":{"type":"boolean"},"lead_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Leads in it (deleted ones left out); null for members without settings access."}},"required":["id","status_id","key","name","sort_order","is_active","requirements","auto_follow_up_minutes","counts_as_contact","lead_count"],"additionalProperties":false},"PlatformInvoice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string"},"kind":{"type":"string","enum":["subscription","credits","addon","credit_note"]},"status":{"type":"string"},"subtotal":{"$ref":"#/components/schemas/Paise"},"cgst":{"$ref":"#/components/schemas/Paise"},"sgst":{"$ref":"#/components/schemas/Paise"},"igst":{"$ref":"#/components/schemas/Paise"},"total":{"$ref":"#/components/schemas/Paise"},"place_of_supply":{"type":["string","null"]},"gstin":{"type":["string","null"]},"issued_at":{"$ref":"#/components/schemas/DateTime"},"paid_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"credit_note_for":{"description":"Credit notes: the number of the invoice reduced.","type":["string","null"]},"document_url":{"type":"string"}},"required":["id","number","kind","status","subtotal","cgst","sgst","igst","total","place_of_supply","gstin","issued_at","paid_at","credit_note_for","document_url"],"additionalProperties":false},"PoliceAcknowledgementUpload":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["filename","content_type","size"]},"PoliceRuleOverride":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"city":{"type":"string"},"state":{"type":"string"},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"rule":{"anyOf":[{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"authority":{"type":"string","minLength":1,"maxLength":200},"online":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","format":"uri"},"steps":{"type":"string","maxLength":1000}},"required":["name","url","steps"],"additionalProperties":false},{"type":"null"}]},"offline":{"type":"string","maxLength":1000},"fields":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"string","enum":["owner_name","owner_phone","owner_email","owner_address","premises_address","premises_police_station","tenancy_from","tenancy_to","monthly_rent","agreement_ref","tenant_name","tenant_relation","tenant_birth_year","tenant_phone","tenant_email","tenant_permanent_address","tenant_previous_address","tenant_id_proof","tenant_pan","occupants","tenant_occupation","tenant_workplace","reference_1","reference_2","foreign_passport_visa"]}},"documents":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"deadline":{"type":"object","properties":{"basis":{"type":"string","enum":["before_move_in","after_move_in"]},"days":{"type":"integer","minimum":0,"maximum":90}},"required":["basis","days"],"additionalProperties":false},"legal_basis":{"type":"string","maxLength":500},"fee":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["label","authority","online","offline","fields","documents","deadline","legal_basis","fee"],"additionalProperties":false},{"type":"null"}]},"source":{"type":["string","null"]},"note":{"type":["string","null"]},"valid":{"type":"boolean"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","city","state","effective_from","rule","source","note","valid","updated_at"],"additionalProperties":false},"PoliceRuleOverrideInput":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":40},"state":{"type":"string","minLength":2,"maxLength":2},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"rule":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"authority":{"type":"string","minLength":1,"maxLength":200},"online":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","format":"uri"},"steps":{"type":"string","maxLength":1000}},"required":["name","url","steps"]},{"type":"null"}]},"offline":{"type":"string","maxLength":1000},"fields":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"string","enum":["owner_name","owner_phone","owner_email","owner_address","premises_address","premises_police_station","tenancy_from","tenancy_to","monthly_rent","agreement_ref","tenant_name","tenant_relation","tenant_birth_year","tenant_phone","tenant_email","tenant_permanent_address","tenant_previous_address","tenant_id_proof","tenant_pan","occupants","tenant_occupation","tenant_workplace","reference_1","reference_2","foreign_passport_visa"]}},"documents":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"deadline":{"type":"object","properties":{"basis":{"type":"string","enum":["before_move_in","after_move_in"]},"days":{"type":"integer","minimum":0,"maximum":90}},"required":["basis","days"]},"legal_basis":{"type":"string","maxLength":500},"fee":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["label","authority","online","offline","fields","documents","deadline","legal_basis","fee"]},"source":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["city","state","effective_from","rule"]},"PoliceRuleView":{"type":"object","properties":{"id":{"type":"string"},"origin":{"type":"string","enum":["system","company"]},"label":{"type":"string"},"authority":{"type":"string"},"online":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"steps":{"type":"string"}},"required":["name","url","steps"],"additionalProperties":false},{"type":"null"}]},"offline":{"type":"string"},"documents":{"type":"array","items":{"type":"string"}},"deadline":{"type":"string"},"legal_basis":{"type":"string"},"fee":{"type":["string","null"]},"source":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string"},"retrieved_on":{"type":"string"}},"required":["title","url","retrieved_on"],"additionalProperties":false},"verified":{"type":"boolean","description":"false: unverified [U] — confirm with the police."},"note":{"type":["string","null"]}},"required":["id","origin","label","authority","online","offline","documents","deadline","legal_basis","fee","source","verified","note"],"additionalProperties":false},"PoliceRulesTable":{"type":"object","properties":{"system":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"origin":{"type":"string","enum":["system","company"]},"label":{"type":"string"},"authority":{"type":"string"},"online":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"steps":{"type":"string"}},"required":["name","url","steps"],"additionalProperties":false},{"type":"null"}]},"offline":{"type":"string"},"documents":{"type":"array","items":{"type":"string"}},"legal_basis":{"type":"string"},"fee":{"type":["string","null"]},"source":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string"},"retrieved_on":{"type":"string"}},"required":["title","url","retrieved_on"],"additionalProperties":false},"verified":{"type":"boolean","description":"false: unverified [U] — confirm with the police."},"note":{"type":["string","null"]},"city":{"type":"string"},"state":{"type":"string"},"fields":{"type":"array","items":{"type":"string"}},"deadline":{"type":"object","properties":{"basis":{"type":"string"},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["basis","days"],"additionalProperties":false},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"effective_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","origin","label","authority","online","offline","documents","legal_basis","fee","source","verified","note","city","state","fields","deadline","effective_from","effective_to"],"additionalProperties":false}},"company":{"type":"array","items":{"$ref":"#/components/schemas/PoliceRuleOverride"}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"state":{"type":"string"}},"required":["key","label","state"],"additionalProperties":false}}},"required":["system","company","cities"],"additionalProperties":false},"PoliceVerificationStatus":{"type":"string","enum":["pending","submitted","done","na"]},"PoliceVerificationView":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/PoliceVerificationStatus"},{"type":"null"}]},"status_label":{"type":["string","null"]},"tracked":{"type":"boolean"},"rule":{"$ref":"#/components/schemas/PoliceRuleView"},"city":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false},{"type":"null"}]},"state":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"],"additionalProperties":false},{"type":"null"}]},"due_on":{"$ref":"#/components/schemas/LocalDate"},"overdue":{"type":"boolean"},"days_overdue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ack_no":{"type":["string","null"]},"ack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"scan_status":{"anyOf":[{"$ref":"#/components/schemas/FileScanStatus"},{"type":"null"}]}},"required":["name","scan_status"],"additionalProperties":false},{"type":"null"}]},"submitted_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"done_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"na_reason":{"type":["string","null"]},"form_generated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reminders_sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_reminded_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["status","status_label","tracked","rule","city","state","due_on","overdue","days_overdue","ack_no","ack","submitted_on","done_on","na_reason","form_generated_at","reminders_sent","last_reminded_on"],"additionalProperties":false},"PortalConnection":{"type":"object","properties":{"connection_id":{"$ref":"#/components/schemas/Id"},"portal":{"type":"string","enum":["99acres","magicbricks","housing","justdial","sulekha","commonfloor"]},"name":{"type":["string","null"]},"status":{"type":"string"},"health":{"type":"string","enum":["ok","degraded","error","disconnected","pending"]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"push_url":{"description":"The URL the portal calls (secret).","type":["string","null"]},"pull":{"anyOf":[{"type":"object","properties":{"enabled":{"type":"boolean"},"interval_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"overlap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"endpoint":{"type":["string","null"]}},"required":["enabled","interval_minutes","overlap_minutes","endpoint"],"additionalProperties":false},{"type":"null"}]},"sync":{"anyOf":[{"type":"object","properties":{"cursor":{"type":["string","null"]},"last_run_at":{"type":["string","null"]},"last_status":{"anyOf":[{"type":"string","enum":["ok","error","auth"]},{"type":"null"}]},"last_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"type":["string","null"]},"reconcile":{"type":"object","properties":{"last_at":{"type":["string","null"]},"last_on":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["ok","error","auth","skipped"]},{"type":"null"}]},"stored":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":["string","null"]}},"required":["last_at","last_on","status","stored","error"],"additionalProperties":false,"description":"The nightly 48-hour reconciliation pull of a push-first connection."}},"required":["cursor","last_run_at","last_status","last_count","last_error","reconcile"],"additionalProperties":false},{"type":"null"}]},"credentials":{"type":"object","properties":{"has_secret":{"type":"boolean"},"fields":{"type":"array","items":{"type":"string"}},"hints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["has_secret","fields","hints"],"additionalProperties":false},"activation":{"type":"object","properties":{"status":{"type":"string","enum":["not_requested","requested","waiting_for_portal","test_lead_received","live"]},"requested_at":{"type":["string","null"]},"requested_by":{"type":["string","null"]},"waiting_at":{"type":["string","null"]},"test_lead_at":{"type":["string","null"]},"live_at":{"type":["string","null"]},"reminded_at":{"type":["string","null"]}},"required":["status","requested_at","requested_by","waiting_at","test_lead_at","live_at","reminded_at"],"additionalProperties":false,"description":"API activation steps; leads move the later steps."},"project_map":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"portal_project_id":{"type":"string","minLength":1,"maxLength":64},"project_id":{"$ref":"#/components/schemas/Id"}},"required":["portal_project_id","project_id"],"additionalProperties":false},"description":"Portal project id → PropZolo project."},"package_ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Last day of the portal package (company calendar)."},"allowed_ips":{"description":"Push callers allowed by IP address or CIDR block; empty = any caller.","type":"array","items":{"type":"string"}},"last_ok_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"error_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"onboarding":{"anyOf":[{"type":"object","properties":{"email_subject":{"type":"string"},"email_body":{"type":"string"},"mailto":{"type":"string"},"test_url":{"type":["string","null"]}},"required":["email_subject","email_body","mailto","test_url"],"additionalProperties":false},{"type":"null"}],"description":"The pre-written email to the account manager and a sandbox test link (managers only)."}},"required":["connection_id","portal","name","status","health","source_id","push_url","pull","sync","credentials","activation","project_map","package_ends_on","last_ok_at","last_error","error_count","created_at","onboarding"],"additionalProperties":false},"PortalKey":{"type":"string","enum":["99acres","magicbricks","housing","justdial","sulekha","commonfloor","nobroker","square_yards","makaan"]},"PortalReferral":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"status":{"type":"string","enum":["received","lead_created","duplicate","held"]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"type":["string","null"]},"referrer":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","status","lead_id","note","referrer","created_at"],"additionalProperties":false},"PortalSetup":{"type":"object","properties":{"portal":{"$ref":"#/components/schemas/PortalKey"},"name":{"type":"string"},"modes":{"type":"array","items":{"type":"string","enum":["push","pull","email"]}},"push_contact":{"type":["string","null"]},"push_method":{"type":"string"},"push_steps":{"type":"array","items":{"type":"string"}},"pull_steps":{"type":"array","items":{"type":"string"}},"pull_credentials":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"help":{"type":"string"},"secret":{"type":"boolean"}},"required":["name","label","help","secret"],"additionalProperties":false}},"email_steps":{"type":"array","items":{"type":"string"}},"caveat":{"type":["string","null"]},"can_manage":{"type":"boolean"},"connections":{"type":"array","items":{"$ref":"#/components/schemas/PortalConnection"}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_active":{"type":"boolean"}},"required":["id","name","is_active"],"additionalProperties":false}}},"required":["portal","name","modes","push_contact","push_method","push_steps","pull_steps","pull_credentials","email_steps","caveat","can_manage","connections","sources"],"additionalProperties":false},"PossessionStatus":{"type":"string","enum":["ready_to_move","under_construction"]},"PostSalesChecklist":{"type":"object","properties":{"file":{"type":"object","properties":{"type":{"type":"string","enum":["deal","booking"]},"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"kind":{"type":"string","enum":["new_booking","resale","rental"]}},"required":["type","id","ref","kind"],"additionalProperties":false},"doc_items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"required":{"type":"boolean"},"id_kind":{"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"id_number":{"description":"Masked; hidden for roles without the PAN rule.","type":["string","null"]},"status":{"type":"string","enum":["pending","uploaded","verified","rejected"]},"reject_reason":{"type":["string","null"]},"document":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"content_type":{"type":"string"},"uploaded_at":{"$ref":"#/components/schemas/DateTime"},"applicant_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"A booking’s personal paper: whose it is."}},"required":["id","name","content_type","uploaded_at","applicant_id"],"additionalProperties":false},{"type":"null"}]},"uploaded_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"uploaded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reviewed_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reminded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"in_template":{"type":"boolean"},"personal":{"type":"boolean","description":"One applicant’s paper: a booking files it under an applicant."}},"required":["key","label","required","id_kind","status","reject_reason","document","uploaded_by","uploaded_at","reviewed_by","reviewed_at","reminded_at","in_template","personal"],"additionalProperties":false}},"reminders_enabled":{"type":"boolean"},"applicants":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_primary":{"type":"boolean"}},"required":["id","name","is_primary"],"additionalProperties":false}}},"required":["file","doc_items","reminders_enabled","applicants"],"additionalProperties":false},"PostSalesConfig":{"type":"object","properties":{"settings":{"type":"object","properties":{"stage_sla_days":{"type":"object","properties":{"token":{"type":"integer","minimum":1,"maximum":365},"agreement":{"type":"integer","minimum":1,"maximum":365},"registration":{"type":"integer","minimum":1,"maximum":365},"handover":{"type":"integer","minimum":1,"maximum":365}},"required":["token","agreement","registration","handover"],"additionalProperties":false},"stage_messages":{"type":"object","properties":{"agreement":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"],"additionalProperties":false},"registration":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"],"additionalProperties":false},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"],"additionalProperties":false},"completed":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"],"additionalProperties":false}},"required":["agreement","registration","handover","completed"],"additionalProperties":false},"document_reminders":{"type":"boolean"},"escalation_lead_days":{"type":"integer","minimum":1,"maximum":90},"auto_raise_brokerage":{"type":"boolean"}},"required":["stage_sla_days","stage_messages","document_reminders","escalation_lead_days","auto_raise_brokerage"],"additionalProperties":false},"templates":{"type":"object","properties":{"new_booking":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label","required","id_kind","personal"],"additionalProperties":false}},"resale":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label","required","id_kind","personal"],"additionalProperties":false}},"rental":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label","required","id_kind","personal"],"additionalProperties":false}}},"required":["new_booking","resale","rental"],"additionalProperties":false},"defaults":{"type":"object","properties":{"settings":{"type":"object","properties":{"stage_sla_days":{"type":"object","properties":{"token":{"type":"integer","minimum":1,"maximum":365},"agreement":{"type":"integer","minimum":1,"maximum":365},"registration":{"type":"integer","minimum":1,"maximum":365},"handover":{"type":"integer","minimum":1,"maximum":365}},"required":["token","agreement","registration","handover"],"additionalProperties":false},"stage_messages":{"type":"object","properties":{"agreement":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"],"additionalProperties":false},"registration":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"],"additionalProperties":false},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"],"additionalProperties":false},"completed":{"type":"object","properties":{"enabled":{"type":"boolean"},"channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]}},"required":["enabled","channel"],"additionalProperties":false}},"required":["agreement","registration","handover","completed"],"additionalProperties":false},"document_reminders":{"type":"boolean"},"escalation_lead_days":{"type":"integer","minimum":1,"maximum":90},"auto_raise_brokerage":{"type":"boolean"}},"required":["stage_sla_days","stage_messages","document_reminders","escalation_lead_days","auto_raise_brokerage"],"additionalProperties":false},"templates":{"type":"object","properties":{"new_booking":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label","required","id_kind","personal"],"additionalProperties":false}},"resale":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label","required","id_kind","personal"],"additionalProperties":false}},"rental":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"default":true,"type":"boolean"},"id_kind":{"default":null,"anyOf":[{"type":"string","enum":["pan","aadhaar"]},{"type":"null"}]},"personal":{"default":null,"description":"One applicant’s paper (shared with that applicant only); null: decided by the item.","type":["boolean","null"]}},"required":["key","label","required","id_kind","personal"],"additionalProperties":false}}},"required":["new_booking","resale","rental"],"additionalProperties":false}},"required":["settings","templates"],"additionalProperties":false}},"required":["settings","templates"],"additionalProperties":false},"PostSalesFile":{"type":"object","properties":{"type":{"type":"string","enum":["deal","booking"]},"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"kind":{"type":"string","enum":["new_booking","resale","rental"]},"title":{"type":"string"},"customer":{"type":["string","null"]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"place":{"type":["string","null"]},"agreement_value":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"stage":{"type":"string","enum":["token","agreement","registration","handover","completed"]},"record_stage":{"type":"string"},"days_in_stage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"past_sla":{"type":"boolean"},"progress":{"type":"integer","minimum":0,"maximum":100},"next_action":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["code","label"],"additionalProperties":false},{"type":"null"}]},"owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"last_activity_at":{"$ref":"#/components/schemas/DateTime"},"loan_required":{"type":"boolean"},"documents":{"type":"object","properties":{"required":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to_verify":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["required","verified","missing","to_verify","rejected"],"additionalProperties":false},"dues_outstanding":{"$ref":"#/components/schemas/Paise"},"brokerage_due":{"$ref":"#/components/schemas/Paise"},"handover_status":{"type":"string","enum":["none","open","completed"]},"open_snags":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"can_edit":{"type":"boolean"}},"required":["type","id","ref","kind","title","customer","contact_id","lead_id","project","place","agreement_value","stage","record_stage","days_in_stage","past_sla","progress","next_action","owner","last_activity_at","loan_required","documents","dues_outstanding","brokerage_due","handover_status","open_snags","can_edit"],"additionalProperties":false},"PostSalesHandover":{"type":"object","properties":{"file":{"type":"object","properties":{"type":{"type":"string","enum":["deal","booking"]},"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"kind":{"type":"string","enum":["new_booking","resale","rental"]}},"required":["type","id","ref","kind"],"additionalProperties":false},"status":{"type":"string","enum":["open","completed"]},"keys_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"keys_note":{"type":["string","null"]},"meters":{"type":"object","properties":{"electricity":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"water":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"gas":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]}},"additionalProperties":false},"handover_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"acceptance_document_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"notes":{"type":["string","null"]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"override_reason":{"type":["string","null"]},"snags":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"description":{"type":"string"},"location":{"type":["string","null"]},"photos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolved_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","description","location","photos","resolved_at","resolved_by","created_at"],"additionalProperties":false}},"gate":{"type":"object","properties":{"blockers":{"type":"array","items":{"type":"string"}},"messages":{"type":"array","items":{"type":"string"}}},"required":["blockers","messages"],"additionalProperties":false},"can_edit":{"type":"boolean"},"can_override":{"type":"boolean"}},"required":["file","status","keys_count","keys_note","meters","handover_date","acceptance_document_id","notes","completed_at","completed_by","override_reason","snags","gate","can_edit","can_override"],"additionalProperties":false},"PredictiveGateCheck":{"type":"object","properties":{"key":{"type":"string","enum":["history","outcomes","validation","auc","beats_rules","brier","calibration"]},"passed":{"type":"boolean"},"value":{"type":["number","null"]},"threshold":{"type":"number"},"text":{"type":"string"}},"required":["key","passed","value","threshold","text"],"additionalProperties":false},"PredictiveScoringView":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/PredictiveSettings"},"bounds":{"type":"object","properties":{"min_history_days":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false},"min_positives":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false},"min_auc":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false},"min_auc_lift":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false},"max_ece":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false}},"required":["min_history_days","min_positives","min_auc","min_auc_lift","max_ece"],"additionalProperties":false},"mode":{"type":"string","enum":["model","rules"],"description":"What scores the leads now."},"status_text":{"type":"string"},"active_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"readiness":{"type":"object","properties":{"history_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ready":{"type":"boolean"},"needed":{"type":"object","properties":{"history_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["history_days","positives"],"additionalProperties":false},"checks":{"type":"array","items":{"$ref":"#/components/schemas/PredictiveGateCheck"}}},"required":["history_days","positives","ready","needed","checks"],"additionalProperties":false},"latest":{"anyOf":[{"$ref":"#/components/schemas/ScoreModelDetail"},{"type":"null"}]},"active":{"anyOf":[{"$ref":"#/components/schemas/ScoreModelDetail"},{"type":"null"}]},"history":{"type":"array","items":{"$ref":"#/components/schemas/ScoreModelSummary"}},"last_run":{"anyOf":[{"type":"object","properties":{"at":{"type":"string"},"trigger":{"type":"string","enum":["schedule","manual"]},"outcome":{"type":"string","enum":["skipped","insufficient_data","not_enough_rows","trained","failed"]},"text":{"type":"string"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"readiness":{"anyOf":[{"type":"object","properties":{"history_days":{"type":"number"},"positives":{"type":"number"}},"required":["history_days","positives"],"additionalProperties":false},{"type":"null"}]}},"required":["at","trigger","outcome","text","version","readiness"],"additionalProperties":false},{"type":"null"}]}},"required":["settings","bounds","mode","status_text","active_version","readiness","latest","active","history","last_run"],"additionalProperties":false},"PredictiveSettings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Use the model for scores and queues once one passes its checks."},"min_history_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_auc":{"type":"number"},"min_auc_lift":{"type":"number"},"max_ece":{"type":"number"}},"required":["enabled","min_history_days","min_positives","min_auc","min_auc_lift","max_ece"],"additionalProperties":false},"PresignUploadInput":{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["photo","floor_plan","master_plan","video","brochure","price_list","document"]},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","filename","content_type","size"]},"PresignedAudioUpload":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["key","url","method","headers","expires_at"],"additionalProperties":false},"PresignedUpload":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"},"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","url","method","headers","expires_at","max_bytes"],"additionalProperties":false},"PriceChange":{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"field":{"type":"string","enum":["price","rent_amount"]},"from":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]}},"required":["at","field","from","to","by"],"additionalProperties":false},"PriceList":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"template":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"effective_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"in_force":{"type":"boolean"},"rates":{"anyOf":[{"$ref":"#/components/schemas/PriceRates"},{"type":"null"}],"description":"Pricing admins only."},"valid":{"type":"boolean"},"notes":{"type":["string","null"]},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cost_sheets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","project_id","template","version","name","status","effective_from","effective_to","in_force","rates","valid","notes","published_at","cost_sheets","updated_at"],"additionalProperties":false},"PriceRates":{"type":"object","properties":{"bsp_rate":{"type":"integer","minimum":0,"maximum":100000000000000},"bsp_overrides":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"rate":{"type":"integer","minimum":0,"maximum":100000000000000}},"required":["tower_id","configuration_id","rate"],"additionalProperties":false}},"plc":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":60},"facings":{"maxItems":8,"type":"array","items":{"type":"string"}},"views":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"corner":{"type":["boolean","null"]},"floor_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"floor_max":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"basis":{"type":"string","enum":["per_area","fixed"]},"amount":{"type":"integer","minimum":0,"maximum":100000000000000}},"required":["label","amount"],"additionalProperties":false}},"floor_rise":{"type":"object","properties":{"mode":{"type":"string","enum":["none","per_floor","slab"]},"start_floor":{"type":"integer","minimum":1,"maximum":300},"rate":{"type":"integer","minimum":0,"maximum":100000000000000},"slabs":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_floor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to_floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rate":{"type":"integer","minimum":0,"maximum":100000000000000}},"required":["from_floor","to_floor","rate"],"additionalProperties":false}}},"required":["mode"],"additionalProperties":false},"parking":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":100000000000000}},"heads":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"additionalProperties":{"type":"integer","minimum":0,"maximum":100000000000000}}},"required":["bsp_rate"],"additionalProperties":false,"description":"BSP per area unit (overrides per tower / configuration), PLC rules, floor rise, parking by type and each other charge by template code (per_area: paise per area unit · fixed: paise · percent_bsp: basis points)."},"PriceRatesInput":{"type":"object","properties":{"bsp_rate":{"type":"integer","minimum":0,"maximum":100000000000000},"bsp_overrides":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"rate":{"type":"integer","minimum":0,"maximum":100000000000000}},"required":["tower_id","configuration_id","rate"]}},"plc":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":60},"facings":{"maxItems":8,"type":"array","items":{"type":"string"}},"views":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"corner":{"type":["boolean","null"]},"floor_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"floor_max":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"basis":{"type":"string","enum":["per_area","fixed"]},"amount":{"type":"integer","minimum":0,"maximum":100000000000000}},"required":["label","amount"]}},"floor_rise":{"type":"object","properties":{"mode":{"type":"string","enum":["none","per_floor","slab"]},"start_floor":{"type":"integer","minimum":1,"maximum":300},"rate":{"type":"integer","minimum":0,"maximum":100000000000000},"slabs":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_floor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to_floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rate":{"type":"integer","minimum":0,"maximum":100000000000000}},"required":["from_floor","to_floor","rate"]}}},"required":["mode"]},"parking":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":100000000000000}},"heads":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"additionalProperties":{"type":"integer","minimum":0,"maximum":100000000000000}}},"required":["bsp_rate"],"description":"BSP per area unit (overrides per tower / configuration), PLC rules, floor rise, parking by type and each other charge by template code (per_area: paise per area unit · fixed: paise · percent_bsp: basis points)."},"PrivacyNotice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"purpose":{"type":"string"},"language":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"body":{"type":"string"},"content_hash":{"type":"string","description":"sha256 of the notice as shown — cited by consent evidence."},"status":{"type":"string","enum":["draft","published","retired"]},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"published_by":{"type":["string","null"]},"retired_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","purpose","language","version","title","body","content_hash","status","published_at","published_by","retired_at","created_at","updated_at"],"additionalProperties":false},"ProjectCompletion":{"type":"object","properties":{"project":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}],"description":"The whole project’s certificate date (or null)."},"towers":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"cc_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","name","cc_on"],"additionalProperties":false}}},"required":["project","towers"],"additionalProperties":false},"ProjectConfiguration":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"type":["number","null"]},"carpet_min":{"type":["number","null"]},"carpet_max":{"type":["number","null"]},"super_min":{"type":["number","null"]},"super_max":{"type":["number","null"]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"price_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"units_total":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"units_available":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","name","property_type","bhk","carpet_min","carpet_max","super_min","super_max","area_unit","price_min","price_max","units_total","units_available"],"additionalProperties":false},"ProjectConfigurationInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"examples":["3 BHK Premium"]},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"carpet_min":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]},"carpet_max":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]},"super_min":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]},"super_max":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]},"area_unit":{"default":"sqft","$ref":"#/components/schemas/AreaUnit"},"price_min":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"units_total":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"units_available":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["name","property_type"]},"ProjectDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"$ref":"#/components/schemas/ProjectStatus"},"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_types":{"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"developer":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"locality":{"anyOf":[{"$ref":"#/components/schemas/LocalityRef"},{"type":"null"}]},"city":{"type":["string","null"]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"price_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"bhk_options":{"type":"array","items":{"type":"number"}},"rera_numbers":{"type":"array","items":{"$ref":"#/components/schemas/ReraRegistration"}},"cp_brokerage_pct":{"type":["number","null"]},"is_own":{"type":"boolean"},"is_published":{"type":"boolean"},"cover_url":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"updated_at":{"$ref":"#/components/schemas/DateTime"},"launch_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"address":{"type":["string","null"]},"state":{"type":["string","null"]},"pincode":{"type":["string","null"]},"land_area":{"type":["number","null"]},"land_area_unit":{"anyOf":[{"$ref":"#/components/schemas/AreaUnit"},{"type":"null"}]},"open_area_pct":{"type":["number","null"]},"towers_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"units_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"floors_max":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amenities":{"type":"array","items":{"$ref":"#/components/schemas/AmenityRef"}},"approvals":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}},{"type":"null"}]},"approved_banks":{"type":"array","items":{"type":"string"}},"usps":{"type":"array","items":{"type":"string"}},"description":{"type":["string","null"]},"offers":{"type":["string","null"]},"video_url":{"type":["string","null"]},"virtual_tour_url":{"type":["string","null"]},"configurations":{"type":"array","items":{"$ref":"#/components/schemas/ProjectConfiguration"}},"can":{"type":"object","properties":{"edit":{"type":"boolean"},"publish":{"type":"boolean"},"delete":{"type":"boolean"}},"required":["edit","publish","delete"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","slug","status","category","property_types","developer","locality","city","possession_date","price_min","price_max","bhk_options","rera_numbers","cp_brokerage_pct","is_own","is_published","cover_url","latitude","longitude","updated_at","launch_date","address","state","pincode","land_area","land_area_unit","open_area_pct","towers_count","units_count","floors_max","amenities","approvals","approved_banks","usps","description","offers","video_url","virtual_tour_url","configurations","can","created_at"],"additionalProperties":false},"ProjectLeadCapture":{"type":"object","properties":{"meta_forms":{"type":"array","items":{"type":"object","properties":{"connection_id":{"$ref":"#/components/schemas/Id"},"form_id":{"type":"string"},"name":{"type":["string","null"]},"page_name":{"type":["string","null"]},"enabled":{"type":"boolean"}},"required":["connection_id","form_id","name","page_name","enabled"],"additionalProperties":false}},"forms":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_active":{"type":"boolean"}},"required":["id","name","is_active"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["meta_forms","forms","sources"],"additionalProperties":false},"ProjectMatch":{"type":"object","properties":{"score":{"type":"integer","minimum":0,"maximum":100},"reasons":{"$ref":"#/components/schemas/MatchReasons"},"project":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"locality":{"type":["string","null"]},"possession_date":{"type":["string","null"]},"cp_brokerage_pct":{"type":["number","null"]}},"required":["id","name","locality","possession_date","cp_brokerage_pct"],"additionalProperties":false},"configuration":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"type":["number","null"]},"price_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["id","name","property_type","bhk","price_min","price_max"],"additionalProperties":false}},"required":["score","reasons","project","configuration"],"additionalProperties":false},"ProjectStatus":{"type":"string","enum":["pre_launch","new_launch","under_construction","ready_to_move","completed"]},"ProjectSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"$ref":"#/components/schemas/ProjectStatus"},"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_types":{"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"developer":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"locality":{"anyOf":[{"$ref":"#/components/schemas/LocalityRef"},{"type":"null"}]},"city":{"type":["string","null"]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"price_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"bhk_options":{"type":"array","items":{"type":"number"}},"rera_numbers":{"type":"array","items":{"$ref":"#/components/schemas/ReraRegistration"}},"cp_brokerage_pct":{"type":["number","null"]},"is_own":{"type":"boolean"},"is_published":{"type":"boolean"},"cover_url":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","slug","status","category","property_types","developer","locality","city","possession_date","price_min","price_max","bhk_options","rera_numbers","cp_brokerage_pct","is_own","is_published","cover_url","latitude","longitude","updated_at"],"additionalProperties":false},"ProjectUpdate":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"},"body":{"type":["string","null"]},"progress_pct":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["draft","published"]},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","project_id","title","body","progress_pct","status","published_at","created_by_id","created_at","updated_at"],"additionalProperties":false},"PropertyCategory":{"type":"string","enum":["residential","commercial","agricultural","industrial"]},"PropertyDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string","examples":["P-2031"]},"listing_type":{"$ref":"#/components/schemas/ListingType"},"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_type":{"$ref":"#/components/schemas/PropertyType"},"title":{"type":"string"},"status":{"$ref":"#/components/schemas/ListingStatus"},"bhk":{"type":["number","null"]},"bathrooms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"layout":{"anyOf":[{"$ref":"#/components/schemas/Layout"},{"type":"null"}]},"carpet_area":{"type":["number","null"]},"builtup_area":{"type":["number","null"]},"super_area":{"type":["number","null"]},"plot_area":{"type":["number","null"]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"area_sqft":{"description":"Canonical area: carpet → built-up → super → plot.","type":["number","null"]},"price":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_per_sqft":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Of the price (sale) or the monthly rent (rentals)."},"price_on_request":{"type":"boolean"},"rent_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"maintenance_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"maintenance_period":{"type":["string","null"]},"furnishing":{"anyOf":[{"$ref":"#/components/schemas/Furnishing"},{"type":"null"}]},"facing":{"anyOf":[{"$ref":"#/components/schemas/Facing"},{"type":"null"}]},"possession_status":{"anyOf":[{"$ref":"#/components/schemas/PossessionStatus"},{"type":"null"}]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"available_from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"society_name":{"type":["string","null"]},"sub_locality":{"type":["string","null"]},"city":{"type":"string"},"locality":{"anyOf":[{"$ref":"#/components/schemas/LocalityRef"},{"type":"null"}]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"location_precision":{"type":"string","enum":["exact","approximate"],"description":"approximate (~100 m) when the caller may not see the address."},"cover_url":{"description":"Public, EXIF-free photo variant.","type":["string","null"]},"photos_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"matches_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Open buyer / tenant leads this listing matches."},"listed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"is_featured":{"type":"boolean"},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"When the owner last confirmed availability (F-13)."},"verification_badge":{"anyOf":[{"$ref":"#/components/schemas/ListingBadge"},{"type":"null"}],"description":"The Verified badge (U-04); null when the listing was never verified."},"views_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shares_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiries_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"description":{"type":["string","null"]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"building":{"type":["string","null"]},"floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total_floors":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"landmark":{"type":["string","null"]},"state":{"type":["string","null"]},"pincode":{"type":["string","null"]},"bedrooms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"balconies":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"extra_rooms":{"type":"array","items":{"type":"string"}},"plot_length":{"type":["number","null"]},"plot_breadth":{"type":["number","null"]},"road_width_ft":{"type":["number","null"]},"frontage_ft":{"type":["number","null"]},"is_corner":{"type":"boolean"},"overlooking":{"type":"array","items":{"type":"string"}},"vastu_compliant":{"type":["boolean","null"]},"furnishing_items":{"type":"array","items":{"type":"string"}},"year_built":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"transaction_type":{"anyOf":[{"$ref":"#/components/schemas/TransactionType"},{"type":"null"}]},"ownership":{"anyOf":[{"$ref":"#/components/schemas/Ownership"},{"type":"null"}]},"approvals":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["boolean","string"]}},{"type":"null"}]},"rera_number":{"type":["string","null"]},"loan_banks":{"type":"array","items":{"type":"string"}},"covered_parking":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"open_parking":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"two_wheeler_parking":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amenities":{"type":"array","items":{"$ref":"#/components/schemas/AmenityRef"}},"water_supply":{"type":["string","null"]},"power_backup":{"type":["string","null"]},"gated_community":{"type":["boolean","null"]},"price_negotiable":{"type":"boolean"},"all_inclusive":{"type":["boolean","null"]},"token_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"maintenance_included":{"type":["boolean","null"]},"deposit_months":{"type":["number","null"]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"agreement_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"escalation_pct":{"type":["number","null"]},"tenant_preferences":{"type":"array","items":{"type":"string"}},"pets_allowed":{"type":["boolean","null"]},"non_veg_allowed":{"type":["boolean","null"]},"co_broking":{"type":"boolean"},"network_visibility":{"type":"string"},"expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_by_id":{"type":["string","null"]},"owner":{"anyOf":[{"$ref":"#/components/schemas/PropertyOwner"},{"type":"string"}]},"unit_no":{"type":["string","null"]},"address":{"type":["string","null"]},"owner_expected_price":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},{"type":"string"}]},"rent_floor":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},{"type":"string"}]},"deposit_floor":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},{"type":"string"}]},"lock_in_max_months":{"anyOf":[{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},{"type":"string"}]},"mandate":{"anyOf":[{"$ref":"#/components/schemas/PropertyMandate"},{"type":"string"}]},"price_history":{"type":"array","items":{"$ref":"#/components/schemas/PriceChange"}},"allowed_statuses":{"type":"array","items":{"$ref":"#/components/schemas/ListingStatus"},"description":"Statuses this listing may move to now."},"can":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"share":{"type":"boolean"},"publish":{"type":"boolean"},"documents":{"type":"boolean","description":"May open private documents and the key register."}},"required":["edit","delete","share","publish","documents"],"additionalProperties":false}},"required":["id","ref_code","listing_type","category","property_type","title","status","bhk","bathrooms","carpet_area","builtup_area","super_area","plot_area","area_unit","area_sqft","price","price_per_sqft","price_on_request","rent_amount","deposit_amount","maintenance_amount","maintenance_period","furnishing","facing","possession_status","possession_date","available_from","society_name","sub_locality","city","locality","latitude","longitude","location_precision","cover_url","photos_count","matches_count","listed_by","is_featured","verified_at","verification_badge","views_count","shares_count","enquiries_count","visits_count","created_at","updated_at","description","project","building","floor","total_floors","landmark","state","pincode","bedrooms","balconies","extra_rooms","plot_length","plot_breadth","road_width_ft","frontage_ft","is_corner","overlooking","vastu_compliant","furnishing_items","year_built","transaction_type","ownership","approvals","rera_number","loan_banks","covered_parking","open_parking","two_wheeler_parking","amenities","water_supply","power_backup","gated_community","price_negotiable","all_inclusive","token_amount","maintenance_included","deposit_months","lock_in_months","notice_months","agreement_months","escalation_pct","tenant_preferences","pets_allowed","non_veg_allowed","co_broking","network_visibility","expires_on","custom","created_by_id","price_history","allowed_statuses","can"],"additionalProperties":false},"PropertyMandate":{"type":"object","properties":{"type":{"description":"MandateType, or \"•••\" when masked.","type":["string","null"]},"expires_on":{"type":["string","null"]},"brokerage_from_owner":{"type":["string","null"]},"brokerage_from_client":{"type":["string","null"]}},"required":["type","expires_on","brokerage_from_owner","brokerage_from_client"],"additionalProperties":false,"description":"Field rule property.mandate."},"PropertyMapPoint":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"listing_type":{"$ref":"#/components/schemas/ListingType"},"status":{"$ref":"#/components/schemas/ListingStatus"},"bhk":{"type":["number","null"]},"price":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"rent_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["id","ref_code","title","listing_type","status","bhk","price","rent_amount","latitude","longitude"],"additionalProperties":false},"PropertyMatch":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"score":{"type":"integer","minimum":0,"maximum":100},"status":{"$ref":"#/components/schemas/MatchStatus"},"reasons":{"$ref":"#/components/schemas/MatchReasons"},"property":{"$ref":"#/components/schemas/PropertySummary"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","score","status","reasons","property","updated_at"],"additionalProperties":false},"PropertyOwner":{"type":"object","properties":{"contact_id":{"type":["string","null"]},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"key_with":{"type":["string","null"]},"visit_instructions":{"type":["string","null"]}},"required":["contact_id","name","phone","key_with","visit_instructions"],"additionalProperties":false,"description":"Field rule property.owner; masked leaves read \"•••\"."},"PropertyOwnerInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","minLength":6,"maxLength":32,"description":"Any format; normalised to E.164 (NRI numbers keep their code)."},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]}},"required":["name","phone"]},"PropertySavedView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"visibility":{"type":"string","enum":["private","team"]},"filters":{},"sort":{"type":["string","null"]},"layout":{"type":"string","enum":["table","grid","map"]},"is_pinned":{"type":"boolean"},"mine":{"type":"boolean"}},"required":["id","name","visibility","filters","sort","layout","is_pinned","mine"],"additionalProperties":false},"PropertySavedViewInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"visibility":{"default":"private","type":"string","enum":["private","team"]},"filters":{"description":"Filter tree (the shared filter DSL), or null."},"sort":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"layout":{"default":"table","type":"string","enum":["table","grid","map"]},"is_pinned":{"type":"boolean"}},"required":["name","filters"]},"PropertySummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string","examples":["P-2031"]},"listing_type":{"$ref":"#/components/schemas/ListingType"},"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_type":{"$ref":"#/components/schemas/PropertyType"},"title":{"type":"string"},"status":{"$ref":"#/components/schemas/ListingStatus"},"bhk":{"type":["number","null"]},"bathrooms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"layout":{"anyOf":[{"$ref":"#/components/schemas/Layout"},{"type":"null"}]},"carpet_area":{"type":["number","null"]},"builtup_area":{"type":["number","null"]},"super_area":{"type":["number","null"]},"plot_area":{"type":["number","null"]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"area_sqft":{"description":"Canonical area: carpet → built-up → super → plot.","type":["number","null"]},"price":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"price_per_sqft":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Of the price (sale) or the monthly rent (rentals)."},"price_on_request":{"type":"boolean"},"rent_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"maintenance_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"maintenance_period":{"type":["string","null"]},"furnishing":{"anyOf":[{"$ref":"#/components/schemas/Furnishing"},{"type":"null"}]},"facing":{"anyOf":[{"$ref":"#/components/schemas/Facing"},{"type":"null"}]},"possession_status":{"anyOf":[{"$ref":"#/components/schemas/PossessionStatus"},{"type":"null"}]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"available_from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"society_name":{"type":["string","null"]},"sub_locality":{"type":["string","null"]},"city":{"type":"string"},"locality":{"anyOf":[{"$ref":"#/components/schemas/LocalityRef"},{"type":"null"}]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"location_precision":{"type":"string","enum":["exact","approximate"],"description":"approximate (~100 m) when the caller may not see the address."},"cover_url":{"description":"Public, EXIF-free photo variant.","type":["string","null"]},"photos_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"matches_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Open buyer / tenant leads this listing matches."},"listed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"is_featured":{"type":"boolean"},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"When the owner last confirmed availability (F-13)."},"verification_badge":{"anyOf":[{"$ref":"#/components/schemas/ListingBadge"},{"type":"null"}],"description":"The Verified badge (U-04); null when the listing was never verified."},"views_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shares_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiries_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","ref_code","listing_type","category","property_type","title","status","bhk","bathrooms","carpet_area","builtup_area","super_area","plot_area","area_unit","area_sqft","price","price_per_sqft","price_on_request","rent_amount","deposit_amount","maintenance_amount","maintenance_period","furnishing","facing","possession_status","possession_date","available_from","society_name","sub_locality","city","locality","latitude","longitude","location_precision","cover_url","photos_count","matches_count","listed_by","is_featured","verified_at","verification_badge","views_count","shares_count","enquiries_count","visits_count","created_at","updated_at"],"additionalProperties":false},"PropertyTimelineItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"type":{"type":"string"},"title":{"type":["string","null"]},"body":{"type":["string","null"]},"meta":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"actor":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"occurred_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","type","title","body","meta","actor","occurred_at"],"additionalProperties":false},"PropertyType":{"type":"string","enum":["apartment","independent_house","villa","builder_floor","penthouse","studio","row_house","farm_house","residential_plot","serviced_apartment","pg_coliving","office_space","coworking","shop","showroom","commercial_plot","warehouse","industrial_shed","industrial_land","agricultural_land","hotel_resort","other"]},"PunchInput":{"type":"object","properties":{"kind":{"type":"string","enum":["in","out","break_start","break_end"]},"client_key":{"description":"Offline queue key: the same key again returns the stored punch.","anyOf":[{"type":"string","minLength":8,"maxLength":80},{"type":"null"}]},"captured_at":{"description":"The phone’s wall clock at the capture.","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"sent_at":{"description":"The phone’s wall clock when this request was sent.","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"capture_run":{"description":"Id of the app run that captured it.","anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"capture_mono_ms":{"description":"Monotonic clock at the capture (ms).","anyOf":[{"type":"number","minimum":0,"maximum":10000000000000},{"type":"null"}]},"send_run":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"send_mono_ms":{"anyOf":[{"type":"number","minimum":0,"maximum":10000000000000},{"type":"null"}]},"lat":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"lng":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"accuracy_m":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]},"fix_at":{"description":"When the GPS fix was taken.","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"mock_location":{"description":"The phone reported a mock (fake) location.","type":["boolean","null"]},"selfie_key":{"description":"Key from POST /attendance/selfies after the upload.","anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"reason":{"description":"Why you punch in outside your office or site.","anyOf":[{"type":"string","maxLength":280},{"type":"null"}]},"device_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["kind"]},"PunchResult":{"type":"object","properties":{"punch":{"$ref":"#/components/schemas/AttendancePunch"},"day":{"$ref":"#/components/schemas/AttendanceDay"},"warnings":{"type":"array","items":{"type":"string"}},"replayed":{"type":"boolean"}},"required":["punch","day","warnings","replayed"],"additionalProperties":false},"PushTokenState":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"push_enabled":{"type":"boolean"}},"required":["id","push_enabled"],"additionalProperties":false},"QrCode":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"short_code":{"type":"string"},"short_url":{"type":"string","description":"What the printed code encodes."},"scans":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"People’s scans since the code was made."},"placement":{"$ref":"#/components/schemas/QrPlacement"},"sub_source":{"type":["string","null"]},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"utm_campaign":{"type":["string","null"]},"utm_content":{"type":["string","null"]},"valid_from":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"valid_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"Exclusive."},"is_active":{"type":"boolean"},"state":{"$ref":"#/components/schemas/QrState"},"target":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/QrTargetKind"},"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"label":{"type":"string"},"url":{"description":"Where a scan leads now; null when the target is off or gone.","type":["string","null"]}},"required":["kind","id","label","url"],"additionalProperties":false},"last_scan_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","short_code","short_url","scans","placement","sub_source","source","campaign","project","utm_campaign","utm_content","valid_from","valid_until","is_active","state","target","last_scan_at","created_at","updated_at"],"additionalProperties":false},"QrDailyScans":{"type":"object","properties":{"qr_id":{"$ref":"#/components/schemas/Id"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"$ref":"#/components/schemas/LocalDate"},"scans":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["day","scans"],"additionalProperties":false}}},"required":["qr_id","days"],"additionalProperties":false},"QrPlacement":{"type":"string","enum":["hoarding","newspaper","site_board","brochure","event_stall","cp_flyer","standee","flyer","digital","other"]},"QrState":{"type":"string","enum":["live","scheduled","ended","paused"],"description":"live, scheduled (before valid_from), ended (from valid_until) or paused."},"QrStats":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"codes":{"type":"array","items":{"type":"object","properties":{"scans":{"type":"integer","minimum":0,"maximum":9007199254740991},"unique_devices":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Of those leads, with a site visit done."},"won":{"type":"integer","minimum":0,"maximum":9007199254740991},"rates":{"type":"object","properties":{"scan_to_lead":{"description":"Leads per unique device.","type":["number","null"]},"lead_to_visit":{"type":["number","null"]},"visit_to_won":{"type":["number","null"]}},"required":["scan_to_lead","lead_to_visit","visit_to_won"],"additionalProperties":false},"qr_id":{"$ref":"#/components/schemas/Id"}},"required":["scans","unique_devices","leads","visits","won","rates","qr_id"],"additionalProperties":false}},"totals":{"type":"object","properties":{"scans":{"type":"integer","minimum":0,"maximum":9007199254740991},"unique_devices":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Of those leads, with a site visit done."},"won":{"type":"integer","minimum":0,"maximum":9007199254740991},"rates":{"type":"object","properties":{"scan_to_lead":{"description":"Leads per unique device.","type":["number","null"]},"lead_to_visit":{"type":["number","null"]},"visit_to_won":{"type":["number","null"]}},"required":["scan_to_lead","lead_to_visit","visit_to_won"],"additionalProperties":false}},"required":["scans","unique_devices","leads","visits","won","rates"],"additionalProperties":false}},"required":["from","to","codes","totals"],"additionalProperties":false},"QrTargetInput":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["form","landing_page","property","kiosk"]},"id":{"$ref":"#/components/schemas/Id"}},"required":["kind","id"]},{"type":"object","properties":{"kind":{"type":"string","const":"whatsapp"},"phone":{"description":"A WhatsApp number; empty: the company phone.","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"url"},"url":{"type":"string","minLength":1,"maxLength":2000}},"required":["kind","url"]}]},"QrTargetKind":{"type":"string","enum":["form","landing_page","property","whatsapp","kiosk","url"]},"QueueItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"},"phone":{"type":["string","null"]},"alternate_phones":{"type":"array","items":{"type":"string"}},"dial_number":{"description":"What the phone dials (the member’s own lead).","type":["string","null"]},"alt_dial_number":{"type":["string","null"]},"status":{"type":"string","enum":["new","attempted","callback","interested"],"description":"Dial stage."},"status_key":{"type":"string"},"status_name":{"type":"string"},"sub_status":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false},{"type":"null"}]},"city":{"type":["string","null"]},"source":{"type":["string","null"]},"campaign":{"type":["string","null"]},"call_attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_called_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_call_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_me":{"type":"boolean"}},"required":["id","name","is_me"],"additionalProperties":false},{"type":"null"}]},"next_follow_up_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"plan":{"$ref":"#/components/schemas/DialPick"},"last_note":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["content","created_at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","ref","name","dial_number","alt_dial_number","status","status_key","status_name","sub_status","city","source","campaign","call_attempts","last_called_at","last_call_by","next_follow_up_at","created_at","plan","last_note"],"additionalProperties":false},"QueuedResult":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"],"additionalProperties":false},"QuickReply":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"shortcut":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"shared":{"type":"boolean","description":"Visible to the whole team (no owner)."},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"usage_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"can_edit":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","shortcut","title","body","shared","owner_id","usage_count","can_edit","created_at","updated_at"],"additionalProperties":false},"RateCard":{"type":"object","properties":{"sms_segment_paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"whatsapp_message_paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"email_paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ai_credit_paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_topup_rupees":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_topup_rupees":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sms_segment_paise","whatsapp_message_paise","email_paise","ai_credit_paise","min_topup_rupees","max_topup_rupees"],"additionalProperties":false},"ReactivationAttempt":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"batch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"cohort":{"type":"string","enum":["treatment","holdout","none"]},"status":{"type":"string","enum":["holdout","pending","sent","replied","handed_off","skipped","closed"]},"channel":{"anyOf":[{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]},{"type":"null"}]},"legal_basis":{"type":["string","null"]},"skip_reason":{"type":["string","null"]},"skip_detail":{"type":["string","null"]},"close_reason":{"type":["string","null"]},"handoff_reason":{"type":["string","null"]},"handoff_member":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"ai_status":{"type":["string","null"]},"followups_sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selected_at":{"$ref":"#/components/schemas/DateTime"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"delivered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"replied_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"requalified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"handed_off_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"visit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"deal_won_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"revenue_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"opted_out_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"closed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","batch_id","lead","cohort","status","channel","legal_basis","skip_reason","skip_detail","close_reason","handoff_reason","handoff_member","ai_status","followups_sent","selected_at","sent_at","delivered_at","replied_at","requalified_at","handed_off_at","visit_at","deal_won_at","revenue_paise","opted_out_at","closed_at","updated_at"],"additionalProperties":false},"ReactivationBatch":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"run_on":{"type":"string"},"status":{"type":"string","enum":["pending_approval","approved","rejected"]},"first":{"type":"boolean"},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decision_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","run_on","status","first","counts","decided_by","decided_at","decision_note","created_at"],"additionalProperties":false},"ReactivationConfig":{"type":"object","properties":{"audience":{"type":"object","properties":{"preset":{"type":"string","enum":["lost_cold","inactive","portal_unqualified","new_inventory","smart_list"]},"lead_types":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","enum":["buy","rent","sell","let_out","invest"]}},"dormant_min_days":{"type":"integer","minimum":7,"maximum":1825},"dormant_max_days":{"type":"integer","minimum":14,"maximum":1825},"inactive_days":{"type":"integer","minimum":14,"maximum":1825},"portal_days":{"type":"integer","minimum":7,"maximum":365},"inventory_days":{"type":"integer","minimum":1,"maximum":90},"min_match_score":{"type":"integer","minimum":40,"maximum":100},"smart_list_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"smart_list: a saved lead view (yours or a team view). Its name and filter are stored with the programme when it is saved."},"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]}},"description":"Who: lost or cold for 30–365 days (lost_cold), no activity for N days (inactive), portal leads never qualified after 21 days (portal_unqualified), an old requirement a new listing fits (new_inventory), or the leads of a smart list (smart_list); plus the filter DSL."},"channels":{"type":"object","properties":{"order":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]}},"whatsapp_cloud":{"type":"object","properties":{"template_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"followup_template_id":{"description":"The one follow-up: a different approved template of the channel; none = no follow-up.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"sms":{"type":"object","properties":{"template_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"followup_template_id":{"description":"The one follow-up: a different approved template of the channel; none = no follow-up.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"email":{"type":"object","properties":{"template_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"followup_template_id":{"description":"The one follow-up: a different approved template of the channel; none = no follow-up.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"call_task":{"type":"object","properties":{"priority":{"type":"string","enum":["normal","high"]}}}},"description":"Tried in order: the first channel the law and the person’s consent allow is used."},"message":{"type":"object","properties":{"ai":{"type":"boolean"},"variables":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"hint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["key"]},"description":"Template variables AI writes per lead (only from their own requirement and live listings)."},"instructions":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"The only place an offer may come from."},"vars":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"additionalProperties":{"type":"string","maxLength":300}}}},"schedule":{"type":"object","properties":{"window":{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"daily_cap":{"type":"integer","minimum":1,"maximum":2000},"budget_paise":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"holdout_pct":{"type":"integer","minimum":0,"maximum":50},"attribution_days":{"type":"integer","minimum":7,"maximum":90},"end_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}}},"follow_up":{"type":"object","properties":{"max":{"type":"integer","minimum":0,"maximum":1,"description":"At most one follow-up (0 = none)."},"after_days":{"type":"integer","minimum":1,"maximum":14}}},"handoff":{"type":"object","properties":{"route":{"type":"string","enum":["owner","rules"]},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sla_minutes":{"type":"integer","minimum":15,"maximum":1440},"when":{"type":"string","enum":["requalified","reply"]},"reopen":{"type":"boolean"}}}}},"ReactivationMessagePreview":{"type":"object","properties":{"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"channel":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]},"legal_basis":{"type":["string","null"]},"ai":{"type":"string","enum":["done","fallback","off","none"]},"note":{"type":["string","null"]},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"text":{"type":["string","null"]},"subject":{"type":["string","null"]},"sendable":{"type":"boolean","description":"The messaging pipeline would accept it now (consent, DND, DLT, wallet)."},"blocks":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"detail":{"type":["string","null"]}},"required":["reason","detail"],"additionalProperties":false}}},"required":["lead","channel","legal_basis","ai","note","values","text","subject","sendable","blocks"],"additionalProperties":false},"ReactivationPreview":{"type":"object","properties":{"counts":{"$ref":"#/components/schemas/ReactivationSelectionCounts"},"audience_total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daily_cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holdout_pct":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"days_to_cover":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"windows":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]},"open_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["channel","open_minutes"],"additionalProperties":false}},"samples":{"type":"array","items":{"type":"object","properties":{"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"cohort":{"type":"string","enum":["treatment","holdout"]},"channel":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]},"legal_basis":{"type":"string"},"dormant_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["lead","cohort","channel","legal_basis","dormant_days"],"additionalProperties":false}}},"required":["counts","audience_total","daily_cap","holdout_pct","days_to_cover","windows","samples"],"additionalProperties":false},"ReactivationProgram":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused","stopped"]},"status_reason":{"type":["string","null"]},"preset":{"type":"string","enum":["lost_cold","inactive","portal_unqualified","new_inventory","smart_list"]},"channels":{"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]}},"holdout_pct":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daily_cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approved":{"type":"boolean"},"launched_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_run_on":{"type":["string","null"]},"spent_paise":{"$ref":"#/components/schemas/Paise"},"summary":{"type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"treatment":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holdout":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requalified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handed_off":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","treatment","holdout","pending","contacted","replied","requalified","handed_off","skipped"],"additionalProperties":false},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"can":{"type":"object","properties":{"edit":{"type":"boolean"},"send":{"type":"boolean"},"delete":{"type":"boolean"}},"required":["edit","send","delete"],"additionalProperties":false},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The full configuration with defaults filled in."},"compliance":{"type":"object","properties":{"state":{"type":"string","enum":["missing","stale","fail","pass","overridden"]},"status":{"anyOf":[{"type":"string","enum":["pass","fail"]},{"type":"null"}]},"issues":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["rule","check","ai"]},"category":{"type":"string"},"severity":{"type":"string","enum":["block","warn"]},"quote":{"type":["string","null"]},"message":{"type":"string"},"rule_id":{"type":["string","null"]}},"required":["source","category","severity","quote","message","rule_id"],"additionalProperties":false}},"ai_review":{"anyOf":[{"type":"string","enum":["done","skipped","unavailable"]},{"type":"null"}]},"checked_at":{"type":["string","null"]},"override":{"anyOf":[{"type":"object","properties":{"by":{"type":"string"},"at":{"type":"string"},"reason":{"type":"string"}},"required":["by","at","reason"],"additionalProperties":false},{"type":"null"}]}},"required":["state","status","issues","ai_review","checked_at","override"],"additionalProperties":false},"approved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"approved_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"launched_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"paused_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"stopped_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"ai_credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending_batch":{"anyOf":[{"$ref":"#/components/schemas/ReactivationBatch"},{"type":"null"}]},"batches":{"type":"array","items":{"$ref":"#/components/schemas/ReactivationBatch"}}},"required":["id","name","description","status","status_reason","preset","channels","holdout_pct","daily_cap","approved","launched_at","last_run_on","spent_paise","summary","created_by","created_at","updated_at","can","config","compliance","approved_at","approved_by","launched_by","paused_at","stopped_at","ai_credits","pending_batch","batches"],"additionalProperties":false},"ReactivationProgramListItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused","stopped"]},"status_reason":{"type":["string","null"]},"preset":{"type":"string","enum":["lost_cold","inactive","portal_unqualified","new_inventory","smart_list"]},"channels":{"type":"array","items":{"type":"string","enum":["whatsapp_cloud","sms","email","call_task"]}},"holdout_pct":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daily_cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approved":{"type":"boolean"},"launched_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_run_on":{"type":["string","null"]},"spent_paise":{"$ref":"#/components/schemas/Paise"},"summary":{"type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"treatment":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holdout":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requalified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handed_off":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","treatment","holdout","pending","contacted","replied","requalified","handed_off","skipped"],"additionalProperties":false},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"can":{"type":"object","properties":{"edit":{"type":"boolean"},"send":{"type":"boolean"},"delete":{"type":"boolean"}},"required":["edit","send","delete"],"additionalProperties":false}},"required":["id","name","description","status","status_reason","preset","channels","holdout_pct","daily_cap","approved","launched_at","last_run_on","spent_paise","summary","created_by","created_at","updated_at","can"],"additionalProperties":false},"ReactivationSelectionCounts":{"type":"object","properties":{"scanned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paced_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"treatment":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holdout":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_dormant":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"excluded":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"skipped_by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"channels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"bases":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"capped":{"type":"boolean"},"truncated":{"type":"boolean"}},"required":["scanned","paced_out","treatment","holdout","skipped","not_dormant","excluded","skipped_by","channels","bases","capped","truncated"],"additionalProperties":false},"ReactivationSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"email_basis":{"type":"string","enum":["consent","legitimate_interest"],"description":"consent: an explicit email opt-in · legitimate_interest: also people whose consent ledger records a DPDP legitimate-use basis for email. Every email carries a one-click unsubscribe."},"cooldown_days":{"type":"integer","minimum":30,"maximum":365},"lifetime_cap":{"type":"integer","minimum":1,"maximum":10},"recent_contact_days":{"type":"integer","minimum":7,"maximum":180}},"required":["enabled","email_basis","cooldown_days","lifetime_cap","recent_contact_days"],"additionalProperties":false},"ReactivationStats":{"type":"object","properties":{"treatment":{"type":"object","properties":{"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requalified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handed_off":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revenue_paise":{"$ref":"#/components/schemas/Paise"}},"required":["leads","contacted","delivered","replied","requalified","handed_off","visits","deals","revenue_paise"],"additionalProperties":false},"holdout":{"type":"object","properties":{"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requalified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handed_off":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revenue_paise":{"$ref":"#/components/schemas/Paise"}},"required":["leads","contacted","delivered","replied","requalified","handed_off","visits","deals","revenue_paise"],"additionalProperties":false},"comparable":{"type":"boolean","description":"Both groups have 30+ leads: the lift can be read."},"funnel":{"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"of_selected":{"type":"number"},"of_previous":{"type":"number"}},"required":["step","count","of_selected","of_previous"],"additionalProperties":false}},"lift":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["replied","requalified","visits","deals"]},"treatment_rate":{"type":"number"},"holdout_rate":{"type":"number"},"absolute_lift":{"type":"number"},"relative_lift":{"type":["number","null"]},"incremental":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"p_value":{"type":["number","null"]},"significant":{"type":"boolean"}},"required":["metric","treatment_rate","holdout_rate","absolute_lift","relative_lift","incremental","p_value","significant"],"additionalProperties":false}},"revenue":{"type":"object","properties":{"treatment_per_lead_paise":{"$ref":"#/components/schemas/Paise"},"holdout_per_lead_paise":{"$ref":"#/components/schemas/Paise"},"incremental_paise":{"$ref":"#/components/schemas/Paise"}},"required":["treatment_per_lead_paise","holdout_per_lead_paise","incremental_paise"],"additionalProperties":false},"cost":{"type":"object","properties":{"wallet_paise":{"$ref":"#/components/schemas/Paise"},"ai_paise":{"$ref":"#/components/schemas/Paise"},"total_paise":{"$ref":"#/components/schemas/Paise"},"per_contacted_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"per_requalified_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"per_incremental_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["wallet_paise","ai_paise","total_paise","per_contacted_paise","per_requalified_paise","per_incremental_paise"],"additionalProperties":false},"by_channel":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string"},"contacted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["channel","contacted","replied"],"additionalProperties":false}},"legal_bases":{"type":"array","items":{"type":"object","properties":{"basis":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["basis","count"],"additionalProperties":false}},"skip_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["reason","count"],"additionalProperties":false}},"close_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["reason","count"],"additionalProperties":false}},"ai_credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credit_paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["treatment","holdout","comparable","funnel","lift","revenue","cost","by_channel","legal_bases","skip_reasons","close_reasons","ai_credits","credit_paise"],"additionalProperties":false},"RealtimeEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"notification.created · inbox.message · inbox.read · share.viewed · lead.updated · counter.updated · inventory.updated · ping"},"at":{"$ref":"#/components/schemas/DateTime"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","at"],"additionalProperties":false},"Receipt":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"string","examples":["RCPT/2026-27/0001"]},"financial_year":{"type":"string","examples":["2026-27"]},"deal":{"anyOf":[{"$ref":"#/components/schemas/DealLink"},{"type":"null"}]},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":["string","null"]}},"required":["id","number"],"additionalProperties":false},{"type":"null"}],"description":"The brokerage invoice it settles."},"amount":{"$ref":"#/components/schemas/Paise"},"tds_amount":{"description":"TDS the payer deducted (settles the invoice with the amount).","$ref":"#/components/schemas/Paise"},"gst_amount":{"description":"The GST part of an invoice settlement — not commission.","$ref":"#/components/schemas/Paise"},"excess_amount":{"description":"Paid beyond what its invoice still asks (credited after payment): owed back to the customer.","$ref":"#/components/schemas/Paise"},"purpose":{"type":"string","enum":["commission","token"],"description":"commission, or a token collected for the owner (payment links) — not counted as received."},"mode":{"$ref":"#/components/schemas/PaymentMode"},"reference":{"description":"UTR, cheque / DD number, card approval code or the gateway payment id.","type":["string","null"]},"bank":{"type":["string","null"]},"received_on":{"$ref":"#/components/schemas/LocalDate"},"cleared_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/ReceiptStatus"},"notes":{"type":["string","null"]},"attachment":{"anyOf":[{"$ref":"#/components/schemas/DealDocument"},{"type":"null"}]},"created_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","number","financial_year","deal","invoice","amount","tds_amount","gst_amount","excess_amount","purpose","mode","reference","bank","received_on","cleared_on","status","notes","attachment","created_by","created_at"],"additionalProperties":false},"ReceiptAttachmentInput":{"type":"object","properties":{"key":{"type":"string","minLength":10,"maxLength":300},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["key","filename","content_type","size"],"description":"An upload presigned on the deal’s documents."},"ReceiptStatus":{"type":"string","enum":["received","cleared","bounced","cancelled"]},"Receivable":{"type":"object","properties":{"contact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outstanding":{"$ref":"#/components/schemas/Paise"},"overdue":{"$ref":"#/components/schemas/Paise"},"oldest_due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"ageing":{"type":"object","properties":{"not_due":{"$ref":"#/components/schemas/Paise"},"d1_30":{"$ref":"#/components/schemas/Paise"},"d31_60":{"$ref":"#/components/schemas/Paise"},"d61_90":{"$ref":"#/components/schemas/Paise"},"d90_plus":{"$ref":"#/components/schemas/Paise"}},"required":["not_due","d1_30","d31_60","d61_90","d90_plus"],"additionalProperties":false}},"required":["contact","invoices","outstanding","overdue","oldest_due_on","ageing"],"additionalProperties":false},"RecomputeMatchesInput":{"anyOf":[{"type":"object","properties":{"lead_id":{"$ref":"#/components/schemas/Id"}},"required":["lead_id"]},{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"}},"required":["property_id"]}]},"RecomputeResult":{"type":"object","properties":{"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":["string","null"]}},"required":["matched","removed","skipped"],"additionalProperties":false},"ReconciliationSettings":{"type":"object","properties":{"auto_confirm":{"type":"boolean","description":"Confirm clear matches (same UTR, exact amount, in the window) without a person."},"date_window_days":{"type":"integer","minimum":0,"maximum":10},"amount_tolerance":{"type":"integer","minimum":0,"maximum":100000,"description":"Paise."}},"required":["auto_confirm","date_window_days","amount_tolerance"],"additionalProperties":false},"ReconciliationSettingsInput":{"type":"object","properties":{"auto_confirm":{"type":"boolean","description":"Confirm clear matches (same UTR, exact amount, in the window) without a person."},"date_window_days":{"type":"integer","minimum":0,"maximum":10},"amount_tolerance":{"type":"integer","minimum":0,"maximum":100000,"description":"Paise."}},"required":["auto_confirm","date_window_days","amount_tolerance"]},"RecordDepositEntryInput":{"type":"object","properties":{"kind":{"type":"string","enum":["received","retained","refund"]},"amount":{"$ref":"#/components/schemas/PaiseInput"},"mode":{"type":"string","enum":["upi","neft","rtgs","imps","cheque","dd","cash","escrow","other"]},"reference":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"occurred_on":{"$ref":"#/components/schemas/LocalDate"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"deduction_ids":{"anyOf":[{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"}},{"type":"null"}]}},"required":["kind","amount","mode","occurred_on"]},"RecordPoliceVerificationInput":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/PoliceVerificationStatus"},"ack_no":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"submitted_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"done_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"na_reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"ack":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":10,"maxLength":300},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["key","filename","content_type","size"]},{"type":"null"}]}},"required":["status"]},"RecordReceiptInput":{"type":"object","properties":{"deal_id":{"$ref":"#/components/schemas/Id"},"invoice_id":{"description":"An open invoice of the deal it settles.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"amount":{"$ref":"#/components/schemas/PaiseInput"},"tds_amount":{"description":"TDS the payer deducted (with an invoice).","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"mode":{"$ref":"#/components/schemas/PaymentMode"},"reference":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"bank":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"received_on":{"description":"Default: today in the company time zone.","anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"attachment":{"anyOf":[{"$ref":"#/components/schemas/ReceiptAttachmentInput"},{"type":"null"}]}},"required":["deal_id","amount","mode"]},"RecordRegistrationInput":{"type":"object","properties":{"registration_no":{"type":"string","minLength":4,"maxLength":64},"registered_on":{"$ref":"#/components/schemas/LocalDate"},"office":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["registration_no","registered_on"]},"RecordTenancyInput":{"type":"object","properties":{"moved_in_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notice_given_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notice_by":{"anyOf":[{"type":"string","enum":["tenant","landlord","mutual"]},{"type":"null"}]},"move_out_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"moved_out_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}}},"RecordingSyncConfig":{"type":"object","properties":{"recordings_enabled":{"type":"boolean"},"disclosure_text":{"type":"string","description":"What members tell callers before a recorded call (F-05 text)."},"retention_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How long recordings are kept; null: no policy."}},"required":["recordings_enabled","disclosure_text","retention_days"],"additionalProperties":false},"RecordingSyncReport":{"type":"object","properties":{"device_id":{"$ref":"#/components/schemas/InstallationId"},"opted_in":{"type":"boolean"},"access":{"type":"string","enum":["none","media","all_files"],"description":"none · media: shared audio through MediaStore · all_files: the enterprise build’s file access"},"wifi_only":{"type":"boolean"},"folders":{"type":"integer","minimum":0,"maximum":64},"found":{"type":"integer","minimum":0,"maximum":100000},"pending":{"type":"integer","minimum":0,"maximum":100000},"uploaded":{"type":"integer","minimum":0,"maximum":10000000},"failed":{"type":"integer","minimum":0,"maximum":100000},"last_scan_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_upload_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["device_id","opted_in","access","wifi_only","folders","found","pending","uploaded","failed","last_scan_at","last_upload_at","last_error"]},"RegisterDealDocumentInput":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/DealDocumentKind"},"key":{"type":"string","minLength":10,"maxLength":300},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","key","filename","content_type","size"]},"RegisterDeviceBody":{"type":"object","properties":{"device_id":{"$ref":"#/components/schemas/InstallationId"},"platform":{"description":"The phone’s OS (U-02); an older app sends nothing and stays android.","type":"string","enum":["android","ios"]},"build_flavor":{"$ref":"#/components/schemas/BuildFlavor"},"brand":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"model":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"os_version":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"app_version":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"runtime_version":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"update_id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"capabilities":{"description":"What the native layer supports: call_log, recordings …","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":32},"additionalProperties":{"type":"boolean"}},"sims":{"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/SimSummary"}},"permissions":{"description":"Granted Android permissions (call_log, contacts …).","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":32},"additionalProperties":{"type":"boolean"}},"battery_optimized":{"type":["boolean","null"]},"push_token":{"description":"The current push token (FCM or Expo); omit when push is unavailable.","anyOf":[{"$ref":"#/components/schemas/FcmToken"},{"type":"null"}]},"rotate_device_token":{"description":"The app lost its device token (a 401 in the background): issue a new one.","type":"boolean"},"tracking_notice_ack":{"description":"true: the member has just acknowledged the company’s call-tracking notice (`disclosure_text`) on this phone — audited.","type":"boolean"},"holds_device_token":{"description":"false: the app never received a device token for this sign-in (a lost answer) — a new one is issued; the sign-in itself is unchanged.","type":"boolean"}},"required":["device_id"]},"RegisterInspectionMediaInput":{"type":"object","properties":{"target":{"type":"string","minLength":1,"maxLength":120},"key":{"type":"string","minLength":10,"maxLength":300},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"caption":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"captured_at":{"$ref":"#/components/schemas/DateTime"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"file_modified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"capture_run":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"capture_mono_ms":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"send_run":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"send_mono_ms":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["target","key","content_type","size","captured_at"]},"RegisterVerificationDocumentInput":{"type":"object","properties":{"kind":{"type":"string","enum":["sale_deed","index_ii","property_tax","electricity_bill","society_noc","authority_letter","other"]},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"key":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","filename","content_type","size","key"]},"RegisterVerificationPhotoInput":{"type":"object","properties":{"slot":{"type":"string","minLength":1,"maxLength":32},"key":{"type":"string","minLength":1,"maxLength":300,"description":"The key from the presigned upload."},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"captured_at":{"type":"string","format":"date-time","description":"The phone’s clock when the photo was captured."},"sent_at":{"description":"The phone’s clock when this request was sent.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"file_modified_at":{"description":"The file’s last-modified time (phone clock).","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"capture_run":{"description":"Id of the page / app run that captured the photo.","anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"capture_mono_ms":{"description":"That run’s monotonic clock at capture (ms).","anyOf":[{"type":"number","minimum":0,"maximum":1000000000000},{"type":"null"}]},"send_run":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"send_mono_ms":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000000},{"type":"null"}]},"location":{"description":"The phone’s location fix at capture (null when it shared none).","anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracy_m":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]},"fix_at":{"description":"The location fix’s own timestamp (phone clock).","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["lat","lng","accuracy_m"]},{"type":"null"}]}},"required":["slot","key","content_type","size","captured_at"]},"RegisteredDevice":{"type":"object","properties":{"id":{"description":"The device record (use it in /devices/{id} paths).","$ref":"#/components/schemas/Id"},"device_id":{"$ref":"#/components/schemas/InstallationId"},"device_token":{"description":"The credential for the app’s background work (`Authorization: Bearer pzd_…`). Present only in the answer that issues it — store it at once; it is never shown again.","type":"string"},"device_token_expires_at":{"$ref":"#/components/schemas/DateTime"},"tracking_enabled":{"type":"boolean","description":"Set by an admin per phone; the app obeys it."},"cursor_floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Epoch milliseconds: calls older than this are never uploaded (a first registration reaches back `config.backfill_days`; a phone that changed hands starts now). null: no limit."},"config":{"$ref":"#/components/schemas/MobileConfig"},"disclosure_text":{"type":"string","description":"The company’s call-tracking notice (or the default): the app shows it to each member and has it acknowledged before tracking starts (DPDP)."},"server_time":{"$ref":"#/components/schemas/DateTime"}},"required":["id","device_id","tracking_enabled","cursor_floor","config","disclosure_text","server_time"],"additionalProperties":false},"RentInstalment":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period_label":{"type":"string","description":"Nov 2026, or 12–30 Nov 2026 for a prorated period"},"period_start":{"$ref":"#/components/schemas/LocalDate"},"period_end":{"$ref":"#/components/schemas/LocalDate"},"due_on":{"$ref":"#/components/schemas/LocalDate"},"amount":{"$ref":"#/components/schemas/Paise"},"prorated":{"type":"boolean"},"late_fee":{"description":"Approved late fees (charged).","$ref":"#/components/schemas/Paise"},"paid":{"$ref":"#/components/schemas/Paise"},"outstanding":{"$ref":"#/components/schemas/Paise"},"status":{"type":"string","enum":["scheduled","due","overdue","partially_paid","paid","waived","cancelled"]},"waived_reason":{"type":["string","null"]},"late_fee_proposed":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["id","amount"],"additionalProperties":false},{"type":"null"}],"description":"A late fee waiting for approval (not charged yet)."}},"required":["id","seq","period_label","period_start","period_end","due_on","amount","prorated","late_fee","paid","outstanding","status","waived_reason","late_fee_proposed"],"additionalProperties":false},"RentPayment":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["payment","reversal"]},"status":{"type":"string","enum":["pending","confirmed","rejected"]},"source":{"type":"string","enum":["member","tenant_link","mandate","deposit"]},"method":{"type":"string","enum":["upi","autopay","enach","cash","bank","cheque","deposit"]},"amount":{"$ref":"#/components/schemas/Paise"},"advance":{"description":"Left over after allocation; kept as an advance, not auto-applied.","$ref":"#/components/schemas/Paise"},"utr":{"type":["string","null"]},"received_on":{"$ref":"#/components/schemas/LocalDate"},"receipt_number":{"type":["string","null"]},"notes":{"type":["string","null"]},"rejected_reason":{"type":["string","null"]},"reverses_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reversed":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","status","source","method","amount","advance","utr","received_on","receipt_number","notes","rejected_reason","reverses_id","reversed","created_at","created_by"],"additionalProperties":false},"RentSettings":{"type":"object","properties":{"reminders":{"type":"object","properties":{"enabled":{"type":"boolean"},"before_days":{"maxItems":3,"type":"array","items":{"type":"integer","minimum":1,"maximum":15}},"on_due":{"type":"boolean"},"overdue_days":{"maxItems":6,"type":"array","items":{"type":"integer","minimum":1,"maximum":60}},"quiet_weekdays":{"maxItems":6,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"holidays":{"maxItems":60,"type":"array","items":{"$ref":"#/components/schemas/LocalDate"}}},"required":["enabled","before_days","on_due","overdue_days","quiet_weekdays","holidays"],"additionalProperties":false},"late_fee":{"type":"object","properties":{"kind":{"type":"string","enum":["none","flat_per_day","percent_per_day","flat_once"]},"amount":{"description":"Per day (flat_per_day) or once (flat_once).","$ref":"#/components/schemas/Paise"},"bps":{"type":"integer","minimum":0,"maximum":1000,"description":"Basis points per day of the overdue rent."},"grace_days":{"type":"integer","minimum":0,"maximum":30},"cap":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["kind","amount","bps","grace_days","cap"],"additionalProperties":false},"receipts":{"type":"object","properties":{"show_company":{"type":"boolean"},"footer":{"type":"string","maxLength":300},"send_to_tenant":{"type":"boolean"},"notify_landlord":{"type":"boolean"}},"required":["show_company","footer","send_to_tenant","notify_landlord"],"additionalProperties":false}},"required":["reminders","late_fee","receipts"],"additionalProperties":false},"RentSettingsInput":{"type":"object","properties":{"reminders":{"type":"object","properties":{"enabled":{"type":"boolean"},"before_days":{"maxItems":3,"type":"array","items":{"type":"integer","minimum":1,"maximum":15}},"on_due":{"type":"boolean"},"overdue_days":{"maxItems":6,"type":"array","items":{"type":"integer","minimum":1,"maximum":60}},"quiet_weekdays":{"maxItems":6,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"holidays":{"maxItems":60,"type":"array","items":{"$ref":"#/components/schemas/LocalDate"}}},"required":["enabled","before_days","on_due","overdue_days","quiet_weekdays","holidays"]},"late_fee":{"type":"object","properties":{"kind":{"type":"string","enum":["none","flat_per_day","percent_per_day","flat_once"]},"amount":{"description":"Per day (flat_per_day) or once (flat_once).","$ref":"#/components/schemas/Paise"},"bps":{"type":"integer","minimum":0,"maximum":1000,"description":"Basis points per day of the overdue rent."},"grace_days":{"type":"integer","minimum":0,"maximum":30},"cap":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]}},"required":["kind","amount","bps","grace_days","cap"]},"receipts":{"type":"object","properties":{"show_company":{"type":"boolean"},"footer":{"type":"string","maxLength":300},"send_to_tenant":{"type":"boolean"},"notify_landlord":{"type":"boolean"}},"required":["show_company","footer","send_to_tenant","notify_landlord"]}},"required":["reminders","late_fee","receipts"]},"RentSummary":{"type":"object","properties":{"month":{"type":"string"},"due_this_month":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["amount","count"],"additionalProperties":false},"overdue":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["amount","count"],"additionalProperties":false},"collected":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["amount","count"],"additionalProperties":false},"pending_payments":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["payment","reversal"]},"status":{"type":"string","enum":["pending","confirmed","rejected"]},"source":{"type":"string","enum":["member","tenant_link","mandate","deposit"]},"method":{"type":"string","enum":["upi","autopay","enach","cash","bank","cheque","deposit"]},"amount":{"$ref":"#/components/schemas/Paise"},"advance":{"description":"Left over after allocation; kept as an advance, not auto-applied.","$ref":"#/components/schemas/Paise"},"utr":{"type":["string","null"]},"received_on":{"$ref":"#/components/schemas/LocalDate"},"receipt_number":{"type":["string","null"]},"notes":{"type":["string","null"]},"rejected_reason":{"type":["string","null"]},"reverses_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reversed":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"agreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property":{"type":["string","null"]},"tenant":{"type":"string"},"landlord":{"type":"string"}},"required":["id","property","tenant","landlord"],"additionalProperties":false}},"required":["id","kind","status","source","method","amount","advance","utr","received_on","receipt_number","notes","rejected_reason","reverses_id","reversed","created_at","created_by","agreement"],"additionalProperties":false}},"late_fees":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"amount":{"$ref":"#/components/schemas/Paise"},"as_of":{"$ref":"#/components/schemas/LocalDate"},"instalment_id":{"$ref":"#/components/schemas/Id"},"period_label":{"type":"string"},"agreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property":{"type":["string","null"]},"tenant":{"type":"string"},"landlord":{"type":"string"}},"required":["id","property","tenant","landlord"],"additionalProperties":false}},"required":["id","amount","as_of","instalment_id","period_label","agreement"],"additionalProperties":false}}},"required":["month","due_this_month","overdue","collected","pending_payments","late_fees"],"additionalProperties":false},"RentalAgreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/AgreementStatus"},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"}},"required":["id","ref_code","title"],"additionalProperties":false},{"type":"null"}]},"deal":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"title":{"type":"string"},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]}},"required":["id","ref","title","owner"],"additionalProperties":false},{"type":"null"}]},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}],"description":"The member who manages the let (own / team scopes)."},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"}},"required":["id","ref"],"additionalProperties":false},{"type":"null"}]},"landlord":{"$ref":"#/components/schemas/DealContactRef"},"tenant":{"$ref":"#/components/schemas/DealContactRef"},"start_date":{"$ref":"#/components/schemas/LocalDate"},"end_date":{"$ref":"#/components/schemas/LocalDate"},"rent_amount":{"$ref":"#/components/schemas/Paise"},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"maintenance":{"anyOf":[{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"period":{"anyOf":[{"$ref":"#/components/schemas/MaintenancePeriod"},{"type":"null"}]}},"required":["amount","period"],"additionalProperties":false},{"type":"null"}],"description":"As agreed: copied from the listing when the agreement is recorded, editable after that."},"escalation_pct":{"type":["string","null"]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lock_in_ends_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rent_due_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"police_verification":{"anyOf":[{"$ref":"#/components/schemas/PoliceVerificationStatus"},{"type":"null"}]},"agreement_type":{"anyOf":[{"$ref":"#/components/schemas/AgreementType"},{"type":"null"}]},"has_document":{"type":"boolean"},"document_scan_status":{"anyOf":[{"$ref":"#/components/schemas/FileScanStatus"},{"type":"null"}]},"renewal_reminder_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}],"description":"Date of the next renewal reminder."},"days_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days until the end date (negative once it has passed)."},"renewal_deal":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"stage":{"$ref":"#/components/schemas/DealStage"}},"required":["id","ref","stage"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"renew":{"type":"boolean"}},"required":["edit","delete","renew"],"additionalProperties":false}},"required":["id","status","property","deal","owner","lead","landlord","tenant","start_date","end_date","rent_amount","deposit_amount","maintenance","escalation_pct","lock_in_months","lock_in_ends_on","notice_months","rent_due_day","police_verification","agreement_type","has_document","document_scan_status","renewal_reminder_on","days_left","renewal_deal","created_at","updated_at","capabilities"],"additionalProperties":false},"RentalComparison":{"type":"object","properties":{"agreement_id":{"$ref":"#/components/schemas/Id"},"move_in":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"conducted_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","revision","status","conducted_on"],"additionalProperties":false},{"type":"null"}]},"move_out":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"conducted_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","revision","status","conducted_on"],"additionalProperties":false},{"type":"null"}]},"ready":{"type":"boolean"},"final":{"type":"boolean","description":"The move-out is signed: its proposals can become deductions."},"comparison":{"anyOf":[{"$ref":"#/components/schemas/InspectionComparison"},{"type":"null"}]},"media":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["photo","video"]},"target":{"type":"string"},"preview_url":{"type":["string","null"]},"thumb_url":{"type":["string","null"]},"captured_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","target","preview_url","thumb_url","captured_at"],"additionalProperties":false}},"proposals":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"source":{"type":"string","enum":["damage","missing_item","utilities","cleaning","keys","unpaid_rent","repair","other"]},"label":{"type":"string"},"detail":{"type":["string","null"]},"basis":{"type":["string","null"]},"amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"null: the rate card cannot know it — the agent decides."},"exists":{"type":"boolean","description":"Already a deduction on the deposit."}},"required":["ref","source","label","detail","basis","amount","exists"],"additionalProperties":false}},"rates_set":{"type":"boolean"}},"required":["agreement_id","move_in","move_out","ready","final","comparison","media","proposals","rates_set"],"additionalProperties":false},"RentalCompliancePanel":{"type":"object","properties":{"today":{"$ref":"#/components/schemas/LocalDate"},"agreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"start_date":{"$ref":"#/components/schemas/LocalDate"},"end_date":{"$ref":"#/components/schemas/LocalDate"},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"live":{"type":"boolean"}},"required":["id","status","start_date","end_date","deal_id","live"],"additionalProperties":false},"kyc":{"type":"object","properties":{"configured":{"type":"boolean","description":"PropZolo’s KYC partner is set up."},"partner":{"type":["string","null"]},"allowed":{"type":"object","properties":{"aadhaar":{"type":"boolean"},"pan":{"type":"boolean"},"photo":{"type":"boolean"},"offline_aadhaar":{"type":"boolean"}},"required":["aadhaar","pan","photo","offline_aadhaar"],"additionalProperties":false},"parties":{"type":"array","items":{"$ref":"#/components/schemas/KycPartyView"}},"complete":{"type":"boolean"}},"required":["configured","partner","allowed","parties","complete"],"additionalProperties":false},"police":{"$ref":"#/components/schemas/PoliceVerificationView"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"request_kyc":{"type":"boolean"},"record_police":{"type":"boolean"},"view_photo":{"type":"boolean"}},"required":["edit","request_kyc","record_police","view_photo"],"additionalProperties":false}},"required":["today","agreement","kyc","police","capabilities"],"additionalProperties":false},"RentalComplianceSettings":{"type":"object","properties":{"kyc":{"type":"object","properties":{"aadhaar":{"type":"boolean"},"pan":{"type":"boolean"},"offline_aadhaar":{"type":"boolean"},"photo":{"type":"boolean"},"request_days":{"type":"integer","minimum":1,"maximum":30}},"required":["aadhaar","pan","offline_aadhaar","photo","request_days"]},"police":{"type":"object","properties":{"track_new":{"type":"boolean"},"reminders":{"type":"boolean"}},"required":["track_new","reminders"]}},"required":["kyc","police"]},"RentalComplianceSettingsView":{"type":"object","properties":{"kyc":{"type":"object","properties":{"aadhaar":{"type":"boolean"},"pan":{"type":"boolean"},"offline_aadhaar":{"type":"boolean"},"photo":{"type":"boolean"},"request_days":{"type":"integer","minimum":1,"maximum":30}},"required":["aadhaar","pan","offline_aadhaar","photo","request_days"],"additionalProperties":false},"police":{"type":"object","properties":{"track_new":{"type":"boolean"},"reminders":{"type":"boolean"}},"required":["track_new","reminders"],"additionalProperties":false},"configured":{"type":"boolean","description":"PropZolo’s KYC partner is set up in its console."},"partner":{"type":["string","null"]},"retention_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The KYC photos and partner answers retention policy."}},"required":["kyc","police","configured","partner","retention_days"],"additionalProperties":false},"RentalDepositPanel":{"type":"object","properties":{"today":{"$ref":"#/components/schemas/LocalDate"},"agreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["id","status","deposit_amount","deal_id"],"additionalProperties":false},"deposit":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"null until someone first works with the deposit."},"agreed_amount":{"$ref":"#/components/schemas/Paise"},"holder":{"type":"string","enum":["owner","escrow","brokerage"]},"holder_label":{"type":"string"},"escrow":{"anyOf":[{"type":"object","properties":{"partner":{"type":["string","null"]},"reference":{"type":["string","null"]},"provider":{"type":["string","null"]},"account_open":{"type":"boolean"},"status":{"type":["string","null"]},"synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["partner","reference","provider","account_open","status","synced_at"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string","enum":["awaiting","held","settling","disputed","settled"]},"status_label":{"type":"string"},"figures":{"type":"object","properties":{"received":{"$ref":"#/components/schemas/Paise"},"retained":{"$ref":"#/components/schemas/Paise"},"refunded":{"$ref":"#/components/schemas/Paise"},"decided":{"$ref":"#/components/schemas/Paise"},"pending":{"$ref":"#/components/schemas/Paise"},"refund_due":{"$ref":"#/components/schemas/Paise"},"refundable_now":{"$ref":"#/components/schemas/Paise"},"shortfall":{"$ref":"#/components/schemas/Paise"},"landlord_due":{"$ref":"#/components/schemas/Paise"},"balance_held":{"$ref":"#/components/schemas/Paise"}},"required":["received","retained","refunded","decided","pending","refund_due","refundable_now","shortfall","landlord_due","balance_held"],"additionalProperties":false},"settlement_started":{"type":"boolean"},"refund_due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"days_to_refund":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Negative: overdue by that many days."},"settled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"review":{"type":"object","properties":{"status":{"type":"string"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"blocked_reason":{"type":["string","null"]}},"required":["status","sent_at","expires_at","opened_at","blocked_reason"],"additionalProperties":false}},"required":["id","agreed_amount","holder","holder_label","escrow","status","status_label","figures","settlement_started","refund_due_on","days_to_refund","settled_at","review"],"additionalProperties":false},"entries":{"type":"array","items":{"$ref":"#/components/schemas/DepositEntry"}},"deductions":{"type":"array","items":{"$ref":"#/components/schemas/DepositDeduction"}},"holders":{"type":"object","properties":{"escrow":{"type":"boolean"},"brokerage":{"type":"boolean"}},"required":["escrow","brokerage"],"additionalProperties":false},"escrow_available":{"type":"boolean","description":"An escrow partner is set up (accounts opened through it)."},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"money":{"type":"boolean"},"send_review":{"type":"boolean"}},"required":["edit","money","send_review"],"additionalProperties":false}},"required":["today","agreement","deposit","entries","deductions","holders","escrow_available","capabilities"],"additionalProperties":false},"RentalInspection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"agreement_id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["move_in","move_out"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"correction_of":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","revision"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string","enum":["draft","signing","locked","superseded","cancelled"]},"status_label":{"type":"string"},"template":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["key","version"],"additionalProperties":false},{"type":"null"}]},"scheduled_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"conducted_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"checklist":{"$ref":"#/components/schemas/InspectionChecklist"},"answers":{"$ref":"#/components/schemas/InspectionAnswers"},"draft_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"signing_round":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"media":{"type":"array","items":{"$ref":"#/components/schemas/InspectionMedia"}},"gaps":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"target":{"type":"string"},"text":{"type":"string"}},"required":["code","target","text"],"additionalProperties":false}},"progress":{"$ref":"#/components/schemas/InspectionProgress"},"content_hash":{"description":"SHA-256 of the content both parties sign.","type":["string","null"]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"locked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"superseded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"correction_reason":{"type":["string","null"]},"reopen_reason":{"type":["string","null"]},"cancel_reason":{"type":["string","null"]},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/InspectionSignature"}},"report":{"type":"object","properties":{"status":{"type":"string"},"document_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["status","document_id"],"additionalProperties":false},"comparison":{"type":"object","properties":{"status":{"type":"string"},"document_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["status","document_id","at"],"additionalProperties":false},"agreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false},{"type":"null"}]},"landlord":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"tenant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"start_date":{"$ref":"#/components/schemas/LocalDate"},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["id","property","landlord","tenant","start_date","deal_id"],"additionalProperties":false},"baseline":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conducted_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["id","revision","conducted_on"],"additionalProperties":false},{"type":"null"}],"description":"A move-out: the signed move-in it is compared with."},"rules":{"type":"object","properties":{"photos_per_room":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"meter_photo":{"type":"boolean"},"video_max_mb":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["photos_per_room","meter_photo","video_max_mb"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"can":{"type":"object","properties":{"capture":{"type":"boolean"},"complete":{"type":"boolean"},"reopen":{"type":"boolean"},"cancel":{"type":"boolean"},"revise":{"type":"boolean"},"sign":{"type":"boolean"},"report":{"type":"boolean"}},"required":["capture","complete","reopen","cancel","revise","sign","report"],"additionalProperties":false}},"required":["id","agreement_id","kind","revision","correction_of","status","status_label","template","scheduled_on","conducted_on","checklist","answers","draft_version","signing_round","media","gaps","progress","content_hash","completed_at","locked_at","superseded_at","correction_reason","reopen_reason","cancel_reason","signatures","report","comparison","agreement","baseline","rules","created_at","updated_at","can"],"additionalProperties":false},"RentalInspectionSettings":{"type":"object","properties":{"capture":{"type":"object","properties":{"photos_per_room":{"type":"integer","minimum":0,"maximum":5},"meter_photo":{"type":"boolean"},"video_max_mb":{"type":"integer","minimum":5,"maximum":100}},"required":["photos_per_room","meter_photo","video_max_mb"],"additionalProperties":false},"signing":{"type":"object","properties":{"link_days":{"type":"integer","minimum":1,"maximum":14}},"required":["link_days"],"additionalProperties":false},"reminders":{"type":"object","properties":{"move_in_days":{"type":"integer","minimum":0,"maximum":14},"move_out_days":{"type":"integer","minimum":0,"maximum":14}},"required":["move_in_days","move_out_days"],"additionalProperties":false},"rates":{"type":"object","properties":{"electricity":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"water":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"gas":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"cleaning_per_room":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"key_replacement":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"damage_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"damage_major":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]}},"required":["electricity","water","gas","cleaning_per_room","key_replacement","damage_minor","damage_major"],"additionalProperties":false,"description":"Paise (per unit for meters); null: the agent decides each amount."},"deposit":{"type":"object","properties":{"refund_days":{"type":"integer","minimum":1,"maximum":90},"escrow":{"type":"boolean"},"brokerage":{"type":"boolean"}},"required":["refund_days","escrow","brokerage"],"additionalProperties":false}},"required":["capture","signing","reminders","rates","deposit"],"additionalProperties":false},"RentalInspectionSettingsInput":{"type":"object","properties":{"capture":{"type":"object","properties":{"photos_per_room":{"type":"integer","minimum":0,"maximum":5},"meter_photo":{"type":"boolean"},"video_max_mb":{"type":"integer","minimum":5,"maximum":100}},"required":["photos_per_room","meter_photo","video_max_mb"]},"signing":{"type":"object","properties":{"link_days":{"type":"integer","minimum":1,"maximum":14}},"required":["link_days"]},"reminders":{"type":"object","properties":{"move_in_days":{"type":"integer","minimum":0,"maximum":14},"move_out_days":{"type":"integer","minimum":0,"maximum":14}},"required":["move_in_days","move_out_days"]},"rates":{"type":"object","properties":{"electricity":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"water":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"gas":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"cleaning_per_room":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"key_replacement":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"damage_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"damage_major":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]}},"required":["electricity","water","gas","cleaning_per_room","key_replacement","damage_minor","damage_major"],"description":"Paise (per unit for meters); null: the agent decides each amount."},"deposit":{"type":"object","properties":{"refund_days":{"type":"integer","minimum":1,"maximum":90},"escrow":{"type":"boolean"},"brokerage":{"type":"boolean"}},"required":["refund_days","escrow","brokerage"]}},"required":["capture","signing","reminders","rates","deposit"]},"RentalInspectionSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["move_in","move_out"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"correction":{"type":"boolean"},"status":{"type":"string","enum":["draft","signing","locked","superseded","cancelled"]},"status_label":{"type":"string"},"scheduled_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"conducted_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"progress":{"$ref":"#/components/schemas/InspectionProgress"},"signatures":{"type":"array","items":{"type":"object","properties":{"party":{"type":"string"},"status":{"type":"string"},"signed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["party","status","signed_at"],"additionalProperties":false}},"locked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"report":{"type":"object","properties":{"status":{"type":"string"},"document_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["status","document_id"],"additionalProperties":false},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","revision","correction","status","status_label","scheduled_on","conducted_on","progress","signatures","locked_at","report","created_at"],"additionalProperties":false},"RentalInspectionsPanel":{"type":"object","properties":{"today":{"$ref":"#/components/schemas/LocalDate"},"agreement":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"start_date":{"$ref":"#/components/schemas/LocalDate"},"end_date":{"$ref":"#/components/schemas/LocalDate"},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["id","status","start_date","end_date","deal_id"],"additionalProperties":false},"tenancy":{"type":"object","properties":{"moved_in_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notice_given_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notice_by":{"anyOf":[{"type":"string","enum":["tenant","landlord","mutual"]},{"type":"null"}]},"move_out_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}],"description":"The planned move-out (from the notice)."},"moved_out_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"expected_move_in":{"description":"The accepted offer’s move-in date, else the start.","$ref":"#/components/schemas/LocalDate"}},"required":["moved_in_on","notice_given_on","notice_by","move_out_on","moved_out_on","expected_move_in"],"additionalProperties":false},"inspections":{"type":"object","properties":{"move_in":{"type":"array","items":{"$ref":"#/components/schemas/RentalInspectionSummary"}},"move_out":{"type":"array","items":{"$ref":"#/components/schemas/RentalInspectionSummary"}}},"required":["move_in","move_out"],"additionalProperties":false},"comparison":{"type":"object","properties":{"ready":{"type":"boolean"},"final":{"type":"boolean"}},"required":["ready","final"],"additionalProperties":false},"templates":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"property_kind":{"type":"string"}},"required":["key","title","property_kind"],"additionalProperties":false}},"suggested_template":{"type":"string"},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"}},"required":["edit"],"additionalProperties":false}},"required":["today","agreement","tenancy","inspections","comparison","templates","suggested_template","capabilities"],"additionalProperties":false},"RentalOffer":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"side":{"$ref":"#/components/schemas/RentalOfferSide"},"status":{"$ref":"#/components/schemas/RentalOfferStatus"},"monthly_rent":{"$ref":"#/components/schemas/Paise"},"maintenance_included":{"type":"boolean"},"maintenance_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"A month, on top of the rent."},"deposit_months":{"type":["string","null"]},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"escalation_pct":{"type":["string","null"]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"agreement_months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"move_in_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"inclusions":{"type":"array","items":{"type":"string"}},"special_conditions":{"type":["string","null"]},"tenant_profile":{"type":["string","null"]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"breaches":{"type":"array","items":{"type":"string","enum":["rent","deposit","lock_in"]},"description":"Where the terms missed the owner’s floor when made (no amounts: the floor is private)."},"owner_approval":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"via":{"type":"string","enum":["link","proposed","recorded"]}},"required":["at","via"],"additionalProperties":false},{"type":"null"}],"description":"The owner proposed (a counter), approved by link, or a member recorded the consent."},"counter_of_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_via":{"type":"string","enum":["member","owner_link","api"]},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"decided_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decided_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decision_note":{"type":["string","null"]},"changes":{"type":"array","items":{"$ref":"#/components/schemas/RentalOfferChange"},"description":"Against the version before it (empty for the first)."}},"required":["id","version","side","status","monthly_rent","maintenance_included","maintenance_amount","deposit_months","deposit_amount","escalation_pct","lock_in_months","notice_months","agreement_months","move_in_date","inclusions","special_conditions","tenant_profile","expires_at","breaches","owner_approval","counter_of_id","created_via","created_by","created_at","decided_at","decided_by","decision_note","changes"],"additionalProperties":false},"RentalOfferChange":{"type":"object","properties":{"field":{"type":"string"},"label":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}},"required":["field","label","from","to"],"additionalProperties":false},"RentalOfferComparisonRow":{"type":"object","properties":{"key":{"type":"string","enum":["rent","deposit","lock_in","notice","agreement","maintenance"]},"label":{"type":"string"},"asked":{"type":["string","null"]},"offered":{"type":"string"},"floor":{"description":"Null when there is none or the reader may not see it.","type":["string","null"]},"short_of_floor":{"type":"boolean"},"vs_asked":{"type":["string","null"]}},"required":["key","label","asked","offered","floor","short_of_floor","vs_asked"],"additionalProperties":false},"RentalOfferPanel":{"type":"object","properties":{"deal":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"stage":{"type":"string"},"type":{"type":"string"}},"required":["id","ref","stage","type"],"additionalProperties":false},"live":{"anyOf":[{"$ref":"#/components/schemas/RentalOffer"},{"type":"null"}]},"accepted":{"anyOf":[{"$ref":"#/components/schemas/RentalOffer"},{"type":"null"}]},"offers":{"type":"array","items":{"$ref":"#/components/schemas/RentalOffer"}},"listing":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"rent_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"deposit_months":{"type":["string","null"]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"agreement_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"maintenance_included":{"type":["boolean","null"]},"maintenance_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"rent_floor":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},{"type":"string"}]},"rent_floor_source":{"anyOf":[{"type":"string","enum":["rent_floor","expected_price"]},{"type":"null"}]},"deposit_floor":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},{"type":"string"}]},"lock_in_max_months":{"anyOf":[{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},{"type":"string"}]}},"required":["id","ref_code","title","rent_amount","deposit_amount","deposit_months","lock_in_months","notice_months","agreement_months","maintenance_included","maintenance_amount","rent_floor_source"],"additionalProperties":false},{"type":"null"}]},"comparison":{"type":"array","items":{"$ref":"#/components/schemas/RentalOfferComparisonRow"}},"approval":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["owner","chain","owner_and_chain"]},"owner_needed":{"type":"boolean"},"chain_needed":{"type":"boolean"},"chain":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false},{"type":"null"}]},"link":{"anyOf":[{"$ref":"#/components/schemas/RentalOwnerLink"},{"type":"null"}]}},"required":["mode","owner_needed","chain_needed","chain","link"],"additionalProperties":false},{"type":"null"}],"description":"Who must still approve the live offer (below the floor) and how far it got."},"owner_links":{"type":"array","items":{"$ref":"#/components/schemas/RentalOwnerLink"}},"landlord":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"handoff":{"anyOf":[{"type":"object","properties":{"agreement_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"start_date":{"$ref":"#/components/schemas/LocalDate"},"end_date":{"$ref":"#/components/schemas/LocalDate"},"renewal_reminders":{"type":"array","items":{"$ref":"#/components/schemas/LocalDate"}}},"required":["agreement_id","start_date","end_date","renewal_reminders"],"additionalProperties":false},{"type":"null"}],"description":"The draft agreement the accepted offer opened and its renewal reminders (T-60/45/30)."},"defaults":{"type":"object","properties":{"agreement_months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"notice_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"offer_validity_hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agreement_months","notice_months","offer_validity_hours"],"additionalProperties":false},"capabilities":{"type":"object","properties":{"edit":{"type":"boolean"},"record_owner_consent":{"type":"boolean"}},"required":["edit","record_owner_consent"],"additionalProperties":false}},"required":["deal","live","accepted","offers","listing","comparison","approval","owner_links","landlord","handoff","defaults","capabilities"],"additionalProperties":false},"RentalOfferSide":{"type":"string","enum":["tenant","landlord"],"description":"Who proposes the terms: the tenant, or the owner (landlord)."},"RentalOfferStatus":{"type":"string","enum":["open","accepted","rejected","countered","withdrawn","expired","superseded"]},"RentalOwnerLink":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"offer_id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["pending","sent","opened","used","revoked","expired","blocked"]},"channel":{"type":["string","null"]},"blocked_reason":{"type":["string","null"]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"When the message carrying it was delivered."},"opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"used_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"decision":{"anyOf":[{"type":"string","enum":["accept","reject","counter"]},{"type":"null"}]},"decision_note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","offer_id","status","channel","blocked_reason","expires_at","sent_at","opened_at","used_at","decision","decision_note","created_at"],"additionalProperties":false,"description":"The owner’s decision link (never its token)."},"RentalPipelineSettings":{"type":"object","properties":{"offer_validity_hours":{"type":"integer","minimum":0,"maximum":720},"owner_link_hours":{"type":"integer","minimum":1,"maximum":168},"floor_approval":{"type":"string","enum":["owner","chain","owner_and_chain"]},"auto_send_to_owner":{"type":"boolean"},"draft_agreement_on_accept":{"type":"boolean"},"default_agreement_months":{"type":"integer","minimum":1,"maximum":120},"default_notice_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":12},{"type":"null"}]},"renewal_notice_landlord":{"default":true,"type":"boolean"},"renewal_notice_tenant":{"default":true,"type":"boolean"}},"required":["offer_validity_hours","owner_link_hours","floor_approval","auto_send_to_owner","draft_agreement_on_accept","default_agreement_months","default_notice_months","renewal_notice_landlord","renewal_notice_tenant"],"additionalProperties":false},"RentalPipelineSettingsInput":{"type":"object","properties":{"offer_validity_hours":{"type":"integer","minimum":0,"maximum":720},"owner_link_hours":{"type":"integer","minimum":1,"maximum":168},"floor_approval":{"type":"string","enum":["owner","chain","owner_and_chain"]},"auto_send_to_owner":{"type":"boolean"},"draft_agreement_on_accept":{"type":"boolean"},"default_agreement_months":{"type":"integer","minimum":1,"maximum":120},"default_notice_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":12},{"type":"null"}]},"renewal_notice_landlord":{"default":true,"type":"boolean"},"renewal_notice_tenant":{"default":true,"type":"boolean"}},"required":["offer_validity_hours","owner_link_hours","floor_approval","auto_send_to_owner","draft_agreement_on_accept","default_agreement_months","default_notice_months"]},"ReorderCustomFieldsInput":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/CustomFieldEntity"},"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["entity","ids"]},"ReorderInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"},"description":"Every id once, in the new order."}},"required":["ids"]},"ReorderMediaInput":{"type":"object","properties":{"property_id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["ids"]},"ReplySupportTicketInput":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000},"attachments":{"default":[],"maxItems":5,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":300},"filename":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf"]}},"required":["key","filename","content_type"]}}},"required":["body"]},"ReportCatalogue":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["leads","deals","visits","calls","tasks","messages","campaigns"]},"label":{"type":"string"},"noun":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2},"description":{"type":"string"},"default_date":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ReportCatalogueField"}},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"ratios":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"money":{"type":"boolean"}},"required":["key","label","money"],"additionalProperties":false}}},"required":["key","label","noun","description","default_date","fields","outcomes","ratios"],"additionalProperties":false}},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"description":"Teams the caller may share with."},"can":{"type":"object","properties":{"build":{"type":"boolean","description":"The plan includes the report builder (advanced reports)."},"share_company":{"type":"boolean"},"schedule":{"type":"boolean","description":"`reports.schedule` and a plan with scheduled reports."},"export":{"type":"boolean"},"settings":{"type":"boolean","description":"May switch outside recipients on or off (settings.company)."},"external_recipients":{"type":"boolean","description":"The company allows outside recipients."}},"required":["build","share_company","schedule","export","settings","external_recipients"],"additionalProperties":false}},"required":["entities","teams","can"],"additionalProperties":false,"description":"What the caller may report on: entities, fields, outcomes, ratios."},"ReportCatalogueField":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","bigint","boolean","date","enum","array"]},"section":{"type":["string","null"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"value":{"type":["string","number"]},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},{"type":"null"}]},"of":{"anyOf":[{"type":"string","enum":["string","number","enum"]},{"type":"null"}]},"nullable":{"type":"boolean"},"groupable":{"type":"boolean"},"measurable":{"type":"boolean"},"rangeable":{"type":"boolean"},"money":{"type":"boolean"},"unit":{"anyOf":[{"type":"string","enum":["minutes","seconds","days"]},{"type":"null"}]},"day":{"type":"boolean"}},"required":["key","label","type","section","options","of","nullable","groupable","measurable","rangeable","money","unit","day"],"additionalProperties":false},"ReportCell":{"type":"object","properties":{"value":{"type":["number","string","null"]},"display":{"type":"string"}},"required":["value","display"],"additionalProperties":false},"ReportDelivery":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"slot":{"type":"string"},"channel":{"type":"string"},"recipient":{"type":"object","properties":{"type":{"type":"string","enum":["member","external"]},"name":{"type":"string"}},"required":["type","name"],"additionalProperties":false},"status":{"type":"string"},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"rows":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"period_label":{"type":["string","null"]},"error":{"type":["string","null"]},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","slot","channel","recipient","status","attempts","rows","period_label","error","sent_at","created_at"],"additionalProperties":false},"ReportDeliverySettings":{"type":"object","properties":{"external_recipients":{"type":"boolean"}},"required":["external_recipients"],"additionalProperties":false},"ReportDeliverySettingsInput":{"type":"object","properties":{"external_recipients":{"type":"boolean"}},"required":["external_recipients"]},"ReportDrillPage":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"},"subtitle":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"},"owner":{"type":["string","null"]},"link":{"type":["string","null"]}},"required":["id","title","subtitle","at","owner","link"],"additionalProperties":false}},"next":{"type":["string","null"]}},"required":["rows","next"],"additionalProperties":false},"ReportPeriod":{"type":"object","properties":{"preset":{"anyOf":[{"type":"string","enum":["today","yesterday","tomorrow","this_week","last_week","next_week","this_month","last_month","next_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","last_12_months","next_7_days"]},{"type":"null"}]},"from":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["preset","from","to"],"additionalProperties":false,"description":"A preset period or calendar days (inclusive), company time zone."},"ReportPeriodInput":{"type":"object","properties":{"preset":{"anyOf":[{"type":"string","enum":["today","yesterday","tomorrow","this_week","last_week","next_week","this_month","last_month","next_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","last_12_months","next_7_days"]},{"type":"null"}]},"from":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["preset","from","to"],"description":"A preset period or calendar days (inclusive), company time zone."},"ReportRange":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"from_day":{"$ref":"#/components/schemas/LocalDate"},"to_day":{"description":"Last day of the range, inclusive.","$ref":"#/components/schemas/LocalDate"},"days":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from","to","from_day","to_day","days"],"additionalProperties":false},"ReportResult":{"type":"object","properties":{"mode":{"type":"string","enum":["kpi","group","series","pivot"]},"entity":{"type":"string","enum":["leads","deals","visits","calls","tasks","messages","campaigns"]},"title":{"type":"string"},"group":{"anyOf":[{"type":"object","properties":{"field":{"type":"string"},"label":{"type":"string"}},"required":["field","label"],"additionalProperties":false},{"type":"null"}]},"split":{"anyOf":[{"type":"object","properties":{"field":{"type":"string"},"label":{"type":"string"}},"required":["field","label"],"additionalProperties":false},{"type":"null"}]},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["text","count","number","money","percent","date","minutes","days"]}},"required":["key","label","kind"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"cells":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/ReportCell"}},"split":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/ReportCell"}}},{"type":"null"}]}},"required":["key","label","cells","split"],"additionalProperties":false}},"series":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/ReportCell"}}},"required":["key","label","totals"],"additionalProperties":false}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/ReportCell"}},"groups":{"type":"integer","minimum":0,"maximum":9007199254740991},"truncated":{"type":"boolean"},"range":{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"from_day":{"$ref":"#/components/schemas/LocalDate"},"to_day":{"$ref":"#/components/schemas/LocalDate"}},"required":["label","from_day","to_day"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":"array","items":{"type":"string"}}},"required":["mode","entity","title","group","split","columns","rows","series","totals","groups","truncated","range","notes"],"additionalProperties":false,"description":"Totals over everything that matched, the groups (top N) and notes."},"ReportSchedule":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"report_id":{"$ref":"#/components/schemas/Id"},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"time":{"type":"string"},"weekday":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"month_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"period":{"type":"string","enum":["report","yesterday","last_7_days","last_week","last_month","last_30_days"]},"channels":{"type":"array","items":{"type":"string","enum":["email","whatsapp"]}},"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"external_emails":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"unsubscribed":{"type":"boolean"}},"required":["email","unsubscribed"],"additionalProperties":false}},"status":{"type":"string","enum":["active","paused"]},"description":{"type":"string"},"next_run_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_run_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_status":{"type":["string","null"]},"failure_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"editable":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","report_id","frequency","time","weekday","month_day","period","channels","members","external_emails","status","description","next_run_at","last_run_at","last_status","failure_count","created_by","editable","created_at"],"additionalProperties":false},"ReportSpec":{"type":"object","properties":{"v":{"type":"number","const":1},"entity":{"type":"string","enum":["leads","deals","visits","calls","tasks","messages","campaigns"]},"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"range":{"anyOf":[{"$ref":"#/components/schemas/AggregateDateRange"},{"type":"null"}]},"measures":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"fn":{"type":"string","enum":["count","sum","avg","min","max","count_if","rate","ratio"]},"field":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]}},"required":["fn","field"],"additionalProperties":false}},"group_by":{"anyOf":[{"$ref":"#/components/schemas/AggregateGroupBy"},{"type":"null"}]},"split_by":{"anyOf":[{"$ref":"#/components/schemas/AggregateGroupBy"},{"type":"null"}],"description":"A second dimension: one series per value (pivot)."},"sort":{"anyOf":[{"type":"object","properties":{"by":{"type":"string","enum":["value","key"]},"dir":{"type":"string","enum":["asc","desc"]}},"required":["by","dir"],"additionalProperties":false},{"type":"null"}]},"limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":50},{"type":"null"}]},"visual":{"type":"string","enum":["table","bar","line","kpi"]}},"required":["v","entity","filter","range","measures","group_by","split_by","sort","limit","visual"],"additionalProperties":false,"description":"A report: entity, filter (shared DSL), range, up to 4 measures (count, sum/avg/min/max of a field, count_if / rate of an outcome, a catalogue ratio), a group-by and an optional split, sort, top-N and the chart."},"RequestExportInput":{"type":"object","properties":{"filter":{"$ref":"#/components/schemas/FilterNode"},"view":{"$ref":"#/components/schemas/LeadView"},"q":{"type":"string","minLength":1,"maxLength":100},"columns":{"maxItems":29,"type":"array","items":{"type":"string","enum":["ref","name","phone","other_phones","email","city","lead_type","pipeline","status","sub_status","temperature","source","sub_source","campaign","owner","presales","budget_min","budget_max","bhk","property_types","location","tags","enquiry_count","call_attempts","received_at","last_enquiry_at","last_contacted_at","next_follow_up_at","created_at"]}},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}}},"RequestKycInput":{"type":"object","properties":{"party":{"$ref":"#/components/schemas/KycParty"},"person":{"description":"A co-tenant: found by phone, or added as a contact.","anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"phone":{"type":"string","minLength":6,"maxLength":24},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email"},{"type":"null"}]}},"required":["name","phone"]},{"type":"null"}]},"checks":{"anyOf":[{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/KycCheck"}},{"type":"null"}]}},"required":["party"]},"Requirement":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_types":{"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"bhk":{"type":"array","items":{"type":"number"}},"budget_min":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"budget_max":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"area_min_sqft":{"type":["number","null"]},"area_max_sqft":{"type":["number","null"]},"area_unit_display":{"anyOf":[{"$ref":"#/components/schemas/AreaUnit"},{"type":"null"}]},"locality_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"location_text":{"type":["string","null"]},"possession":{"type":["string","null"]},"transaction_types":{"type":"array","items":{"$ref":"#/components/schemas/TransactionType"}},"furnishing":{"type":"array","items":{"$ref":"#/components/schemas/Furnishing"}},"facing":{"type":"array","items":{"$ref":"#/components/schemas/Facing"}},"floor_preference":{"type":["string","null"]},"min_bathrooms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"parking_required":{"type":["boolean","null"]},"amenity_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"vastu_required":{"type":["boolean","null"]},"purpose":{"type":["string","null"]},"loan_required":{"type":["boolean","null"]},"loan_status":{"type":["string","null"]},"buy_within":{"type":["string","null"]},"move_in_by":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"lease_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tenant_profile":{"type":["string","null"]},"family_size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"has_pets":{"type":["boolean","null"]},"notes":{"type":["string","null"]}},"required":["category","property_types","bhk","budget_min","budget_max","area_min_sqft","area_max_sqft","area_unit_display","locality_ids","location_text","possession","transaction_types","furnishing","facing","floor_preference","min_bathrooms","parking_required","amenity_ids","vastu_required","purpose","loan_required","loan_status","buy_within","move_in_by","lease_months","tenant_profile","family_size","has_pets","notes"],"additionalProperties":false},"RequirementInput":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_types":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"bhk":{"maxItems":20,"type":"array","items":{"type":"number"},"description":"0.5 = 1 RK; steps of 0.5 up to 20."},"budget_min":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"budget_max":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"area_min_sqft":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"area_max_sqft":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"area_unit_display":{"anyOf":[{"$ref":"#/components/schemas/AreaUnit"},{"type":"null"}]},"locality_ids":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"location_text":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"possession":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"transaction_types":{"maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/TransactionType"}},"furnishing":{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/Furnishing"}},"facing":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/Facing"}},"floor_preference":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"min_bathrooms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"parking_required":{"type":["boolean","null"]},"amenity_ids":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"vastu_required":{"type":["boolean","null"]},"purpose":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"loan_required":{"type":["boolean","null"]},"loan_status":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"buy_within":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"move_in_by":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"lease_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tenant_profile":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"family_size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"has_pets":{"type":["boolean","null"]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}}},"RequirementInputOutput":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_types":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"bhk":{"maxItems":20,"type":"array","items":{"type":"number"},"description":"0.5 = 1 RK; steps of 0.5 up to 20."},"budget_min":{"anyOf":[{"$ref":"#/components/schemas/PaiseInputOutput"},{"type":"null"}]},"budget_max":{"anyOf":[{"$ref":"#/components/schemas/PaiseInputOutput"},{"type":"null"}]},"area_min_sqft":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"area_max_sqft":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"area_unit_display":{"anyOf":[{"$ref":"#/components/schemas/AreaUnit"},{"type":"null"}]},"locality_ids":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"location_text":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"possession":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"transaction_types":{"maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/TransactionType"}},"furnishing":{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/Furnishing"}},"facing":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/Facing"}},"floor_preference":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"min_bathrooms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"parking_required":{"type":["boolean","null"]},"amenity_ids":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"vastu_required":{"type":["boolean","null"]},"purpose":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"loan_required":{"type":["boolean","null"]},"loan_status":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"buy_within":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"move_in_by":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"lease_months":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tenant_profile":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"family_size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"has_pets":{"type":["boolean","null"]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"additionalProperties":false},"RequirementLevel":{"type":"string","enum":["required","optional","hidden"]},"RequirementProposal":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"current":{"type":["string","null"]},"proposed":{"type":"string"},"confidence":{"type":"number","minimum":0,"maximum":1},"status":{"type":"string","enum":["stated","inferred"]},"evidence":{"type":["string","null"]},"conflict":{"type":"boolean"},"suggested":{"type":"boolean"},"patch":{"type":"object","properties":{"lead_type":{"$ref":"#/components/schemas/LeadType"},"requirement":{"$ref":"#/components/schemas/RequirementInputOutput"}},"additionalProperties":false}},"required":["key","label","current","proposed","confidence","status","evidence","conflict","suggested","patch"],"additionalProperties":false,"description":"One field the AI read from the notes, compared with the lead."},"ReraNumber":{"type":"object","properties":{"state":{"type":"string","pattern":"^[A-Z]{2}$"},"number":{"type":"string","minLength":3,"maxLength":80},"phase":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valid_till":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["state","number"]},"ReraRegistration":{"type":"object","properties":{"state":{"type":"string"},"number":{"type":"string"},"phase":{"type":["string","null"]},"valid_till":{"type":["string","null"]}},"required":["state","number","phase","valid_till"],"additionalProperties":false},"RescheduleSiteVisitInput":{"type":"object","properties":{"scheduled_at":{"type":"string","minLength":10,"maxLength":40},"reason":{"type":"string","minLength":2,"maxLength":300},"duration_min":{"type":"integer","minimum":15,"maximum":480}},"required":["scheduled_at","reason"]},"ResolveDeductionInput":{"type":"object","properties":{"final_amount":{"$ref":"#/components/schemas/PaiseInput"},"note":{"type":"string","minLength":3,"maxLength":1000}},"required":["final_amount","note"]},"RetentionKind":{"type":"string","enum":["invalid_leads","lost_leads","message_bodies","call_recordings","ingest_payloads","synced_emails","field_locations","attendance_selfies","inventory_messages","debrief_audio","kyc_artifacts","maintenance_media","maintenance_tickets","rent_utr_claims","mcp_call_logs","loan_documents","site_chat","ad_audience_members","workflow_run_logs","assistant_drafts"]},"RetentionPolicy":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/RetentionKind"},"label":{"type":"string"},"description":{"type":"string"},"unit":{"type":"string","enum":["days","months"]},"min_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"keep_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"last_run_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_run":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"updated_by":{"type":["string","null"]},"updated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["kind","label","description","unit","min_days","max_days","keep_days","enabled","last_run_at","last_run","updated_by","updated_at"],"additionalProperties":false},"RetentionPreview":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/RetentionKind"},"keep_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cutoff":{"$ref":"#/components/schemas/DateTime"},"due":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","keep_days","cutoff","due","held"],"additionalProperties":false},"RevealedPhones":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"phones":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"e164":{"type":"string"},"national10":{"type":"string"},"label":{"type":["string","null"]},"is_primary":{"type":"boolean"},"is_whatsapp":{"type":["boolean","null"]}},"required":["id","e164","national10","label","is_primary","is_whatsapp"],"additionalProperties":false}},"email":{"type":["string","null"]},"alternate_email":{"type":["string","null"]},"remaining_today":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Reveals left today; null when no quota applies."}},"required":["contact_id","phones","email","alternate_email","remaining_today"],"additionalProperties":false},"ReverseDepositEntryInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]},"ReviewVerificationDocumentInput":{"type":"object","properties":{"status":{"type":"string","enum":["approved","rejected"]},"name_match":{"anyOf":[{"type":"string","enum":["match","partial","mismatch"]},{"type":"null"}]},"address_match":{"anyOf":[{"type":"string","enum":["match","partial","mismatch"]},{"type":"null"}]},"document_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["status"]},"RevokedDevice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"device_id":{"$ref":"#/components/schemas/InstallationId"},"revoked_at":{"$ref":"#/components/schemas/DateTime"},"sessions_revoked":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","device_id","revoked_at","sessions_revoked"],"additionalProperties":false},"RightsKind":{"type":"string","enum":["access","correction","erasure","nomination","grievance","consent_withdrawal"]},"RightsRequest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string","description":"R-12"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string"},"status":{"type":"string"},"requester_name":{"type":"string"},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"received_at":{"$ref":"#/components/schemas/DateTime"},"due_at":{"description":"End of the 90th day after receipt, company time zone.","$ref":"#/components/schemas/DateTime"},"sla":{"$ref":"#/components/schemas/RightsSlaState"},"days_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"action_status":{"type":["string","null"]},"channel":{"type":"string"},"verified_via":{"type":["string","null"]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"language":{"type":["string","null"]},"details":{"type":["string","null"]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"erased":{"type":"boolean"},"held":{"type":"boolean"}},"required":["id","name","erased","held"],"additionalProperties":false}},"report_ready_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"has_report":{"type":"boolean"},"outcome":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"resolution":{"type":["string","null"]},"timeline":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"kind":{"type":"string","enum":["received","note","status","assigned","contacts","step"]},"by":{"type":["string","null"]},"by_name":{"type":["string","null"]},"text":{"type":"string"}},"required":["at","kind","by","by_name","text"],"additionalProperties":false}},"closed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"closed_by":{"type":["string","null"]}},"required":["id","ref","number","kind","status","requester_name","phone","email","received_at","due_at","sla","days_left","assignee","contact_count","action_status","channel","verified_via","verified_at","language","details","payload","contacts","report_ready_at","has_report","outcome","resolution","timeline","closed_at","closed_by"],"additionalProperties":false},"RightsRequestListItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string","description":"R-12"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string"},"status":{"type":"string"},"requester_name":{"type":"string"},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"received_at":{"$ref":"#/components/schemas/DateTime"},"due_at":{"description":"End of the 90th day after receipt, company time zone.","$ref":"#/components/schemas/DateTime"},"sla":{"$ref":"#/components/schemas/RightsSlaState"},"days_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"action_status":{"type":["string","null"]}},"required":["id","ref","number","kind","status","requester_name","phone","email","received_at","due_at","sla","days_left","assignee","contact_count","action_status"],"additionalProperties":false},"RightsSlaState":{"type":"string","enum":["on_track","due_soon","overdue","closed"]},"RightsStatus":{"type":"string","enum":["open","in_progress","completed","rejected"]},"Role":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"is_system":{"type":"boolean"},"is_owner":{"type":"boolean"},"requires_two_factor":{"type":"boolean"},"audience":{"type":"string","enum":["staff","partner"]},"members":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Active members with this role."},"members_total":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending_invitations":{"type":"integer","minimum":0,"maximum":9007199254740991},"can_edit":{"type":"boolean","description":"The caller may change this role’s permissions."},"can_delete":{"type":"boolean"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","key","name","description","is_system","is_owner","requires_two_factor","audience","members","members_total","pending_invitations","can_edit","can_delete","updated_at"],"additionalProperties":false},"RoleDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"is_system":{"type":"boolean"},"is_owner":{"type":"boolean"},"requires_two_factor":{"type":"boolean"},"audience":{"type":"string","enum":["staff","partner"]},"members":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Active members with this role."},"members_total":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending_invitations":{"type":"integer","minimum":0,"maximum":9007199254740991},"can_edit":{"type":"boolean","description":"The caller may change this role’s permissions."},"can_delete":{"type":"boolean"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"permissions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/PermissionValue"}},"description":"Resource → action → value, plus `fields` → field rule → mode (registry in docs/04 §4.2)."}},"required":["id","key","name","description","is_system","is_owner","requires_two_factor","audience","members","members_total","pending_invitations","can_edit","can_delete","updated_at","permissions"],"additionalProperties":false},"RoleDiff":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/PermissionChange"}},"violations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false},"description":"Widened permissions you do not hold yourself — saving is refused."},"members_affected":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["changes","violations","members_affected"],"additionalProperties":false},"RollbackImportInput":{"type":"object","properties":{"keep_blocked":{"type":"boolean"}}},"RoomTag":{"type":"string","enum":["living","kitchen","bedroom","bathroom","balcony","dining","exterior","view","amenity","other"]},"RoutingMember":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"role":{"type":"string"},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"active":{"type":"boolean"},"shift":{"anyOf":[{"$ref":"#/components/schemas/MemberShift"},{"type":"null"}]},"lead_capacity":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"languages":{"type":"array","items":{"type":"string"}},"service_locality_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"specializations":{"type":"array","items":{"type":"string"}},"today":{"type":"integer","minimum":0,"maximum":9007199254740991},"open_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"untouched":{"type":"integer","minimum":0,"maximum":9007199254740991},"app_seen_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"on_leave":{"type":"boolean"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["id","name","role","branch_id","active","shift","lead_capacity","languages","service_locality_ids","specializations","today","open_leads","untouched","app_seen_at","on_leave","rules"],"additionalProperties":false},"RoutingSettings":{"type":"object","properties":{"phone_stale_minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"An owner whose phone has not synced for this long gets twice the rotation time."},"require_check_in":{"type":"boolean","description":"Only members punched in today receive automatic leads."},"rotation_warning_minutes":{"type":"integer","minimum":0,"maximum":240,"description":"Warn the owner this many shift minutes before a lead rotates (0 = off)."}},"required":["phone_stale_minutes","require_check_in","rotation_warning_minutes"],"additionalProperties":false},"SaveImportMappingInput":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/ImportEntity"},"template":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"mapping":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"options":{"$ref":"#/components/schemas/ImportOptions"}},"required":["mapping"]},"SaveInspectionAnswersInput":{"type":"object","properties":{"ops":{"minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/InspectionOp"}}},"required":["ops"]},"SaveInspectionAnswersResult":{"type":"object","properties":{"inspection":{"$ref":"#/components/schemas/RentalInspection"},"applied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string"}},"required":["index","reason"],"additionalProperties":false}}},"required":["inspection","applied","skipped"],"additionalProperties":false},"SaveInspectionTemplateInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"property_kind":{"type":"string","enum":["1rk","1bhk","2bhk","3bhk","4bhk","villa","commercial"]},"body":{"$ref":"#/components/schemas/InspectionTemplateBodyInput"}},"required":["title","property_kind","body"]},"SaveInspectionTemplateInputInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"property_kind":{"type":"string","enum":["1rk","1bhk","2bhk","3bhk","4bhk","villa","commercial"]},"body":{"$ref":"#/components/schemas/InspectionTemplateBodyInput"}},"required":["title","property_kind","body"]},"SavedReport":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"kind":{"type":"string","enum":["query","report"]},"definition":{"anyOf":[{"$ref":"#/components/schemas/AskPlan"},{"type":"null"}]},"chart":{"type":"string","enum":["auto","table","bar","line"]},"question":{"type":["string","null"]},"visibility":{"type":"string","enum":["private","team"]},"is_pinned":{"type":"boolean"},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"mine":{"type":"boolean"},"editable":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","kind","definition","chart","question","visibility","is_pinned","author","mine","editable","created_at","updated_at"],"additionalProperties":false},"SavedView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"entity":{"type":"string"},"name":{"type":"string"},"visibility":{"$ref":"#/components/schemas/SavedViewVisibility"},"filters":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"columns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Visible column ids in order; null = defaults."},"sort":{"description":"List sort, e.g. -received_at.","type":["string","null"]},"layout":{"$ref":"#/components/schemas/SavedViewLayout"},"is_pinned":{"type":"boolean"},"author":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"mine":{"type":"boolean","description":"The caller wrote it."},"editable":{"type":"boolean","description":"The caller may change, re-share or delete it."},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","entity","name","visibility","filters","columns","sort","layout","is_pinned","author","mine","editable","created_at","updated_at"],"additionalProperties":false},"SavedViewEntity":{"type":"string","enum":["leads","contacts"]},"SavedViewLayout":{"type":"string","enum":["table","kanban","map","calendar"]},"SavedViewVisibility":{"type":"string","enum":["private","team"]},"ScheduleVisitResult":{"type":"object","properties":{"visit":{"$ref":"#/components/schemas/SiteVisit"},"conflicts":{"type":"array","items":{"$ref":"#/components/schemas/SiteVisitConflict"}}},"required":["visit","conflicts"],"additionalProperties":false},"ScoreModelDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","retired","rejected","rolled_back"]},"trigger":{"type":"string","enum":["schedule","manual"]},"trained_at":{"$ref":"#/components/schemas/DateTime"},"activated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"retired_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"auc":{"type":["number","null"]},"rules_auc":{"type":["number","null"]},"decision":{"type":"string"},"train_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"train_positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valid_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valid_positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trees":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"base_rate":{"type":"number"},"data_from":{"$ref":"#/components/schemas/DateTime"},"data_to":{"$ref":"#/components/schemas/DateTime"},"valid_from":{"$ref":"#/components/schemas/DateTime"},"metrics":{"type":"object","properties":{"brier":{"type":["number","null"]},"brier_skill":{"type":["number","null"]},"log_loss":{"type":["number","null"]},"ece":{"type":["number","null"]},"reliability":{"type":"array","items":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"},"predicted":{"type":"number"},"observed":{"type":"number"},"rows":{"type":"number"}},"required":["from","to","predicted","observed","rows"],"additionalProperties":false}},"lift":{"type":"array","items":{"type":"object","properties":{"decile":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate":{"type":"number"},"lift":{"type":"number"},"captured":{"type":"number"}},"required":["decile","rows","positives","rate","lift","captured"],"additionalProperties":false}},"importance":{"type":"array","items":{"type":"object","properties":{"feature":{"type":"string"},"label":{"type":"string"},"share":{"type":"number"}},"required":["feature","label","share"],"additionalProperties":false}}},"required":["brier","brier_skill","log_loss","ece","reliability","lift","importance"],"additionalProperties":false},"gates":{"type":"object","properties":{"passed":{"type":"boolean"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/PredictiveGateCheck"}}},"required":["passed","checks"],"additionalProperties":false},"timings":{"type":"object","properties":{"rows":{"type":"number"},"trees":{"type":"number"},"load_ms":{"type":"number"},"train_ms":{"type":"number"},"total_ms":{"type":"number"},"budget_hit":{"type":"boolean"}},"required":["rows","trees","load_ms","train_ms","total_ms","budget_hit"],"additionalProperties":false}},"required":["id","version","status","trigger","trained_at","activated_at","retired_at","auc","rules_auc","decision","train_rows","train_positives","valid_rows","valid_positives","trees","base_rate","data_from","data_to","valid_from","metrics","gates","timings"],"additionalProperties":false},"ScoreModelSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","retired","rejected","rolled_back"]},"trigger":{"type":"string","enum":["schedule","manual"]},"trained_at":{"$ref":"#/components/schemas/DateTime"},"activated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"retired_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"auc":{"type":["number","null"]},"rules_auc":{"type":["number","null"]},"decision":{"type":"string"},"train_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"train_positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valid_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valid_positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trees":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"base_rate":{"type":"number"},"data_from":{"$ref":"#/components/schemas/DateTime"},"data_to":{"$ref":"#/components/schemas/DateTime"},"valid_from":{"$ref":"#/components/schemas/DateTime"}},"required":["id","version","status","trigger","trained_at","activated_at","retired_at","auc","rules_auc","decision","train_rows","train_positives","valid_rows","valid_positives","trees","base_rate","data_from","data_to","valid_from"],"additionalProperties":false},"ScorecardRow":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"branch":{"type":["string","null"]},"active":{"type":"boolean"},"calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"connected":{"type":"integer","minimum":0,"maximum":9007199254740991},"connect_rate":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"talk_sec":{"type":"integer","minimum":0,"maximum":9007199254740991},"follow_ups_due":{"type":"integer","minimum":0,"maximum":9007199254740991},"follow_ups_on_time":{"type":"integer","minimum":0,"maximum":9007199254740991},"follow_ups_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"follow_ups_missed":{"type":"integer","minimum":0,"maximum":9007199254740991},"on_time_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"visits_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_received":{"type":"integer","minimum":0,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals_won":{"type":"integer","minimum":0,"maximum":9007199254740991},"won_value_paise":{"$ref":"#/components/schemas/Paise"},"median_response_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"ranks":{"type":"object","properties":{"calls":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"connected":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"talk_sec":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"on_time_pct":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"visits_done":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"conversions":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"response":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["calls","connected","talk_sec","on_time_pct","visits_done","conversions","response"],"additionalProperties":false},"avg_rank":{"type":["number","null"]},"rank":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["member_id","name","branch","active","calls","connected","connect_rate","talk_sec","follow_ups_due","follow_ups_on_time","follow_ups_late","follow_ups_missed","on_time_pct","visits_done","leads_received","conversions","deals_won","won_value_paise","median_response_minutes","ranks","avg_rank","rank"],"additionalProperties":false},"SearchHit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["lead","contact"],"description":"More kinds (property, project …) join later."},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"href":{"type":"string","description":"Workspace path, e.g. /leads/{id}."}},"required":["id","kind","title","subtitle","href"],"additionalProperties":false},"SeatUsage":{"type":"object","properties":{"used":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Active staff members (partner-portal users are free)."},"pending_invitations":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Seats on the subscription; null = no limit."},"available":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"plan":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"],"additionalProperties":false},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionStatus"},{"type":"null"}]}},"required":["used","pending_invitations","limit","available","plan","status"],"additionalProperties":false},"SecurityPolicy":{"type":"object","properties":{"two_factor":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"key":{"type":"string"},"name":{"type":"string"},"audience":{"type":"string","enum":["staff","partner"]},"requires_two_factor":{"type":"boolean"},"locked":{"type":"boolean","description":"Owner and Admin always require 2FA."},"members":{"type":"integer","minimum":0,"maximum":9007199254740991},"members_without_two_factor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","key","name","audience","requires_two_factor","locked","members","members_without_two_factor"],"additionalProperties":false}}},"required":["roles"],"additionalProperties":false},"sessions":{"type":"object","properties":{"web_idle_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"web_absolute_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mobile_idle_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["web_idle_days","web_absolute_days","mobile_idle_days"],"additionalProperties":false},"ip_allowlist":{"type":"object","properties":{"available":{"type":"boolean"},"task":{"type":"string","description":"Roadmap task that enforces it at sign-in."}},"required":["available","task"],"additionalProperties":false}},"required":["two_factor","sessions","ip_allowlist"],"additionalProperties":false},"SendChannel":{"type":"string","enum":["whatsapp_cloud","whatsapp_web","sms","email"],"description":"whatsapp_cloud = official WhatsApp; whatsapp_web = an agent’s linked number."},"SendForSignatureInput":{"type":"object","properties":{"signing_order":{"default":"sequential","type":"string","enum":["sequential","parallel"]},"sign_type":{"default":"aadhaar","type":"string","enum":["aadhaar","electronic"]},"witnesses":{"default":[],"maxItems":2,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":160},"phone":{"type":"string","minLength":6,"maxLength":20}},"required":["name","phone"]}},"estamp_denomination":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}],"description":"Paise; at least the estimated duty. Null: no e-stamp through PropZolo."},"expires_in_days":{"default":10,"type":"integer","minimum":3,"maximum":30}},"required":["estamp_denomination"]},"SendMessageInput":{"type":"object","properties":{"contact_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"$ref":"#/components/schemas/Id"},"channel":{"default":"auto","type":"string","enum":["whatsapp_cloud","whatsapp_web","sms","email","auto"]},"purpose":{"$ref":"#/components/schemas/MessagePurpose"},"template_id":{"$ref":"#/components/schemas/Id"},"template_use_case":{"description":"e.g. visit_reminder_24h","type":"string","minLength":1,"maxLength":32},"language":{"type":"string","maxLength":8},"body":{"type":"string","maxLength":4096},"media":{"$ref":"#/components/schemas/SendMessageMedia"},"interactive":{"description":"Reply buttons (≤ 3, title ≤ 20) or a list (≤ 10 rows, title ≤ 24, description ≤ 72) under `body` — WhatsApp Cloud only, inside the 24-hour window; no template or media.","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"buttons"},"header":{"type":"string","minLength":1,"maxLength":60},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":256},"title":{"type":"string","minLength":1,"maxLength":20}},"required":["title"]}}},"required":["type","buttons"]},{"type":"object","properties":{"type":{"type":"string","const":"list"},"header":{"type":"string","minLength":1,"maxLength":60},"footer":{"type":"string","minLength":1,"maxLength":60},"button":{"type":"string","minLength":1,"maxLength":20},"sections":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":24},"rows":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":24},"description":{"type":"string","minLength":1,"maxLength":72}},"required":["title"]}}},"required":["title","rows"]}}},"required":["type","button","sections"]}]},"subject":{"type":"string","maxLength":250},"vars":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"additionalProperties":{"type":"string","maxLength":1000}},"property_id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"visit_id":{"$ref":"#/components/schemas/Id"},"channel_account_id":{"$ref":"#/components/schemas/Id"},"conversation_id":{"description":"The conversation being answered: a WhatsApp reply goes to its number and account.","$ref":"#/components/schemas/Id"},"reply_to_message_id":{"$ref":"#/components/schemas/Id"},"when_quiet":{"default":"block","type":"string","enum":["block","defer"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":200,"description":"Unique per logical send (a UUID): the same key never sends twice."}},"required":["purpose","idempotency_key"]},"SendMessageMedia":{"type":"object","properties":{"storage_key":{"description":"From POST /api/v1/conversations/uploads.","type":"string","minLength":1,"maxLength":500},"url":{"type":"string","maxLength":2000,"format":"uri"},"mime":{"type":"string","minLength":3,"maxLength":100,"example":"image/jpeg"},"filename":{"type":"string","maxLength":240},"size":{"description":"Bytes (checked against WhatsApp’s limit).","type":"integer","minimum":0,"maximum":209715200}},"required":["mime"],"description":"One photo, video, voice note or document; the body becomes its caption (not for voice notes)."},"SendMessageResult":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"queued"},"message_id":{"$ref":"#/components/schemas/Id"},"conversation_id":{"$ref":"#/components/schemas/Id"},"channel":{"$ref":"#/components/schemas/SendChannel"},"purpose":{"$ref":"#/components/schemas/MessagePurpose"},"duplicate":{"type":"boolean"},"not_before":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Estimated cost in paise."},"warnings":{"type":"array","items":{"type":"string"}},"preview":{"$ref":"#/components/schemas/MessagePreview"}},"required":["status","message_id","conversation_id","channel","purpose","duplicate","not_before","cost","warnings","preview"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"blocked"},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/MessageGateBlock"}},"channel":{"anyOf":[{"$ref":"#/components/schemas/SendChannel"},{"type":"null"}]},"purpose":{"$ref":"#/components/schemas/MessagePurpose"},"message_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"The cancelled message recording the block, if any."},"duplicate":{"type":"boolean"},"tried":{"type":"array","items":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/SendChannel"},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/MessageGateBlock"}}},"required":["channel","blocks"],"additionalProperties":false}}},"required":["status","blocks","channel","purpose","message_id","duplicate","tried"],"additionalProperties":false}]},"SendRentalOfferToOwnerInput":{"type":"object","properties":{"channel":{"anyOf":[{"type":"string","enum":["auto","whatsapp_cloud","sms","email"]},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}}},"SendRentalOfferToOwnerResult":{"type":"object","properties":{"status":{"type":"string","enum":["queued","blocked","approval_requested"]},"link_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"channel":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["status","link_id","channel","reason"],"additionalProperties":false},"SendVisitOtpResult":{"type":"object","properties":{"visit":{"$ref":"#/components/schemas/SiteVisit"},"channel":{"type":"string","description":"whatsapp_cloud · sms · email · agent (no channel reached the client)"},"shown_code":{"description":"Only when the company shows the code to the agent.","type":["string","null"]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"resend_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["visit","channel","shown_code","expires_at","resend_in_sec"],"additionalProperties":false},"Sequence":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/SequenceStep"}},"entry":{"anyOf":[{"type":"object","properties":{"event":{"type":"string"},"filter":{"anyOf":[{},{"type":"null"}]}},"required":["event"],"additionalProperties":false},{"type":"null"}]},"settings":{"type":"object","properties":{"pause_on":{"type":"object","properties":{"reply":{"type":"boolean"},"call":{"type":"boolean"},"visit":{"type":"boolean"}},"required":["reply","call","visit"],"additionalProperties":false}},"required":["pause_on"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"activated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"archived_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"counts":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exited":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","paused","completed","exited","removed","total"],"additionalProperties":false},"can_edit":{"type":"boolean"},"can_activate":{"type":"boolean"},"can_delete":{"type":"boolean"},"can_enroll":{"type":"boolean"}},"required":["id","name","description","status","steps","entry","settings","version","created_by","activated_at","archived_at","created_at","updated_at","counts","can_edit","can_activate","can_delete","can_enroll"],"additionalProperties":false},"SequenceAnalytics":{"type":"object","properties":{"totals":{"type":"object","properties":{"enrolled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exited":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visit_booked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enrolled","active","paused","completed","exited","removed","replied","visit_booked","won"],"additionalProperties":false},"exits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"pauses":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"steps":{"type":"array","items":{"type":"object","properties":{"step_id":{"type":"string"},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string"},"label":{"type":["string","null"]},"reached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skip_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["reason","count"],"additionalProperties":false}}},"required":["step_id","index","kind","label","reached","sent","delivered","read","replied","skipped","failed","done","waiting","paused","skip_reasons"],"additionalProperties":false}}},"required":["totals","exits","pauses","steps"],"additionalProperties":false},"SequenceEnrollInput":{"type":"object","properties":{"lead_ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"filter":{"$ref":"#/components/schemas/FilterNode"},"view":{"$ref":"#/components/schemas/LeadView"},"q":{"type":"string","minLength":1,"maxLength":100},"all":{"description":"Every lead in your edit scope (with no filter).","type":"boolean"}}},"SequenceEnrollResult":{"type":"object","properties":{"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"array","items":{"type":"object","properties":{"lead_id":{"type":"string"},"reason":{"type":"string"}},"required":["lead_id","reason"],"additionalProperties":false}},"enrollment_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["matched","enrolled","skipped","enrollment_ids"],"additionalProperties":false},"SequenceEnrollment":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"sequence":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},"status":{"type":"string","enum":["active","paused","completed","exited","removed"]},"source":{"type":"string"},"step_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"step_number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"next_step":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"label":{"type":["string","null"]},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","kind","label","due_at"],"additionalProperties":false},{"type":"null"}]},"last_step":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"reason":{"type":["string","null"]},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","status","reason","at"],"additionalProperties":false},{"type":"null"}]},"pause_reason":{"description":"reply · call · visit · manual","type":["string","null"]},"paused_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"exit_reason":{"description":"won · lost · closed · deleted · merged · removed · archived","type":["string","null"]},"enrolled_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"enrolled_at":{"$ref":"#/components/schemas/DateTime"},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"replied_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"visit_booked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"can_change":{"type":"boolean"}},"required":["id","sequence","lead","status","source","step_count","step_number","next_step","last_step","pause_reason","paused_at","exit_reason","enrolled_by","enrolled_at","finished_at","replied_at","visit_booked_at","can_change"],"additionalProperties":false},"SequenceEntryRule":{"type":"object","properties":{"event":{"type":"string","enum":["lead.created","lead.status_changed","lead.reenquired"]},"filter":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]}},"required":["event"],"description":"Enrols leads on a lead event when they match the filter."},"SequenceStep":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"kind":{"type":"string","enum":["whatsapp","sms","email","call_task","task"]},"label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"delay":{"type":"object","properties":{"amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["minutes","hours","days","business_hours","business_days"]},"at":{"description":"Day delays: the local time the step goes out.","anyOf":[{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]}},"required":["amount","unit"],"additionalProperties":false},"window":{"description":"Daily send window on the company clock; a due time outside it waits for the next opening.","anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"days":{"anyOf":[{"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},{"type":"null"}]}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"template_id":{"description":"Message steps: an approved template of the channel.","$ref":"#/components/schemas/Id"},"purpose":{"type":"string","enum":["promotional","service"]},"title":{"description":"Task steps; `{name}` becomes the contact’s first name.","anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"task_type":{"type":"string","enum":["follow_up","whatsapp","meeting","email","document","other"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"assignee":{"type":"string","enum":["owner","presales"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]}},"required":["id","kind","delay"],"additionalProperties":false},"SequenceStepInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,32}$"},"kind":{"type":"string","enum":["whatsapp","sms","email","call_task","task"]},"label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"delay":{"type":"object","properties":{"amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["minutes","hours","days","business_hours","business_days"]},"at":{"description":"Day delays: the local time the step goes out.","anyOf":[{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]}},"required":["amount","unit"]},"window":{"description":"Daily send window on the company clock; a due time outside it waits for the next opening.","anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"days":{"anyOf":[{"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},{"type":"null"}]}},"required":["start","end"]},{"type":"null"}]},"template_id":{"description":"Message steps: an approved template of the channel.","$ref":"#/components/schemas/Id"},"purpose":{"type":"string","enum":["promotional","service"]},"title":{"description":"Task steps; `{name}` becomes the contact’s first name.","anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"task_type":{"type":"string","enum":["follow_up","whatsapp","meeting","email","document","other"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"assignee":{"type":"string","enum":["owner","presales"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]}},"required":["id","kind","delay"]},"SetCallTargetsInput":{"type":"object","properties":{"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}],"description":"null: the company default."},"daily_calls":{"type":"integer","minimum":1,"maximum":1000},"daily_talk_min":{"type":"integer","minimum":1,"maximum":1000}},"required":["member_id","daily_calls","daily_talk_min"]},"SetPushTokenBody":{"type":"object","properties":{"token":{"anyOf":[{"$ref":"#/components/schemas/FcmToken"},{"type":"null"}]}},"required":["token"]},"Share":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"url":{"type":"string"},"title":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string","enum":["active","expired","revoked"]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},{"type":"null"}]},"property_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"shared_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"view_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"view_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"first_viewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_viewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"reactions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/ShareReaction"}},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","url","title","channel","status","lead","property_ids","project_id","shared_by","view_count","view_seconds","first_viewed_at","last_viewed_at","reactions","expires_at","revoked_at","created_at"],"additionalProperties":false},"ShareChannel":{"type":"string","enum":["copy","wa_link","whatsapp_cloud","whatsapp_web","sms","email"],"description":"copy (link copied) · wa_link (wa.me draft on the agent’s phone) · the others are recorded for the messaging pipeline."},"ShareReaction":{"type":"string","enum":["liked","not_for_me"]},"ShareRecipient":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"},"lead_type":{"$ref":"#/components/schemas/LeadType"}},"required":["id","ref","name","lead_type"],"additionalProperties":false},"ShareView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"device":{"type":["string","null"]},"city":{"type":["string","null"]},"viewed_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","property_id","seconds","device","city","viewed_at"],"additionalProperties":false},"SignInspectionInput":{"type":"object","properties":{"typed_name":{"type":"string","minLength":2,"maxLength":160},"signature":{"description":"A drawn signature as data:image/png;base64,… (optional).","anyOf":[{"type":"string","maxLength":300000},{"type":"null"}]},"code":{"type":"string","minLength":4,"maxLength":12}},"required":["typed_name","code"]},"SignInspectionResult":{"type":"object","properties":{"signed":{"type":"boolean"},"locked":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["invalid","expired","locked","no_code"]},{"type":"null"}]},"attempts_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inspection":{"$ref":"#/components/schemas/RentalInspection"}},"required":["signed","locked","reason","attempts_left","inspection"],"additionalProperties":false},"SignedOutDevice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"tokens_revoked":{"type":"integer","minimum":0,"maximum":9007199254740991},"push_cleared":{"type":"boolean"}},"required":["id","tokens_revoked","push_cleared"],"additionalProperties":false},"SimSummary":{"type":"object","properties":{"slot":{"anyOf":[{"type":"integer","minimum":0,"maximum":8},{"type":"null"}]},"subscription_id":{"anyOf":[{"anyOf":[{"type":"string","maxLength":24},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}]},{"type":"null"}]},"carrier":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"display_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"number":{"description":"The SIM’s own number, if the phone reports it. Only the last four digits are stored.","anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"is_work":{"type":"boolean"}}},"SiteChatSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"greeting":{"type":"string","maxLength":200},"daily_credit_cap":{"default":200,"type":"integer","minimum":0,"maximum":100000},"daily_session_cap":{"default":300,"type":"integer","minimum":0,"maximum":100000}},"required":["enabled","greeting","daily_credit_cap","daily_session_cap"],"additionalProperties":false},"SiteChatSettingsInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"greeting":{"type":"string","maxLength":200},"daily_credit_cap":{"default":200,"type":"integer","minimum":0,"maximum":100000},"daily_session_cap":{"default":300,"type":"integer","minimum":0,"maximum":100000}},"required":["enabled","greeting"]},"SiteDomain":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"hostname":{"type":"string"},"status":{"type":"string","enum":["pending","active","failed","moved"]},"ssl_status":{"type":["string","null"]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"checked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string"},"host":{"type":"string","description":"What DNS screens call \"Host\" / \"Name\" (relative to the domain)."},"value":{"type":"string"}},"required":["type","name","host","value"],"additionalProperties":false}},"home_page":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"title":{"type":"string"},"slug":{"type":"string"},"published":{"type":"boolean"}},"required":["id","title","slug","published"],"additionalProperties":false},{"type":"null"}]},"last_error":{"type":["string","null"]},"url":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","hostname","status","ssl_status","verified_at","checked_at","records","home_page","last_error","url","created_at"],"additionalProperties":false},"SiteSettings":{"type":"object","properties":{"tracking":{"type":"object","properties":{"meta_pixel_id":{"anyOf":[{"type":"string","pattern":"^\\d{10,20}$"},{"type":"null"}]},"ga4_id":{"anyOf":[{"type":"string","pattern":"^G-[A-Z0-9]{4,16}$"},{"type":"null"}]},"gtm_id":{"anyOf":[{"type":"string","pattern":"^GTM-[A-Z0-9]{4,12}$"},{"type":"null"}]},"google_ads_id":{"anyOf":[{"type":"string","pattern":"^AW-\\d{6,14}$"},{"type":"null"}]},"google_ads_label":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{4,64}$"},{"type":"null"}]}},"required":["meta_pixel_id","ga4_id","gtm_id","google_ads_id","google_ads_label"],"additionalProperties":false},"forms_tracking":{"type":"boolean"},"consent":{"type":"object","properties":{"banner_text":{"type":["string","null"]},"privacy_url":{"type":["string","null"]}},"required":["banner_text","privacy_url"],"additionalProperties":false},"microsites":{"type":"object","properties":{"form_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"theme":{"anyOf":[{"$ref":"#/components/schemas/LandingTheme"},{"type":"null"}]}},"required":["form_id","theme"],"additionalProperties":false}},"required":["tracking","forms_tracking","consent","microsites"],"additionalProperties":false},"SiteVisit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"$ref":"#/components/schemas/SiteVisitStatus"},"phase":{"type":"string","enum":["upcoming","in_progress","done","no_show","cancelled"],"description":"upcoming · in_progress (checked in) · done · no_show · cancelled"},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"},"contact_id":{"$ref":"#/components/schemas/Id"}},"required":["id","ref","name","contact_id"],"additionalProperties":false},"agent":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"presales":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"ends_at":{"$ref":"#/components/schemas/DateTime"},"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visit_number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"meeting_point":{"type":["string","null"]},"pickup":{"type":"object","properties":{"required":{"type":"boolean"},"address":{"type":["string","null"]},"at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["required","address","at"],"additionalProperties":false},"partner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"items":{"type":"array","items":{"$ref":"#/components/schemas/SiteVisitItem"}},"confirmed":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"via":{"type":"string","enum":["link","agent"]}},"required":["at","via"],"additionalProperties":false},{"type":"null"}]},"otp":{"type":"object","properties":{"required":{"type":"boolean"},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"method":{"anyOf":[{"type":"string","enum":["otp","override"]},{"type":"null"}]},"channel":{"type":["string","null"]},"sent_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"attempts_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"locked":{"type":"boolean"},"resend_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["required","verified_at","method","channel","sent_at","expires_at","attempts_left","locked","resend_in_sec"],"additionalProperties":false},"check_in":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"accuracy_m":{"type":["number","null"]},"distance_m":{"type":["number","null"]},"far":{"type":"boolean"},"mock":{"type":"boolean"},"has_photo":{"type":"boolean"}},"required":["at","lat","lng","accuracy_m","distance_m","far","mock","has_photo"],"additionalProperties":false},{"type":"null"}]},"check_out":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"distance_m":{"type":["number","null"]},"mock":{"type":"boolean"}},"required":["at","lat","lng","distance_m","mock"],"additionalProperties":false},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"actual_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rating":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"notes":{"type":["string","null"]},"next_step":{"type":["string","null"]},"objections":{"type":"array","items":{"type":"string"}},"revisit_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"feedback_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cancelled_reason":{"type":["string","null"]},"no_show_reason":{"type":["string","null"]},"reschedules":{"type":"array","items":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"reason":{"type":["string","null"]},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["from","to","reason","at"],"additionalProperties":false}},"requests":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"at":{"$ref":"#/components/schemas/DateTime"},"preferred_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"note":{"type":["string","null"]},"status":{"type":"string","enum":["open","rescheduled","dismissed"]}},"required":["id","at","preferred_at","note","status"],"additionalProperties":false},"description":"What the client asked for on the confirmation page; open until the visit is rescheduled, or it closes."},"confirm_url":{"description":"The client’s confirm / reschedule link (for members who may change the visit).","type":["string","null"]},"can_edit":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","phase","lead","agent","presales","created_by_id","project","scheduled_at","ends_at","duration_min","visit_number","meeting_point","pickup","partner_id","items","confirmed","otp","check_in","check_out","completed_at","actual_minutes","rating","notes","next_step","objections","revisit_at","feedback_at","cancelled_reason","no_show_reason","reschedules","requests","confirm_url","can_edit","created_at","updated_at"],"additionalProperties":false},"SiteVisitAnalytics":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"}},"required":["from","to"],"additionalProperties":false},"group_by":{"type":"string","enum":["agent","source","project"]},"totals":{"type":"object","properties":{"scheduled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upcoming":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_show":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"checked_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"feedback":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["scheduled","upcoming","completed","no_show","cancelled","verified","checked_in","feedback","revisits","deals"],"additionalProperties":false},"rates":{"type":"object","properties":{"completion_pct":{"type":["number","null"]},"no_show_pct":{"type":["number","null"]},"verified_pct":{"type":["number","null"]},"deal_pct":{"type":["number","null"]},"feedback_pct":{"type":["number","null"]}},"required":["completion_pct","no_show_pct","verified_pct","deal_pct","feedback_pct"],"additionalProperties":false},"funnel":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["scheduled","completed","deal"]},"label":{"type":"string"},"count":{"type":"number"}},"required":["key","label","count"],"additionalProperties":false}},"breakdown":{"type":"array","items":{"type":"object","properties":{"key":{"type":["string","null"]},"label":{"type":"string"},"scheduled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upcoming":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_show":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"checked_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"feedback":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rates":{"type":"object","properties":{"completion_pct":{"type":["number","null"]},"no_show_pct":{"type":["number","null"]},"verified_pct":{"type":["number","null"]},"deal_pct":{"type":["number","null"]},"feedback_pct":{"type":["number","null"]}},"required":["completion_pct","no_show_pct","verified_pct","deal_pct","feedback_pct"],"additionalProperties":false}},"required":["key","label","scheduled","upcoming","completed","no_show","cancelled","verified","checked_in","feedback","revisits","deals","rates"],"additionalProperties":false}},"by_day":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"scheduled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_show":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","scheduled","completed","no_show"],"additionalProperties":false}},"truncated":{"type":"boolean"}},"required":["range","group_by","totals","rates","funnel","breakdown","by_day","truncated"],"additionalProperties":false},"SiteVisitCalendar":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"lanes":{"type":"array","items":{"type":"object","properties":{"agent":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"visits":{"type":"array","items":{"$ref":"#/components/schemas/SiteVisit"}}},"required":["agent","visits"],"additionalProperties":false}},"truncated":{"type":"boolean"}},"required":["from","to","lanes","truncated"],"additionalProperties":false},"SiteVisitCertificate":{"type":"object","properties":{"visit_id":{"$ref":"#/components/schemas/Id"},"company":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"lead":{"type":"object","properties":{"ref":{"type":"string"},"name":{"type":"string"},"phone":{"type":["string","null"]}},"required":["ref","name","phone"],"additionalProperties":false},"agent":{"type":["string","null"]},"project":{"type":["string","null"]},"stops":{"type":"array","items":{"type":"string"}},"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"check_in":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"distance_m":{"type":["number","null"]},"mock":{"type":"boolean"}},"required":["at","lat","lng","distance_m","mock"],"additionalProperties":false},{"type":"null"}]},"check_out":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]}},"required":["at","lat","lng"],"additionalProperties":false},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"duration_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"verification":{"type":"object","properties":{"method":{"type":"string","enum":["otp","otp_shown_to_agent","override","none"]},"channel":{"type":["string","null"]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"override_reason":{"type":["string","null"]}},"required":["method","channel","verified_at","override_reason"],"additionalProperties":false},"issued_at":{"$ref":"#/components/schemas/DateTime"},"seal":{"type":"string","description":"Key version and HMAC over the facts: a change to any fact prints a different seal."},"verify_url":{"description":"Public page where anyone holding the print checks the seal (valid, or changed since printed).","type":["string","null"]}},"required":["visit_id","company","lead","agent","project","stops","scheduled_at","check_in","check_out","completed_at","duration_min","verification","issued_at","seal","verify_url"],"additionalProperties":false},"SiteVisitCheckInInput":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracy_m":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]},"mock_location":{"description":"The phone reported a mock (fake) location.","type":["boolean","null"]},"photo_key":{"description":"Key from POST …/photos after the upload.","anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"client_key":{"description":"Offline queue key: sending the same key again returns the stored capture.","anyOf":[{"type":"string","minLength":8,"maxLength":128},{"type":"null"}]},"captured_at":{"description":"Phone time of the capture (kept when plausible).","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"otp":{"anyOf":[{"type":"string","minLength":4,"maxLength":12},{"type":"null"}]}},"required":["lat","lng"]},"SiteVisitCheckOutInput":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracy_m":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]},"mock_location":{"description":"The phone reported a mock (fake) location.","type":["boolean","null"]},"photo_key":{"description":"Key from POST …/photos after the upload.","anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"client_key":{"description":"Offline queue key: sending the same key again returns the stored capture.","anyOf":[{"type":"string","minLength":8,"maxLength":128},{"type":"null"}]},"captured_at":{"description":"Phone time of the capture (kept when plausible).","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"override_reason":{"description":"Finish without the required OTP (site_visits.override_otp, audited).","anyOf":[{"type":"string","minLength":3,"maxLength":300},{"type":"null"}]}}},"SiteVisitConflict":{"type":"object","properties":{"visit_id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["overlap","buffer"]},"gap_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scheduled_at":{"$ref":"#/components/schemas/DateTime"},"ends_at":{"$ref":"#/components/schemas/DateTime"},"lead_name":{"description":"Null when the other visit is outside your scope.","type":["string","null"]}},"required":["visit_id","kind","gap_min","scheduled_at","ends_at","lead_name"],"additionalProperties":false},"SiteVisitFeedbackInput":{"type":"object","properties":{"rating":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"items":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"item_id":{"$ref":"#/components/schemas/Id"},"reaction":{"$ref":"#/components/schemas/VisitReaction"},"reasons":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/VisitFeedbackReason"}},"remarks":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["item_id","reaction"]}},"objections":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/VisitFeedbackReason"}},"next_step":{"anyOf":[{"$ref":"#/components/schemas/VisitNextStep"},{"type":"null"}]},"revisit_at":{"anyOf":[{"type":"string","minLength":10,"maxLength":40},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}}},"SiteVisitItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"property":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"listing_type":{"type":"string"},"locality":{"type":["string","null"]}},"required":["id","ref_code","title","listing_type","locality"],"additionalProperties":false},{"type":"null"}]},"unit":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"unit_no":{"type":"string"}},"required":["id","unit_no"],"additionalProperties":false},{"type":"null"}]},"planned_at":{"description":"The agent’s time for this stop, or an even split of the visit.","$ref":"#/components/schemas/DateTime"},"reaction":{"anyOf":[{"$ref":"#/components/schemas/VisitReaction"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"remarks":{"type":["string","null"]}},"required":["id","sort_order","property","unit","planned_at","reaction","reasons","remarks"],"additionalProperties":false},"SiteVisitNoShowInput":{"type":"object","properties":{"reason":{"type":"string","minLength":2,"maxLength":300},"offer_reschedule":{"description":"Default: the company setting (on).","type":["boolean","null"]}},"required":["reason"]},"SiteVisitPhotoInput":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","minLength":3,"maxLength":100},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["filename","content_type","size"]},"SiteVisitSettings":{"type":"object","properties":{"default_duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travel_buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"otp":{"type":"object","properties":{"required":{"type":"string","enum":["off","all","rules"]},"project_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"source_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"partner_visits":{"type":"boolean"},"fallback":{"type":"string","enum":["show_agent","none"]}},"required":["required","project_ids","source_ids","partner_visits","fallback"],"additionalProperties":false},"check_in":{"type":"object","properties":{"radius_m":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["radius_m"],"additionalProperties":false},"reminders":{"type":"object","properties":{"confirmation":{"type":"boolean"},"client_24h":{"type":"boolean"},"client_2h":{"type":"boolean"},"agent_minutes_before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"owner_notice":{"type":"boolean"},"overdue_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["confirmation","client_24h","client_2h","agent_minutes_before","owner_notice","overdue_minutes"],"additionalProperties":false},"feedback_due_hours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_show_offer":{"type":"boolean"}},"required":["default_duration_min","travel_buffer_min","otp","check_in","reminders","feedback_due_hours","no_show_offer"],"additionalProperties":false},"SiteVisitSettingsPatch":{"type":"object","properties":{"default_duration_min":{"type":"integer","minimum":15,"maximum":480},"travel_buffer_min":{"type":"integer","minimum":0,"maximum":240},"otp":{"type":"object","properties":{"required":{"type":"string","enum":["off","all","rules"]},"project_ids":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"source_ids":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"partner_visits":{"type":"boolean"},"fallback":{"type":"string","enum":["show_agent","none"]}}},"check_in":{"type":"object","properties":{"radius_m":{"type":"integer","minimum":50,"maximum":20000}}},"reminders":{"type":"object","properties":{"confirmation":{"type":"boolean"},"client_24h":{"type":"boolean"},"client_2h":{"type":"boolean"},"agent_minutes_before":{"type":"integer","minimum":0,"maximum":1440},"owner_notice":{"type":"boolean"},"overdue_minutes":{"type":"integer","minimum":0,"maximum":360}}},"feedback_due_hours":{"type":"integer","minimum":1,"maximum":72},"no_show_offer":{"type":"boolean"}}},"SiteVisitStatus":{"type":"string","enum":["scheduled","confirmed","rescheduled","completed","no_show","cancelled"]},"SiteVisitStopInput":{"type":"object","properties":{"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"unit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"at":{"description":"Planned time at this stop (default: an even split).","anyOf":[{"type":"string","minLength":10,"maxLength":40},{"type":"null"}]}}},"SlaDashboard":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"truncated":{"type":"boolean"},"totals":{"type":"object","properties":{"started":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached_open":{"type":"integer","minimum":0,"maximum":9007199254740991},"at_risk_now":{"type":"integer","minimum":0,"maximum":9007199254740991},"on_time_pct":{"type":["number","null"]}},"required":["started","met","met_late","breached_open","at_risk_now","on_time_pct"],"additionalProperties":false},"policies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"metric":{"type":"string","enum":["first_response","first_call","first_visit","stage_dwell","task_overdue"]},"metric_label":{"type":"string"},"target_label":{"type":["string","null"]},"enabled":{"type":"boolean"},"started":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached_open":{"type":"integer","minimum":0,"maximum":9007199254740991},"at_risk_now":{"type":"integer","minimum":0,"maximum":9007199254740991},"on_time_pct":{"type":["number","null"]}},"required":["id","key","name","metric","metric_label","target_label","enabled","started","met","met_late","breached_open","at_risk_now","on_time_pct"],"additionalProperties":false}},"by_member":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"breaches":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached_open":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","breaches","met_late","breached_open"],"additionalProperties":false}},"by_team":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"breaches":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached_open":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","breaches","met_late","breached_open"],"additionalProperties":false}},"at_risk":{"type":"array","items":{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"metric":{"type":"string","enum":["first_response","first_call","first_visit","stage_dwell","task_overdue"]}},"required":["id","name","metric"],"additionalProperties":false},"record":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"},"link":{"type":"string"}},"required":["type","id","label","link"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"At risk: minutes left; breached: minutes past due."}},"required":["policy","record","owner","due_at","minutes"],"additionalProperties":false}},"breached":{"type":"array","items":{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"metric":{"type":"string","enum":["first_response","first_call","first_visit","stage_dwell","task_overdue"]}},"required":["id","name","metric"],"additionalProperties":false},"record":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"},"link":{"type":"string"}},"required":["type","id","label","link"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"At risk: minutes left; breached: minutes past due."}},"required":["policy","record","owner","due_at","minutes"],"additionalProperties":false}}},"required":["range","truncated","totals","policies","by_member","by_team","at_risk","breached"],"additionalProperties":false},"SlaDigest":{"type":"object","properties":{"day":{"$ref":"#/components/schemas/LocalDate"},"totals":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"untouched":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","met","met_late","breached","pending","untouched"],"additionalProperties":false},"avg_response_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"members":{"type":"array","items":{"type":"object","properties":{"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached":{"type":"integer","minimum":0,"maximum":9007199254740991},"untouched":{"type":"integer","minimum":0,"maximum":9007199254740991},"avg_response_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["member_id","name","leads","met","met_late","breached","untouched","avg_response_minutes"],"additionalProperties":false}},"breaches":{"type":"array","items":{"$ref":"#/components/schemas/SlaLead"}}},"required":["day","totals","avg_response_minutes","members","breaches"],"additionalProperties":false},"SlaLead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"},"owner":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"source":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"state":{"$ref":"#/components/schemas/SlaState"},"minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"elapsed_minutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"remaining_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"overdue_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","ref","name","owner","source","created_at","due_at","state","minutes","elapsed_minutes","remaining_minutes","overdue_minutes"],"additionalProperties":false},"SlaPolicy":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"metric":{"type":"string","enum":["first_response","first_call","first_visit","stage_dwell","task_overdue"]},"metric_label":{"type":"string"},"enabled":{"type":"boolean"},"target_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"clock":{"type":"string","enum":["business","calendar"]},"scope":{"type":"object","properties":{"entity":{"type":"string","enum":["lead","deal"]},"pipeline_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"status_keys":{"type":"array","items":{"type":"string"}},"deal_stages":{"type":"array","items":{"type":"string","enum":["negotiation","token","agreement","registration"]}},"deal_types":{"type":"array","items":{"type":"string","enum":["sale","rent","lease"]}},"lead_types":{"type":"array","items":{"type":"string","enum":["buy","rent","sell","let_out","invest"]}},"source_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"task_types":{"type":"array","items":{"type":"string"}}},"required":["entity","pipeline_ids","status_keys","deal_stages","deal_types","lead_types","source_ids","task_types"],"additionalProperties":false},"ladder":{"type":"object","properties":{"at_risk_percent":{"type":"integer","minimum":10,"maximum":99},"notify_owner":{"type":"boolean"},"breach_notify":{"type":"string","enum":["team_lead","manager","owner"]},"after_breach_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":43200},{"type":"null"}]},"after_breach_action":{"type":"string","enum":["none","notify","reassign","pool"]},"repeat_threshold":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}]},"repeat_window_days":{"type":"integer","minimum":1,"maximum":30}},"required":["at_risk_percent","notify_owner","breach_notify","after_breach_minutes","after_breach_action","repeat_threshold","repeat_window_days"],"additionalProperties":false},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"system":{"type":"boolean","description":"The E3 first-response SLA (per-source minutes on the SLA screen)."},"updated_at":{"$ref":"#/components/schemas/DateTime"},"live":{"type":"object","properties":{"running":{"type":"integer","minimum":0,"maximum":9007199254740991},"at_risk":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["running","at_risk","breached"],"additionalProperties":false}},"required":["id","key","name","metric","metric_label","enabled","target_minutes","clock","scope","ladder","settings","system","updated_at","live"],"additionalProperties":false},"SlaState":{"type":"string","enum":["none","on_track","at_risk","breached","met","met_late"]},"SnoozeTaskInput":{"type":"object","properties":{"preset":{"anyOf":[{"type":"string","enum":["in_1h","this_evening","tomorrow_9am","tomorrow_10am","next_monday_10am"]},{"type":"null"}]},"until":{"anyOf":[{"type":"string","minLength":10,"maxLength":40},{"type":"null"}]}}},"SocialAccount":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string","enum":["facebook_page","instagram_business","google_business"]},"external_id":{"type":"string"},"name":{"type":"string"},"mode":{"type":"string","enum":["live","fake"]},"status":{"type":"string","enum":["active","needs_reconnect","disconnected"]},"last_error":{"type":["string","null"]},"connected_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","provider","external_id","name","mode","status","last_error","connected_at","updated_at"],"additionalProperties":false,"description":"`mode: fake` — a demo connection; posts go to the demo publisher."},"SocialPost":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"account_id":{"$ref":"#/components/schemas/Id"},"account_name":{"type":"string"},"provider":{"type":"string","enum":["facebook_page","instagram_business","google_business"]},"demo":{"type":"boolean"},"variant_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"creative_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"creative_url":{"type":["string","null"]},"text":{"type":"string"},"link_url":{"type":["string","null"]},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","cancelled"]},"scheduled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"external_post_id":{"type":["string","null"]},"permalink":{"type":["string","null"]},"last_error":{"type":["string","null"]},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cancelled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","account_id","account_name","provider","demo","variant_id","creative_id","creative_url","text","link_url","status","scheduled_at","attempts","next_attempt_at","external_post_id","permalink","last_error","published_at","cancelled_at","created_by_id","created_at","updated_at"],"additionalProperties":false},"SourceFunnelRow":{"type":"object","properties":{"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"type":{"type":["string","null"]},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"junk":{"type":"integer","minimum":0,"maximum":9007199254740991},"lost":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacted":{"type":"integer","minimum":0,"maximum":9007199254740991},"qualified":{"type":"integer","minimum":0,"maximum":9007199254740991},"visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991},"cost_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cpl_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_visit_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"cost_per_deal_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"commission_expected_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"commission_received_paise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"roi_pct":{"type":["number","null"]},"projected_roi_pct":{"type":["number","null"]}},"required":["source_id","name","type","leads","junk","lost","contacted","qualified","visited","deals","cost_paise","cpl_paise","cost_per_visit_paise","cost_per_deal_paise","commission_expected_paise","commission_received_paise","roi_pct","projected_roi_pct"],"additionalProperties":false,"description":"Commission and ROI are null without commission access."},"SourceInboundEmail":{"type":"object","properties":{"available":{"type":"boolean"},"mailbox":{"anyOf":[{"type":"object","properties":{"connection_id":{"$ref":"#/components/schemas/Id"},"address":{"type":["string","null"]},"status":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"},"last_received_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["connection_id","address","status","created_at","last_received_at"],"additionalProperties":false},{"type":"null"}]},"pending_review":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_received_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"forwarding":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"received_at":{"$ref":"#/components/schemas/DateTime"},"confirmation":{"anyOf":[{"$ref":"#/components/schemas/ForwardingConfirmation"},{"type":"null"}]}},"required":["id","received_at","confirmation"],"additionalProperties":false}}},"required":["available","mailbox","pending_review","last_received_at","forwarding"],"additionalProperties":false},"SpeedStats":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"responded":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"median_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"p90_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"avg_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"with_sla":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached":{"type":"integer","minimum":0,"maximum":9007199254740991},"within_sla_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]}},"required":["leads","responded","pending","median_minutes","p90_minutes","avg_minutes","with_sla","met","met_late","breached","within_sla_pct"],"additionalProperties":false},"SpeedToLeadReport":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"clock":{"type":"string","enum":["business","calendar"]},"sla_enabled":{"type":"boolean"},"truncated":{"type":"boolean"},"totals":{"$ref":"#/components/schemas/SpeedStats"},"distribution":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","enum":["m5","m15","m30","h1","h4","h24","over","none"]},"label":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["bucket","label","count"],"additionalProperties":false}},"by_member":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"responded":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"median_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"p90_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"avg_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"with_sla":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached":{"type":"integer","minimum":0,"maximum":9007199254740991},"within_sla_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]}},"required":["id","name","leads","responded","pending","median_minutes","p90_minutes","avg_minutes","with_sla","met","met_late","breached","within_sla_pct"],"additionalProperties":false}},"by_source":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"responded":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"median_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"p90_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"avg_minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"with_sla":{"type":"integer","minimum":0,"maximum":9007199254740991},"met":{"type":"integer","minimum":0,"maximum":9007199254740991},"met_late":{"type":"integer","minimum":0,"maximum":9007199254740991},"breached":{"type":"integer","minimum":0,"maximum":9007199254740991},"within_sla_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]}},"required":["id","name","leads","responded","pending","median_minutes","p90_minutes","avg_minutes","with_sla","met","met_late","breached","within_sla_pct"],"additionalProperties":false}}},"required":["range","clock","sla_enabled","truncated","totals","distribution","by_member","by_source"],"additionalProperties":false},"SplitRole":{"type":"string","enum":["sourcing","closing","listing","presales"]},"StaffExitState":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string","enum":["queued","running","done","failed"]},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["member","round_robin","pool"]},"member_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"team_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["kind","member_ids","team_id"],"additionalProperties":false},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"totals":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"presales_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","presales_leads","tasks","visits","deals"],"additionalProperties":false},"moved":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"presales_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","presales_leads","tasks","visits","deals"],"additionalProperties":false},"recipients":{"type":"object","propertyNames":{"$ref":"#/components/schemas/Id"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"turn":{"type":"integer","minimum":0,"maximum":9007199254740991},"started_at":{"$ref":"#/components/schemas/DateTime"},"started_by":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"error":{"type":["string","null"]}},"required":["member_id","status","target","fallback_member_id","totals","moved","recipients","turn","started_at","started_by","finished_at","error"],"additionalProperties":false},"StaffExitSummary":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"active":{"type":"boolean"},"reports_to_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["id","name","active","reports_to_id"],"additionalProperties":false},"counts":{"type":"object","properties":{"leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"presales_leads":{"type":"integer","minimum":0,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991},"visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"deals":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["leads","presales_leads","tasks","visits","deals"],"additionalProperties":false},"state":{"anyOf":[{"$ref":"#/components/schemas/StaffExitState"},{"type":"null"}]},"suggestions":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"same_team":{"type":"boolean"},"open_leads":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","same_team","open_leads"],"additionalProperties":false}},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"members":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","members"],"additionalProperties":false}}},"required":["member","counts","state","suggestions","teams"],"additionalProperties":false},"StaffExitTarget":{"type":"object","properties":{"kind":{"type":"string","enum":["member","round_robin","pool"]},"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"member_ids":{"anyOf":[{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},{"type":"null"}]},"team_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["kind"]},"StageRule":{"type":"object","properties":{"next":{"anyOf":[{"maxItems":40,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}},{"type":"null"}],"description":"Stages it may move to; null: any."},"entry":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"field"},"field":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","field"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"record"},"record":{"type":"string","enum":["completed_visit","any_visit","open_deal","linked_property","connected_call","share_sent","live_offer","accepted_offer"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","record","min"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"document"},"document":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","document","min"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"photos"},"min":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["kind","min"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"approval"}},"required":["kind"],"additionalProperties":false}]}},"checklist":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"type":"boolean"},"evidence":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"field"},"field":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","field"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"record"},"record":{"type":"string","enum":["completed_visit","any_visit","open_deal","linked_property","connected_call","share_sent","live_offer","accepted_offer"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","record","min"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"document"},"document":{"type":"string","enum":["token_receipt","agreement","sale_deed","kyc","payment_proof","other"]},"min":{"default":1,"type":"integer","minimum":1,"maximum":50}},"required":["kind","document","min"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"photos"},"min":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["kind","min"],"additionalProperties":false}]},{"type":"null"}],"description":"Ticks itself when this holds."}},"required":["key","label","required","evidence"],"additionalProperties":false}},"auto":{"maxItems":5,"type":"array","items":{"oneOf":[{"type":"object","properties":{"on":{"type":"string","const":"event"},"event":{"type":"string","enum":["visit.scheduled","visit.completed","visit.no_show","deal.opened","deal.won","deal.lost","checklist.completed"]},"to":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"sub":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["on","event","to","sub"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"timer"},"after_minutes":{"type":"integer","minimum":5,"maximum":527040},"to":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"sub":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}]}},"required":["on","after_minutes","to","sub"],"additionalProperties":false}]}}},"required":["next","entry","checklist","auto"],"additionalProperties":false},"StaleListing":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"listing_type":{"type":"string"},"price":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"rent_amount":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"owner":{"description":"Field rule property.owner: absent when hidden, values masked when masked.","anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},{"type":"null"}]},"has_owner":{"type":"boolean","description":"An owner contact is set (the owner can be asked)."},"listed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"stale_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"price_nudged_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"days_since_confirmed":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_check":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"channel":{"type":["string","null"]},"blocked_reason":{"type":["string","null"]},"sent_at":{"$ref":"#/components/schemas/DateTime"},"opened_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"responded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","status","channel","blocked_reason","sent_at","opened_at","responded_at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","ref_code","title","status","listing_type","price","rent_amount","has_owner","listed_by","verified_at","stale_at","price_nudged_at","days_since_confirmed","last_check"],"additionalProperties":false},"StampDutyCalculatorInput":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/IndianStateCode"},"kind":{"$ref":"#/components/schemas/AgreementDocumentKind"},"on":{"$ref":"#/components/schemas/LocalDate"},"start":{"$ref":"#/components/schemas/LocalDate"},"end":{"$ref":"#/components/schemas/LocalDate"},"monthly_rent":{"$ref":"#/components/schemas/PaiseInput"},"escalation_pct":{"anyOf":[{"type":"string","pattern":"^\\d{1,3}(?:\\.\\d{1,2})?$"},{"type":"null"}]},"deposit":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"non_refundable":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"area":{"default":"urban","type":"string","enum":["urban","rural"]},"registered":{"default":false,"type":"boolean"}},"required":["state","kind","on","start","end","monthly_rent"]},"StampDutyEstimate":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"estimated"},"rule":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"source":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":["string","null"]},"retrieved_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["title","url","retrieved_on"],"additionalProperties":false},"verified":{"type":"boolean","description":"False: figures not confirmed against an official source [U]."},"note":{"type":"string"},"origin":{"type":"string","enum":["system","company"]}},"required":["id","label","effective_from","source","verified","origin"],"additionalProperties":false},"term":{"type":"object","properties":{"months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["months","days"],"additionalProperties":false},"total_rent":{"$ref":"#/components/schemas/Paise"},"average_annual_rent":{"$ref":"#/components/schemas/Paise"},"base_lines":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["label","amount"],"additionalProperties":false}},"base":{"$ref":"#/components/schemas/Paise"},"duty":{"$ref":"#/components/schemas/Paise"},"registration_required":{"type":"boolean"},"registration_fee":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"extra":{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"amount":{"$ref":"#/components/schemas/Paise"}},"required":["label","amount"],"additionalProperties":false},{"type":"null"}]},"total":{"$ref":"#/components/schemas/Paise"},"e_stamp":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["status","rule","term","total_rent","average_annual_rent","base_lines","base","duty","registration_required","registration_fee","extra","total","e_stamp","warnings"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"no_rule"},"state":{"type":"string"},"message":{"type":"string"}},"required":["status","state","message"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"not_covered"},"state":{"type":"string"},"rule_id":{"type":"string"},"message":{"type":"string"}},"required":["status","state","rule_id","message"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"invalid"},"message":{"type":"string"}},"required":["status","message"],"additionalProperties":false}]},"StampDutyOverride":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"state":{"type":"string"},"kind":{"type":"string"},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Rate bands (basis points or a fixed duty), deposit treatment, minimum, maximum, rounding, registration fee — paise as numbers."},"source":{"type":["string","null"]},"note":{"type":["string","null"]},"updated_at":{"$ref":"#/components/schemas/DateTime"},"invalid":{"type":"boolean"}},"required":["id","state","kind","effective_from","rule","source","note","updated_at","invalid"],"additionalProperties":false},"StampDutyOverrideInput":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"state":{"$ref":"#/components/schemas/IndianStateCode"},"kind":{"type":"string","enum":["leave_licence","rent_11m","lease_deed","any"]},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Rate bands (basis points or a fixed duty), deposit treatment, minimum, maximum, rounding, registration fee — paise as numbers."},"source":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["state","kind","effective_from","rule"]},"StampDutyTable":{"type":"object","properties":{"system":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"kinds":{"type":"array","items":{"type":"string"}},"label":{"type":"string"},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"effective_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"verified":{"type":"boolean"},"source":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":["string","null"]},"retrieved_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["title","url","retrieved_on"],"additionalProperties":false},"note":{"type":["string","null"]},"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Rate bands (basis points or a fixed duty), deposit treatment, minimum, maximum, rounding, registration fee — paise as numbers."}},"required":["id","state","kinds","label","effective_from","effective_to","verified","source","note","rule"],"additionalProperties":false}},"overrides":{"type":"array","items":{"$ref":"#/components/schemas/StampDutyOverride"}}},"required":["system","overrides"],"additionalProperties":false},"StartAgreementDocumentInput":{"type":"object","properties":{"template_key":{"description":"Default: Maharashtra’s leave and licence there, else the 11-month agreement (lease deed from 12 months).","anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{2,63}$"},{"type":"null"}]},"state":{"description":"Default: the listing’s state, else the company’s.","anyOf":[{"$ref":"#/components/schemas/IndianStateCode"},{"type":"null"}]},"execution":{"anyOf":[{"$ref":"#/components/schemas/AgreementExecution"},{"type":"null"}]},"area":{"anyOf":[{"type":"string","enum":["urban","rural"]},{"type":"null"}]}}},"StartCheckoutInput":{"type":"object","properties":{"plan_code":{"type":"string","minLength":1,"maxLength":32},"cycle":{"type":"string","enum":["monthly","yearly"]},"seats":{"type":"integer","minimum":1,"maximum":10000}},"required":["plan_code","cycle","seats"]},"StartRegistrationInput":{"type":"object","properties":{"assignee_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"StatementMailbox":{"type":"object","properties":{"enabled":{"type":"boolean"},"address":{"description":"Forward the bank’s statement mails here; null while inbound email is not set up.","type":["string","null"]},"bank":{"type":"string","enum":["hdfc","icici","sbi","axis","kotak","generic"]},"senders":{"type":"array","items":{"type":"string"}},"accounts":{"type":"array","items":{"type":"string"},"description":"The company’s own account numbers: a mailed statement must be for one of them; with none, mailed statements are never auto-confirmed."},"last_received_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["enabled","address","bank","senders","accounts","last_received_at"],"additionalProperties":false},"StatusCategory":{"type":"string","enum":["open","won","lost","invalid"]},"StatusComponent":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"$ref":"#/components/schemas/StatusLevel"}},"required":["key","name","description","status"],"additionalProperties":false},"StatusIncident":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["incident","maintenance"]},"title":{"type":"string"},"impact":{"type":"string","enum":["minor","major","critical","maintenance"]},"status":{"type":"string","description":"investigating · identified · monitoring · resolved (incidents); scheduled · in_progress · completed."},"components":{"type":"array","items":{"type":"string"}},"starts_at":{"$ref":"#/components/schemas/DateTime"},"ends_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"resolved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"body":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","status","body","created_at"],"additionalProperties":false}}},"required":["id","kind","title","impact","status","components","starts_at","ends_at","resolved_at","updates"],"additionalProperties":false},"StatusLevel":{"type":"string","enum":["operational","degraded","partial_outage","major_outage","maintenance"]},"StatusMatrix":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"dimension":{"type":"string","enum":["owner","presales","source","project","campaign","partner","branch"]},"level":{"type":"string","enum":["status","sub_status","lost_reason"]},"pipeline":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Status or sub-status id; `none:<status id>` = no sub-status."},"label":{"type":"string"},"status_id":{"$ref":"#/components/schemas/Id"},"status_label":{"type":"string"},"sub_status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"category":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","label","status_id","status_label","sub_status_id","category","color"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"label":{"type":"string"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"cells":{"type":"array","items":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Lead counts aligned with `columns`."}},"required":["id","label","total","cells"],"additionalProperties":false}},"totals":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"cells":{"type":"array","items":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["total","cells"],"additionalProperties":false},"truncated":{"type":"boolean"}},"required":["range","dimension","level","pipeline","pipelines","columns","rows","totals","truncated"],"additionalProperties":false},"StatusRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","enum":["required","optional"]},{"type":"object","properties":{"min":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["min"],"additionalProperties":false}]}},"StatusSnapshot":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/StatusLevel"},"summary":{"type":"string","description":"\"All systems operational\", \"Delays in WhatsApp delivery\" …"},"checked_at":{"$ref":"#/components/schemas/DateTime"},"components":{"type":"array","items":{"$ref":"#/components/schemas/StatusComponent"}},"active":{"type":"array","items":{"$ref":"#/components/schemas/StatusIncident"},"description":"Open incidents and maintenance in progress."},"scheduled":{"type":"array","items":{"$ref":"#/components/schemas/StatusIncident"},"description":"Planned maintenance that has not started."},"history":{"type":"array","items":{"$ref":"#/components/schemas/StatusIncident"},"description":"Resolved in the last 30 days, newest first."}},"required":["status","summary","checked_at","components","active","scheduled","history"],"additionalProperties":false},"StepUpResult":{"type":"object","properties":{"verified_until":{"description":"Sensitive actions on this session need no new code until then.","$ref":"#/components/schemas/DateTime"},"method":{"type":"string","enum":["totp","backup_code"]},"backup_codes_left":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["verified_until","method","backup_codes_left"],"additionalProperties":false},"StudioPhoto":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"caption":{"type":["string","null"]},"room_tag":{"type":["string","null"]},"is_cover":{"type":"boolean"},"thumb_url":{"type":"string"}},"required":["id","caption","room_tag","is_cover","thumb_url"],"additionalProperties":false},"SubscriptionChangeResult":{"type":"object","properties":{"kind":{"type":"string","enum":["upgrade","downgrade","unchanged","cycle_change"]},"charge_now":{"description":"Prorated for the rest of the period: added to the next charge, or (yearly cycles) paid now via `payment_url`.","$ref":"#/components/schemas/BillingAmount"},"effective_at":{"$ref":"#/components/schemas/DateTime"},"payment_url":{"description":"Yearly upgrades: pay the prorated difference here; the upgrade applies once it is paid.","type":["string","null"]},"subscription":{"$ref":"#/components/schemas/SubscriptionSummary"}},"required":["kind","charge_now","effective_at","payment_url","subscription"],"additionalProperties":false},"SubscriptionStatus":{"type":"string","enum":["trialing","active","past_due","paused","cancelled","expired"]},"SubscriptionSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"plan_code":{"type":"string"},"plan_name":{"type":"string"},"status":{"type":"string","enum":["trialing","active","past_due","paused","cancelled","expired"]},"cycle":{"type":"string","enum":["monthly","yearly"]},"seats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trial_ends_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"current_period_start":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"current_period_end":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"cancel_at_period_end":{"type":"boolean"},"gateway":{"type":["string","null"]},"gateway_status":{"type":["string","null"]},"period_amount":{"anyOf":[{"$ref":"#/components/schemas/BillingAmount"},{"type":"null"}],"description":"What one period costs at the current plan and seats."},"pending_change":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["checkout","downgrade","cycle_change","upgrade"]},"plan_code":{"type":"string"},"cycle":{"type":"string","enum":["monthly","yearly"]},"seats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"effective_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"checkout_url":{"type":["string","null"]}},"required":["kind","plan_code","cycle","seats","effective_at","checkout_url"],"additionalProperties":false},{"type":"null"}]}},"required":["id","plan_code","plan_name","status","cycle","seats","trial_ends_at","current_period_start","current_period_end","cancel_at_period_end","gateway","gateway_status","period_amount","pending_change"],"additionalProperties":false},"SupportAccess":{"type":"object","properties":{"grants":{"type":"array","items":{"$ref":"#/components/schemas/SupportGrant"}},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/SupportSession"}}},"required":["grants","sessions"],"additionalProperties":false},"SupportAttachment":{"type":"object","properties":{"key":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"description":"Download link, valid for ten minutes.","type":["string","null"]}},"required":["key","filename","content_type","size","url"],"additionalProperties":false},"SupportGrant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"mode":{"type":"string","enum":["read","full"]},"reason":{"type":"string"},"status":{"type":"string","enum":["active","expired","revoked"]},"granted_by_id":{"$ref":"#/components/schemas/Id"},"granted_to":{"description":"A named PropZolo agent, or null for the support team.","type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"revoked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","mode","reason","status","granted_by_id","granted_to","created_at","expires_at","revoked_at"],"additionalProperties":false},"SupportMessage":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"author_kind":{"type":"string","enum":["member","support"]},"author_name":{"type":"string"},"mine":{"type":"boolean"},"body":{"type":"string"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/SupportAttachment"}},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","author_kind","author_name","mine","body","attachments","created_at"],"additionalProperties":false},"SupportSession":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"grant_id":{"$ref":"#/components/schemas/Id"},"agent":{"type":"string"},"mode":{"type":"string","enum":["read","full"]},"started_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"end_reason":{"type":["string","null"]}},"required":["id","grant_id","agent","mode","started_at","ended_at","expires_at","end_reason"],"additionalProperties":false},"SupportTicket":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"ref":{"type":"string","description":"\"#1042\" — quote it when you talk to support."},"subject":{"type":"string"},"category":{"$ref":"#/components/schemas/SupportTicketCategory"},"priority":{"$ref":"#/components/schemas/SupportTicketPriority"},"status":{"$ref":"#/components/schemas/SupportTicketStatus"},"requester":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"role":{"type":["string","null"]}},"required":["id","name","role"],"additionalProperties":false},"mine":{"type":"boolean","description":"You opened it."},"first_response_due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_responded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_response":{"anyOf":[{"type":"string","enum":["met","missed","on_track","at_risk","breached"]},{"type":"null"}],"description":"Where the ticket stands against its first-response target."},"last_message_at":{"$ref":"#/components/schemas/DateTime"},"last_message_by":{"type":"string","enum":["member","support"]},"solved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","number","ref","subject","category","priority","status","requester","mine","first_response_due_at","first_responded_at","first_response","last_message_at","last_message_by","solved_at","created_at"],"additionalProperties":false},"SupportTicketCategory":{"type":"string","enum":["how_to","problem","lead_sources","messaging","mobile_app","billing","data_privacy","feature_request","other"]},"SupportTicketDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"ref":{"type":"string","description":"\"#1042\" — quote it when you talk to support."},"subject":{"type":"string"},"category":{"$ref":"#/components/schemas/SupportTicketCategory"},"priority":{"$ref":"#/components/schemas/SupportTicketPriority"},"status":{"$ref":"#/components/schemas/SupportTicketStatus"},"requester":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"role":{"type":["string","null"]}},"required":["id","name","role"],"additionalProperties":false},"mine":{"type":"boolean","description":"You opened it."},"first_response_due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_responded_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"first_response":{"anyOf":[{"type":"string","enum":["met","missed","on_track","at_risk","breached"]},{"type":"null"}],"description":"Where the ticket stands against its first-response target."},"last_message_at":{"$ref":"#/components/schemas/DateTime"},"last_message_by":{"type":"string","enum":["member","support"]},"solved_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/SupportMessage"}}},"required":["id","number","ref","subject","category","priority","status","requester","mine","first_response_due_at","first_responded_at","first_response","last_message_at","last_message_by","solved_at","created_at","messages"],"additionalProperties":false},"SupportTicketPriority":{"type":"string","enum":["low","normal","high","urgent"]},"SupportTicketStatus":{"type":"string","enum":["open","pending","solved","closed"],"description":"open: waiting for PropZolo · pending: waiting for you · solved (a reply reopens it) · closed."},"SupportUpload":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"}},"required":["key","url","method","headers","expires_at"],"additionalProperties":false},"SupportUploadInput":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf"]},"size":{"type":"integer","exclusiveMinimum":0,"maximum":10485760}},"required":["filename","content_type","size"]},"Suppression":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"channel":{"type":"string"},"address":{"type":["string","null"]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reason":{"type":["string","null"]},"source":{"type":"string"},"note":{"type":["string","null"]},"since":{"$ref":"#/components/schemas/DateTime"}},"required":["id","channel","address","contact_id","reason","source","note","since"],"additionalProperties":false},"SyncCall":{"type":"object","properties":{"device_call_id":{"description":"The phone’s CallLog._ID — with the phone, the idempotency key of the row.","anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}]},"number":{"description":"As the call log has it; hidden numbers come as \"\" or \"-1\".","type":"string"},"name":{"description":"The name saved in the phone book.","type":["string","null"]},"type":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"string","maxLength":16}],"description":"Android CallLog.Calls.TYPE (1 incoming, 2 outgoing, 3 missed, 4 voicemail, 5 rejected, 6 blocked) or a direction."},"date":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Start of the call, epoch milliseconds."},"duration":{"default":0,"description":"Talk time in seconds.","type":"integer","minimum":0,"maximum":86400},"sim_slot":{"anyOf":[{"type":"integer","minimum":0,"maximum":3},{"type":"null"}]},"subscription_id":{"anyOf":[{"anyOf":[{"type":"string","maxLength":64},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}]},{"type":"null"}]},"sim_label":{"type":["string","null"]},"sim_number":{"description":"Ignored: SIM numbers are not stored with calls.","type":["string","null"]},"attempt_ms":{"description":"Dial → hang-up in ms (ring + talk); bad values are dropped."},"net":{"description":"Network snapshot (short keys, see NetSnapshot.kt); cleaned, never refused."}},"required":["device_call_id","type","date"]},"SyncCallsInput":{"type":"object","properties":{"device_id":{"type":"string","minLength":8,"maxLength":128,"description":"The installation id the phone registered with."},"calls":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/SyncCall"}},"app_version":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"device_now":{"description":"The phone’s clock (epoch ms) when it sent the batch: call dates of a phone more than 2 minutes off are corrected.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"want_notifications":{"description":"Accepted for older builds; notifications are polled.","type":"boolean"}},"required":["device_id","calls"]},"SyncCallsResult":{"type":"object","properties":{"received":{"type":"integer","minimum":0,"maximum":9007199254740991},"inserted":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":0,"maximum":9007199254740991},"matched":{"type":"integer","minimum":0,"maximum":9007199254740991},"unmatched":{"type":"integer","minimum":0,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":0,"maximum":9007199254740991},"skipped_by":{"type":"object","properties":{"personal_sim":{"type":"integer","minimum":0,"maximum":9007199254740991},"unknown_sim":{"type":"integer","minimum":0,"maximum":9007199254740991},"invalid_date":{"type":"integer","minimum":0,"maximum":9007199254740991},"before_backfill":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_in_crm":{"type":"integer","minimum":0,"maximum":9007199254740991},"other_device":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["personal_sim","unknown_sim","invalid_date","before_backfill","not_in_crm","other_device"],"additionalProperties":false},"stored":{"type":"integer","minimum":0,"maximum":9007199254740991},"tracking_disabled":{"type":"boolean"},"pending_outcomes":{"type":"array","items":{"$ref":"#/components/schemas/PendingCallOutcome"}},"server_time":{"$ref":"#/components/schemas/DateTime"},"clock_offset_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The phone’s clock minus the server’s (ms) when `device_now` was sent; else null."}},"required":["received","inserted","duplicates","matched","unmatched","skipped","skipped_by","stored","tracking_disabled","pending_outcomes","server_time","clock_offset_ms"],"additionalProperties":false},"SyncedEmail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"from":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":["string","null"]}},"required":["address","name"],"additionalProperties":false},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"subject":{"type":["string","null"]},"snippet":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"mime":{"type":["string","null"]},"size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["name","mime","size"],"additionalProperties":false}},"sent_at":{"$ref":"#/components/schemas/DateTime"},"is_private":{"type":"boolean"},"is_mine":{"type":"boolean","description":"The caller’s mailbox holds it: they may mark it private."},"mailbox_member":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"contact_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"lead_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"thread_key":{"type":"string"},"body_text":{"type":["string","null"]},"body_html":{"description":"Sanitised HTML: show it only in a sandboxed frame that loads nothing from the network.","type":["string","null"]}},"required":["id","provider","direction","from","to","cc","subject","snippet","attachments","sent_at","is_private","is_mine","mailbox_member","contact_ids","lead_ids","thread_key","body_text","body_html"],"additionalProperties":false},"SyncedEmailSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"from":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":["string","null"]}},"required":["address","name"],"additionalProperties":false},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"subject":{"type":["string","null"]},"snippet":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"mime":{"type":["string","null"]},"size":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["name","mime","size"],"additionalProperties":false}},"sent_at":{"$ref":"#/components/schemas/DateTime"},"is_private":{"type":"boolean"},"is_mine":{"type":"boolean","description":"The caller’s mailbox holds it: they may mark it private."},"mailbox_member":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"contact_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"lead_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["id","provider","direction","from","to","cc","subject","snippet","attachments","sent_at","is_private","is_mine","mailbox_member","contact_ids","lead_ids"],"additionalProperties":false},"SyndicationDashboard":{"type":"object","properties":{"portals":{"type":"array","items":{"type":"object","properties":{"portal":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]},"label":{"type":"string"},"account_state":{"type":"string","enum":["not_connected","ok","degraded","error","disconnected","pending"]},"counts":{"type":"object","propertyNames":{"type":"string","enum":["queued","submitted","live","rejected","failed","expired","deactivating","deactivated"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["queued","submitted","live","rejected","failed","expired","deactivating","deactivated"]},"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quota":{"$ref":"#/components/schemas/SyndicationQuota"},"last_synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["portal","label","account_state","counts","leads","views","quota","last_synced_at"],"additionalProperties":false}},"failures":{"type":"array","items":{"type":"object","properties":{"syndication_id":{"$ref":"#/components/schemas/Id"},"property_id":{"$ref":"#/components/schemas/Id"},"ref_code":{"type":"string"},"title":{"type":"string"},"portal":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]},"status":{"type":"string","enum":["queued","submitted","live","rejected","failed","expired","deactivating","deactivated"]},"error_code":{"type":["string","null"]},"message":{"type":["string","null"]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["syndication_id","property_id","ref_code","title","portal","status","error_code","message","updated_at"],"additionalProperties":false}},"totals":{"type":"object","properties":{"live":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"problems":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["live","pending","problems","leads"],"additionalProperties":false}},"required":["portals","failures","totals"],"additionalProperties":false},"SyndicationPortalAccount":{"type":"object","properties":{"portal":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]},"label":{"type":"string"},"connection_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":["string","null"]},"state":{"type":"string","enum":["not_connected","ok","degraded","error","disconnected","pending"]},"settings":{"anyOf":[{"type":"object","properties":{"account_id":{"type":["string","null"]},"package_name":{"type":["string","null"]},"listing_limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"package_ends_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["account_id","package_name","listing_limit","package_ends_on"],"additionalProperties":false},{"type":"null"}]},"credentials":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"}},"hints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["fields","hints"],"additionalProperties":false},"last_ok_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"capabilities":{"type":"object","properties":{"create":{"type":"boolean"},"update":{"type":"boolean"},"deactivate":{"type":"boolean"},"media_upload":{"type":"boolean"},"status_pull":{"type":"boolean"},"quota":{"type":"boolean"}},"required":["create","update","deactivate","media_upload","status_pull","quota"],"additionalProperties":false},"verified":{"type":"boolean"},"transport":{"type":"string","enum":["fake","unverified"]},"available":{"type":"boolean","description":"Whether PropZolo publishes to this portal yet (false: coming — no account can be connected)"},"broker_posting":{"type":"boolean"},"notes":{"type":"string"},"quota":{"$ref":"#/components/schemas/SyndicationQuota"},"quota_synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["portal","label","connection_id","name","state","settings","credentials","last_ok_at","last_error","capabilities","verified","transport","available","broker_posting","notes","quota","quota_synced_at"],"additionalProperties":false},"SyndicationQuota":{"type":"object","properties":{"limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"state":{"type":"string","enum":["unlimited","ok","near","full"]}},"required":["limit","used","remaining","state"],"additionalProperties":false},"SyndicationSettings":{"type":"object","properties":{"default_portals":{"type":"array","items":{"type":"string","enum":["99acres","magicbricks","housing","nobroker","square_yards"]}},"price_display":{"type":"string","enum":["exact","on_request"]},"contact_mode":{"type":"string","enum":["agent","company"]},"company_contact_name":{"type":["string","null"]},"company_contact_phone":{"type":["string","null"]},"agent_rera_number":{"type":["string","null"]},"auto_update":{"type":"boolean"}},"required":["default_portals","price_display","contact_mode","company_contact_name","company_contact_phone","agent_rera_number","auto_update"],"additionalProperties":false},"Task":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"type":{"$ref":"#/components/schemas/TaskType"},"title":{"type":"string"},"description":{"type":["string","null"]},"due_at":{"$ref":"#/components/schemas/DateTime"},"remind_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"priority":{"type":"string"},"status":{"$ref":"#/components/schemas/TaskStatus"},"overdue":{"type":"boolean"},"assignee":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"name":{"type":"string"}},"required":["id","ref","name"],"additionalProperties":false},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"deal_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"recurrence":{"anyOf":[{"$ref":"#/components/schemas/TaskRecurrence"},{"type":"null"}]},"snoozed_until":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"completed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"outcome":{"type":["string","null"]},"is_system":{"type":"boolean"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","type","title","description","due_at","remind_at","priority","status","overdue","assignee","created_by_id","lead","contact_id","property_id","deal_id","recurrence","snoozed_until","completed_at","outcome","is_system","created_at","updated_at"],"additionalProperties":false},"TaskPriority":{"type":"string","enum":["low","normal","high","urgent"]},"TaskRecurrence":{"type":"object","properties":{"freq":{"type":"string","enum":["daily","weekly","monthly"]},"interval":{"type":"integer","minimum":1,"maximum":30},"count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Occurrences left, this one included."},"until":{"description":"Last local date (YYYY-MM-DD).","type":["string","null"]}},"required":["freq","interval","count","until"],"additionalProperties":false},"TaskRecurrenceInput":{"type":"object","properties":{"freq":{"type":"string","enum":["daily","weekly","monthly"]},"interval":{"anyOf":[{"type":"integer","minimum":1,"maximum":30},{"type":"null"}]},"count":{"anyOf":[{"type":"integer","minimum":2,"maximum":365},{"type":"null"}]},"until":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["freq"]},"TaskStatus":{"type":"string","enum":["open","done","cancelled"]},"TaskType":{"type":"string","enum":["follow_up","call","whatsapp","meeting","site_visit","email","document","payment","other"]},"TaskView":{"type":"string","enum":["open","overdue","today","upcoming","done","all"]},"TdsEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"payout_id":{"$ref":"#/components/schemas/Id"},"payee":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["type","id","name"],"additionalProperties":false},"pan_status":{"type":"string"},"pan_last4":{"type":["string","null"]},"pan_holder":{"type":["string","null"]},"act":{"type":["string","null"]},"section_code":{"type":["string","null"]},"nature":{"type":"string"},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/Paise"},"base":{"$ref":"#/components/schemas/Paise"},"tds":{"$ref":"#/components/schemas/Paise"},"reason":{"type":"string"},"reason_label":{"type":"string"},"event_on":{"$ref":"#/components/schemas/LocalDate"},"financial_year":{"type":"string"},"quarter":{"type":"string","enum":["Q1","Q2","Q3","Q4"]},"deposit_due_on":{"$ref":"#/components/schemas/LocalDate"},"deposit":{"anyOf":[{"type":"object","properties":{"challan_number":{"type":["string","null"]},"bsr_code":{"type":["string","null"]},"deposited_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["challan_number","bsr_code","deposited_on"],"additionalProperties":false},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","payout_id","payee","pan_status","pan_last4","pan_holder","act","section_code","nature","rate_bps","amount","base","tds","reason","reason_label","event_on","financial_year","quarter","deposit_due_on","deposit","created_at"],"additionalProperties":false},"TdsPreview":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Paise"},"releasable":{"$ref":"#/components/schemas/Paise"},"gst_amount":{"$ref":"#/components/schemas/Paise"},"event_on":{"description":"The deduction event: the earlier of approval and payment.","$ref":"#/components/schemas/LocalDate"},"section":{"anyOf":[{"type":"object","properties":{"act":{"type":"string"},"code":{"type":"string"}},"required":["act","code"],"additionalProperties":false},{"type":"null"}]},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"base":{"$ref":"#/components/schemas/Paise"},"tds":{"$ref":"#/components/schemas/Paise"},"reason":{"type":"string"},"reason_label":{"type":"string"},"capped":{"type":"boolean"},"net":{"$ref":"#/components/schemas/Paise"},"prior_amount":{"$ref":"#/components/schemas/Paise"},"financial_year":{"type":"string"}},"required":["amount","releasable","gst_amount","event_on","section","rate_bps","base","tds","reason","reason_label","capped","net","prior_amount","financial_year"],"additionalProperties":false},"TdsSection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"act":{"type":"string"},"code":{"type":"string"},"nature":{"type":"string"},"description":{"type":"string"},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"threshold_fy":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"threshold_single":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"no_pan_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_pan_code":{"type":["string","null"]},"effective_from":{"$ref":"#/components/schemas/LocalDate"},"effective_to":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"return_form":{"type":["string","null"]},"certificate_form":{"type":["string","null"]},"source":{"type":["string","null"]},"verified":{"type":"boolean"},"override":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"threshold_fy":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"no_pan_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":["string","null"]},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","rate_bps","threshold_fy","no_pan_rate_bps","reason","updated_at"],"additionalProperties":false},{"type":"null"}]},"current":{"type":"boolean"}},"required":["id","act","code","nature","description","rate_bps","threshold_fy","threshold_single","no_pan_rate_bps","no_pan_code","effective_from","effective_to","return_form","certificate_form","source","verified","override","current"],"additionalProperties":false},"TdsSummary":{"type":"object","properties":{"fy":{"type":"string"},"quarter":{"anyOf":[{"type":"string","enum":["Q1","Q2","Q3","Q4"]},{"type":"null"}]},"from":{"$ref":"#/components/schemas/LocalDate"},"to":{"$ref":"#/components/schemas/LocalDate"},"return_due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"amount":{"$ref":"#/components/schemas/Paise"},"tds":{"$ref":"#/components/schemas/Paise"},"deposited":{"$ref":"#/components/schemas/Paise"},"payable":{"$ref":"#/components/schemas/Paise"},"by_section":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/Paise"},"tds":{"$ref":"#/components/schemas/Paise"},"deposited":{"$ref":"#/components/schemas/Paise"}},"required":["key","label","count","amount","tds","deposited"],"additionalProperties":false}},"by_payee":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/Paise"},"tds":{"$ref":"#/components/schemas/Paise"},"deposited":{"$ref":"#/components/schemas/Paise"}},"required":["key","label","count","amount","tds","deposited"],"additionalProperties":false}},"by_month":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"tds":{"$ref":"#/components/schemas/Paise"},"deposited":{"$ref":"#/components/schemas/Paise"},"deposit_due_on":{"$ref":"#/components/schemas/LocalDate"}},"required":["month","tds","deposited","deposit_due_on"],"additionalProperties":false}}},"required":["fy","quarter","from","to","return_due_on","amount","tds","deposited","payable","by_section","by_payee","by_month"],"additionalProperties":false},"Team":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/MemberStatus"}},"required":["id","name","status"],"additionalProperties":false}},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","name","lead","members","created_at","updated_at"],"additionalProperties":false},"TeamAccountability":{"type":"object","properties":{"period":{"type":"string","enum":["d7","d30"]},"day":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"view":{"type":"string","enum":["scope","peers","self"],"description":"scope: the members your report scope reaches · peers: your team (shared ranking) · self: only you."},"rotation":{"type":"object","properties":{"enabled":{"type":"boolean"},"min_score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","min_score"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"is_me":{"type":"boolean"},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"band":{"anyOf":[{"type":"string","enum":["strong","steady","attention"]},{"type":"null"}]},"rank":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"trend":{"type":"object","properties":{"delta":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"direction":{"anyOf":[{"type":"string","enum":["up","down","flat"]},{"type":"null"}]}},"required":["delta","direction"],"additionalProperties":false},"weakest":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","enum":["first_response","follow_ups","callbacks","call_notes","stale_leads","hygiene"]},"label":{"type":"string"},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","label","value"],"additionalProperties":false},{"type":"null"}]},"eligible":{"type":["boolean","null"]}},"required":["member_id","name","is_me","score","band","rank","trend","weakest","eligible"],"additionalProperties":false}}},"required":["period","day","view","rotation","rows"],"additionalProperties":false},"TeamAttendance":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/LocalDate"},"is_today":{"type":"boolean"},"live_location":{"type":"boolean"},"summary":{"type":"object","properties":{"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_duty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_break":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"present":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"late":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"absent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leave":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"off":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["members","on_duty","on_break","present","late","not_in","absent","leave","off"],"additionalProperties":false},"members":{"type":"array","items":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"designation":{"type":["string","null"]},"branch":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","designation","branch"],"additionalProperties":false},"status":{"type":["string","null"]},"state":{"type":"string","enum":["off","on","break"]},"day":{"anyOf":[{"$ref":"#/components/schemas/AttendanceDay"},{"type":"null"}]},"plan_kind":{"type":"string","enum":["working","holiday","weekly_off"]},"position":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"accuracy_m":{"type":["number","null"]},"at":{"$ref":"#/components/schemas/DateTime"}},"required":["lat","lng","accuracy_m","at"],"additionalProperties":false},{"type":"null"}]}},"required":["member","status","state","day","plan_kind","position"],"additionalProperties":false}}},"required":["date","is_today","live_location","summary","members"],"additionalProperties":false},"TeamInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"team_lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"member_ids":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}}},"required":["name"]},"TelephonyConnection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string"},"connector_key":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":"string","enum":["pending","connected","error","disconnected"]},"health":{"$ref":"#/components/schemas/ConnectionHealth"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Non-secret settings of the connector."},"has_secret":{"type":"boolean"},"secret_hints":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Last four characters of long tokens."},"inbound_url":{"description":"Webhook URL the provider calls (secret).","type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"connected_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"connected_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"last_ok_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_error":{"type":["string","null"]},"error_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"hooks":{"anyOf":[{"$ref":"#/components/schemas/TelephonyHooks"},{"type":"null"}]}},"required":["id","provider","connector_key","name","status","health","config","has_secret","secret_hints","inbound_url","scopes","connected_at","connected_by_id","last_ok_at","last_error","error_count","created_at","updated_at","hooks"],"additionalProperties":false},"TelephonyHooks":{"type":"object","properties":{"status":{"type":"string","description":"Status callback URL — sent with every click-to-call."},"connect":{"type":"string","description":"The Connect applet’s dynamic URL (routes a ringing call)."},"passthru":{"type":"string","description":"The Passthru applet’s URL after Connect (reports how the call ended)."}},"required":["status","connect","passthru"],"additionalProperties":false,"description":"Secret webhook URLs of the connection — paste them in Exotel."},"TelephonyNumber":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"connection_id":{"$ref":"#/components/schemas/Id"},"provider":{"type":"string"},"e164":{"type":"string"},"label":{"type":["string","null"]},"kind":{"type":["string","null"]},"is_default":{"type":"boolean"},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"fallback_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"fallback_e164":{"type":["string","null"]},"status":{"type":"string"},"synced_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"current_source":{"anyOf":[{"$ref":"#/components/schemas/TelephonyNumberSource"},{"type":"null"}]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/TelephonyNumberSource"}},"a2p":{"type":"object","properties":{"state":{"type":"string","enum":["declared","pending","rejected","expired","revoked","none"]},"latest":{"anyOf":[{"$ref":"#/components/schemas/A2pDeclaration"},{"type":"null"}]}},"required":["state","latest"],"additionalProperties":false}},"required":["id","connection_id","provider","e164","label","kind","is_default","branch_id","fallback_member_id","fallback_e164","status","synced_at","current_source","sources","a2p"],"additionalProperties":false},"TelephonyNumberSource":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"source":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"type":{"type":"string"},"is_active":{"type":"boolean"}},"required":["id","name","type","is_active"],"additionalProperties":false},"valid_from":{"$ref":"#/components/schemas/DateTime"},"valid_to":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"route_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"note":{"type":["string","null"]},"live":{"type":"boolean"}},"required":["id","source","valid_from","valid_to","route_member_id","note","live"],"additionalProperties":false},"TelephonyOverview":{"type":"object","properties":{"connection":{"anyOf":[{"$ref":"#/components/schemas/IntegrationConnection"},{"type":"null"}]},"hooks":{"anyOf":[{"$ref":"#/components/schemas/TelephonyHooks"},{"type":"null"}]},"settings":{"$ref":"#/components/schemas/TelephonySettings"},"numbers":{"type":"array","items":{"$ref":"#/components/schemas/TelephonyNumber"}},"recording_retention_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["connection","hooks","settings","numbers","recording_retention_days"],"additionalProperties":false},"TelephonySettings":{"type":"object","properties":{"record_calls":{"type":"boolean"},"disclosure_text":{"type":"string","minLength":10,"maxLength":500},"recording_disclosed":{"type":"boolean","description":"The provider flows play the disclosure to the customer before the call connects; no call is recorded until it is set."},"ai_assist_disclosed":{"type":"boolean","description":"The disclosure tells callers an AI assistant processes the call; live call assist stays off until it is set."},"click_to_call_a2p":{"type":"string","enum":["warn","block","off"]},"missed_call_ack":{"type":"boolean"},"missed_call_channel":{"type":"string","enum":["auto","whatsapp_cloud","sms"]},"callback_minutes":{"type":"integer","minimum":5,"maximum":1440},"ring_timeout_sec":{"type":"integer","minimum":15,"maximum":120},"max_call_minutes":{"type":"integer","minimum":5,"maximum":240},"calling_hours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false}},"required":["record_calls","disclosure_text","recording_disclosed","ai_assist_disclosed","click_to_call_a2p","missed_call_ack","missed_call_channel","callback_minutes","ring_timeout_sec","max_call_minutes","calling_hours"],"additionalProperties":false},"Temperature":{"type":"string","enum":["hot","warm","cold"]},"TemplateChannel":{"type":"string","enum":["sms","email","whatsapp_cloud"]},"TemplatePreview":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/TemplateChannel"},"source":{"type":"string","enum":["sample","record"]},"text":{"type":"string"},"subject":{"type":["string","null"]},"html":{"type":["string","null"]},"params":{"type":"array","items":{"type":"string"}},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":"string"},"blocking":{"type":"boolean"}},"required":["code","detail","blocking"],"additionalProperties":false}},"sms":{"anyOf":[{"type":"object","properties":{"encoding":{"type":"string","enum":["gsm","unicode"]},"parts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["encoding","parts","units"],"additionalProperties":false},{"type":"null"}]},"rera":{"type":"object","properties":{"numbers":{"type":"array","items":{"type":"string"}},"authority_url":{"type":["string","null"]}},"required":["numbers","authority_url"],"additionalProperties":false}},"required":["channel","source","text","subject","html","params","issues","sms","rera"],"additionalProperties":false},"TemplateStatus":{"type":"string","enum":["draft","pending","approved","rejected","paused","disabled"]},"TemplateVariable":{"type":"object","properties":{"index":{"description":"Position of a {#var#} / {{n}} placeholder.","type":"integer","minimum":1,"maximum":100},"key":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"path":{"description":"CRM field for a custom variable, e.g. lead.custom.bank.","type":"string","maxLength":100},"label":{"type":"string","maxLength":80},"sample":{"type":"string","maxLength":200},"fallback":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"max_length":{"type":"integer","minimum":1,"maximum":500}},"required":["key"],"additionalProperties":false},"TemplateVariableInput":{"type":"object","properties":{"index":{"description":"Position of a {#var#} / {{n}} placeholder.","type":"integer","minimum":1,"maximum":100},"key":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"path":{"description":"CRM field for a custom variable, e.g. lead.custom.bank.","type":"string","maxLength":100},"label":{"type":"string","maxLength":80},"sample":{"type":"string","maxLength":200},"fallback":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"max_length":{"type":"integer","minimum":1,"maximum":500}},"required":["key"]},"TenancyDates":{"type":"object","properties":{"moved_in_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notice_given_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notice_by":{"anyOf":[{"type":"string","enum":["tenant","landlord","mutual"]},{"type":"null"}]},"move_out_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}],"description":"The planned move-out (from the notice)."},"moved_out_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}},"required":["moved_in_on","notice_given_on","notice_by","move_out_on","moved_out_on"],"additionalProperties":false},"Tower":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"floors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basement_levels":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"units_per_floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stage":{"type":["string","null"]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"units_total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"units_by_status":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["id","project_id","name","floors","basement_levels","units_per_floor","stage","possession_date","sort_order","units_total","units_by_status"],"additionalProperties":false},"TransactionType":{"type":"string","enum":["new_booking","resale"]},"TransitionWalkIn":{"type":"object","properties":{"action":{"type":"string","enum":["attend","done","left","requeue"]},"member_id":{"description":"attend: who takes the visitor (default: you).","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["action"]},"Unit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"release_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"unit_no":{"type":"string"},"floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stack":{"type":["string","null"]},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"type":["number","null"]},"carpet_area":{"type":["number","null"]},"builtup_area":{"type":["number","null"]},"super_area":{"type":["number","null"]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"facing":{"anyOf":[{"$ref":"#/components/schemas/Facing"},{"type":"null"}]},"view":{"type":["string","null"]},"is_corner":{"type":"boolean"},"base_rate":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Paise per area unit; null when prices are hidden."},"floor_rise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"total_price":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"status":{"description":"A hold that ran out reads as available.","$ref":"#/components/schemas/UnitStatus"},"blocked_reason":{"description":"Inventory managers only.","type":["string","null"]},"hold":{"anyOf":[{"$ref":"#/components/schemas/UnitHoldSummary"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string"},"code":{"type":"string"},"parking_type":{"type":["string","null"]},"level":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/UnitStatus"}},"required":["id","kind","code","parking_type","level","status"],"additionalProperties":false}},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","project_id","tower_id","configuration_id","release_id","unit_no","floor","stack","property_type","bhk","carpet_area","builtup_area","super_area","area_unit","facing","view","is_corner","base_rate","floor_rise","total_price","status","blocked_reason","hold","items","updated_at"],"additionalProperties":false},"UnitDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"tower_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"release_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"unit_no":{"type":"string"},"floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stack":{"type":["string","null"]},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"type":["number","null"]},"carpet_area":{"type":["number","null"]},"builtup_area":{"type":["number","null"]},"super_area":{"type":["number","null"]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"facing":{"anyOf":[{"$ref":"#/components/schemas/Facing"},{"type":"null"}]},"view":{"type":["string","null"]},"is_corner":{"type":"boolean"},"base_rate":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}],"description":"Paise per area unit; null when prices are hidden."},"floor_rise":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"total_price":{"anyOf":[{"$ref":"#/components/schemas/Paise"},{"type":"null"}]},"status":{"description":"A hold that ran out reads as available.","$ref":"#/components/schemas/UnitStatus"},"blocked_reason":{"description":"Inventory managers only.","type":["string","null"]},"hold":{"anyOf":[{"$ref":"#/components/schemas/UnitHoldSummary"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string"},"code":{"type":"string"},"parking_type":{"type":["string","null"]},"level":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/UnitStatus"}},"required":["id","kind","code","parking_type","level","status"],"additionalProperties":false}},"updated_at":{"$ref":"#/components/schemas/DateTime"},"tower":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"release":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false},{"type":"null"}]},"configuration":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"plc":{},"holds":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"release_reason":{"type":["string","null"]},"release_label":{"type":["string","null"]},"extension_status":{"type":["string","null"]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"holder":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","created_at","expires_at","ended_at","release_reason","release_label","extension_status","lead","holder"],"additionalProperties":false}}},"required":["id","project_id","tower_id","configuration_id","release_id","unit_no","floor","stack","property_type","bhk","carpet_area","builtup_area","super_area","area_unit","facing","view","is_corner","base_rate","floor_rise","total_price","status","blocked_reason","hold","items","updated_at","tower","release","configuration","plc","holds"],"additionalProperties":false},"UnitGrid":{"type":"object","properties":{"tower":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"floors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","floors"],"additionalProperties":false},"layout":{"type":"string","enum":["stacks","positions"]},"stacks":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","properties":{"floor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"label":{"type":"string"},"cells":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"required":["floor","label","cells"],"additionalProperties":false}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"truncated":{"type":"boolean"}},"required":["tower","layout","stacks","rows","units","truncated"],"additionalProperties":false},"UnitHold":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["unit","item"]},"id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"}},"required":["kind","id","label"],"additionalProperties":false},"project_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"holder_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"extension_status":{"type":["string","null"]}},"required":["id","status","target","project_id","lead_id","holder_member_id","expires_at","extension_status"],"additionalProperties":false},"UnitHoldInput":{"type":"object","properties":{"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":720},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},"UnitHoldListItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"status":{"type":"string"},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["unit","item"]},"id":{"$ref":"#/components/schemas/Id"},"label":{"type":"string"}},"required":["kind","id","label"],"additionalProperties":false},"project_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"holder_member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"expires_at":{"$ref":"#/components/schemas/DateTime"},"extension_status":{"type":["string","null"]},"mine":{"type":"boolean"},"holder":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"extension_hours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"time_left":{"type":"string"}},"required":["id","status","target","project_id","lead_id","holder_member_id","expires_at","extension_status","mine","holder","lead","extension_hours","time_left"],"additionalProperties":false},"UnitHoldPolicy":{"type":"object","properties":{"default_hours":{"type":"integer","minimum":1,"maximum":720},"max_hours":{"type":"integer","minimum":1,"maximum":720},"role_max_hours":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"type":"integer","minimum":1,"maximum":720}},"max_active_per_member":{"type":"integer","minimum":1,"maximum":200},"allow_extension":{"type":"boolean"},"extension_hours":{"type":"integer","minimum":1,"maximum":168},"warn_before_minutes":{"type":"integer","minimum":0,"maximum":1440},"require_lead":{"type":"boolean"}},"required":["default_hours","max_hours","role_max_hours","max_active_per_member","allow_extension","extension_hours","warn_before_minutes","require_lead"],"additionalProperties":false},"UnitHoldSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"expires_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"mine":{"type":"boolean"},"holder":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"kind":{"type":"string","enum":["member","partner"]}},"required":["id","name","kind"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number"],"additionalProperties":false},{"type":"null"}]},"extension_status":{"type":["string","null"]},"extension_hours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["id","expires_at","created_at","mine","holder","lead","extension_status","extension_hours","note"],"additionalProperties":false},"UnitImportPreview":{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"problems":{"type":"array","items":{"type":"string"}},"new_towers":{"type":"array","items":{"type":"string"}},"counts":{"type":"object","properties":{"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"create":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"update":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status_kept":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["rows","create","update","unchanged","duplicate","invalid","status_kept"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tower":{"type":["string","null"]},"unit_no":{"type":["string","null"]},"action":{"type":"string","enum":["create","update","unchanged","duplicate","invalid"]},"changed":{"type":"array","items":{"type":"string"}},"status_kept":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"],"additionalProperties":false}},"warnings":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"],"additionalProperties":false}}},"required":["row","tower","unit_no","action","changed","status_kept","errors","warnings"],"additionalProperties":false}}},"required":["headers","mapping","problems","new_towers","counts","rows"],"additionalProperties":false},"UnitImportResult":{"type":"object","properties":{"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"create":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"update":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status_kept":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"towers_created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items_allocated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"touched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["rows","create","update","unchanged","duplicate","invalid","status_kept","created","updated","towers_created","items_allocated","touched"],"additionalProperties":false},"UnitRelease":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"project_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"status":{"type":"string","enum":["planned","released"]},"notes":{"type":["string","null"]},"released_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","project_id","name","status","notes","released_at","created_at","units"],"additionalProperties":false},"UnitStatus":{"type":"string","enum":["available","on_hold","blocked","booked","sold","not_released","landowner_share","mortgaged"]},"UpdateAccountProfileInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"languages":{"maxItems":20,"type":"array","items":{"type":"string","enum":["en","hi","kn","ta","te","ml","mr","gu","bn","pa","or","ur","as","kok"]}}}},"UpdateActivityInput":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000},"is_pinned":{"type":"boolean"}}},"UpdateAgreementDocumentInput":{"type":"object","properties":{"expected_version":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version you loaded (a newer one → 409)."},"template_key":{"description":"Switching resets the clauses.","type":"string","pattern":"^[a-z][a-z0-9_]{2,63}$"},"state":{"$ref":"#/components/schemas/IndianStateCode"},"execution":{"$ref":"#/components/schemas/AgreementExecution"},"area":{"type":"string","enum":["urban","rural"]},"fields":{"description":"The full set (replaces what was saved).","$ref":"#/components/schemas/AgreementDocumentFieldsInput"},"clauses":{"description":"The full ordered list.","maxItems":60,"type":"array","items":{"$ref":"#/components/schemas/AgreementClauseSelectionInput"}},"reset_clauses":{"type":"boolean"},"stamp_certificate_no":{"description":"A stamp paper bought outside PropZolo: marks the document stamped.","anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"stamp_override":{"description":"This deal’s own stamp duty / fee with where it comes from; null clears it.","anyOf":[{"type":"object","properties":{"duty":{"$ref":"#/components/schemas/PaiseInput"},"registration_fee":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["duty","reason"]},{"type":"null"}]}},"required":["expected_version"]},"UpdateBranchInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"rera_number":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"gstin":{"description":"For a branch registered in another state.","anyOf":[{"description":"15-character GSTIN (validated with its check character).","type":"string","maxLength":32},{"type":"null"}]},"latitude":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"geofence_m":{"anyOf":[{"type":"integer","minimum":20,"maximum":5000},{"type":"null"}]},"business_hours":{"anyOf":[{"$ref":"#/components/schemas/BusinessHoursInputInput"},{"type":"null"}]},"is_active":{"type":"boolean"}}},"UpdateBrandingInput":{"type":"object","properties":{"brand_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]}},"required":["brand_color"]},"UpdateBroadcastInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"channel":{"type":"string","enum":["whatsapp_cloud","sms","email"]},"template_id":{"$ref":"#/components/schemas/Id"},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"audience":{"$ref":"#/components/schemas/BroadcastAudienceInput"},"scheduled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"throttle_per_min":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"window":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},{"type":"null"}]},"vars":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"additionalProperties":{"type":"string","maxLength":1000}},{"type":"null"}]},"send_mode":{"description":"best_time: each contact at their best hour (engagement history) within best_time_hours.","anyOf":[{"type":"string","enum":["now","best_time"]},{"type":"null"}]},"best_time_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":168},{"type":"null"}]},"personalize_with_ai":{"type":["boolean","null"]},"personalization":{"description":"The template variables AI writes per recipient (up to 3) and the creator’s instructions.","anyOf":[{"type":"object","properties":{"instructions":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"variables":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z_]{0,47}$"},"hint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["key"]}}},"required":["variables"]},{"type":"null"}]}}},"UpdateCallTrackingSettingsInput":{"type":"object","properties":{"tracking_scope":{"type":"string","enum":["all_work_sim","crm_only"]},"disclosure_text":{"type":"string","minLength":20,"maxLength":1000},"unknown_sim_policy":{"type":"string","enum":["skip","store"]},"recordings_enabled":{"type":"boolean"},"backfill_days":{"type":"integer","minimum":0,"maximum":365},"sync_interval_min":{"type":"integer","minimum":15,"maximum":240},"min_app_version":{"type":"string","pattern":"^\\d{1,4}(?:\\.\\d{1,4}){0,2}$"},"require_tracking":{"type":"boolean"},"call_rule":{"type":"object","properties":{"enabled":{"type":"boolean"},"min_remark_chars":{"type":"integer","minimum":0,"maximum":50},"role_keys":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"description":"Switching it on (again) starts it now."}}},"UpdateCommissionPayoutInput":{"type":"object","properties":{"status":{"description":"pending, approved (runs the payout approval policy), on_hold or cancelled — paid goes through /pay.","$ref":"#/components/schemas/PayoutStatus"},"gross":{"$ref":"#/components/schemas/PaiseInput"},"release_rule":{"$ref":"#/components/schemas/PayoutReleaseRule"},"invoice_ref":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"reason":{"description":"Why it is held or cancelled.","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"paid_on":{"description":"Refused: record payments with /pay.","deprecated":true,"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]}}},"UpdateCompanyInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"legal_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"state":{"anyOf":[{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN state code, e.g. KA."},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{5}$"},{"type":"null"}]},"phone":{"description":"Any format; stored as E.164.","anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email"},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"gstin":{"anyOf":[{"description":"15-character GSTIN (validated with its check character).","type":"string","maxLength":32},{"type":"null"}]},"pan":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"rera_numbers":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/CompanyReraRegistrationInput"}},"timezone":{"type":"string","minLength":1,"maxLength":64,"description":"IANA time zone, e.g. Asia/Kolkata.","examples":["Asia/Kolkata"]},"locale":{"type":"string","enum":["en-IN","hi-IN"]},"financial_year_start":{"type":"integer","minimum":1,"maximum":12}}},"UpdateContactInput":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"first_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"alternate_email":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"phones":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/PhoneInput"}},"kinds":{"maxItems":9,"type":"array","items":{"$ref":"#/components/schemas/ContactKind"}},"gender":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"dob":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"anniversary":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"occupation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"employer":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"designation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"income_band":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"is_nri":{"type":"boolean"},"country":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"language":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]},"aadhaar_last4":{"description":"Only the last 4 digits of an Aadhaar number.","anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"tags":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":40}},"blocked":{"type":"boolean"},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"description":"`phones` is the full list: numbers left out are removed."},"UpdateConversationInput":{"type":"object","properties":{"labels":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":32,"description":"Free text, e.g. \"Site visit\" (compared case-insensitively)."}},"snoozed_until":{"description":"Hidden from the inbox views until then (at most 90 days ahead); null wakes it up.","anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"archived":{"description":"Done: moves it out of the inbox until the next message.","type":"boolean"}}},"UpdateCustomFieldInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"choices":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/CustomFieldChoice"}},"is_required":{"type":"boolean"},"section":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"help_text":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"visible_to":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"editable_by":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"is_active":{"type":"boolean"}},"description":"Key and type never change."},"UpdateDealInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"contact_id":{"description":"The primary client; default: the lead’s contact or the first party.","$ref":"#/components/schemas/Id"},"parties":{"$ref":"#/components/schemas/DealPartiesInput"},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"unit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"agreed_value":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"token_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"token_mode":{"anyOf":[{"$ref":"#/components/schemas/PaymentMode"},{"type":"null"}]},"token_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"agreement_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"registration_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"handover_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"commission":{"anyOf":[{"$ref":"#/components/schemas/DealCommissionInput"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"request_approval":{"description":"Ask for approval when a policy requires it: the chain is raised and returned in meta.approval.","anyOf":[{"type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},{"type":"null"}]}}},"UpdateDeductionInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"detail":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"amount":{"$ref":"#/components/schemas/PaiseInput"}}},"UpdateDepositInput":{"type":"object","properties":{"agreed_amount":{"$ref":"#/components/schemas/PaiseInput"},"holder":{"type":"string","enum":["owner","escrow","brokerage"]},"escrow_partner":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"escrow_reference":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}}},"UpdateEnquiryForm":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"is_active":{"type":"boolean"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"fields":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FormFieldInput"}},"consent_text":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"consent_required":{"type":"boolean"},"otp_required":{"type":"boolean"},"spam_protection":{"$ref":"#/components/schemas/FormSpamProtection"},"success_action":{"$ref":"#/components/schemas/FormSuccessActionInput"},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"submit_label":{"type":"string","minLength":1,"maxLength":40},"allowed_origins":{"examples":[["https://www.example.com"]],"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]}}},"UpdateFinanceSettingsInput":{"type":"object","properties":{"gst":{"type":"object","properties":{"registration":{"type":"string","enum":["regular","composition","unregistered"]},"rate_bps":{"type":"integer","minimum":0,"maximum":2800},"sac_sale":{"type":"string","pattern":"^99\\d{4}$"},"sac_rent":{"type":"string","pattern":"^99\\d{4}$"},"sac_land":{"type":"string","pattern":"^99\\d{4}$"}}},"invoice":{"type":"object","properties":{"prefix":{"type":"string","pattern":"^[A-Z][A-Z0-9]{0,4}$"},"credit_note_prefix":{"type":"string","pattern":"^[A-Z][A-Z0-9]{0,4}$"},"pad":{"type":"integer","minimum":3,"maximum":6},"due_days":{"type":"integer","minimum":0,"maximum":120},"backdate_days":{"anyOf":[{"type":"integer","minimum":0,"maximum":90},{"type":"null"}]},"round_total":{"type":"boolean"},"terms":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"signatory_name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"signatory_designation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"show_upi_qr":{"type":"boolean"},"upi_vpa":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9.\\-_]{2,256}@[a-zA-Z][a-zA-Z0-9.-]{1,63}$"},{"type":"null"}]}}},"bank":{"anyOf":[{"type":"object","properties":{"account_name":{"type":"string","minLength":2,"maxLength":120},"account_number":{"type":"string","pattern":"^\\d{9,18}$"},"ifsc":{"type":"string","pattern":"^[A-Z]{4}0[A-Z0-9]{6}$"},"bank_name":{"type":"string","minLength":2,"maxLength":120},"branch":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["account_name","account_number","ifsc","bank_name"]},{"type":"null"}]},"payouts":{"type":"object","properties":{"release_rule":{"$ref":"#/components/schemas/PayoutReleaseRule"},"payee_gst_rate_bps":{"type":"integer","minimum":0,"maximum":2800}}},"tds":{"type":"object","properties":{"enabled":{"type":"boolean"}}},"reminders":{"type":"object","properties":{"customer":{"type":"boolean"},"days_after_due":{"maxItems":6,"type":"array","items":{"type":"integer","minimum":0,"maximum":180}}}}}},"UpdateInvoiceInput":{"type":"object","properties":{"contact_id":{"description":"Who is billed; default the deal party of party_role.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"party_role":{"anyOf":[{"type":"string","enum":["buyer","seller","tenant","landlord","developer","other"]},{"type":"null"}]},"lines":{"description":"Free lines (replace the deal’s).","anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":300},"sac":{"anyOf":[{"type":"string","pattern":"^99\\d{4}$"},{"type":"null"}]},"side":{"anyOf":[{"type":"string","enum":["buyer","seller","tenant","landlord"]},{"type":"null"}]},"taxable":{"$ref":"#/components/schemas/PaiseInput"}},"required":["description","taxable"]}},{"type":"null"}]},"bill_to":{"anyOf":[{"type":"object","properties":{"legal_name":{"type":"string","minLength":1,"maxLength":200},"gstin":{"anyOf":[{"description":"15-character GSTIN (validated with its check character).","type":"string","maxLength":32},{"type":"null"}]},"pan":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"state":{"anyOf":[{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN state code, e.g. KA."},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{5}$"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200,"format":"email"},{"type":"null"}]}}},{"type":"null"}]},"place_of_supply":{"description":"Set by hand; default by the rules.","anyOf":[{"type":"string","enum":["AN","AP","AR","AS","BR","CH","CG","DH","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LA","LD","MP","MH","MN","ML","MZ","NL","OD","PY","PB","RJ","SK","TN","TS","TR","UP","UK","WB"],"description":"ISO 3166-2:IN state code, e.g. KA."},{"type":"null"}]},"due_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},"UpdateKiosk":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"site_name":{"type":"string","minLength":1,"maxLength":80},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"settings":{"type":"object","properties":{"welcome_title":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"welcome_text":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"accent":{"anyOf":[{"type":"string","maxLength":7},{"type":"null"}]},"language":{"type":"string","enum":["en","hi","both"]},"otp":{"type":"string","enum":["required","optional","off"]},"ask_lead_type":{"type":"boolean"},"configurations":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}},"budget_bands":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40},"label":{"type":"string","maxLength":60},"min":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"max":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key"]}},"came_via":{"minItems":1,"type":"array","items":{"type":"string","enum":["walk_in","cp","ad","referral","other"]}},"ask_email":{"type":"boolean"},"ask_notes":{"type":"boolean"},"notify_member_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"default_owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"idle_reset_sec":{"type":"integer","minimum":30,"maximum":600}},"additionalProperties":false}}},"UpdateLandingPage":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{1,58}[a-z0-9])$"},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"form_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"domain_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"blocks":{"minItems":1,"maxItems":16,"type":"array","items":{"$ref":"#/components/schemas/LandingBlockInput"}},"theme":{"type":"object","properties":{"preset":{"type":"string","enum":["clean","bold","minimal"]},"appearance":{"type":"string","enum":["auto","light","dark"]},"accent":{"type":"string","enum":["brand","indigo","emerald","amber","rose","teal","slate"]},"corners":{"type":"string","enum":["soft","sharp","round"]}}},"settings":{"type":"object","properties":{"price_policy":{"type":"string","enum":["show","from","on_request"]}}},"seo":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":70},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"noindex":{"type":"boolean"},"image_media_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"tracking":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom","off"]},"meta_pixel_id":{"anyOf":[{"type":"string","pattern":"^\\d{10,20}$"},{"type":"null"}]},"ga4_id":{"anyOf":[{"type":"string","pattern":"^G-[A-Z0-9]{4,16}$"},{"type":"null"}]},"gtm_id":{"anyOf":[{"type":"string","pattern":"^GTM-[A-Z0-9]{4,12}$"},{"type":"null"}]},"google_ads_id":{"anyOf":[{"type":"string","pattern":"^AW-\\d{6,14}$"},{"type":"null"}]},"google_ads_label":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{4,64}$"},{"type":"null"}]}}},"experiment":{"anyOf":[{"$ref":"#/components/schemas/LandingExperiment2"},{"type":"null"}]}},"description":"Changes the draft; the live page changes when it is published."},"UpdateLeadInput":{"type":"object","properties":{"lead_type":{"$ref":"#/components/schemas/LeadType"},"temperature":{"anyOf":[{"$ref":"#/components/schemas/Temperature"},{"type":"null"}]},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"campaign_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sub_source":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"utm":{"anyOf":[{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":300}},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"expected_value":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"expected_close_on":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"requirement":{"$ref":"#/components/schemas/RequirementInput"},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"UpdateLeadSource":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"$ref":"#/components/schemas/LeadSourceType"},"provider":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_]{0,31}$"},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$","description":"Hex colour.","examples":["#6D5DFC"]},{"type":"null"}]},"monthly_cost":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"default_pipeline_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"assignment_rule_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"default_tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"default_lead_type":{"anyOf":[{"$ref":"#/components/schemas/LeadType"},{"type":"null"}]},"expected_every_hours":{"anyOf":[{"type":"integer","minimum":1,"maximum":720},{"type":"null"}]},"alarm_member_ids":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"allowed_ips":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}},"field_mapping":{"anyOf":[{"$ref":"#/components/schemas/FieldMapping"},{"type":"null"}]},"is_active":{"type":"boolean"}}},"UpdateMediaInput":{"type":"object","properties":{"caption":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"room_tag":{"anyOf":[{"$ref":"#/components/schemas/RoomTag"},{"type":"null"}]},"is_cover":{"description":"Makes this the cover (the previous cover is unset).","type":"boolean","const":true}}},"UpdateMemberInput":{"type":"object","properties":{"role_id":{"$ref":"#/components/schemas/Id"},"branch_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"reports_to_id":{"description":"Their manager; the reporting tree drives the team scope.","anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"designation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"employee_code":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"languages":{"maxItems":20,"type":"array","items":{"type":"string","enum":["en","hi","kn","ta","te","ml","mr","gu","bn","pa","or","ur","as","kok"]}},"specializations":{"maxItems":10,"type":"array","items":{"type":"string","enum":["resale","rentals","projects","commercial","plots"]}},"service_locality_ids":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"lead_capacity":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"shift":{"description":"Working hours for routing; null follows the company hours.","anyOf":[{"type":"object","properties":{"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$"}},"required":["days","start","end"]},{"type":"null"}]},"call_tracking_enabled":{"type":"boolean"}}},"UpdateOnboardingInput":{"type":"object","properties":{"dismissed":{"type":"boolean"}},"required":["dismissed"]},"UpdatePipelineInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"lead_types":{"minItems":1,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/LeadType"}},"is_default":{"type":"boolean"}},"description":"The default changes by making another pipeline the default."},"UpdatePipelineStatusInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"category":{"$ref":"#/components/schemas/StatusCategory"},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"is_default":{"type":"boolean"},"is_active":{"type":"boolean"},"sla_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":43200},{"type":"null"}]},"requirements":{"anyOf":[{"type":"object","properties":{"follow_up":{"$ref":"#/components/schemas/RequirementLevel"},"site_visit":{"$ref":"#/components/schemas/RequirementLevel"},"note":{"$ref":"#/components/schemas/RequirementLevel"},"deal":{"$ref":"#/components/schemas/RequirementLevel"},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}}},{"type":"null"}]}}},"UpdatePipelineSubStatusInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"requirements":{"anyOf":[{"type":"object","properties":{"follow_up":{"$ref":"#/components/schemas/RequirementLevel"},"site_visit":{"$ref":"#/components/schemas/RequirementLevel"},"note":{"$ref":"#/components/schemas/RequirementLevel"},"deal":{"$ref":"#/components/schemas/RequirementLevel"},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}}},{"type":"null"}]},"auto_follow_up_minutes":{"description":"Automatic retry call after this many minutes (working hours apply), e.g. RNR → 120.","anyOf":[{"type":"integer","minimum":1,"maximum":43200},{"type":"null"}]},"counts_as_contact":{"description":"false when no conversation happened (RNR, switched off).","type":"boolean"},"is_active":{"type":"boolean"}}},"UpdateProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"developer_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"is_own":{"type":"boolean"},"status":{"$ref":"#/components/schemas/ProjectStatus"},"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_types":{"maxItems":22,"type":"array","items":{"$ref":"#/components/schemas/PropertyType"}},"rera_numbers":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ReraNumber"}},"launch_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"locality_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"state":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","pattern":"^\\d{6}$"},{"type":"null"}]},"latitude":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"land_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"land_area_unit":{"anyOf":[{"$ref":"#/components/schemas/AreaUnit"},{"type":"null"}]},"open_area_pct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"towers_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":500},{"type":"null"}]},"units_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"floors_max":{"anyOf":[{"type":"integer","minimum":0,"maximum":250},{"type":"null"}]},"amenity_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"approvals":{"anyOf":[{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"boolean"}},{"type":"null"}]},"approved_banks":{"maxItems":40,"type":"array","items":{"type":"string","maxLength":60}},"usps":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"cp_brokerage_pct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"offers":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"video_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"virtual_tour_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"is_published":{"type":"boolean"}}},"UpdatePropertyInput":{"type":"object","properties":{"listing_type":{"$ref":"#/components/schemas/ListingType"},"category":{"$ref":"#/components/schemas/PropertyCategory"},"property_type":{"$ref":"#/components/schemas/PropertyType"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"owner_contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"owner":{"anyOf":[{"$ref":"#/components/schemas/PropertyOwnerInput"},{"type":"null"}]},"mandate":{"anyOf":[{"$ref":"#/components/schemas/MandateType"},{"type":"null"}]},"mandate_expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"owner_expected_price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"brokerage_from_owner":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"brokerage_from_client":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"key_with":{"anyOf":[{"type":"string","enum":["owner","agent","office","security","tenant","other"]},{"type":"null"}]},"visit_instructions":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"society_name":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"building":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"unit_no":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"floor":{"anyOf":[{"type":"integer","minimum":-5,"maximum":250},{"type":"null"}]},"total_floors":{"anyOf":[{"type":"integer","minimum":0,"maximum":250},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"locality_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"sub_locality":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"landmark":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"city":{"type":"string","maxLength":80},"state":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"pincode":{"anyOf":[{"type":"string","pattern":"^\\d{6}$"},{"type":"null"}]},"latitude":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"bedrooms":{"anyOf":[{"type":"integer","minimum":0,"maximum":50},{"type":"null"}]},"bathrooms":{"anyOf":[{"type":"integer","minimum":0,"maximum":50},{"type":"null"}]},"layout":{"anyOf":[{"$ref":"#/components/schemas/Layout"},{"type":"null"}]},"balconies":{"anyOf":[{"type":"integer","minimum":0,"maximum":20},{"type":"null"}]},"extra_rooms":{"maxItems":4,"type":"array","items":{"type":"string","enum":["study","servant","pooja","store"]}},"carpet_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"builtup_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"super_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"plot_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"plot_length":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"plot_breadth":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"road_width_ft":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000},{"type":"null"}]},"frontage_ft":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"facing":{"anyOf":[{"$ref":"#/components/schemas/Facing"},{"type":"null"}]},"is_corner":{"type":"boolean"},"overlooking":{"maxItems":5,"type":"array","items":{"type":"string","enum":["park","main_road","pool","club","garden"]}},"vastu_compliant":{"type":["boolean","null"]},"furnishing":{"anyOf":[{"$ref":"#/components/schemas/Furnishing"},{"type":"null"}]},"furnishing_items":{"maxItems":12,"type":"array","items":{"type":"string","enum":["ac","wardrobe","modular_kitchen","geyser","fridge","washing_machine","tv","beds","sofa","dining_table","microwave","water_purifier"]}},"possession_status":{"anyOf":[{"$ref":"#/components/schemas/PossessionStatus"},{"type":"null"}]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"year_built":{"anyOf":[{"type":"integer","minimum":1800,"maximum":2100},{"type":"null"}]},"transaction_type":{"anyOf":[{"$ref":"#/components/schemas/TransactionType"},{"type":"null"}]},"ownership":{"anyOf":[{"$ref":"#/components/schemas/Ownership"},{"type":"null"}]},"approvals":{"description":"State-aware approvals, e.g. { \"khata\": \"A\", \"oc\": true, \"authority\": \"BBMP\" }.","anyOf":[{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string","maxLength":60}]}},{"type":"null"}]},"rera_number":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"loan_banks":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":60}},"covered_parking":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"open_parking":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"two_wheeler_parking":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"amenity_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"water_supply":{"anyOf":[{"type":"string","enum":["corporation","borewell","both","tanker"]},{"type":"null"}]},"power_backup":{"anyOf":[{"type":"string","enum":["none","partial","full"]},{"type":"null"}]},"gated_community":{"type":["boolean","null"]},"price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"price_negotiable":{"type":"boolean"},"price_on_request":{"type":"boolean"},"all_inclusive":{"type":["boolean","null"]},"maintenance_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"maintenance_period":{"anyOf":[{"type":"string","enum":["monthly","quarterly","yearly","one_time"]},{"type":"null"}]},"token_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"rent_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"maintenance_included":{"type":["boolean","null"]},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"deposit_months":{"anyOf":[{"type":"number","minimum":0,"maximum":60},{"type":"null"}]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":240},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":24},{"type":"null"}]},"agreement_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":240},{"type":"null"}]},"escalation_pct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"rent_floor":{"description":"The lowest monthly rent the owner accepts (paise).","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"deposit_floor":{"description":"The lowest deposit the owner accepts (paise).","anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"lock_in_max_months":{"description":"The longest lock-in the owner accepts (months).","anyOf":[{"type":"integer","minimum":0,"maximum":120},{"type":"null"}]},"available_from":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"tenant_preferences":{"maxItems":5,"type":"array","items":{"type":"string","enum":["family","bachelor_male","bachelor_female","company","students"]}},"pets_allowed":{"type":["boolean","null"]},"non_veg_allowed":{"type":["boolean","null"]},"listed_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"co_broking":{"type":"boolean"},"network_visibility":{"type":"string","enum":["private","company","network","public"]},"is_featured":{"type":"boolean"},"expires_on":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{}}},"description":"Only the fields sent change; null clears a value."},"UpdateQrCode":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"target":{"$ref":"#/components/schemas/QrTargetInput"},"source_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"placement":{"$ref":"#/components/schemas/QrPlacement"},"sub_source":{"description":"The exact spot (\"ORR junction, facing the flyover\") → leads.sub_source.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"campaign_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"utm_campaign":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"utm_content":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"valid_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"valid_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"is_active":{"type":"boolean"}}},"UpdateQuickReplyInput":{"type":"object","properties":{"shortcut":{"description":"Typed after \"/\" in the composer; a leading \"/\" is dropped and letters are lower-cased.","type":"string"},"title":{"type":"string","minLength":1,"maxLength":80},"body":{"type":"string","minLength":1,"maxLength":4096}}},"UpdateRentalAgreementInput":{"type":"object","properties":{"property_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"owner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"maintenance_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"maintenance_period":{"anyOf":[{"$ref":"#/components/schemas/MaintenancePeriod"},{"type":"null"}]},"landlord_contact_id":{"$ref":"#/components/schemas/Id"},"tenant_contact_id":{"$ref":"#/components/schemas/Id"},"start_date":{"$ref":"#/components/schemas/LocalDate"},"end_date":{"$ref":"#/components/schemas/LocalDate"},"rent_amount":{"$ref":"#/components/schemas/PaiseInput"},"deposit_amount":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"escalation_pct":{"anyOf":[{"$ref":"#/components/schemas/DecimalInput"},{"type":"null"}]},"lock_in_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":120},{"type":"null"}]},"notice_months":{"anyOf":[{"type":"integer","minimum":0,"maximum":24},{"type":"null"}]},"rent_due_day":{"anyOf":[{"type":"integer","minimum":1,"maximum":28},{"type":"null"}]},"agreement_type":{"anyOf":[{"$ref":"#/components/schemas/AgreementType"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","renewed","terminated"]}}},"UpdateRoleInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"permissions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/PermissionValue"}},"description":"Resource → action → value, plus `fields` → field rule → mode (registry in docs/04 §4.2)."},"requires_two_factor":{"type":"boolean"}}},"UpdateSavedViewInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"visibility":{"$ref":"#/components/schemas/SavedViewVisibility"},"filters":{"anyOf":[{"$ref":"#/components/schemas/FilterNode"},{"type":"null"}]},"columns":{"anyOf":[{"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]},"sort":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"layout":{"$ref":"#/components/schemas/SavedViewLayout"},"is_pinned":{"type":"boolean"}}},"UpdateSecurityPolicyInput":{"type":"object","properties":{"two_factor_role_ids":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Id"},"description":"Every role that must use two-step verification (Owner and Admin are always included)."}},"required":["two_factor_role_ids"]},"UpdateSequenceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"steps":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/SequenceStepInput"}},"entry":{"anyOf":[{"$ref":"#/components/schemas/SequenceEntryRule"},{"type":"null"}]},"settings":{"type":"object","properties":{"pause_on":{"type":"object","properties":{"reply":{"type":"boolean"},"call":{"type":"boolean"},"visit":{"type":"boolean"}}}}}}},"UpdateSiteSettings":{"type":"object","properties":{"tracking":{"type":"object","properties":{"meta_pixel_id":{"anyOf":[{"type":"string","pattern":"^\\d{10,20}$"},{"type":"null"}]},"ga4_id":{"anyOf":[{"type":"string","pattern":"^G-[A-Z0-9]{4,16}$"},{"type":"null"}]},"gtm_id":{"anyOf":[{"type":"string","pattern":"^GTM-[A-Z0-9]{4,12}$"},{"type":"null"}]},"google_ads_id":{"anyOf":[{"type":"string","pattern":"^AW-\\d{6,14}$"},{"type":"null"}]},"google_ads_label":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{4,64}$"},{"type":"null"}]}}},"forms_tracking":{"type":"boolean"},"consent":{"type":"object","properties":{"banner_text":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}]},"privacy_url":{"anyOf":[{"type":"string","maxLength":300,"pattern":"^(?:https:\\/\\/\\S+)?$"},{"type":"null"}]}}},"microsites":{"type":"object","properties":{"form_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"theme":{"anyOf":[{"type":"object","properties":{"preset":{"default":"clean","type":"string","enum":["clean","bold","minimal"]},"appearance":{"default":"auto","type":"string","enum":["auto","light","dark"]},"accent":{"default":"brand","type":"string","enum":["brand","indigo","emerald","amber","rose","teal","slate"]},"corners":{"default":"soft","type":"string","enum":["soft","sharp","round"]}}},{"type":"null"}]}}}}},"UpdateSiteVisitInput":{"type":"object","properties":{"agent_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"presales_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"stops":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/SiteVisitStopInput"}},"meeting_point":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"pickup":{"anyOf":[{"type":"object","properties":{"address":{"type":"string","minLength":3,"maxLength":300},"at":{"anyOf":[{"type":"string","minLength":10,"maxLength":40},{"type":"null"}]}},"required":["address"]},{"type":"null"}]},"duration_min":{"type":"integer","minimum":15,"maximum":480},"partner_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}}},"UpdateTaskInput":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/TaskType"},"title":{"type":"string","minLength":1,"maxLength":160},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"due_at":{"type":"string","minLength":10,"maxLength":40},"remind_at":{"anyOf":[{"type":"string","minLength":10,"maxLength":40},{"type":"null"}]},"priority":{"$ref":"#/components/schemas/TaskPriority"},"assignee_id":{"$ref":"#/components/schemas/Id"},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"contact_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"recurrence":{"anyOf":[{"$ref":"#/components/schemas/TaskRecurrenceInput"},{"type":"null"}]}}},"UpdateTeamInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"team_lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"member_ids":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Id"}}}},"UpdateTemplateInput":{"type":"object","properties":{"display_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"category":{"type":"string","minLength":1,"maxLength":24},"use_case":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"header":{"description":"email: { type: \"email\", subject, text? } · WhatsApp: { type, text? }"},"body":{"type":"string","minLength":1,"maxLength":200000},"footer":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"buttons":{},"variables":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/TemplateVariableInput"}},"dlt_template_id":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}]},"dlt_header":{"anyOf":[{"type":"string","maxLength":11},{"type":"null"}]},"provider_template_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"channel_account_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"status":{"type":"string","enum":["approved","paused","disabled"]}}},"UpdateTowerInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"floors":{"type":"integer","minimum":0,"maximum":200},"basement_levels":{"anyOf":[{"type":"integer","minimum":0,"maximum":10},{"type":"null"}]},"units_per_floor":{"anyOf":[{"type":"integer","minimum":1,"maximum":50},{"type":"null"}]},"stage":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"possession_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"sort_order":{"type":"integer","minimum":0,"maximum":1000}}},"UpdateUnitInput":{"type":"object","properties":{"unit_no":{"type":"string","minLength":1,"maxLength":30},"floor":{"anyOf":[{"type":"integer","minimum":-10,"maximum":200},{"type":"null"}]},"stack":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"configuration_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"property_type":{"$ref":"#/components/schemas/PropertyType"},"bhk":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}]},"carpet_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"builtup_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"super_area":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"area_unit":{"$ref":"#/components/schemas/AreaUnit"},"facing":{"anyOf":[{"$ref":"#/components/schemas/Facing"},{"type":"null"}]},"view":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"is_corner":{"type":"boolean"},"base_rate":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"floor_rise":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]},"total_price":{"anyOf":[{"$ref":"#/components/schemas/PaiseInput"},{"type":"null"}]}}},"UpdateWalkInPolicy":{"type":"object","properties":{"cp_lock_days":{"type":"integer","minimum":7,"maximum":365},"consent_text":{"type":"string","minLength":20,"maxLength":1000},"verify_later":{"type":"boolean"}}},"UpdateWalletInput":{"type":"object","properties":{"low_balance_alert":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}],"description":"Alert below this many units (paise or credits); null switches the alert off."}},"required":["low_balance_alert"]},"VerificationChecklistItem":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$","description":"Stable item key (stored on each photo)."},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"type":"boolean"},"hint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["key","label","required"],"additionalProperties":false},"VerificationChecklistItemInput":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$","description":"Stable item key (stored on each photo)."},"label":{"type":"string","minLength":1,"maxLength":80},"required":{"type":"boolean"},"hint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["key","label","required"]},"VerificationDecisionInput":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]},"note":{"description":"Required to reject.","anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"acknowledge_flags":{"description":"The reviewer checked the points flagged for review (needed when the visit is `review`).","type":"boolean"}},"required":["decision"]},"VerificationDocument":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string"},"kind_label":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"filename":{"type":["string","null"]},"content_type":{"type":"string"},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"uploaded_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"uploaded_at":{"$ref":"#/components/schemas/DateTime"},"name_match":{"anyOf":[{"type":"string","enum":["match","partial","mismatch"]},{"type":"null"}]},"address_match":{"anyOf":[{"type":"string","enum":["match","partial","mismatch"]},{"type":"null"}]},"document_date":{"anyOf":[{"$ref":"#/components/schemas/LocalDate"},{"type":"null"}]},"note":{"type":["string","null"]},"reviewed_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"reviewed_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"scan_status":{"description":"Malware scan: pending · clean · infected · not_scanned · failed.","type":["string","null"]}},"required":["id","kind","kind_label","status","filename","content_type","size_bytes","uploaded_by","uploaded_at","name_match","address_match","document_date","note","reviewed_by","reviewed_at","scan_status"],"additionalProperties":false},"VerificationDocumentUploadInput":{"type":"object","properties":{"kind":{"type":"string","enum":["sale_deed","index_ii","property_tax","electricity_bill","society_noc","authority_letter","other"]},"filename":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","filename","content_type","size"]},"VerificationFlag":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["fail","review","info"]},"text":{"type":"string"}},"required":["code","severity","text"],"additionalProperties":false},"VerificationPhoto":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"slot":{"type":"string"},"status":{"type":"string","enum":["processing","ready","failed"]},"failure":{"type":["string","null"]},"preview_url":{"description":"Short-lived signed URL of an EXIF-free copy; the original is never served.","type":["string","null"]},"preview_expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"captured_at":{"description":"Reconciled capture time (server clock).","$ref":"#/components/schemas/DateTime"},"captured_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"uploaded_at":{"$ref":"#/components/schemas/DateTime"},"time_source":{"type":"string","description":"monotonic · device · server"},"device":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"accuracy_m":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["lat","lng","accuracy_m"],"additionalProperties":false},{"type":"null"}],"description":"The phone’s fix; ~110 m grid unless the address is visible."},"device_fix_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"exif":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"accuracy_m":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["lat","lng","accuracy_m"],"additionalProperties":false},{"type":"null"}],"description":"The photo’s own GPS tag, when it had one."},"exif_taken_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"exif_time_source":{"type":["string","null"]},"distance_m":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"result":{"anyOf":[{"type":"string","enum":["pending","pass","review","fail"]},{"type":"null"}]},"flags":{"type":"array","items":{"$ref":"#/components/schemas/VerificationFlag"}}},"required":["id","slot","status","failure","preview_url","preview_expires_at","width","height","captured_at","captured_by","uploaded_at","time_source","device","device_fix_at","exif","exif_taken_at","exif_time_source","distance_m","result","flags"],"additionalProperties":false},"VerificationPhotoUploadInput":{"type":"object","properties":{"slot":{"type":"string","minLength":1,"maxLength":32},"content_type":{"type":"string","minLength":3,"maxLength":120},"size":{"type":"integer","minimum":1,"maximum":9007199254740991},"filename":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]}},"required":["slot","content_type","size"]},"VerificationReason":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["fail","review","info"]},"slot":{"type":["string","null"]},"photo_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"text":{"type":"string"}},"required":["code","severity","slot","photo_id","text"],"additionalProperties":false},"VerificationStatus":{"type":"string","enum":["draft","submitted","verified","rejected","cancelled","expired","revoked","invalidated","superseded"],"description":"draft · submitted · verified (the badge) · rejected · cancelled · expired · revoked · invalidated · superseded"},"VerifySiteVisitOtpInput":{"type":"object","properties":{"code":{"type":"string","minLength":4,"maxLength":12}},"required":["code"]},"VerifyVisitOtpResult":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/VisitOtpVerdict"},"visit":{"$ref":"#/components/schemas/SiteVisit"}},"required":["result","visit"],"additionalProperties":false},"ViewCountQuery":{"type":"object","properties":{"view":{"$ref":"#/components/schemas/LeadView"},"filter":{"$ref":"#/components/schemas/FilterNode"},"q":{"type":"string","minLength":1,"maxLength":100}}},"ViewCountsInput":{"type":"object","properties":{"entity":{"type":"string","const":"leads"},"queries":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"additionalProperties":{"$ref":"#/components/schemas/ViewCountQuery"}}},"required":["entity","queries"]},"VisitCheckInResult":{"type":"object","properties":{"visit":{"$ref":"#/components/schemas/SiteVisit"},"warnings":{"type":"array","items":{"type":"string","enum":["far_from_site","mock_location","low_accuracy","no_site_location","early","late"]}},"distance_m":{"type":["number","null"]},"replayed":{"type":"boolean"},"otp":{"anyOf":[{"$ref":"#/components/schemas/VisitOtpVerdict"},{"type":"null"}]}},"required":["visit","warnings","distance_m","replayed","otp"],"additionalProperties":false},"VisitCheckOutResult":{"type":"object","properties":{"visit":{"$ref":"#/components/schemas/SiteVisit"},"replayed":{"type":"boolean"},"distance_m":{"type":["number","null"]}},"required":["visit","replayed","distance_m"],"additionalProperties":false},"VisitFeedbackReason":{"type":"string","enum":["price","location","size","layout","condition","floor","view","amenities","possession","builder","parking","vastu","connectivity","other"]},"VisitFunnelReport":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"date_type":{"type":"string","enum":["received_at","status_changed_at","last_activity_at","created_at"]},"group":{"type":"string","enum":["owner","presales"]},"totals":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"visit_scheduled":{"type":"integer","minimum":0,"maximum":9007199254740991},"visit_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"visit_no_show":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_interested_after_visit":{"type":"integer","minimum":0,"maximum":9007199254740991},"dropped_after_visit":{"type":"integer","minimum":0,"maximum":9007199254740991},"booked_after_visit":{"type":"integer","minimum":0,"maximum":9007199254740991},"meeting_scheduled":{"type":"integer","minimum":0,"maximum":9007199254740991},"meeting_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"visit_rate":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"booked_rate":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]}},"required":["total","visit_scheduled","visit_done","visit_no_show","not_interested_after_visit","dropped_after_visit","booked_after_visit","meeting_scheduled","meeting_done","visit_rate","booked_rate"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"visit_scheduled":{"type":"integer","minimum":0,"maximum":9007199254740991},"visit_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"visit_no_show":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_interested_after_visit":{"type":"integer","minimum":0,"maximum":9007199254740991},"dropped_after_visit":{"type":"integer","minimum":0,"maximum":9007199254740991},"booked_after_visit":{"type":"integer","minimum":0,"maximum":9007199254740991},"meeting_scheduled":{"type":"integer","minimum":0,"maximum":9007199254740991},"meeting_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"visit_rate":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"booked_rate":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]}},"required":["member_id","name","total","visit_scheduled","visit_done","visit_no_show","not_interested_after_visit","dropped_after_visit","booked_after_visit","meeting_scheduled","meeting_done","visit_rate","booked_rate"],"additionalProperties":false}}},"required":["range","date_type","group","totals","rows"],"additionalProperties":false},"VisitNextStep":{"type":"string","enum":["negotiation","revisit","show_more","follow_up","not_interested"]},"VisitNoShowResult":{"type":"object","properties":{"visit":{"$ref":"#/components/schemas/SiteVisit"},"offer":{"type":"object","properties":{"status":{"type":"string","enum":["queued","blocked","skipped"]},"channel":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["status","channel","reason"],"additionalProperties":false}},"required":["visit","offer"],"additionalProperties":false},"VisitOtpVerdict":{"type":"object","properties":{"verified":{"type":"boolean"},"reason":{"type":"string","enum":["invalid","expired","locked","no_code"]},"attempts_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["verified"],"additionalProperties":false},"VisitPhotoUpload":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"$ref":"#/components/schemas/DateTime"},"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","url","method","headers","expires_at","max_bytes"],"additionalProperties":false},"VisitReaction":{"type":"string","enum":["liked","maybe","disliked"]},"VisitResult":{"type":"string","enum":["fail","incomplete","pending","review","pass"],"description":"fail (retake photos) · incomplete · pending (photos being checked) · review · pass"},"VisitsReport":{"type":"object","properties":{"range":{"$ref":"#/components/schemas/ReportRange"},"totals":{"type":"object","properties":{"scheduled":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"verified":{"type":"integer","minimum":0,"maximum":9007199254740991},"no_show":{"type":"integer","minimum":0,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"revisits":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_with_deal":{"type":"integer","minimum":0,"maximum":9007199254740991},"no_show_rate":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"verified_rate":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]},"visit_to_deal_pct":{"description":"Percent with one decimal (0–100); null without a base.","type":["number","null"]}},"required":["scheduled","completed","verified","no_show","cancelled","pending","first_visits","revisits","leads_visited","leads_with_deal","no_show_rate","verified_rate","visit_to_deal_pct"],"additionalProperties":false},"by_agent":{"type":"array","items":{"type":"object","properties":{"member_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"scheduled":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"verified":{"type":"integer","minimum":0,"maximum":9007199254740991},"no_show":{"type":"integer","minimum":0,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"revisits":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_with_deal":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["member_id","name","scheduled","completed","verified","no_show","cancelled","pending","first_visits","revisits","leads_visited","leads_with_deal"],"additionalProperties":false}},"by_project":{"type":"array","items":{"type":"object","properties":{"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"scheduled":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"verified":{"type":"integer","minimum":0,"maximum":9007199254740991},"no_show":{"type":"integer","minimum":0,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_visits":{"type":"integer","minimum":0,"maximum":9007199254740991},"revisits":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_visited":{"type":"integer","minimum":0,"maximum":9007199254740991},"leads_with_deal":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["project_id","name","scheduled","completed","verified","no_show","cancelled","pending","first_visits","revisits","leads_visited","leads_with_deal"],"additionalProperties":false}},"by_day":{"type":"array","items":{"type":"object","properties":{"day":{"$ref":"#/components/schemas/LocalDate"},"scheduled":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"no_show":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["day","scheduled","completed","no_show"],"additionalProperties":false}}},"required":["range","totals","by_agent","by_project","by_day"],"additionalProperties":false},"VoiceAgentSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"number_ids":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"voice":{"type":"string","enum":["female_warm","female_crisp","male_calm","male_bright"]},"languages":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["en","hi","hinglish"]}},"default_language":{"type":"string","enum":["en","hi","hinglish"]},"calling_hours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"additionalProperties":false,"description":"Inside 09:00–21:00 (TRAI)."},"max_call_minutes":{"type":"integer","minimum":1,"maximum":15},"daily_cap":{"type":"integer","minimum":0,"maximum":5000,"description":"Calls dialled per company day (0: no limit)."},"transfer":{"type":"object","properties":{"enabled":{"type":"boolean"},"member_ids":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"ring_timeout_sec":{"type":"integer","minimum":10,"maximum":60}},"required":["enabled","member_ids","ring_timeout_sec"],"additionalProperties":false},"visit_confirmation":{"type":"object","properties":{"lead_hours":{"type":"integer","minimum":2,"maximum":48},"same_day_hours":{"type":"integer","minimum":1,"maximum":6}},"required":["lead_hours","same_day_hours"],"additionalProperties":false},"feedback_delay_minutes":{"type":"integer","minimum":30,"maximum":1440},"kinds":{"type":"object","properties":{"new_enquiry":{"type":"object","properties":{"enabled":{"type":"boolean"},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_minutes":{"type":"integer","minimum":5,"maximum":1440},"script":{"type":"string","maxLength":1000,"description":"Tone and questions for the agent — never prices or dates."}},"required":["enabled","max_attempts","retry_minutes","script"],"additionalProperties":false},"missed_call":{"type":"object","properties":{"enabled":{"type":"boolean"},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_minutes":{"type":"integer","minimum":5,"maximum":1440},"script":{"type":"string","maxLength":1000,"description":"Tone and questions for the agent — never prices or dates."}},"required":["enabled","max_attempts","retry_minutes","script"],"additionalProperties":false},"visit_confirmation":{"type":"object","properties":{"enabled":{"type":"boolean"},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_minutes":{"type":"integer","minimum":5,"maximum":1440},"script":{"type":"string","maxLength":1000,"description":"Tone and questions for the agent — never prices or dates."}},"required":["enabled","max_attempts","retry_minutes","script"],"additionalProperties":false},"visit_feedback":{"type":"object","properties":{"enabled":{"type":"boolean"},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_minutes":{"type":"integer","minimum":5,"maximum":1440},"script":{"type":"string","maxLength":1000,"description":"Tone and questions for the agent — never prices or dates."}},"required":["enabled","max_attempts","retry_minutes","script"],"additionalProperties":false}},"required":["new_enquiry","missed_call","visit_confirmation","visit_feedback"],"additionalProperties":false}},"required":["enabled","number_ids","voice","languages","default_language","calling_hours","max_call_minutes","daily_cap","transfer","visit_confirmation","feedback_delay_minutes","kinds"],"additionalProperties":false},"VoiceAgentSettingsInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"number_ids":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"voice":{"type":"string","enum":["female_warm","female_crisp","male_calm","male_bright"]},"languages":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["en","hi","hinglish"]}},"default_language":{"type":"string","enum":["en","hi","hinglish"]},"calling_hours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Inside 09:00–21:00 (TRAI)."},"max_call_minutes":{"type":"integer","minimum":1,"maximum":15},"daily_cap":{"type":"integer","minimum":0,"maximum":5000,"description":"Calls dialled per company day (0: no limit)."},"transfer":{"type":"object","properties":{"enabled":{"type":"boolean"},"member_ids":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Id"}},"ring_timeout_sec":{"type":"integer","minimum":10,"maximum":60}},"required":["enabled","member_ids","ring_timeout_sec"]},"visit_confirmation":{"type":"object","properties":{"lead_hours":{"type":"integer","minimum":2,"maximum":48},"same_day_hours":{"type":"integer","minimum":1,"maximum":6}},"required":["lead_hours","same_day_hours"]},"feedback_delay_minutes":{"type":"integer","minimum":30,"maximum":1440},"kinds":{"type":"object","properties":{"new_enquiry":{"type":"object","properties":{"enabled":{"type":"boolean"},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_minutes":{"type":"integer","minimum":5,"maximum":1440},"script":{"type":"string","maxLength":1000,"description":"Tone and questions for the agent — never prices or dates."}},"required":["enabled","max_attempts","retry_minutes","script"]},"missed_call":{"type":"object","properties":{"enabled":{"type":"boolean"},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_minutes":{"type":"integer","minimum":5,"maximum":1440},"script":{"type":"string","maxLength":1000,"description":"Tone and questions for the agent — never prices or dates."}},"required":["enabled","max_attempts","retry_minutes","script"]},"visit_confirmation":{"type":"object","properties":{"enabled":{"type":"boolean"},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_minutes":{"type":"integer","minimum":5,"maximum":1440},"script":{"type":"string","maxLength":1000,"description":"Tone and questions for the agent — never prices or dates."}},"required":["enabled","max_attempts","retry_minutes","script"]},"visit_feedback":{"type":"object","properties":{"enabled":{"type":"boolean"},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_minutes":{"type":"integer","minimum":5,"maximum":1440},"script":{"type":"string","maxLength":1000,"description":"Tone and questions for the agent — never prices or dates."}},"required":["enabled","max_attempts","retry_minutes","script"]}},"required":["new_enquiry","missed_call","visit_confirmation","visit_feedback"]}},"required":["enabled","number_ids","voice","languages","default_language","calling_hours","max_call_minutes","daily_cap","transfer","visit_confirmation","feedback_delay_minutes","kinds"]},"VoiceAgentSettingsView":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/VoiceAgentSettings"},"numbers":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"e164":{"$ref":"#/components/schemas/PhoneE164"},"label":{"type":["string","null"]},"a2p":{"type":"string","enum":["declared","pending","rejected","expired","revoked","none"]},"voice_ready":{"type":"boolean","description":"A live A2P declaration that lists AI voice calls."}},"required":["id","e164","label","a2p","voice_ready"],"additionalProperties":false}},"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"has_phone":{"type":"boolean"}},"required":["id","name","has_phone"],"additionalProperties":false}},"provider":{"type":"object","properties":{"configured":{"type":"boolean"},"key":{"type":["string","null"]}},"required":["configured","key"],"additionalProperties":false}},"required":["settings","numbers","members","provider"],"additionalProperties":false},"VoiceCall":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["new_enquiry","missed_call","visit_confirmation","visit_feedback"]},"status":{"type":"string","enum":["scheduled","dialing","live","completed","failed","blocked","cancelled"]},"outcome":{"anyOf":[{"type":"string","enum":["visit_booked","visit_confirmed","visit_reschedule","visit_cancel","feedback_given","qualified","transferred","callback_requested","not_interested","opted_out","wrong_number","no_answer","busy","voicemail","failed"]},{"type":"null"}]},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"contact_id":{"$ref":"#/components/schemas/Id"},"visit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"source":{"type":"string","enum":["event","member"]},"requested_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"due_at":{"$ref":"#/components/schemas/DateTime"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"language":{"anyOf":[{"type":"string","enum":["en","hi","hinglish"]},{"type":"null"}]},"caller_e164":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"basis":{"description":"service | consent | enquiry_grant | enquiry_window","type":["string","null"]},"call_log_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"block_reason":{"type":["string","null"]},"block_detail":{"type":["string","null"]},"summary":{"type":["string","null"]},"callback_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Seconds from the trigger to the first dial."},"transfer":{"anyOf":[{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"status":{"type":["string","null"]}},"required":["member_id","status"],"additionalProperties":false},{"type":"null"}]},"talk_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"voice_credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_paise":{"$ref":"#/components/schemas/Paise"},"answered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","status","outcome","lead","contact_id","visit_id","source","requested_by_id","due_at","attempts","max_attempts","language","caller_e164","basis","call_log_id","block_reason","block_detail","summary","callback_sec","transfer","talk_sec","voice_credits","cost_paise","answered_at","ended_at","created_at"],"additionalProperties":false},"VoiceCallDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["new_enquiry","missed_call","visit_confirmation","visit_feedback"]},"status":{"type":"string","enum":["scheduled","dialing","live","completed","failed","blocked","cancelled"]},"outcome":{"anyOf":[{"type":"string","enum":["visit_booked","visit_confirmed","visit_reschedule","visit_cancel","feedback_given","qualified","transferred","callback_requested","not_interested","opted_out","wrong_number","no_answer","busy","voicemail","failed"]},{"type":"null"}]},"lead":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"contact_id":{"$ref":"#/components/schemas/Id"},"visit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"source":{"type":"string","enum":["event","member"]},"requested_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"due_at":{"$ref":"#/components/schemas/DateTime"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"language":{"anyOf":[{"type":"string","enum":["en","hi","hinglish"]},{"type":"null"}]},"caller_e164":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"basis":{"description":"service | consent | enquiry_grant | enquiry_window","type":["string","null"]},"call_log_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"block_reason":{"type":["string","null"]},"block_detail":{"type":["string","null"]},"summary":{"type":["string","null"]},"callback_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Seconds from the trigger to the first dial."},"transfer":{"anyOf":[{"type":"object","properties":{"member_id":{"$ref":"#/components/schemas/Id"},"status":{"type":["string","null"]}},"required":["member_id","status"],"additionalProperties":false},{"type":"null"}]},"talk_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"voice_credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_paise":{"$ref":"#/components/schemas/Paise"},"answered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"ended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"turns":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["agent","customer","member"]},"text":{"type":"string"},"at_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"overrides":{"type":"array","items":{"type":"string"},"description":"Where the product changed the model’s line or action."}},"required":["role","text","at_ms","overrides"],"additionalProperties":false}},"facts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","kind","status","outcome","lead","contact_id","visit_id","source","requested_by_id","due_at","attempts","max_attempts","language","caller_e164","basis","call_log_id","block_reason","block_detail","summary","callback_sec","transfer","talk_sec","voice_credits","cost_paise","answered_at","ended_at","created_at","turns","facts"],"additionalProperties":false},"VoiceDebrief":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"lead_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"call_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"member":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"status":{"type":"string","enum":["uploaded","transcribing","extracting","ready","applied","discarded","failed"]},"problem":{"type":["string","null"]},"problem_message":{"type":["string","null"]},"audio":{"type":"object","properties":{"seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"available":{"type":"boolean"}},"required":["seconds","available"],"additionalProperties":false},"transcript":{"type":["string","null"]},"transcript_source":{"type":["string","null"]},"language":{"type":["string","null"]},"proposal":{"anyOf":[{"$ref":"#/components/schemas/VoiceDebriefProposal"},{"type":"null"}]},"proposal_version":{"type":"integer","minimum":0,"maximum":9007199254740991},"findings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":["string","null"]}},"required":["code","message","path"],"additionalProperties":false}},"applied":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"applied_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"activity_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"recorded_at":{"$ref":"#/components/schemas/DateTime"},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"mine":{"type":"boolean"},"can_apply":{"type":"boolean"}},"required":["id","lead_id","call_id","member","status","problem","problem_message","audio","transcript","transcript_source","language","proposal","proposal_version","findings","applied","applied_at","activity_id","recorded_at","created_at","updated_at","mine","can_apply"],"additionalProperties":false},"VoiceDebriefApplyInput":{"type":"object","properties":{"proposal_version":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The version reviewed: a newer proposal answers 409."},"note":{"type":"string","maxLength":4000},"status":{"anyOf":[{"type":"object","properties":{"status_id":{"$ref":"#/components/schemas/Id"},"sub_status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["status_id","sub_status_id"]},{"type":"null"}]},"follow_up_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"requirement_keys":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}},"tasks":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"due_at":{"$ref":"#/components/schemas/DateTime"},"type":{"anyOf":[{"type":"string","enum":["call","follow_up","whatsapp","site_visit","meeting","document","other"]},{"type":"null"}]}},"required":["title","due_at"]}},"temperature":{"anyOf":[{"type":"string","enum":["hot","warm","cold"]},{"type":"null"}]}},"required":["proposal_version","note","status","follow_up_at","requirement_keys","tasks","temperature"]},"VoiceDebriefInput":{"type":"object","properties":{"client_key":{"type":"string","minLength":8,"maxLength":80,"description":"The phone’s key: a replay registers it once."},"lead_id":{"$ref":"#/components/schemas/Id"},"call_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"key":{"type":"string","minLength":10,"maxLength":300},"seconds":{"anyOf":[{"type":"number","minimum":0,"maximum":600},{"type":"null"}]},"recorded_at":{"$ref":"#/components/schemas/DateTime"}},"required":["client_key","lead_id","key","recorded_at"]},"VoiceDebriefProposal":{"type":"object","properties":{"v":{"type":"number","const":1},"language":{"type":["string","null"]},"note":{"type":"string"},"status":{"anyOf":[{"type":"object","properties":{"status_id":{"$ref":"#/components/schemas/Id"},"sub_status_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"name":{"type":"string"},"sub_name":{"type":["string","null"]},"reason":{"type":["string","null"]},"evidence":{"type":["string","null"]},"gated":{"type":"boolean","description":"Needs an approval: shown, never applied from the debrief."},"gate_reason":{"type":["string","null"]},"needs":{"type":"array","items":{"type":"string"},"description":"What it asks for that a debrief cannot give (site_visit …)."},"follow_up":{"anyOf":[{"type":"string","enum":["required","optional"]},{"type":"null"}]},"note":{"anyOf":[{"type":"string","enum":["required","optional"]},{"type":"null"}]}},"required":["status_id","sub_status_id","name","sub_name","reason","evidence","gated","gate_reason","needs","follow_up","note"],"additionalProperties":false},{"type":"null"}]},"follow_up":{"anyOf":[{"type":"object","properties":{"at":{"$ref":"#/components/schemas/DateTime"},"date":{"$ref":"#/components/schemas/LocalDate"},"time":{"type":"string"},"title":{"type":["string","null"]},"evidence":{"type":["string","null"]}},"required":["at","date","time","title","evidence"],"additionalProperties":false},{"type":"null"}]},"requirement":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"current":{"type":["string","null"]},"proposed":{"type":"string"},"evidence":{"type":["string","null"]},"conflict":{"type":"boolean"},"suggested":{"type":"boolean"}},"required":["key","label","current","proposed","evidence","conflict","suggested"],"additionalProperties":false}},"tasks":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"type":{"type":"string","enum":["call","follow_up","whatsapp","site_visit","meeting","document","other"]},"due_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"evidence":{"type":["string","null"]}},"required":["key","title","type","due_at","evidence"],"additionalProperties":false}},"hot_signals":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"evidence":{"type":["string","null"]}},"required":["text","evidence"],"additionalProperties":false}},"temperature":{"anyOf":[{"type":"string","enum":["hot","warm","cold"]},{"type":"null"}]}},"required":["v","language","note","status","follow_up","requirement","tasks","hot_signals","temperature"],"additionalProperties":false,"description":"Every part cites the transcript words it came from (evidence)."},"VoiceSettings":{"type":"object","properties":{"debriefs":{"type":"boolean"},"transcribe_call_recordings":{"type":"boolean","description":"Metered on the AI wallet; off by default."},"summarize_calls":{"type":"boolean"},"language":{"type":"string","enum":["auto","en-IN","hi-IN","bn-IN","gu-IN","kn-IN","ml-IN","mr-IN","od-IN","pa-IN","ta-IN","te-IN"]},"debrief_max_seconds":{"type":"integer","minimum":30,"maximum":300},"transcription_available":{"type":"boolean"}},"required":["debriefs","transcribe_call_recordings","summarize_calls","language","debrief_max_seconds","transcription_available"],"additionalProperties":false},"VoiceStats":{"type":"object","properties":{"today":{"type":"object","properties":{"dialled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirmed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"transferred":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"talk_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"voice_credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["dialled","connected","booked","confirmed","transferred","opted_out","talk_sec","voice_credits"],"additionalProperties":false},"callback":{"type":"object","properties":{"median_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"within_60s_pct":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["median_sec","within_60s_pct","count"],"additionalProperties":false},"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"live":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["today","callback","waiting","live"],"additionalProperties":false},"WaiveDeductionInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"]},"WalkIn":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"token":{"type":"string"},"token_no":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"token_reassigned":{"type":"boolean"},"status":{"type":"string","enum":["waiting","with_agent","done","left"]},"came_via":{"type":"string"},"came_via_note":{"type":["string","null"]},"verification":{"type":"string"},"captured_at":{"$ref":"#/components/schemas/DateTime"},"synced_at":{"$ref":"#/components/schemas/DateTime"},"captured_offline":{"type":"boolean"},"synced_late":{"type":"boolean"},"attended_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"done_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"left_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"wait_min":{"type":"integer","minimum":0,"maximum":9007199254740991},"service_min":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"repeat_visitor":{"type":"boolean"},"outcome":{"type":["string","null"]},"visitor":{"type":"string"},"lead":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"ref":{"type":"string"},"owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","ref","owner"],"additionalProperties":false},{"type":"null"}]},"kiosk":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"site_name":{"type":"string"}},"required":["id","name","site_name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"attended_by":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"partner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"firm_name":{"type":"string"},"claim_status":{"type":["string","null"]},"claim_note":{"type":["string","null"]}},"required":["id","firm_name","claim_status","claim_note"],"additionalProperties":false},{"type":"null"}]},"answers":{"type":"object","properties":{"lead_type":{"type":["string","null"]},"configurations":{"type":"array","items":{"type":"string"}},"budget":{"type":["string","null"]}},"required":["lead_type","configurations","budget"],"additionalProperties":false},"site_visit_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"actions":{"type":"array","items":{"type":"string","enum":["attend","done","left","requeue"]}},"can_start_visit":{"type":"boolean"}},"required":["id","token","token_no","token_reassigned","status","came_via","came_via_note","verification","captured_at","synced_at","captured_offline","synced_late","attended_at","done_at","left_at","wait_min","service_min","repeat_visitor","outcome","visitor","lead","kiosk","project","attended_by","partner","answers","site_visit_id","actions","can_start_visit"],"additionalProperties":false},"WalkInPolicy":{"type":"object","properties":{"cp_lock_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Channel-partner client-registration lock window."},"consent_text":{"type":"string"},"consent_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped whenever the text changes."},"verify_later":{"type":"boolean","description":"Offline captures get a “confirm it’s you” link."}},"required":["cp_lock_days","consent_text","consent_version","verify_later"],"additionalProperties":false},"WalkInQueue":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/LocalDate"},"summary":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"with_agent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avg_wait_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"longest_wait_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avg_service_min":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["total","waiting","with_agent","done","left","avg_wait_min","longest_wait_min","avg_service_min"],"additionalProperties":false},"items":{"type":"array","items":{"$ref":"#/components/schemas/WalkIn"}},"sites":{"type":"array","items":{"type":"object","properties":{"kiosk_id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"site_name":{"type":"string"},"project_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]}},"required":["kiosk_id","name","site_name","project_id"],"additionalProperties":false}}},"required":["date","summary","items","sites"],"additionalProperties":false},"Wallet":{"type":"object","properties":{"kind":{"type":"string","enum":["sms","whatsapp","ai","voice","email"]},"unit":{"type":"string","enum":["paise","credits"],"description":"Messaging wallets count paise, the AI wallet credits."},"exists":{"type":"boolean"},"balance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"low_balance_alert":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"low_balance":{"type":"boolean"},"disabled":{"type":"boolean"},"updated_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"allowance":{"anyOf":[{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Credits each allowance period brings (wallet units)."},"per_user":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The per-user part of it; 0 for a flat allowance."},"seats":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trial":{"type":"boolean","description":"The trial’s one-time allowance."},"next_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"When the next period’s credits arrive; null in a trial or without a running period."}},"required":["amount","per_user","seats","trial","next_at"],"additionalProperties":false},{"type":"null"}],"description":"What the plan includes for this wallet every period; null when it includes nothing."}},"required":["kind","unit","exists","balance","reserved","available","low_balance_alert","low_balance","disabled","updated_at","allowance"],"additionalProperties":false},"WalletTopUpInput":{"type":"object","properties":{"amount_rupees":{"description":"Messaging wallets.","type":"integer","minimum":1,"maximum":10000000},"credits":{"description":"The AI wallet.","type":"integer","minimum":1,"maximum":10000000}}},"WalletTopUpResult":{"type":"object","properties":{"checkout_url":{"type":"string"},"payment_link_id":{"type":"string"},"kind":{"type":"string","enum":["sms","whatsapp","ai","voice","email"]},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/BillingAmount"}},"required":["checkout_url","payment_link_id","kind","credits","amount"],"additionalProperties":false},"WalletTransaction":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["sms","whatsapp","ai","voice","email"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balance_after":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string"},"ref_type":{"type":["string","null"]},"ref_id":{"type":["string","null"]},"note":{"type":["string","null"]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","amount","balance_after","reason","ref_type","ref_id","note","created_at"],"additionalProperties":false},"WalletsOverview":{"type":"object","properties":{"payments_configured":{"type":"boolean"},"rate_card":{"$ref":"#/components/schemas/RateCard"},"wallets":{"type":"array","items":{"$ref":"#/components/schemas/Wallet"}}},"required":["payments_configured","rate_card","wallets"],"additionalProperties":false},"WebhookApiVersion":{"type":"string","enum":["2026-10-01"],"description":"Dated payload version; additive changes ship without a new one."},"WebhookDelivery":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"subscription_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"kind":{"type":"string","enum":["event","test","replay","automation"]},"event_id":{"type":["string","null"]},"event_type":{"type":["string","null"]},"entity_type":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/WebhookDeliveryStatus"},"attempt":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_attempts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"response_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"request":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Method, masked URL, headers without the signature, size; the body of thin events."},"response":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Content type, size and the first 1 KB of the answer."},"next_retry_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"delivered_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_attempt_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"replay_of_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","subscription_id","kind","event_id","event_type","entity_type","entity_id","status","attempt","max_attempts","status_code","response_ms","error","request","response","next_retry_at","delivered_at","last_attempt_at","replay_of_id","created_at"],"additionalProperties":false},"WebhookDeliveryStatus":{"type":"string","enum":["pending","retrying","succeeded","failed","cancelled"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"kind":{"type":"string","enum":["endpoint","rest_hook"]},"name":{"type":["string","null"]},"url":{"type":"string","description":"Endpoints: the URL as entered. REST hooks: masked (the URL is a credential)."},"events":{"type":"array","items":{"type":"string"}},"api_version":{"$ref":"#/components/schemas/WebhookApiVersion"},"trigger":{"anyOf":[{"$ref":"#/components/schemas/AutomationTriggerKey"},{"type":"null"}]},"app":{"anyOf":[{"type":"string","enum":["zapier","make","pabbly","other"]},{"type":"null"}]},"api_key":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"prefix":{"type":"string"}},"required":["id","name","prefix"],"additionalProperties":false},{"type":"null"}]},"is_active":{"type":"boolean"},"disabled_reason":{"description":"failures · gone (410) · api_key_revoked · manual","type":["string","null"]},"disabled_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"failure_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Failed attempts since the last success."},"last_delivery_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_success_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_failure_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"previous_secret_expires_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}],"description":"After a rotation the previous secret still signs until then."},"created_by":{"anyOf":[{"$ref":"#/components/schemas/MemberRef"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","kind","name","url","events","api_version","trigger","app","api_key","is_active","disabled_reason","disabled_at","failure_count","last_delivery_at","last_success_at","last_failure_at","previous_secret_expires_at","created_by","created_at","updated_at"],"additionalProperties":false},"WebhookEndpointWithSecret":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"secret":{"type":"string","description":"The signing secret (`whsec_…`): shown once — store it now."}},"required":["endpoint","secret"],"additionalProperties":false},"WebhookEventCatalogue":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"sample":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"`data` of a delivery."}},"required":["key","label","description","sample"],"additionalProperties":false}}},"required":["key","label","events"],"additionalProperties":false}},"signing":{"type":"object","properties":{"signature_header":{"type":"string"},"timestamp_header":{"type":"string"},"replay_window_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_ladder_minutes":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["signature_header","timestamp_header","replay_window_seconds","retry_ladder_minutes"],"additionalProperties":false}},"required":["categories","signing"],"additionalProperties":false},"WhatsappConnection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":["string","null"]},"status":{"type":"string"},"health":{"type":"string","enum":["ok","degraded","error","disconnected","pending"]},"mode":{"type":"string","enum":["byo","embedded"]},"waba_id":{"type":["string","null"]},"waba_name":{"type":["string","null"]},"currency":{"description":"Indian portfolios must bill in INR from 1 Jan 2027.","type":["string","null"]},"review_status":{"type":["string","null"]},"subscribed":{"type":"boolean"},"app_id":{"type":["string","null"]},"token_hint":{"type":["string","null"]},"last_error":{"type":["string","null"]},"last_ok_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"connected_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"last_sync":{"type":"object","properties":{"at":{"type":["string","null"]},"error":{"type":["string","null"]},"templates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["at","error","templates"],"additionalProperties":false},"token":{"type":"object","properties":{"expires_at":{"type":["string","null"]},"reconnect":{"type":"boolean"}},"required":["expires_at","reconnect"],"additionalProperties":false,"description":"Access token expiry (null = never or unknown); reconnect from 3 days before it."},"account_health":{"anyOf":[{"type":"object","properties":{"checked_at":{"type":"string"},"currency":{"type":["string","null"]},"payment_method":{"type":"string","enum":["present","missing","unknown"]},"account_status":{"type":["string","null"]},"business_verification":{"type":["string","null"]},"can_send":{"anyOf":[{"type":"string","enum":["AVAILABLE","LIMITED","BLOCKED"]},{"type":"null"}]},"problems":{"type":"array","items":{"type":"object","properties":{"entity":{"type":"string"},"code":{"type":["string","null"]},"text":{"type":"string"}},"required":["entity","code","text"],"additionalProperties":false}},"error":{"type":["string","null"]}},"required":["checked_at","currency","payment_method","account_status","business_verification","can_send","problems","error"],"additionalProperties":false},{"type":"null"}],"description":"The daily WABA health read from Meta; null before the first one."},"numbers":{"type":"array","items":{"$ref":"#/components/schemas/WhatsappNumber"}}},"required":["id","name","status","health","mode","waba_id","waba_name","currency","review_status","subscribed","app_id","token_hint","last_error","last_ok_at","connected_at","last_sync","token","account_health","numbers"],"additionalProperties":false},"WhatsappCredentialCheck":{"type":"object","properties":{"number":{"type":"object","properties":{"phone_number_id":{"type":"string"},"display_phone_number":{"type":"string"},"verified_name":{"type":["string","null"]},"name_status":{"type":["string","null"]},"quality_rating":{"type":["string","null"]},"messaging_limit_tier":{"type":["string","null"]},"status":{"type":["string","null"]}},"required":["phone_number_id","display_phone_number","verified_name","name_status","quality_rating","messaging_limit_tier","status"],"additionalProperties":false},"waba":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"currency":{"type":["string","null"]},"review_status":{"type":["string","null"]}},"required":["id","name","currency","review_status"],"additionalProperties":false},"numbers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"app_id":{"type":["string","null"]}},"required":["number","waba","numbers","app_id"],"additionalProperties":false},"WhatsappCredentials":{"type":"object","properties":{"waba_id":{"type":"string","pattern":"^\\d{1,32}$"},"phone_number_id":{"type":"string","pattern":"^\\d{1,32}$"},"access_token":{"type":"string","minLength":20,"maxLength":2048},"app_secret":{"type":"string","minLength":16,"maxLength":256},"app_id":{"anyOf":[{"type":"string","pattern":"^\\d{1,32}$"},{"type":"null"}]},"verify_token":{"description":"Generated when absent; shown once.","anyOf":[{"type":"string","minLength":16,"maxLength":256,"pattern":"^[A-Za-z0-9._~-]+$"},{"type":"null"}]}},"required":["waba_id","phone_number_id","access_token","app_secret"]},"WhatsappNumber":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"connection_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"phone_number_id":{"type":["string","null"]},"address":{"type":"string","description":"E.164"},"display_phone_number":{"type":"string"},"label":{"type":"string"},"verified_name":{"type":["string","null"]},"name_status":{"description":"APPROVED · PENDING_REVIEW · DECLINED …","type":["string","null"]},"quality_rating":{"description":"GREEN · YELLOW · RED · UNKNOWN","type":["string","null"]},"messaging_limit_tier":{"description":"TIER_250 · TIER_1K · TIER_10K · TIER_100K …","type":["string","null"]},"throughput":{"type":["string","null"]},"status":{"type":"string","description":"connected · degraded · pending · banned · disconnected"},"meta_status":{"type":["string","null"]},"code_verification_status":{"type":["string","null"]},"coexistence":{"type":"boolean"},"is_default":{"type":"boolean"},"last_seen_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","connection_id","phone_number_id","address","display_phone_number","label","verified_name","name_status","quality_rating","messaging_limit_tier","throughput","status","meta_status","code_verification_status","coexistence","is_default","last_seen_at"],"additionalProperties":false},"WhatsappSetup":{"type":"object","properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/WhatsappConnection"}},"embedded_signup":{"type":"object","properties":{"available":{"type":"boolean"},"app_id":{"type":["string","null"]},"config_id":{"type":["string","null"]},"graph_version":{"type":["string","null"]}},"required":["available","app_id","config_id","graph_version"],"additionalProperties":false},"webhook":{"type":"object","properties":{"callback_url":{"type":"string"},"fields":{"type":"array","items":{"type":"string"}}},"required":["callback_url","fields"],"additionalProperties":false},"read_receipts":{"type":"boolean","description":"Blue ticks and “typing…” for customers when a member opens or answers a thread (INT-40)."}},"required":["connections","embedded_signup","webhook","read_receipts"],"additionalProperties":false},"WhiteLabel":{"type":"object","properties":{"entitled":{"type":"boolean","description":"Whether the plan includes white label."},"brand_name":{"type":["string","null"]},"brand_color":{"type":["string","null"]},"accent_color":{"type":["string","null"]},"hide_powered_by":{"type":"boolean"},"powered_by":{"type":"boolean","description":"Whether pages, emails and the app show \"Powered by PropZolo\"."},"email_from_name":{"type":["string","null"]},"email_identity_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"android_app_name":{"type":["string","null"]},"android_package_id":{"type":["string","null"]},"favicon_url":{"type":["string","null"]},"app_icon_url":{"type":["string","null"]},"warnings":{"type":"array","items":{"type":"string"}}},"required":["entitled","brand_name","brand_color","accent_color","hide_powered_by","powered_by","email_from_name","email_identity_id","android_app_name","android_package_id","favicon_url","app_icon_url","warnings"],"additionalProperties":false},"Workflow":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/WorkflowStatus"},"active_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The live published version; null until published."},"trigger":{"anyOf":[{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"],"additionalProperties":false},{"type":"null"}]},"recipe":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","version"],"additionalProperties":false},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"graph":{"$ref":"#/components/schemas/WorkflowGraph"},"settings":{"$ref":"#/components/schemas/WorkflowSettings"},"published_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"has_unpublished_changes":{"type":"boolean"},"issues":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowIssue"}},"summary":{"type":"array","items":{"type":"string"},"description":"The workflow in words, one line per step."}},"required":["id","name","description","status","active_version","trigger","recipe","created_by_id","created_at","updated_at","graph","settings","published_at","has_unpublished_changes","issues","summary"],"additionalProperties":false},"WorkflowBuilderOptions":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"role_key":{"type":"string"},"role_name":{"type":"string"}},"required":["id","name","role_key","role_name"],"additionalProperties":false}},"roles":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}},"statuses":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"pipeline_id":{"$ref":"#/components/schemas/Id"},"pipeline_name":{"type":"string"},"sub_statuses":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}}},"required":["key","name","category","pipeline_id","pipeline_name","sub_statuses"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"],"additionalProperties":false}},"templates":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"channel":{"type":"string"},"name":{"type":"string"},"display_name":{"type":["string","null"]},"purpose":{"type":["string","null"]},"status":{"type":"string"},"language":{"type":"string"}},"required":["id","channel","name","display_name","purpose","status","language"],"additionalProperties":false}},"sequences":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false}}},"required":["members","roles","statuses","sources","templates","sequences"],"additionalProperties":false},"WorkflowCatalogue":{"type":"object","properties":{"triggers":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"entity":{"type":"string"},"entity_label":{"type":"string"},"supports_changes":{"type":"boolean"},"producer_task":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"of":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":["string","number"]},"label":{"type":"string"}},"required":["value"],"additionalProperties":false}},"ops":{"type":"array","items":{"type":"string"}}},"required":["key","label","type","ops"],"additionalProperties":false}}},"required":["key","label","description","category","entity","entity_label","supports_changes","producer_task","fields"],"additionalProperties":false}},"actions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"message":{"type":"boolean"},"needs_lead":{"type":"boolean"},"entities":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"available":{"type":"boolean"},"available_with":{"type":"string"},"params_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["key","label","description","category","message","needs_lead","entities","available","available_with","params_schema"],"additionalProperties":false}},"ai_nodes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"output":{"type":"string"},"available":{"type":"boolean"},"available_with":{"type":"string"},"config_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type","label","description","output","available","available_with","config_schema"],"additionalProperties":false}},"delay_modes":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"max_nodes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_edges":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_wait_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_nodes","max_edges","max_wait_days","max_delay_days"],"additionalProperties":false}},"required":["triggers","actions","ai_nodes","delay_modes","limits"],"additionalProperties":false},"WorkflowDryRun":{"type":"object","properties":{"would_start":{"type":"boolean"},"reason":{"type":["string","null"]},"steps":{"type":"array","items":{"type":"object","properties":{"node_id":{"type":"string"},"node_type":{"type":"string"},"label":{"type":"string"},"status":{"type":"string"},"at":{"$ref":"#/components/schemas/DateTime"},"input":{},"output":{},"error":{"type":"string"}},"required":["node_id","node_type","label","status","at"],"additionalProperties":false}},"outcome":{"type":"string","enum":["completed","failed","not_started"]},"error":{"type":["string","null"]},"started_at":{"$ref":"#/components/schemas/DateTime"},"ended_at":{"$ref":"#/components/schemas/DateTime"}},"required":["would_start","reason","steps","outcome","error","started_at","ended_at"],"additionalProperties":false},"WorkflowGraph":{"type":"object","properties":{"format":{"type":"number","const":1},"nodes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"type":{"type":"string","maxLength":48,"description":"trigger · condition · switch · action · delay · wait_for_event · split_ab · goal · exit · ai.classify_intent · ai.extract_requirement · ai.score · ai.next_action · ai.write_message"},"label":{"type":"string","maxLength":80},"notes":{"type":"string","maxLength":500},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"additionalProperties":false},"config":{"description":"Node settings (see the catalogue).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type"],"additionalProperties":false}},"edges":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"source":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"target":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"handle":{"description":"Output of the source: next, true / false, a branch / variant / label key, event / timeout, past.","type":"string","maxLength":32},"label":{"type":"string","maxLength":80}},"required":["id","source","target"],"additionalProperties":false}}},"required":["nodes"],"additionalProperties":false},"WorkflowGraphInput":{"type":"object","properties":{"format":{"type":"number","const":1},"nodes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"type":{"type":"string","maxLength":48,"description":"trigger · condition · switch · action · delay · wait_for_event · split_ab · goal · exit · ai.classify_intent · ai.extract_requirement · ai.score · ai.next_action · ai.write_message"},"label":{"type":"string","maxLength":80},"notes":{"type":"string","maxLength":500},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"config":{"description":"Node settings (see the catalogue).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type"]}},"edges":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"source":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"target":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"handle":{"description":"Output of the source: next, true / false, a branch / variant / label key, event / timeout, past.","type":"string","maxLength":32},"label":{"type":"string","maxLength":80}},"required":["id","source","target"]}}},"required":["nodes"]},"WorkflowIssue":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"message":{"type":"string"},"path":{"type":"array","items":{"type":"string"},"description":"Path into the graph JSON, e.g. [\"nodes\",\"3\",\"config\",\"params\"]."},"node_id":{"type":["string","null"]},"edge_id":{"type":["string","null"]}},"required":["code","severity","message","path","node_id","edge_id"],"additionalProperties":false},"WorkflowListItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/WorkflowStatus"},"active_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The live published version; null until published."},"trigger":{"anyOf":[{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"],"additionalProperties":false},{"type":"null"}]},"recipe":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","version"],"additionalProperties":false},{"type":"null"}]},"created_by_id":{"anyOf":[{"$ref":"#/components/schemas/Id"},{"type":"null"}]},"created_at":{"$ref":"#/components/schemas/DateTime"},"updated_at":{"$ref":"#/components/schemas/DateTime"},"owner":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"Who created it."},"runs_7d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed_7d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"success_rate_7d":{"description":"Completed ÷ (completed + failed) over 7 days, %.","type":["number","null"]},"last_run_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","name","description","status","active_version","trigger","recipe","created_by_id","created_at","updated_at","owner","runs_7d","failed_7d","success_rate_7d","last_run_at"],"additionalProperties":false},"WorkflowRecipe":{"type":"object","properties":{"key":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"templates":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string"},"purpose":{"type":"string"},"label":{"type":"string"}},"required":["channel","purpose","label"],"additionalProperties":false}},"options_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"JSON Schema of the install options."},"summary":{"type":"array","items":{"type":"string"}},"missing":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["channel","template","action","status"]},"key":{"type":"string"},"message":{"type":"string"}},"required":["kind","key","message"],"additionalProperties":false},"description":"What this company lacks for the recipe to go live."},"installed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","number","version","name","description","category","templates","options_schema","summary","missing","installed"],"additionalProperties":false},"WorkflowRecipeInstall":{"type":"object","properties":{"workflow":{"$ref":"#/components/schemas/Workflow"},"activated":{"type":"boolean"},"missing":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["channel","template","action","status"]},"key":{"type":"string"},"message":{"type":"string"}},"required":["kind","key","message"],"additionalProperties":false}}},"required":["workflow","activated","missing"],"additionalProperties":false},"WorkflowRun":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entity_type":{"type":"string"},"entity_id":{"type":"string"},"lead_id":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/WorkflowRunStatus"},"current_node":{"type":["string","null"]},"wake_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"waiting_for":{"description":"Event a waiting run listens for.","type":["string","null"]},"error":{"type":["string","null"]},"outcome":{"description":"exit · end · goal · failed · record_deleted …","type":["string","null"]},"trigger_event":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},{"type":"null"}]},"started_at":{"$ref":"#/components/schemas/DateTime"},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","version","entity_type","entity_id","lead_id","status","current_node","wake_at","waiting_for","error","outcome","trigger_event","started_at","finished_at"],"additionalProperties":false},"WorkflowRunDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entity_type":{"type":"string"},"entity_id":{"type":"string"},"lead_id":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/WorkflowRunStatus"},"current_node":{"type":["string","null"]},"wake_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"waiting_for":{"description":"Event a waiting run listens for.","type":["string","null"]},"error":{"type":["string","null"]},"outcome":{"description":"exit · end · goal · failed · record_deleted …","type":["string","null"]},"trigger_event":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},{"type":"null"}]},"started_at":{"$ref":"#/components/schemas/DateTime"},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"chain":{"type":"array","items":{"type":"string"},"description":"Workflows of the cascade that led to this run (loop guard)."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRunStep"}}},"required":["id","version","entity_type","entity_id","lead_id","status","current_node","wake_at","waiting_for","error","outcome","trigger_event","started_at","finished_at","chain","steps"],"additionalProperties":false},"WorkflowRunStatus":{"type":"string","enum":["running","waiting","completed","failed","cancelled"]},"WorkflowRunStep":{"type":"object","properties":{"id":{"type":"string"},"node_id":{"type":"string"},"node_type":{"type":"string"},"status":{"type":"string","enum":["done","skipped","failed","waiting"]},"input":{"anyOf":[{},{"type":"null"}]},"output":{"anyOf":[{},{"type":"null"}]},"error":{"type":["string","null"]},"started_at":{"$ref":"#/components/schemas/DateTime"},"finished_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]}},"required":["id","node_id","node_type","status","input","output","error","started_at","finished_at"],"additionalProperties":false},"WorkflowSettings":{"type":"object","properties":{"reentry":{"type":"object","properties":{"mode":{"type":"string","enum":["once","after_days","always"]},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["mode"],"additionalProperties":false},"allow_concurrent_runs":{"type":"boolean"},"max_runs_per_entity_per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"respect_quiet_hours":{"type":"boolean"},"alert_member_ids":{"type":"array","items":{"$ref":"#/components/schemas/Id"}},"recipe":{"type":"object","properties":{"key":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","version"],"additionalProperties":false}},"required":["reentry","allow_concurrent_runs","max_runs_per_entity_per_day","respect_quiet_hours","alert_member_ids"],"additionalProperties":false},"WorkflowSettingsInput":{"type":"object","properties":{"reentry":{"type":"object","properties":{"mode":{"type":"string","enum":["once","after_days","always"]},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["mode"]},"allow_concurrent_runs":{"type":"boolean"},"max_runs_per_entity_per_day":{"type":"integer","minimum":1,"maximum":50},"respect_quiet_hours":{"type":"boolean"},"alert_member_ids":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Id"}}}},"WorkflowStats":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/DateTime"},"to":{"$ref":"#/components/schemas/DateTime"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"started":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","started","completed","failed","cancelled","active"],"additionalProperties":false}},"totals":{"type":"object","properties":{"started":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["started","completed","failed","cancelled","active"],"additionalProperties":false},"success_rate":{"description":"Completed ÷ (completed + failed), in percent.","type":["number","null"]}},"required":["from","to","days","totals","success_rate"],"additionalProperties":false},"WorkflowStatus":{"type":"string","enum":["draft","active","paused","archived"]},"WorkflowValidation":{"type":"object","properties":{"valid":{"type":"boolean"},"issues":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowIssue"}},"summary":{"type":"array","items":{"type":"string"}}},"required":["valid","issues","summary"],"additionalProperties":false},"WorkflowVersion":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"live":{"type":"boolean"},"published_at":{"$ref":"#/components/schemas/DateTime"},"published_by":{"type":["string","null"]},"graph":{"$ref":"#/components/schemas/WorkflowGraph"},"summary":{"type":"array","items":{"type":"string"}}},"required":["version","live","published_at","published_by","graph","summary"],"additionalProperties":false},"WorkspaceDomain":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"hostname":{"type":"string"},"status":{"type":"string","enum":["pending","active","failed","moved"]},"verified_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"checked_at":{"anyOf":[{"$ref":"#/components/schemas/DateTime"},{"type":"null"}]},"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string"},"host":{"type":"string"},"value":{"type":"string"}},"required":["type","name","host","value"],"additionalProperties":false}},"last_error":{"type":["string","null"]},"url":{"type":"string"},"created_at":{"$ref":"#/components/schemas/DateTime"}},"required":["id","hostname","status","verified_at","checked_at","records","last_error","url","created_at"],"additionalProperties":false},"ZonedDateTimeInput":{"type":"string","minLength":10,"maxLength":40,"description":"ISO 8601 instant, or a local YYYY-MM-DDTHH:mm read in the company time zone.","examples":["2026-10-04T10:00","2026-10-04T04:30:00.000Z"]}},"responses":{"Unauthenticated":{"description":"No valid session or API key (missing, expired or revoked).","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Forbidden":{"description":"The caller lacks the permission, API-key scope or support grant this operation needs.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"NotFound":{"description":"Not found — records of another company are reported the same way.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Conflict":{"description":"A unique value already exists, a concurrent change won, or the Idempotency-Key is still in use or was sent with a different request.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ValidationFailed":{"description":"Invalid input; `error.fields` maps field paths to messages.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"RateLimited":{"description":"Too many requests; retry after the Retry-After header.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"InternalError":{"description":"Unexpected error; quote `error.request_id` to support.","headers":{"X-Request-Id":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key (a UUID) per logical request. A retry with the same key and body replays the first response for 24 hours (marked Idempotent-Replayed: true); the same key with another body is a 409.","schema":{"type":"string","minLength":1,"maxLength":255}},"IfNoneMatch":{"name":"If-None-Match","in":"header","required":false,"description":"ETag of the copy the client holds; an unchanged resource answers 304 without a body.","schema":{"type":"string"}}},"headers":{"RequestId":{"description":"Request id (the client may send its own X-Request-Id); also in error bodies as request_id.","schema":{"type":"string"}}},"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"__Host-pz_s","description":"Web session cookie, set by the sign-in flow."},"mobileSession":{"type":"http","scheme":"bearer","description":"Session token of the PropZolo Android app, bound to the registered device."},"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"PropZolo API key","description":"API key created in Settings → Integrations & API. A key acts with its creator’s role, limited to its scopes; the scopes an operation needs are listed in its security requirement."}}}}