{"openapi":"3.0.3","info":{"title":"Pooli API","version":"1.0.0","description":"Pooli public API, version 1 alpha. Machine-readable contract for https://api.pooli.app. Human summary: https://api.pooli.app/docs and https://pooli.app/api-documentation/.\n\nCanonical paths use /v1/users/{uid} and /v1/organizations/{orgId}. /users/{uid} and /organizations/{orgId} are legacy aliases of those prefixes and stay supported.\n\nDevelopment host is https://dev-api.pooli.app. The name api-dev.pooli.app does not resolve.\n\nErrors are JSON objects { error, message, status }. List endpoints accept limit, cursor, startAfter, and envelope. The default list body stays a JSON array (null for an empty log page or empty inventory) so existing clients keep working. envelope=1 returns { data, page }.\n\nAPI keys are created in the Pooli app, which calls the Firebase callable apiKeys-generateApiKey (group prefix required). Each call adds a new key. Keys have no enforced expiry. apiKeys.expiresAt is reserved for a later maximum lifetime and is ignored. POST /v1/auth/keys/rotate and apiKeys-rotateApiKey issue a new key while the previous key keeps working until graceEndsAt (default 7 days). The next use after that instant revokes the old key and deletes its access tokens. POST /v1/auth/keys/revoke and apiKeys-revokeApiKey revoke immediately. Keys are scoped to the authenticated user (apiKeys.uid). Organization routes succeed when that user is the organization ownerUserId, an admin (organization.admins, or members/{uid}.role admin), or a technician with status active. Invoices, payments, estimates, service subscriptions, and billing fields on customers require owner or admin. There is no separate organization key. Optional apiKeys.scopes, when the array is non-empty, must include content_management for /v1/content-ingest. Keys without a scopes array still work.\n\nIntentional legacy spellings, kept as stored: field supplimentalSanitizers, and filter value cartrige. Do not rename them.\n\nSign in with Pooli (OAuth). AI assistants such as Claude, ChatGPT, and Grok connect through https://mcp.pooli.app/mcp with a normal Pooli sign in, with no key to copy. The authorization server is this API (issuer https://api.pooli.app, metadata at /.well-known/oauth-authorization-server). It uses the authorization code flow with PKCE S256 and dynamic client registration. When the user presses Allow, the token endpoint creates an ordinary API key (it starts with pooli_oak_) in the user's apiKeys and returns it as the access token. That key does not expire, there is no refresh token, and it works exactly like any other key: same routes, same rate limit, listed and deleted with the user's other keys. A revoked or deleted pooli_oak_ key returns 401 with WWW-Authenticate error invalid_token so the client signs in again. See the oauth2 security scheme and the OAuth tag.\n\nRate limit: 10 requests per hour per user, shared by all of that user's API keys and connected AI assistants. An active Pool Club subscription, or a seat covered by a Pool Club organization (the organization is a Club member and its technicians fit its seats), allows 150 requests per hour. GET /v1/me reports the effective tier and the requests left. Both limits use the same one-hour window. GET /v1/me counts against this same limit. Sign up for Club at https://pooli.app/select-plan/ for the higher Club limit. Auth header is Authorization: Bearer <API_KEY>. The user or organization id is a path parameter, not a second header.\n\nOrganization read routes never read another organization's collection: customers, routes, stops, invoices, estimates, subscriptions, payments, products, equipment, service visits, and service reports. They are read only. Invoices, payments, estimates, service subscriptions, and billing fields on customers (balances, payment methods, autopay, Stripe customer ids) are limited to the organization owner and admins. Active technicians still receive non-billing customer fields used for service. Card numbers, CVC, expiry, and last4 are removed. Stripe ids are kept for owners and admins.\n\nRoute dates use the organization time zone when organizations/{orgId}.timeZone or timezone is a valid IANA name, or when timeZoneOffset or timezoneOffset is a number of minutes (local minus UTC). The Pooli Pro app fills in organizations/{orgId}.timeZone for each organization the first time an owner or admin opens the app, and owners and admins can change it under Organization Defaults. Until then an organization may have no zone, so the record is not guaranteed to have one. Missing or invalid values fall back to UTC (timeZoneSource utc-fallback).\n\nRoute expansion. GET routes with date, or with from and to, expands repeating stops on the server: weekly, biweekly, and monthly, end dates, technician include and exclude dates, one-week moves, skips, and completed visits matched by Monday to Sunday week. from and to are inclusive and at most 31 days. More than 500 occurrences returns 400. Omitting date and from and to keeps the previous anchor-day list (expanded false) so older clients keep working. Each route gains an occurrences array. stopIds still lists the stops a technician sees. Skipped weeks are in occurrences with skipped true and are left out of stopIds.\n\nPOST /v1/auth/token exchanges a long-lived API key for a short-lived Bearer access token (default 15 minutes, maximum 1 hour). POST /v1/auth/token/refresh replaces an unexpired access token. POST /v1/auth/keys/regenerate invalidates that key's access tokens without changing the long-lived key string. POST /v1/auth/keys/rotate issues a new key and keeps the old key until the grace period ends. POST /v1/auth/keys/revoke ends that key immediately and deletes its tokens. Expired tokens are rejected. GET /v1/me returns apiKeys.uid for the presented key or access token, plus the orgs that user can access with role, technician record, Club and seat status, time zone, and the effective rate limit. Call it once per session. It does not accept a client-supplied uid. It counts against the same hourly rate limit as other authenticated routes.\n\nSend X-Pooli-Act-As: <user id> on an organization route to run the request as that user. Only the organization owner may do this. The target must belong to that organization. A target with a higher role is rejected. The effective role is the acted-as user's role. Billing results follow the effective role. If X-Pooli-Organization is also sent, it must equal the organization id in the path. Personal /v1/users routes reject the header when it names someone else. Content ingest rejects the header. Auth routes ignore it and use the presented credential only.\n\nIdempotency-Key is required on creates that mint a customer, an organization pool, a stop, an inventory item, or a reminder, on PATCH of a stop, on sending a service report, and on adding visit photos. The value is 8 to 200 characters. The same key and JSON body replay the original status and body. A different body with the same key returns 409. The role check runs before the key is recorded. A failed validation does not store a replay. Organization pool create stays HTTP 200. The other idempotent creates return 201. Stop updates return 200.\n\nWrite roles. Owner or admin: create a customer, create, update, or delete an organization pool, import CSV, and set technician status. Owner, admin, or active technician: create or update a stop, and create, update, or delete an organization log. A stop update never replaces occurrenceOverrides. Personal user writes require the path uid to be the API key user: user pools, user logs, inventory, and reminders. Those routes reject acting as someone else. Technicians cannot create customers or organization pools.\n\nService visits. Owner, admin, or an active technician assigned to the stop or visit can run a stop from the API: POST stops/{stopId}/start, then POST service-visits/{visitId}/pause, resume, complete, report, and photos. GET routes/me lists the caller's stops for a day with the visit id and status of each, so an assistant can walk a technician through the day. A visit is the same organizations/{orgId}/jobs document the app uses, so the app and the API see each other's changes. Invalid transitions return 409 with details.reason. Billing (invoices, payments, subscriptions) is not part of these routes.\n\nLocal time. Date-times on stops (scheduledDateTime) accept local wall-clock time without an offset, such as 2026-11-10T14:00, and read it in the request timeZone or the organization time zone. An explicit offset or Z always wins. Nothing is guessed as UTC: with no offset, no timeZone and no saved organization zone the request is a 400. GET /v1/me shows each organization's zone.\n\nRoles on writes. Roles come from the calling user (owner, admin, or technician), never from the request. A technician can only schedule or edit stops for themselves and can only start, pause, resume, complete, add photos to, or send the report of their own visits (403 otherwise). Owners and admins can do all of these for any technician. The role lookup is cached in memory for up to five minutes per server instance.\n\nTechnician status writes accept only active, inactive, or rejected. approved and any other value return 400. active links the technician user the same way processTechnicianApproval does (organizationId, technicianId, organizationStatus active). inactive and rejected clear those three fields when they point at this technician, and leave the organization owner profile unchanged. Stored technician documents may still show pending. Listing with a status query returns pending technicians only.\n\nGET /v1/users/{uid}/maintenance-catalog and GET /v1/organizations/{orgId}/maintenance-catalog return built-in maintenance tasks plus that user's custom tasks. duration is seconds. Copy id, name, category, duration, and aggregationName into a maintenance log create. Organization built-in defaults under 7 days are raised to 7 days."},"servers":[{"url":"https://api.pooli.app","description":"Production"},{"url":"https://dev-api.pooli.app","description":"Development. dev-api.pooli.app is the host that resolves. api-dev.pooli.app does not."}],"tags":[{"name":"Documentation"},{"name":"Pools"},{"name":"Logs"},{"name":"Reminders"},{"name":"Inventory"},{"name":"Maintenance"},{"name":"Technicians"},{"name":"Organization pools"},{"name":"Organization logs"},{"name":"Customers"},{"name":"Routes"},{"name":"Stops"},{"name":"Invoices"},{"name":"Estimates"},{"name":"Subscriptions"},{"name":"Payments"},{"name":"Products"},{"name":"Equipment"},{"name":"Service visits"},{"name":"Service reports"},{"name":"Content ingest"},{"name":"Authentication"},{"name":"OAuth"}],"paths":{"/v1/users/{uid}/pools":{"get":{"tags":["Pools"],"summary":"List pools for a user","description":"Returns sanitized pools for the user id in the path. The API key must belong to that user. location and weather are omitted. Default body is a JSON array. Empty is [].","operationId":"listUserPools","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Pool"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"post":{"tags":["Pools"],"summary":"Create a user pool","description":"The path uid must be the API key user. Acting as another user is rejected on this route. Body is { pool: PoolCreate }. The server sets userId from the path. supplimentalSanitizers is an intentional legacy field name. Do not rename it. cartrige is an intentional legacy spelling used by the app, by CSV import, and as the value stored when filterCategory is omitted on pool create. Do not rename it. When a client sends filterCategory, the create-pool validator currently accepts de, sand, and cartridge.","operationId":"createUserPool","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolCreateRequest"}}}}}},"/v1/users/{uid}/pools/{poolId}":{"get":{"tags":["Pools"],"summary":"Get one user pool","description":"Returns the pool document, including fields the list endpoint strips. Missing pools respond 500 with message Unable to fetch pool. (the handler does not map not-found to 404).","operationId":"getUserPool","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"delete":{"tags":["Pools"],"summary":"Soft-delete a user pool","description":"The path uid must be the API key user. Sets deleted=true. The document is not removed.","operationId":"deleteUserPool","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessFlag"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"patch":{"tags":["Pools"],"summary":"Update a user pool","description":"The path uid must be the effective user. Allowed fields: name, gallonEstimate, poolType, filterCategory, sanitizingChemical, isIndoor, supplimentalSanitizers. supplimentalSanitizers is the intentional legacy spelling. filterCategory accepts de, sand, and cartridge. Unknown fields are rejected. No Stripe calls.","operationId":"patchUserPool","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolPatch"}}}}}},"/v1/users/{uid}/pools/{poolId}/logs":{"get":{"tags":["Logs"],"summary":"List logs for a user pool","description":"Ordered by createdAt descending. Default limit is 50. cursor and startAfter are a date string (ISO-8601 recommended) of the last item from the previous page. type is applied after the page is read, so a filtered page can be shorter than limit. pool and weather are omitted. An empty page is null unless envelope=1, which returns data: [].","operationId":"listUserLogs","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/logType"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Log"}},{"type":"null"}]},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"post":{"tags":["Logs"],"summary":"Create a user pool log","description":"The path uid must be the API key user. Query type is required. Body is the log object itself (not wrapped). data in the 201 response is the new log id string, not the stored document. type=test analyzes the reading with the same rules as saving a test in the app and stores relatedProblems (the problems), recommendations (the products, amounts and wait times for each problem), csi (the saturation index and how reliable it is) and targets (the ranges used) on the log. The same rules are checked against the app by shared test cases. Free and total chlorine use the CYA-adjusted band when adjust for CYA is on (on by default when CYA is visible and the pool has not turned it off). Saved FC/TC min and max do not replace that band. Total alkalinity problems store adjusted alkalinity, matching the app default. Hardness follows the app: a derived calcium or total hardness pair is ignored, and a total hardness reading alone can drive CSI. Products come from the current product catalog, your custom products, your saved default product per type, and the pool's hidden products. Targets come from the pool, then your saved default targets, then the built-in table for the pool type. Earlier tests on the pool inside the app lookback window fill in readings this test left out (CSI and CYA). Amounts use US units (gallons, fluid ounces, ounces, pounds). Metric display settings in the app do not change the API. A client-sent relatedProblems or recommendations value is replaced. A client-sent targets object is used as sent. Changing chemicalReading later with PATCH does not rerun the analysis, so create a new test to get new results. type=swim requires numSwimmers (positive integer) and duration (positive integer seconds). note is an optional string. The server stores swimTime as numSwimmers times duration, in seconds, and does not accept swimTime from the client. A swim log created in the last 2 days adds floor(swimTime / 60) minutes to the pool swimMinSinceSanitizer (a 0 minute total resets that counter, matching the app). At 1440 minutes the server writes an addShock reminder unless that reminder is silenced or the pool openAt field is set. Invalid swim input returns 400. type=note accepts photos: an array of base64 image strings or objects { data, filename }. data may be raw base64 or a data URL. contentType is ignored. The server accepts JPEG, PNG, GIF, and WebP only after reading the file bytes. Each photo must be at most 1500000 decoded bytes. At most 4 photos per request and 12 photos on one note. A create with photos also requires note. Do not send attachments and photos together. The stored attachments array matches the app: attachmentType photo, firestorePath users/{uploaderUid}/{sha256}{ext}, description, and a Firebase download url. The uploaderUid is the API key user (or the acted-as user on an organization route). The 201 data field stays the new log id. Read the log to see attachments. Text-only notes omit photos and still store attachments null. One create or patch counts as one request against the hourly rate limit (10, or 150 for Pool Club, shared by all of the user's keys).","operationId":"createUserLog","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/logType"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedLog"},"examples":{"created":{"summary":"Swim log created","value":{"success":true,"message":"Log created successfully","data":"6f1c0c2e-4b7a-4e1d-9c3a-8b2d5e7f1a90"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogCreate"},"examples":{"swim":{"summary":"Swim log","value":{"numSwimmers":2,"duration":1800,"note":"Morning laps","creatorName":"Alex"}},"notePhoto":{"summary":"Note with one photo","value":{"note":"Skimmer basket is full","creatorName":"Alex","photos":[{"data":"<base64 JPEG, PNG, GIF, or WebP>","filename":"skimmer.jpg"}]}}}}}}}},"/v1/users/{uid}/pools/{poolId}/logs/{logId}":{"get":{"tags":["Logs"],"summary":"Get one user pool log","description":"404 when the document is missing. pool and weather are omitted.","operationId":"getUserLog","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"delete":{"tags":["Logs"],"summary":"Delete a user pool log","description":"The path uid must be the API key user. Hard-deletes the log document. Storage objects for note photos are left in place. The app soft-deletes the note and does not delete those files either.","operationId":"deleteUserLog","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessMessage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"patch":{"tags":["Logs"],"summary":"Update a user pool log","description":"The path uid must be the API key user. Allowed fields: note, creatorName, chemicalReading, equipmentReading, photos. type, userId, and organizationId cannot be changed. photos is accepted only when the stored log type is note. It appends images and does not replace attachments already on the note. A text-only patch that omits photos leaves attachments unchanged. type=note accepts photos: an array of base64 image strings or objects { data, filename }. data may be raw base64 or a data URL. contentType is ignored. The server accepts JPEG, PNG, GIF, and WebP only after reading the file bytes. Each photo must be at most 1500000 decoded bytes. At most 4 photos per request and 12 photos on one note. A create with photos also requires note. Do not send attachments and photos together. The stored attachments array matches the app: attachmentType photo, firestorePath users/{uploaderUid}/{sha256}{ext}, description, and a Firebase download url. The uploaderUid is the API key user (or the acted-as user on an organization route). The 201 data field stays the new log id. Read the log to see attachments. Text-only notes omit photos and still store attachments null. One create or patch counts as one request against the hourly rate limit (10, or 150 for Pool Club, shared by all of the user's keys).","operationId":"patchUserLog","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogPatch"}}}}}},"/v1/users/{uid}/pools/{poolId}/reminders":{"get":{"tags":["Reminders"],"summary":"List reminders for a user pool","description":"The pool field is omitted. Empty is []. Create and update are separate routes and require the path uid to be the API key user.","operationId":"listUserReminders","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Reminder"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"post":{"tags":["Reminders"],"summary":"Create a user pool reminder","description":"reminderType is required. dueDate is an optional date-time and defaults to now. Idempotency-Key is required. This calls the existing scheduleReminder helper, which stores dueDate, notifyDate, and importance for the reminder scheduler. The request itself does not send a notification.","operationId":"createUserReminder","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reminder"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderWrite"}}}}}},"/v1/users/{uid}/inventory":{"get":{"tags":["Inventory"],"summary":"List inventory for a user","description":"An empty inventory is null unless envelope=1, which returns data: []. Create and update are separate routes and require the path uid to be the API key user.","operationId":"listUserInventory","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/InventoryItem"}},{"type":"null"}]},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"post":{"tags":["Inventory"],"summary":"Create a user inventory item","description":"The path uid must be the effective user. name is required. Idempotency-Key is required. No prices or Stripe fields.","operationId":"createUserInventoryItem","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryItem"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryWrite"}}}}}},"/v1/users/{uid}/maintenance-catalog":{"get":{"tags":["Maintenance"],"summary":"List the personal maintenance catalog","description":"Built-in maintenance tasks plus this user's custom tasks. Built-in id, name, and category match the app: MaintenanceCategory, maintenanceCategoryString, and MaintenanceItem.getId (the ReminderType name, so emptySkimmers is cleanSkimmers and sweepWalls is sweepPool). Custom tasks are read from users/{uid}.prefs.customMaintenance. Rows the app would not offer are omitted: category other than custom, a blank name, and rows marked hidden, disabled, deleted, or isDeleted. Deleting a task removes it from that array. Silencing a task is stored on the pool (reminderPrefs.silenced) and does not remove it from this catalog. aliases is included only when the stored task has an aliases array. Nothing is invented. duration is seconds, the same unit a maintenance log stores. Copy id, name, category, duration, and aggregationName (when present) into each maintenances entry on POST /v1/users/{uid}/pools/{poolId}/logs?type=maintenance. group and custom are catalog-only and are ignored on create. Default body is a JSON array. Empty custom tasks still return the built-in list. The example below is abbreviated.","operationId":"listUserMaintenanceCatalog","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/MaintenanceCatalogItem"}},{"$ref":"#/components/schemas/ListEnvelope"}]},"example":[{"id":"cleanSkimmers","name":"Empty Skimmer Basket(s)","category":"emptySkimmers","group":"Weekly","custom":false,"duration":345600},{"id":"sweepPool","name":"Brush Walls","category":"sweepWalls","group":"Weekly","custom":false,"duration":1814400},{"id":"cleanFilter","name":"Clean/Replace Filter","category":"cleanFilter","group":"Semi-Yearly","custom":false,"duration":15724800},{"id":"oasis-walls","name":"Brush the oasis walls","category":"custom","group":"Weekly","custom":true,"duration":604800}]}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/users/{uid}/inventory/{itemId}":{"patch":{"tags":["Inventory"],"summary":"Update a user inventory item","description":"The path uid must be the API key user. Partial update of the same fields as create. No prices or Stripe fields.","operationId":"patchUserInventoryItem","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryItem"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryWrite"}}}}}},"/v1/users/{uid}/pools/{poolId}/reminders/{reminderId}":{"patch":{"tags":["Reminders"],"summary":"Update a user pool reminder","description":"The path uid must be the API key user. Partial update of the same fields as create.","operationId":"patchUserReminder","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"reminderId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reminder"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderWrite"}}}}}},"/users/{uid}/pools":{"get":{"tags":["Pools"],"summary":"List pools for a user","description":"Legacy alias of /v1/users/{uid}/pools. Prefer the canonical path. Returns sanitized pools for the user id in the path. The API key must belong to that user. location and weather are omitted. Default body is a JSON array. Empty is [].","operationId":"listUserPoolsAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Pool"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/pools","x-legacy-alias":true},"post":{"tags":["Pools"],"summary":"Create a user pool","description":"Legacy alias of /v1/users/{uid}/pools. Prefer the canonical path. The path uid must be the API key user. Acting as another user is rejected on this route. Body is { pool: PoolCreate }. The server sets userId from the path. supplimentalSanitizers is an intentional legacy field name. Do not rename it. cartrige is an intentional legacy spelling used by the app, by CSV import, and as the value stored when filterCategory is omitted on pool create. Do not rename it. When a client sends filterCategory, the create-pool validator currently accepts de, sand, and cartridge.","operationId":"createUserPoolAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolCreateRequest"}}}},"x-canonical-path":"/v1/users/{uid}/pools","x-legacy-alias":true}},"/users/{uid}/pools/{poolId}":{"get":{"tags":["Pools"],"summary":"Get one user pool","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}. Prefer the canonical path. Returns the pool document, including fields the list endpoint strips. Missing pools respond 500 with message Unable to fetch pool. (the handler does not map not-found to 404).","operationId":"getUserPoolAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/pools/{poolId}","x-legacy-alias":true},"delete":{"tags":["Pools"],"summary":"Soft-delete a user pool","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}. Prefer the canonical path. The path uid must be the API key user. Sets deleted=true. The document is not removed.","operationId":"deleteUserPoolAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessFlag"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/pools/{poolId}","x-legacy-alias":true},"patch":{"tags":["Pools"],"summary":"Update a user pool","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}. Prefer the canonical path. The path uid must be the effective user. Allowed fields: name, gallonEstimate, poolType, filterCategory, sanitizingChemical, isIndoor, supplimentalSanitizers. supplimentalSanitizers is the intentional legacy spelling. filterCategory accepts de, sand, and cartridge. Unknown fields are rejected. No Stripe calls.","operationId":"patchUserPoolAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolPatch"}}}},"x-canonical-path":"/v1/users/{uid}/pools/{poolId}","x-legacy-alias":true}},"/users/{uid}/pools/{poolId}/logs":{"get":{"tags":["Logs"],"summary":"List logs for a user pool","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}/logs. Prefer the canonical path. Ordered by createdAt descending. Default limit is 50. cursor and startAfter are a date string (ISO-8601 recommended) of the last item from the previous page. type is applied after the page is read, so a filtered page can be shorter than limit. pool and weather are omitted. An empty page is null unless envelope=1, which returns data: [].","operationId":"listUserLogsAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/logType"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Log"}},{"type":"null"}]},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/pools/{poolId}/logs","x-legacy-alias":true},"post":{"tags":["Logs"],"summary":"Create a user pool log","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}/logs. Prefer the canonical path. The path uid must be the API key user. Query type is required. Body is the log object itself (not wrapped). data in the 201 response is the new log id string, not the stored document. type=test analyzes the reading with the same rules as saving a test in the app and stores relatedProblems (the problems), recommendations (the products, amounts and wait times for each problem), csi (the saturation index and how reliable it is) and targets (the ranges used) on the log. The same rules are checked against the app by shared test cases. Free and total chlorine use the CYA-adjusted band when adjust for CYA is on (on by default when CYA is visible and the pool has not turned it off). Saved FC/TC min and max do not replace that band. Total alkalinity problems store adjusted alkalinity, matching the app default. Hardness follows the app: a derived calcium or total hardness pair is ignored, and a total hardness reading alone can drive CSI. Products come from the current product catalog, your custom products, your saved default product per type, and the pool's hidden products. Targets come from the pool, then your saved default targets, then the built-in table for the pool type. Earlier tests on the pool inside the app lookback window fill in readings this test left out (CSI and CYA). Amounts use US units (gallons, fluid ounces, ounces, pounds). Metric display settings in the app do not change the API. A client-sent relatedProblems or recommendations value is replaced. A client-sent targets object is used as sent. Changing chemicalReading later with PATCH does not rerun the analysis, so create a new test to get new results. type=swim requires numSwimmers (positive integer) and duration (positive integer seconds). note is an optional string. The server stores swimTime as numSwimmers times duration, in seconds, and does not accept swimTime from the client. A swim log created in the last 2 days adds floor(swimTime / 60) minutes to the pool swimMinSinceSanitizer (a 0 minute total resets that counter, matching the app). At 1440 minutes the server writes an addShock reminder unless that reminder is silenced or the pool openAt field is set. Invalid swim input returns 400. type=note accepts photos: an array of base64 image strings or objects { data, filename }. data may be raw base64 or a data URL. contentType is ignored. The server accepts JPEG, PNG, GIF, and WebP only after reading the file bytes. Each photo must be at most 1500000 decoded bytes. At most 4 photos per request and 12 photos on one note. A create with photos also requires note. Do not send attachments and photos together. The stored attachments array matches the app: attachmentType photo, firestorePath users/{uploaderUid}/{sha256}{ext}, description, and a Firebase download url. The uploaderUid is the API key user (or the acted-as user on an organization route). The 201 data field stays the new log id. Read the log to see attachments. Text-only notes omit photos and still store attachments null. One create or patch counts as one request against the hourly rate limit (10, or 150 for Pool Club, shared by all of the user's keys).","operationId":"createUserLogAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/logType"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedLog"},"examples":{"created":{"summary":"Swim log created","value":{"success":true,"message":"Log created successfully","data":"6f1c0c2e-4b7a-4e1d-9c3a-8b2d5e7f1a90"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogCreate"},"examples":{"swim":{"summary":"Swim log","value":{"numSwimmers":2,"duration":1800,"note":"Morning laps","creatorName":"Alex"}},"notePhoto":{"summary":"Note with one photo","value":{"note":"Skimmer basket is full","creatorName":"Alex","photos":[{"data":"<base64 JPEG, PNG, GIF, or WebP>","filename":"skimmer.jpg"}]}}}}}},"x-canonical-path":"/v1/users/{uid}/pools/{poolId}/logs","x-legacy-alias":true}},"/users/{uid}/pools/{poolId}/logs/{logId}":{"get":{"tags":["Logs"],"summary":"Get one user pool log","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}/logs/{logId}. Prefer the canonical path. 404 when the document is missing. pool and weather are omitted.","operationId":"getUserLogAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/pools/{poolId}/logs/{logId}","x-legacy-alias":true},"delete":{"tags":["Logs"],"summary":"Delete a user pool log","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}/logs/{logId}. Prefer the canonical path. The path uid must be the API key user. Hard-deletes the log document. Storage objects for note photos are left in place. The app soft-deletes the note and does not delete those files either.","operationId":"deleteUserLogAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessMessage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/pools/{poolId}/logs/{logId}","x-legacy-alias":true},"patch":{"tags":["Logs"],"summary":"Update a user pool log","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}/logs/{logId}. Prefer the canonical path. The path uid must be the API key user. Allowed fields: note, creatorName, chemicalReading, equipmentReading, photos. type, userId, and organizationId cannot be changed. photos is accepted only when the stored log type is note. It appends images and does not replace attachments already on the note. A text-only patch that omits photos leaves attachments unchanged. type=note accepts photos: an array of base64 image strings or objects { data, filename }. data may be raw base64 or a data URL. contentType is ignored. The server accepts JPEG, PNG, GIF, and WebP only after reading the file bytes. Each photo must be at most 1500000 decoded bytes. At most 4 photos per request and 12 photos on one note. A create with photos also requires note. Do not send attachments and photos together. The stored attachments array matches the app: attachmentType photo, firestorePath users/{uploaderUid}/{sha256}{ext}, description, and a Firebase download url. The uploaderUid is the API key user (or the acted-as user on an organization route). The 201 data field stays the new log id. Read the log to see attachments. Text-only notes omit photos and still store attachments null. One create or patch counts as one request against the hourly rate limit (10, or 150 for Pool Club, shared by all of the user's keys).","operationId":"patchUserLogAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogPatch"}}}},"x-canonical-path":"/v1/users/{uid}/pools/{poolId}/logs/{logId}","x-legacy-alias":true}},"/users/{uid}/pools/{poolId}/reminders":{"get":{"tags":["Reminders"],"summary":"List reminders for a user pool","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}/reminders. Prefer the canonical path. The pool field is omitted. Empty is []. Create and update are separate routes and require the path uid to be the API key user.","operationId":"listUserRemindersAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Reminder"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/pools/{poolId}/reminders","x-legacy-alias":true},"post":{"tags":["Reminders"],"summary":"Create a user pool reminder","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}/reminders. Prefer the canonical path. reminderType is required. dueDate is an optional date-time and defaults to now. Idempotency-Key is required. This calls the existing scheduleReminder helper, which stores dueDate, notifyDate, and importance for the reminder scheduler. The request itself does not send a notification.","operationId":"createUserReminderAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reminder"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderWrite"}}}},"x-canonical-path":"/v1/users/{uid}/pools/{poolId}/reminders","x-legacy-alias":true}},"/users/{uid}/inventory":{"get":{"tags":["Inventory"],"summary":"List inventory for a user","description":"Legacy alias of /v1/users/{uid}/inventory. Prefer the canonical path. An empty inventory is null unless envelope=1, which returns data: []. Create and update are separate routes and require the path uid to be the API key user.","operationId":"listUserInventoryAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/InventoryItem"}},{"type":"null"}]},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/inventory","x-legacy-alias":true},"post":{"tags":["Inventory"],"summary":"Create a user inventory item","description":"Legacy alias of /v1/users/{uid}/inventory. Prefer the canonical path. The path uid must be the effective user. name is required. Idempotency-Key is required. No prices or Stripe fields.","operationId":"createUserInventoryItemAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryItem"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryWrite"}}}},"x-canonical-path":"/v1/users/{uid}/inventory","x-legacy-alias":true}},"/users/{uid}/maintenance-catalog":{"get":{"tags":["Maintenance"],"summary":"List the personal maintenance catalog","description":"Legacy alias of /v1/users/{uid}/maintenance-catalog. Prefer the canonical path. Built-in maintenance tasks plus this user's custom tasks. Built-in id, name, and category match the app: MaintenanceCategory, maintenanceCategoryString, and MaintenanceItem.getId (the ReminderType name, so emptySkimmers is cleanSkimmers and sweepWalls is sweepPool). Custom tasks are read from users/{uid}.prefs.customMaintenance. Rows the app would not offer are omitted: category other than custom, a blank name, and rows marked hidden, disabled, deleted, or isDeleted. Deleting a task removes it from that array. Silencing a task is stored on the pool (reminderPrefs.silenced) and does not remove it from this catalog. aliases is included only when the stored task has an aliases array. Nothing is invented. duration is seconds, the same unit a maintenance log stores. Copy id, name, category, duration, and aggregationName (when present) into each maintenances entry on POST /v1/users/{uid}/pools/{poolId}/logs?type=maintenance. group and custom are catalog-only and are ignored on create. Default body is a JSON array. Empty custom tasks still return the built-in list. The example below is abbreviated.","operationId":"listUserMaintenanceCatalogAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/MaintenanceCatalogItem"}},{"$ref":"#/components/schemas/ListEnvelope"}]},"example":[{"id":"cleanSkimmers","name":"Empty Skimmer Basket(s)","category":"emptySkimmers","group":"Weekly","custom":false,"duration":345600},{"id":"sweepPool","name":"Brush Walls","category":"sweepWalls","group":"Weekly","custom":false,"duration":1814400},{"id":"cleanFilter","name":"Clean/Replace Filter","category":"cleanFilter","group":"Semi-Yearly","custom":false,"duration":15724800},{"id":"oasis-walls","name":"Brush the oasis walls","category":"custom","group":"Weekly","custom":true,"duration":604800}]}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/users/{uid}/maintenance-catalog","x-legacy-alias":true}},"/users/{uid}/inventory/{itemId}":{"patch":{"tags":["Inventory"],"summary":"Update a user inventory item","description":"Legacy alias of /v1/users/{uid}/inventory/{itemId}. Prefer the canonical path. The path uid must be the API key user. Partial update of the same fields as create. No prices or Stripe fields.","operationId":"patchUserInventoryItemAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryItem"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryWrite"}}}},"x-canonical-path":"/v1/users/{uid}/inventory/{itemId}","x-legacy-alias":true}},"/users/{uid}/pools/{poolId}/reminders/{reminderId}":{"patch":{"tags":["Reminders"],"summary":"Update a user pool reminder","description":"Legacy alias of /v1/users/{uid}/pools/{poolId}/reminders/{reminderId}. Prefer the canonical path. The path uid must be the API key user. Partial update of the same fields as create.","operationId":"patchUserReminderAlias","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"reminderId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsRejected"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reminder"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderWrite"}}}},"x-canonical-path":"/v1/users/{uid}/pools/{poolId}/reminders/{reminderId}","x-legacy-alias":true}},"/v1/organizations/{orgId}/maintenance-catalog":{"get":{"tags":["Maintenance"],"summary":"List the organization maintenance catalog","description":"Same catalog as the personal route, for an organization member. Owners, admins, and active technicians can read it. Built-in defaults shorter than 7 days are raised to 7 days, matching the pro app (Empty Skimmer Basket(s) and Empty Cleaner). Custom tasks are the effective user's users/{uid}.prefs.customMaintenance. That is the API key user, or the user named by X-Pooli-Act-As when the owner acts as someone else. The app stores custom maintenance on the signed-in user, including while that user works in an organization. There is no separate organization collection. Hidden, disabled, deleted, and isDeleted custom rows are omitted, same as the personal route. Copy id, name, category, duration, and aggregationName (when present) into each maintenances entry on POST /v1/organizations/{orgId}/pools/{poolId}/logs?type=maintenance. The example is abbreviated. cleanSkimmers duration is 604800 seconds (7 days) on this route.","operationId":"listOrganizationMaintenanceCatalog","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/MaintenanceCatalogItem"}},{"$ref":"#/components/schemas/ListEnvelope"}]},"example":[{"id":"cleanSkimmers","name":"Empty Skimmer Basket(s)","category":"emptySkimmers","group":"Weekly","custom":false,"duration":604800},{"id":"sweepPool","name":"Brush Walls","category":"sweepWalls","group":"Weekly","custom":false,"duration":1814400},{"id":"cleanFilter","name":"Clean/Replace Filter","category":"cleanFilter","group":"Semi-Yearly","custom":false,"duration":15724800},{"id":"oasis-filter","name":"Clean the filter at the oasis","category":"custom","group":"Monthly","custom":true,"duration":2592000}]}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/technicians":{"get":{"tags":["Technicians"],"summary":"List technicians","description":"Any present status query (the value is ignored) returns only technicians whose status is pending. Omit status to return every technician.","operationId":"listTechnicians","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/technicianStatus"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Technician"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/technicians/{techId}/status":{"post":{"tags":["Technicians"],"summary":"Set a technician status","description":"Owners and admins only. status must be active, inactive, or rejected. approved and any other value return 400. active sets the technician user's organizationId, technicianId, and organizationStatus to active, the same fields processTechnicianApproval writes. inactive and rejected clear those three fields when they point at this technician, and leave the organization ownerUserId profile unchanged.","operationId":"updateTechnicianStatus","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"techId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessFlag"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TechnicianStatusRequest"}}}}}},"/v1/organizations/{orgId}/pools":{"get":{"tags":["Organization pools"],"summary":"List organization pools","description":"Optional assigned query is compared to the isAssigned field as a string, not a boolean. location and weather are omitted.","operationId":"listOrganizationPools","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/assigned"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Pool"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"post":{"tags":["Organization pools"],"summary":"Create an organization pool","description":"Owners and admins only. Active technicians receive 403. Idempotency-Key is required. Clients that used to call this without the header, or as a technician, now receive 400 or 403. Same body as user pool create. The server sets organizationId from the path and userId from the API key's effective user. supplimentalSanitizers is an intentional legacy field name. Do not rename it. cartrige is an intentional legacy spelling used by the app, by CSV import, and as the value stored when filterCategory is omitted on pool create. Do not rename it. When a client sends filterCategory, the create-pool validator currently accepts de, sand, and cartridge.","operationId":"createOrganizationPool","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolCreateRequest"}}}}}},"/v1/organizations/{orgId}/pools/{poolId}":{"get":{"tags":["Organization pools"],"summary":"Get one organization pool","description":"","operationId":"getOrganizationPool","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"delete":{"tags":["Organization pools"],"summary":"Soft-delete an organization pool","description":"Owners and admins only. Active technicians receive 403.","operationId":"deleteOrganizationPool","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessFlag"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"patch":{"tags":["Organization pools"],"summary":"Update an organization pool","description":"Owners and admins only. Same allowed fields as the user pool update. Active technicians receive 403.","operationId":"patchOrganizationPool","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolPatch"}}}}}},"/v1/organizations/{orgId}/pools/{poolId}/logs":{"get":{"tags":["Organization logs"],"summary":"List logs for an organization pool","description":"Same paging rules as user logs. Default limit 50. cursor and startAfter are dates. type is filtered after the page is read. Empty is null unless envelope=1.","operationId":"listOrganizationLogs","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/logType"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Log"}},{"type":"null"}]},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"post":{"tags":["Organization logs"],"summary":"Create an organization pool log","description":"Owners, admins, and active technicians. Query type is required. Body is the log object. The 201 data field is the new log id. type=test generates relatedProblems, recommendations, csi and targets the same way as a user test create, described on that route. type=swim uses the same body as a user swim log: numSwimmers, duration in seconds, and an optional note. The stored userId is the API user. Swim minute and addShock reminder behavior matches the app, described on the user log create. Organization note documents still store userId null. Photo bytes are stored under users/{apiUserId}/, the same prefix the app uses for the signed-in user. type=note accepts photos: an array of base64 image strings or objects { data, filename }. data may be raw base64 or a data URL. contentType is ignored. The server accepts JPEG, PNG, GIF, and WebP only after reading the file bytes. Each photo must be at most 1500000 decoded bytes. At most 4 photos per request and 12 photos on one note. A create with photos also requires note. Do not send attachments and photos together. The stored attachments array matches the app: attachmentType photo, firestorePath users/{uploaderUid}/{sha256}{ext}, description, and a Firebase download url. The uploaderUid is the API key user (or the acted-as user on an organization route). The 201 data field stays the new log id. Read the log to see attachments. Text-only notes omit photos and still store attachments null. One create or patch counts as one request against the hourly rate limit (10, or 150 for Pool Club, shared by all of the user's keys).","operationId":"createOrganizationLog","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/logType"},{"$ref":"#/components/parameters/actAs"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedLog"},"examples":{"created":{"summary":"Swim log created","value":{"success":true,"message":"Log created successfully","data":"6f1c0c2e-4b7a-4e1d-9c3a-8b2d5e7f1a90"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogCreate"},"examples":{"swim":{"summary":"Swim log","value":{"numSwimmers":2,"duration":1800,"note":"Morning laps","creatorName":"Alex"}},"notePhoto":{"summary":"Note with one photo","value":{"note":"Skimmer basket is full","creatorName":"Alex","photos":[{"data":"<base64 JPEG, PNG, GIF, or WebP>","filename":"skimmer.jpg"}]}}}}}}}},"/v1/organizations/{orgId}/pools/{poolId}/logs/{logId}":{"get":{"tags":["Organization logs"],"summary":"Get one organization pool log","description":"","operationId":"getOrganizationLog","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"delete":{"tags":["Organization logs"],"summary":"Delete an organization pool log","description":"Owners, admins, and active technicians. Hard-deletes the log document. Storage objects for note photos are left in place. The app soft-deletes the note and does not delete those files either.","operationId":"deleteOrganizationLog","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessMessage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"patch":{"tags":["Organization logs"],"summary":"Update an organization pool log","description":"Owners, admins, and active technicians. Allowed fields: note, creatorName, chemicalReading, equipmentReading, photos. photos is accepted only when the stored log type is note. It appends images and does not replace attachments already on the note. Photo bytes are stored under users/{apiUserId}/. A text-only patch that omits photos leaves attachments unchanged. type=note accepts photos: an array of base64 image strings or objects { data, filename }. data may be raw base64 or a data URL. contentType is ignored. The server accepts JPEG, PNG, GIF, and WebP only after reading the file bytes. Each photo must be at most 1500000 decoded bytes. At most 4 photos per request and 12 photos on one note. A create with photos also requires note. Do not send attachments and photos together. The stored attachments array matches the app: attachmentType photo, firestorePath users/{uploaderUid}/{sha256}{ext}, description, and a Firebase download url. The uploaderUid is the API key user (or the acted-as user on an organization route). The 201 data field stays the new log id. Read the log to see attachments. Text-only notes omit photos and still store attachments null. One create or patch counts as one request against the hourly rate limit (10, or 150 for Pool Club, shared by all of the user's keys).","operationId":"patchOrganizationLog","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogPatch"}}}}}},"/v1/organizations/{orgId}/import/csv":{"post":{"tags":["Customers"],"summary":"Import customers and pools from CSV","description":"Owners and admins only. Active technicians receive 403. REST form of the customers-importCsv callable. Send JSON { csvText, mapping, defaults } or a raw text/csv body. filterCategory values are stored as given. The intentional legacy spelling cartrige is valid here and must not be renamed.","operationId":"importOrganizationCustomersCsv","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvImportResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvImportRequest"}},"text/csv":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}}}},"/v1/organizations/{orgId}/customers":{"get":{"tags":["Customers"],"summary":"List organization customers","description":"Read only. Documents live at organizations/{orgId}/customers. A document whose organizationId field is a different org is omitted. Default limit is 50. Card data and secrets are removed. Owners and admins receive billing fields, including stripeCustomerId, balances, payment methods, and autopay. Active technicians receive the service fields (name, phone, email, address, notes, pools) and those billing fields are omitted.","operationId":"listCustomers","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"name":"q","in":"query","required":false,"description":"Search text, at most 100 characters. Case-insensitive substring match on name, email, phone, and the primary address (street, city, state, zip). A phone-like q with at least 3 digits also matches phone numbers ignoring spaces and punctuation. Filtering happens on the server inside this organization and works with limit and cursor. Technicians search the same service fields they can already read. No match returns an empty list.","schema":{"type":"string","maxLength":100}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"post":{"tags":["Customers"],"summary":"Create an organization customer","description":"Owners and admins only. name is required. email, phone, and notes are optional. Billing fields, payment methods, and Stripe ids are rejected. Idempotency-Key is required. No Stripe call is made.","operationId":"createCustomer","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}}}}},"/v1/organizations/{orgId}/customers/{customerId}":{"get":{"tags":["Customers"],"summary":"Get one organization customer","description":"","operationId":"getCustomer","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/routes":{"get":{"tags":["Routes"],"summary":"List routes","description":"Read only. A route is the set of active stops for one technician on one local calendar date, derived from organizations/{orgId}/stops. It is not a separate stored collection. The Pooli Pro app saves an IANA time zone (for example America/Los_Angeles) on the organization the first time an owner or admin opens it, and owners and admins can change it under Organization Defaults. An organization that has not been opened since then can still have none. date uses organization.timeZone or organization.timezone when that value is an IANA name such as America/Los_Angeles. Otherwise it uses organization.timeZoneOffset or organization.timezoneOffset, in minutes, local minus UTC (the same convention as job.timeZoneOffset; PDT is -420). Abbreviations such as PDT are ignored. If none of those fields are present, or the name is not a valid IANA zone, the date is UTC and timeZoneSource is utc-fallback. id is YYYY-MM-DD:technicianUserId, or YYYY-MM-DD:unassigned. Default limit is 50. Pass date, or from and to, to expand repeating stops the way My Route does. The range is inclusive and at most 31 days, and the result is capped at 500 occurrences. Omit both to keep each stop on its stored anchor date (expanded false). stopIds lists stops the technician sees. occurrences adds the occurrence date, start, duration, technicians, travel time and source, fixedArrival, overridden, skipped, and completed. A skipped week is in occurrences and not in stopIds.","operationId":"listRoutes","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"name":"date","in":"query","required":false,"description":"Local calendar date YYYY-MM-DD in the organization time zone. UTC when the organization has no usable zone.","schema":{"type":"string"}},{"name":"technicianUserId","in":"query","required":false,"description":"Only stops assigned to this technician user id on that date, including a one-off cover and excluding a one-week removal.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Range start YYYY-MM-DD, inclusive, with to. Do not combine with date. At most 31 days.","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"Range end YYYY-MM-DD, inclusive, with from.","schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/RouteDay"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/routes/{routeId}":{"get":{"tags":["Routes"],"summary":"Get one route","description":"routeId is the list id, for example 2026-10-15:technicianUserId. The date in the id is expanded, so a repeating stop is included when it occurs on that day.","operationId":"getRoute","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"routeId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteDay"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/stops":{"get":{"tags":["Stops"],"summary":"List route stops","description":"Read only. organizations/{orgId}/stops. Default limit is 50. Deleted stops are included; clients can filter isDeleted.","operationId":"listStops","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"post":{"tags":["Stops"],"summary":"Create a route stop","description":"Owners, admins, and active technicians. poolId and scheduledDateTime are required. The pool must belong to this organization. The stored stop includes pool, using the app shape (chemicalCategory, indoor, id) plus poolId, and customerId and locationId when the pool has them. technicianUserIds, timeZone, duration, and fixedArrival are optional. Omit fixedArrival and the stop stays movable. serviceCost and other billing fields are rejected. Idempotency-Key is required. No routing or Stripe call is made. TIME INPUT. scheduledDateTime takes local wall-clock time, the way a technician says it. 2026-11-10T14:00 (also 2026-11-10 14:00, with optional :ss and fraction) has no offset and is read as local time in this order: the timeZone field in the request body (an IANA name such as America/Los_Angeles), then the organization zone (organization.timeZone or timezone, or timeZoneOffset or timezoneOffset in minutes, the same zone route days and GET /v1/me use). An explicit offset is always honored and wins: 2026-11-10T14:00:00-08:00, +05:30, or Z. The stop is stored as an instant (a Firestore timestamp), exactly like the app, which builds it from the wall clock on the phone. If there is no offset, no timeZone, and the organization has no saved zone (GET /v1/me shows timeZone null), the request is refused with 400 instead of guessed as UTC. A local time that a clock change skips is refused (for example 02:30 on the spring forward day), and a time that happens twice reads as the first one. A date with no time is refused. The response echoes what was understood: scheduledLocal (the local wall time, null when an offset was sent), scheduledTimeZone and scheduledTimeZoneSource (organization.timeZone, request.timeZone, or input.offset). WHO. technicianUserIds holds user ids, the same ids as technicians userId and as technicianUserId in GET /v1/me. Omit it and the stop goes to the caller. A technician can only schedule a stop for themselves: technicianUserIds must be only their own user id (403 otherwise, including an empty list). Owners and admins can schedule any active technician of the organization or the owner (400 for anyone else) and can send an empty list for an unassigned stop. ","operationId":"createStop","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopCreate"}}}}}},"/v1/organizations/{orgId}/stops/{stopId}":{"get":{"tags":["Stops"],"summary":"Get one route stop","description":"","operationId":"getStop","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stopId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]},"patch":{"tags":["Stops"],"summary":"Update a route stop","description":"Owners, admins, and active technicians. Idempotency-Key is required. Allowed fields: scope, occurrenceDate, fixedArrival, duration, scheduledDateTime, technicianUserIds, travelTime, travelFromStopId, travelTimeManual, skip. Unknown fields, including occurrenceOverrides, are rejected. A one-off updates that document. Omit scope or send scope series. scope occurrence is rejected. A repeating stop rejects schedule fields unless scope is series (every week) or occurrence (one week, with occurrenceDate YYYY-MM-DD). fixedArrival is always a series field. Series writes keep the anchor calendar date and do not replace occurrenceOverrides. One-week writes set individual occurrenceOverrides.{date} fields and never replace the map. occurrenceDate must be a real visit of the series, must round-trip as a calendar date, and must not be older than 56 days. One-week moves stay in the same Monday to Sunday week. The response is an acknowledgement, not the stop document, and echoes scheduledDateTimeUtc, scheduledLocal and scheduledTimeZone when scheduledDateTime was sent. TIME INPUT. scheduledDateTime takes local wall-clock time, the way a technician says it. 2026-11-10T14:00 (also 2026-11-10 14:00, with optional :ss and fraction) has no offset and is read as local time in this order: the timeZone field in the request body (an IANA name such as America/Los_Angeles), then the organization zone (organization.timeZone or timezone, or timeZoneOffset or timezoneOffset in minutes, the same zone route days and GET /v1/me use). An explicit offset is always honored and wins: 2026-11-10T14:00:00-08:00, +05:30, or Z. The stop is stored as an instant (a Firestore timestamp), exactly like the app, which builds it from the wall clock on the phone. If there is no offset, no timeZone, and the organization has no saved zone (GET /v1/me shows timeZone null), the request is refused with 400 instead of guessed as UTC. A local time that a clock change skips is refused (for example 02:30 on the spring forward day), and a time that happens twice reads as the first one. A date with no time is refused. The response echoes what was understood: scheduledLocal (the local wall time, null when an offset was sent), scheduledTimeZone and scheduledTimeZoneSource (organization.timeZone, request.timeZone, or input.offset). Send timeZone only together with scheduledDateTime. WHO. A technician can only edit a stop they are on: 403 for any other stop. A technician cannot reassign: technicianUserIds, if sent, must be only their own id and the stop must have no one else on it (403 otherwise). Only owners and admins can add, remove or replace technicians, and only with active technicians of the organization or the owner (400 otherwise).","operationId":"patchStop","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stopId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopUpdateResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopUpdate"}}}}}},"/v1/organizations/{orgId}/invoices":{"get":{"tags":["Invoices"],"summary":"List invoices","description":"Read only. organizations/{orgId}/invoices. Owners and admins only. An active technician receives 403. Default limit is 50. Card data is removed. Stripe ids are kept.","operationId":"listInvoices","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/invoices/{invoiceId}":{"get":{"tags":["Invoices"],"summary":"Get one invoice","description":"","operationId":"getInvoice","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/estimates":{"get":{"tags":["Estimates"],"summary":"List estimates","description":"Owners and admins only. Active technicians receive 403. Read only. organizations/{orgId}/estimates. Default limit is 50.","operationId":"listEstimates","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/estimates/{estimateId}":{"get":{"tags":["Estimates"],"summary":"Get one estimate","description":"Owners and admins only. Active technicians receive 403.","operationId":"getEstimate","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"estimateId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/subscriptions":{"get":{"tags":["Subscriptions"],"summary":"List service subscriptions","description":"Owners and admins only. Active technicians receive 403. Read only. organizations/{orgId}/service_subscriptions. These are organization service billing subscriptions, not Pool Club subscriptions. Default limit is 50.","operationId":"listServiceSubscriptions","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/subscriptions/{subscriptionId}":{"get":{"tags":["Subscriptions"],"summary":"Get one service subscription","description":"Owners and admins only. Active technicians receive 403.","operationId":"getServiceSubscription","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"subscriptionId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/payments":{"get":{"tags":["Payments"],"summary":"List payments","description":"Read only. Owners and admins only. An active technician receives 403. Reads payment_history under this organization's invoices, estimates, and service subscriptions. Optional invoiceId, estimateId, or subscriptionId limits the parent. id is parentType~parentId~paymentId. Stripe ids are kept. Card numbers, CVC, expiry, and last4 are removed. Default limit is 50.","operationId":"listPayments","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"name":"invoiceId","in":"query","required":false,"schema":{"type":"string"}},{"name":"estimateId","in":"query","required":false,"schema":{"type":"string"}},{"name":"subscriptionId","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/PaymentRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/payments/{paymentId}":{"get":{"tags":["Payments"],"summary":"Get one payment","description":"paymentId is the composite id returned by the list.","operationId":"getPayment","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"paymentId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/products":{"get":{"tags":["Products"],"summary":"List the organization product catalog","description":"Read only. organizations/{orgId}/products. Default limit is 50. stripeProductId and stripePriceId are kept.","operationId":"listProducts","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/products/{productId}":{"get":{"tags":["Products"],"summary":"Get one catalog product","description":"","operationId":"getProduct","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"productId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/equipment":{"get":{"tags":["Equipment"],"summary":"List installed equipment","description":"Read only. organizations/{orgId}/installed_equipment. Default limit is 50.","operationId":"listEquipment","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/equipment/{equipmentId}":{"get":{"tags":["Equipment"],"summary":"Get one installed equipment item","description":"","operationId":"getEquipment","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"equipmentId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/service-visits":{"get":{"tags":["Service visits"],"summary":"List service visits","description":"Read only. organizations/{orgId}/jobs. Customer signatures are omitted. Default limit is 50.","operationId":"listServiceVisits","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/service-visits/{visitId}":{"get":{"tags":["Service visits"],"summary":"Get one service visit","description":"","operationId":"getServiceVisit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/service-reports":{"get":{"tags":["Service reports"],"summary":"List service reports","description":"Read only projection of service visits that are completed, sending a report, or already have report fields. Default limit is 50.","operationId":"listServiceReports","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/ServiceReport"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/service-reports/{visitId}":{"get":{"tags":["Service reports"],"summary":"Get one service report","description":"","operationId":"getServiceReport","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceReport"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/routes/me":{"get":{"tags":["Routes"],"summary":"Get my route for a day","description":"The calling user's own route for one local calendar date (default today in the organization time zone). Same projection as GET routes with date and technicianUserId, so the order, travel time and completed flag match. With X-Pooli-Act-As the route is the acted-as user's. A day with no stops returns a route with empty stopIds and occurrences, not 404. Each occurrence adds poolId, poolName, customerId, address, requiresBeforePhoto, requiresGatePhoto, sendJobReports, and visit. visit is null until a visit exists, otherwise { id, status } for the active visit (inProgress, paused) or the completed one, so a client knows whether to start, resume or complete. Use stopId with the start route and visit.id with the other visit routes. Gate and access codes are never returned. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"getMyRoute","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":false,"description":"Local calendar date YYYY-MM-DD in the organization time zone. Defaults to today.","schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyRouteDay"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/stops/{stopId}/start":{"post":{"tags":["Service visits"],"summary":"Start a stop (create or resume the visit)","description":"Owners, admins, and active technicians. Does what Start in the app does: it creates the visit in organizations/{orgId}/jobs with status inProgress, startTime now, the stop embedded as routeStop, estimatedDuration and cost from the stop, technicianCosts from each technician's defaultVisitCost, and timeZoneOffset from the organization zone. 201 with created true when a new visit is made. 200 with changed false and the existing visit when this stop is already in progress for the day, so a retry is safe. 200 with changed true when an existing preview or scheduled visit is started. date defaults to today in the organization time zone and selects the occurrence of a repeating stop. technicianUserId (owner or admin only) records another active technician as the starter. A technician must be assigned to the stop that day or gets 403. 409 reasons: not_scheduled and occurrence_skipped (send allowOffSchedule true to start anyway, as the app's off-schedule confirmation does), visit_paused (resume it), already_completed (send additionalService true for another visit the same week), stop_has_no_pool. Not mirrored: the app's route-start Heading Your Way email and the passive location capture, and the app's write that assigns the starting technician onto an unassigned stop. An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"startStopVisit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stopId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"The visit was already in progress, or an existing preview or scheduled visit was started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartVisitRequest"}}}}}},"/v1/organizations/{orgId}/service-visits/{visitId}/pause":{"post":{"tags":["Service visits"],"summary":"Pause a visit","description":"Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. No body. Sets status paused and pausedAt now, as Pause does in the app. Already paused returns 200 with changed false. 409 not_in_progress when the visit is not in progress (not started, completed, cancelled). An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"pauseServiceVisit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/service-visits/{visitId}/resume":{"post":{"tags":["Service visits"],"summary":"Resume a paused visit","description":"Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. No body. Sets status inProgress, clears pausedAt, and adds the time spent paused (milliseconds) to pauseDuration, as Resume does in the app. Already in progress returns 200 with changed false. 409 not_paused when the visit is not paused. An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"resumeServiceVisit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/service-visits/{visitId}/complete":{"post":{"tags":["Service visits"],"summary":"Complete a visit","description":"Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. No body. Does what Complete does in the app: status completed, completedDate and endTime now, timeZoneOffset, serviceLogIds extended with every non-deleted, non-job log on the pool created since startTime, and a type job log written under the pool with the completed job embedded. Completing a completed visit returns 200 with changed false and writes nothing again. Before it completes, the photo requirements on the visit's embedded stop are checked like the app: a before photo unless the stop sets requiresBeforePhoto false, and a gate photo when the stop sets requiresGateImage true. A missing photo returns 409 photos_required with details.missing (before, gate) and the app's message, for example \"A before photo is required before completing this service\". Add photos with the photos route first. Other 409 reasons: visit_paused (resume first), not_started. requirements.sendJobReports is the stop's setting, the app's default for whether to send the report next. An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"completeServiceVisit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/organizations/{orgId}/service-visits/{visitId}/report":{"post":{"tags":["Service visits"],"summary":"Preview, draft, or send the service report email","description":"Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. Sending needs an explicit confirmation. Without confirm true nothing is sent: the call returns 409 with details.reason confirmation_required and a preview, so an assistant can show it to the person and ask. details matches the ServiceVisitReportPreview schema: recipients (kind customer or admin, name, email, subject), subjects, summary (poolName, serviceDate, technicianName, durationMinutes, logCount, readings, notes, photo counts), bodyPreview (plain text of what the report says), customerNote, adminNote, confirmWith { confirm: true } and draftWith { previewTo: \"me\" }. A preview needs no Idempotency-Key and has no side effects. 409 no_recipients is returned instead when nobody would receive the report. previewTo \"me\" emails a draft of the customer version to the calling user's own email (users/{uid}.email, see GET /v1/me) only. It is marked [Draft], is never sent to the customer or to adminNote.recipients, and changes no document. 409 no_self_email when the account has no email. It cannot be combined with confirm. Both previewTo me and confirm true require an Idempotency-Key because they send email. A replayed key returns the original response and sends once; to confirm after a draft use a new key. With confirm true it runs the same code as the app's technicians-sendJobCompletionReport callable: the customer on the visit's pool gets the report when they have an email on file (unless adminNote.skipCustomer is true), and adminNote.recipients get the report with adminNote.note. Emails are queued in the mail collection like every other email. The visit must be completed (409 not_completed). customerNote and adminNote.note are plain text and are HTML escaped before they go in the email. At most 10 recipients, each a valid email address. A report can be sent again, as in the app. Only the visit's assigned technician, an owner or an admin can preview, draft or send (403 otherwise). An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"sendServiceVisitReport","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitReportResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitReportRequest"}}}}}},"/v1/organizations/{orgId}/service-visits/{visitId}/photos":{"post":{"tags":["Service visits"],"summary":"Add before, after, or gate photos to a visit","description":"Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. Idempotency-Key is required. photos is an array of base64 image strings or objects { data, filename }, with the same rules as note photos: data may be raw base64 or a data URL, contentType is ignored, the server accepts JPEG, PNG, GIF and WebP after reading the file bytes, each photo is at most 1500000 decoded bytes (413 above that), at most 4 photos per request. The server stores no recompressed copy, so send images already sized for upload. Files are saved at organizations/{orgId}/jobs/{visitId}/{milliseconds}-{index}{ext}, the app's job photo folder, and each is appended to beforePhotos, afterPhotos, or gatePhotos as { id, url, note, timestamp, type }. note is optional text (500 characters) saved on each photo. A visit can have at most 12 photos of each type. Allowed while the visit is inProgress, paused, or completed. 409 not_started and photo_limit. Download URLs in responses and in GET service visits are returned without their access token, like every other read. An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"addServiceVisitPhotos","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitPhotosResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitPhotosRequest"}}}}}},"/organizations/{orgId}/maintenance-catalog":{"get":{"tags":["Maintenance"],"summary":"List the organization maintenance catalog","description":"Legacy alias of /v1/organizations/{orgId}/maintenance-catalog. Prefer the canonical path. Same catalog as the personal route, for an organization member. Owners, admins, and active technicians can read it. Built-in defaults shorter than 7 days are raised to 7 days, matching the pro app (Empty Skimmer Basket(s) and Empty Cleaner). Custom tasks are the effective user's users/{uid}.prefs.customMaintenance. That is the API key user, or the user named by X-Pooli-Act-As when the owner acts as someone else. The app stores custom maintenance on the signed-in user, including while that user works in an organization. There is no separate organization collection. Hidden, disabled, deleted, and isDeleted custom rows are omitted, same as the personal route. Copy id, name, category, duration, and aggregationName (when present) into each maintenances entry on POST /v1/organizations/{orgId}/pools/{poolId}/logs?type=maintenance. The example is abbreviated. cleanSkimmers duration is 604800 seconds (7 days) on this route.","operationId":"listOrganizationMaintenanceCatalogAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/MaintenanceCatalogItem"}},{"$ref":"#/components/schemas/ListEnvelope"}]},"example":[{"id":"cleanSkimmers","name":"Empty Skimmer Basket(s)","category":"emptySkimmers","group":"Weekly","custom":false,"duration":604800},{"id":"sweepPool","name":"Brush Walls","category":"sweepWalls","group":"Weekly","custom":false,"duration":1814400},{"id":"cleanFilter","name":"Clean/Replace Filter","category":"cleanFilter","group":"Semi-Yearly","custom":false,"duration":15724800},{"id":"oasis-filter","name":"Clean the filter at the oasis","category":"custom","group":"Monthly","custom":true,"duration":2592000}]}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/maintenance-catalog","x-legacy-alias":true}},"/organizations/{orgId}/technicians":{"get":{"tags":["Technicians"],"summary":"List technicians","description":"Legacy alias of /v1/organizations/{orgId}/technicians. Prefer the canonical path. Any present status query (the value is ignored) returns only technicians whose status is pending. Omit status to return every technician.","operationId":"listTechniciansAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/technicianStatus"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Technician"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/technicians","x-legacy-alias":true}},"/organizations/{orgId}/technicians/{techId}/status":{"post":{"tags":["Technicians"],"summary":"Set a technician status","description":"Legacy alias of /v1/organizations/{orgId}/technicians/{techId}/status. Prefer the canonical path. Owners and admins only. status must be active, inactive, or rejected. approved and any other value return 400. active sets the technician user's organizationId, technicianId, and organizationStatus to active, the same fields processTechnicianApproval writes. inactive and rejected clear those three fields when they point at this technician, and leave the organization ownerUserId profile unchanged.","operationId":"updateTechnicianStatusAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"techId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessFlag"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TechnicianStatusRequest"}}}},"x-canonical-path":"/v1/organizations/{orgId}/technicians/{techId}/status","x-legacy-alias":true}},"/organizations/{orgId}/pools":{"get":{"tags":["Organization pools"],"summary":"List organization pools","description":"Legacy alias of /v1/organizations/{orgId}/pools. Prefer the canonical path. Optional assigned query is compared to the isAssigned field as a string, not a boolean. location and weather are omitted.","operationId":"listOrganizationPoolsAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/assigned"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Pool"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/pools","x-legacy-alias":true},"post":{"tags":["Organization pools"],"summary":"Create an organization pool","description":"Legacy alias of /v1/organizations/{orgId}/pools. Prefer the canonical path. Owners and admins only. Active technicians receive 403. Idempotency-Key is required. Clients that used to call this without the header, or as a technician, now receive 400 or 403. Same body as user pool create. The server sets organizationId from the path and userId from the API key's effective user. supplimentalSanitizers is an intentional legacy field name. Do not rename it. cartrige is an intentional legacy spelling used by the app, by CSV import, and as the value stored when filterCategory is omitted on pool create. Do not rename it. When a client sends filterCategory, the create-pool validator currently accepts de, sand, and cartridge.","operationId":"createOrganizationPoolAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolCreateRequest"}}}},"x-canonical-path":"/v1/organizations/{orgId}/pools","x-legacy-alias":true}},"/organizations/{orgId}/pools/{poolId}":{"get":{"tags":["Organization pools"],"summary":"Get one organization pool","description":"Legacy alias of /v1/organizations/{orgId}/pools/{poolId}. Prefer the canonical path. ","operationId":"getOrganizationPoolAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/pools/{poolId}","x-legacy-alias":true},"delete":{"tags":["Organization pools"],"summary":"Soft-delete an organization pool","description":"Legacy alias of /v1/organizations/{orgId}/pools/{poolId}. Prefer the canonical path. Owners and admins only. Active technicians receive 403.","operationId":"deleteOrganizationPoolAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessFlag"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/pools/{poolId}","x-legacy-alias":true},"patch":{"tags":["Organization pools"],"summary":"Update an organization pool","description":"Legacy alias of /v1/organizations/{orgId}/pools/{poolId}. Prefer the canonical path. Owners and admins only. Same allowed fields as the user pool update. Active technicians receive 403.","operationId":"patchOrganizationPoolAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolPatch"}}}},"x-canonical-path":"/v1/organizations/{orgId}/pools/{poolId}","x-legacy-alias":true}},"/organizations/{orgId}/pools/{poolId}/logs":{"get":{"tags":["Organization logs"],"summary":"List logs for an organization pool","description":"Legacy alias of /v1/organizations/{orgId}/pools/{poolId}/logs. Prefer the canonical path. Same paging rules as user logs. Default limit 50. cursor and startAfter are dates. type is filtered after the page is read. Empty is null unless envelope=1.","operationId":"listOrganizationLogsAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/logType"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Log"}},{"type":"null"}]},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/pools/{poolId}/logs","x-legacy-alias":true},"post":{"tags":["Organization logs"],"summary":"Create an organization pool log","description":"Legacy alias of /v1/organizations/{orgId}/pools/{poolId}/logs. Prefer the canonical path. Owners, admins, and active technicians. Query type is required. Body is the log object. The 201 data field is the new log id. type=test generates relatedProblems, recommendations, csi and targets the same way as a user test create, described on that route. type=swim uses the same body as a user swim log: numSwimmers, duration in seconds, and an optional note. The stored userId is the API user. Swim minute and addShock reminder behavior matches the app, described on the user log create. Organization note documents still store userId null. Photo bytes are stored under users/{apiUserId}/, the same prefix the app uses for the signed-in user. type=note accepts photos: an array of base64 image strings or objects { data, filename }. data may be raw base64 or a data URL. contentType is ignored. The server accepts JPEG, PNG, GIF, and WebP only after reading the file bytes. Each photo must be at most 1500000 decoded bytes. At most 4 photos per request and 12 photos on one note. A create with photos also requires note. Do not send attachments and photos together. The stored attachments array matches the app: attachmentType photo, firestorePath users/{uploaderUid}/{sha256}{ext}, description, and a Firebase download url. The uploaderUid is the API key user (or the acted-as user on an organization route). The 201 data field stays the new log id. Read the log to see attachments. Text-only notes omit photos and still store attachments null. One create or patch counts as one request against the hourly rate limit (10, or 150 for Pool Club, shared by all of the user's keys).","operationId":"createOrganizationLogAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/logType"},{"$ref":"#/components/parameters/actAs"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedLog"},"examples":{"created":{"summary":"Swim log created","value":{"success":true,"message":"Log created successfully","data":"6f1c0c2e-4b7a-4e1d-9c3a-8b2d5e7f1a90"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogCreate"},"examples":{"swim":{"summary":"Swim log","value":{"numSwimmers":2,"duration":1800,"note":"Morning laps","creatorName":"Alex"}},"notePhoto":{"summary":"Note with one photo","value":{"note":"Skimmer basket is full","creatorName":"Alex","photos":[{"data":"<base64 JPEG, PNG, GIF, or WebP>","filename":"skimmer.jpg"}]}}}}}},"x-canonical-path":"/v1/organizations/{orgId}/pools/{poolId}/logs","x-legacy-alias":true}},"/organizations/{orgId}/pools/{poolId}/logs/{logId}":{"get":{"tags":["Organization logs"],"summary":"Get one organization pool log","description":"Legacy alias of /v1/organizations/{orgId}/pools/{poolId}/logs/{logId}. Prefer the canonical path. ","operationId":"getOrganizationLogAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/pools/{poolId}/logs/{logId}","x-legacy-alias":true},"delete":{"tags":["Organization logs"],"summary":"Delete an organization pool log","description":"Legacy alias of /v1/organizations/{orgId}/pools/{poolId}/logs/{logId}. Prefer the canonical path. Owners, admins, and active technicians. Hard-deletes the log document. Storage objects for note photos are left in place. The app soft-deletes the note and does not delete those files either.","operationId":"deleteOrganizationLogAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessMessage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/pools/{poolId}/logs/{logId}","x-legacy-alias":true},"patch":{"tags":["Organization logs"],"summary":"Update an organization pool log","description":"Legacy alias of /v1/organizations/{orgId}/pools/{poolId}/logs/{logId}. Prefer the canonical path. Owners, admins, and active technicians. Allowed fields: note, creatorName, chemicalReading, equipmentReading, photos. photos is accepted only when the stored log type is note. It appends images and does not replace attachments already on the note. Photo bytes are stored under users/{apiUserId}/. A text-only patch that omits photos leaves attachments unchanged. type=note accepts photos: an array of base64 image strings or objects { data, filename }. data may be raw base64 or a data URL. contentType is ignored. The server accepts JPEG, PNG, GIF, and WebP only after reading the file bytes. Each photo must be at most 1500000 decoded bytes. At most 4 photos per request and 12 photos on one note. A create with photos also requires note. Do not send attachments and photos together. The stored attachments array matches the app: attachmentType photo, firestorePath users/{uploaderUid}/{sha256}{ext}, description, and a Firebase download url. The uploaderUid is the API key user (or the acted-as user on an organization route). The 201 data field stays the new log id. Read the log to see attachments. Text-only notes omit photos and still store attachments null. One create or patch counts as one request against the hourly rate limit (10, or 150 for Pool Club, shared by all of the user's keys).","operationId":"patchOrganizationLogAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"poolId","in":"path","required":true,"schema":{"type":"string"}},{"name":"logId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogPatch"}}}},"x-canonical-path":"/v1/organizations/{orgId}/pools/{poolId}/logs/{logId}","x-legacy-alias":true}},"/organizations/{orgId}/import/csv":{"post":{"tags":["Customers"],"summary":"Import customers and pools from CSV","description":"Legacy alias of /v1/organizations/{orgId}/import/csv. Prefer the canonical path. Owners and admins only. Active technicians receive 403. REST form of the customers-importCsv callable. Send JSON { csvText, mapping, defaults } or a raw text/csv body. filterCategory values are stored as given. The intentional legacy spelling cartrige is valid here and must not be renamed.","operationId":"importOrganizationCustomersCsvAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvImportResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvImportRequest"}},"text/csv":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}},"x-canonical-path":"/v1/organizations/{orgId}/import/csv","x-legacy-alias":true}},"/organizations/{orgId}/customers":{"get":{"tags":["Customers"],"summary":"List organization customers","description":"Legacy alias of /v1/organizations/{orgId}/customers. Prefer the canonical path. Read only. Documents live at organizations/{orgId}/customers. A document whose organizationId field is a different org is omitted. Default limit is 50. Card data and secrets are removed. Owners and admins receive billing fields, including stripeCustomerId, balances, payment methods, and autopay. Active technicians receive the service fields (name, phone, email, address, notes, pools) and those billing fields are omitted.","operationId":"listCustomersAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"name":"q","in":"query","required":false,"description":"Search text, at most 100 characters. Case-insensitive substring match on name, email, phone, and the primary address (street, city, state, zip). A phone-like q with at least 3 digits also matches phone numbers ignoring spaces and punctuation. Filtering happens on the server inside this organization and works with limit and cursor. Technicians search the same service fields they can already read. No match returns an empty list.","schema":{"type":"string","maxLength":100}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/customers","x-legacy-alias":true},"post":{"tags":["Customers"],"summary":"Create an organization customer","description":"Legacy alias of /v1/organizations/{orgId}/customers. Prefer the canonical path. Owners and admins only. name is required. email, phone, and notes are optional. Billing fields, payment methods, and Stripe ids are rejected. Idempotency-Key is required. No Stripe call is made.","operationId":"createCustomerAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}}},"x-canonical-path":"/v1/organizations/{orgId}/customers","x-legacy-alias":true}},"/organizations/{orgId}/customers/{customerId}":{"get":{"tags":["Customers"],"summary":"Get one organization customer","description":"Legacy alias of /v1/organizations/{orgId}/customers/{customerId}. Prefer the canonical path. ","operationId":"getCustomerAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/customers/{customerId}","x-legacy-alias":true}},"/organizations/{orgId}/routes":{"get":{"tags":["Routes"],"summary":"List routes","description":"Legacy alias of /v1/organizations/{orgId}/routes. Prefer the canonical path. Read only. A route is the set of active stops for one technician on one local calendar date, derived from organizations/{orgId}/stops. It is not a separate stored collection. The Pooli Pro app saves an IANA time zone (for example America/Los_Angeles) on the organization the first time an owner or admin opens it, and owners and admins can change it under Organization Defaults. An organization that has not been opened since then can still have none. date uses organization.timeZone or organization.timezone when that value is an IANA name such as America/Los_Angeles. Otherwise it uses organization.timeZoneOffset or organization.timezoneOffset, in minutes, local minus UTC (the same convention as job.timeZoneOffset; PDT is -420). Abbreviations such as PDT are ignored. If none of those fields are present, or the name is not a valid IANA zone, the date is UTC and timeZoneSource is utc-fallback. id is YYYY-MM-DD:technicianUserId, or YYYY-MM-DD:unassigned. Default limit is 50. Pass date, or from and to, to expand repeating stops the way My Route does. The range is inclusive and at most 31 days, and the result is capped at 500 occurrences. Omit both to keep each stop on its stored anchor date (expanded false). stopIds lists stops the technician sees. occurrences adds the occurrence date, start, duration, technicians, travel time and source, fixedArrival, overridden, skipped, and completed. A skipped week is in occurrences and not in stopIds.","operationId":"listRoutesAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"name":"date","in":"query","required":false,"description":"Local calendar date YYYY-MM-DD in the organization time zone. UTC when the organization has no usable zone.","schema":{"type":"string"}},{"name":"technicianUserId","in":"query","required":false,"description":"Only stops assigned to this technician user id on that date, including a one-off cover and excluding a one-week removal.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Range start YYYY-MM-DD, inclusive, with to. Do not combine with date. At most 31 days.","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"Range end YYYY-MM-DD, inclusive, with from.","schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/RouteDay"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/routes","x-legacy-alias":true}},"/organizations/{orgId}/routes/{routeId}":{"get":{"tags":["Routes"],"summary":"Get one route","description":"Legacy alias of /v1/organizations/{orgId}/routes/{routeId}. Prefer the canonical path. routeId is the list id, for example 2026-10-15:technicianUserId. The date in the id is expanded, so a repeating stop is included when it occurs on that day.","operationId":"getRouteAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"routeId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteDay"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/routes/{routeId}","x-legacy-alias":true}},"/organizations/{orgId}/stops":{"get":{"tags":["Stops"],"summary":"List route stops","description":"Legacy alias of /v1/organizations/{orgId}/stops. Prefer the canonical path. Read only. organizations/{orgId}/stops. Default limit is 50. Deleted stops are included; clients can filter isDeleted.","operationId":"listStopsAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/stops","x-legacy-alias":true},"post":{"tags":["Stops"],"summary":"Create a route stop","description":"Legacy alias of /v1/organizations/{orgId}/stops. Prefer the canonical path. Owners, admins, and active technicians. poolId and scheduledDateTime are required. The pool must belong to this organization. The stored stop includes pool, using the app shape (chemicalCategory, indoor, id) plus poolId, and customerId and locationId when the pool has them. technicianUserIds, timeZone, duration, and fixedArrival are optional. Omit fixedArrival and the stop stays movable. serviceCost and other billing fields are rejected. Idempotency-Key is required. No routing or Stripe call is made. TIME INPUT. scheduledDateTime takes local wall-clock time, the way a technician says it. 2026-11-10T14:00 (also 2026-11-10 14:00, with optional :ss and fraction) has no offset and is read as local time in this order: the timeZone field in the request body (an IANA name such as America/Los_Angeles), then the organization zone (organization.timeZone or timezone, or timeZoneOffset or timezoneOffset in minutes, the same zone route days and GET /v1/me use). An explicit offset is always honored and wins: 2026-11-10T14:00:00-08:00, +05:30, or Z. The stop is stored as an instant (a Firestore timestamp), exactly like the app, which builds it from the wall clock on the phone. If there is no offset, no timeZone, and the organization has no saved zone (GET /v1/me shows timeZone null), the request is refused with 400 instead of guessed as UTC. A local time that a clock change skips is refused (for example 02:30 on the spring forward day), and a time that happens twice reads as the first one. A date with no time is refused. The response echoes what was understood: scheduledLocal (the local wall time, null when an offset was sent), scheduledTimeZone and scheduledTimeZoneSource (organization.timeZone, request.timeZone, or input.offset). WHO. technicianUserIds holds user ids, the same ids as technicians userId and as technicianUserId in GET /v1/me. Omit it and the stop goes to the caller. A technician can only schedule a stop for themselves: technicianUserIds must be only their own user id (403 otherwise, including an empty list). Owners and admins can schedule any active technician of the organization or the owner (400 for anyone else) and can send an empty list for an unassigned stop. ","operationId":"createStopAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopCreate"}}}},"x-canonical-path":"/v1/organizations/{orgId}/stops","x-legacy-alias":true}},"/organizations/{orgId}/stops/{stopId}":{"get":{"tags":["Stops"],"summary":"Get one route stop","description":"Legacy alias of /v1/organizations/{orgId}/stops/{stopId}. Prefer the canonical path. ","operationId":"getStopAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stopId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/stops/{stopId}","x-legacy-alias":true},"patch":{"tags":["Stops"],"summary":"Update a route stop","description":"Legacy alias of /v1/organizations/{orgId}/stops/{stopId}. Prefer the canonical path. Owners, admins, and active technicians. Idempotency-Key is required. Allowed fields: scope, occurrenceDate, fixedArrival, duration, scheduledDateTime, technicianUserIds, travelTime, travelFromStopId, travelTimeManual, skip. Unknown fields, including occurrenceOverrides, are rejected. A one-off updates that document. Omit scope or send scope series. scope occurrence is rejected. A repeating stop rejects schedule fields unless scope is series (every week) or occurrence (one week, with occurrenceDate YYYY-MM-DD). fixedArrival is always a series field. Series writes keep the anchor calendar date and do not replace occurrenceOverrides. One-week writes set individual occurrenceOverrides.{date} fields and never replace the map. occurrenceDate must be a real visit of the series, must round-trip as a calendar date, and must not be older than 56 days. One-week moves stay in the same Monday to Sunday week. The response is an acknowledgement, not the stop document, and echoes scheduledDateTimeUtc, scheduledLocal and scheduledTimeZone when scheduledDateTime was sent. TIME INPUT. scheduledDateTime takes local wall-clock time, the way a technician says it. 2026-11-10T14:00 (also 2026-11-10 14:00, with optional :ss and fraction) has no offset and is read as local time in this order: the timeZone field in the request body (an IANA name such as America/Los_Angeles), then the organization zone (organization.timeZone or timezone, or timeZoneOffset or timezoneOffset in minutes, the same zone route days and GET /v1/me use). An explicit offset is always honored and wins: 2026-11-10T14:00:00-08:00, +05:30, or Z. The stop is stored as an instant (a Firestore timestamp), exactly like the app, which builds it from the wall clock on the phone. If there is no offset, no timeZone, and the organization has no saved zone (GET /v1/me shows timeZone null), the request is refused with 400 instead of guessed as UTC. A local time that a clock change skips is refused (for example 02:30 on the spring forward day), and a time that happens twice reads as the first one. A date with no time is refused. The response echoes what was understood: scheduledLocal (the local wall time, null when an offset was sent), scheduledTimeZone and scheduledTimeZoneSource (organization.timeZone, request.timeZone, or input.offset). Send timeZone only together with scheduledDateTime. WHO. A technician can only edit a stop they are on: 403 for any other stop. A technician cannot reassign: technicianUserIds, if sent, must be only their own id and the stop must have no one else on it (403 otherwise). Only owners and admins can add, remove or replace technicians, and only with active technicians of the organization or the owner (400 otherwise).","operationId":"patchStopAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stopId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopUpdateResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopUpdate"}}}},"x-canonical-path":"/v1/organizations/{orgId}/stops/{stopId}","x-legacy-alias":true}},"/organizations/{orgId}/invoices":{"get":{"tags":["Invoices"],"summary":"List invoices","description":"Legacy alias of /v1/organizations/{orgId}/invoices. Prefer the canonical path. Read only. organizations/{orgId}/invoices. Owners and admins only. An active technician receives 403. Default limit is 50. Card data is removed. Stripe ids are kept.","operationId":"listInvoicesAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/invoices","x-legacy-alias":true}},"/organizations/{orgId}/invoices/{invoiceId}":{"get":{"tags":["Invoices"],"summary":"Get one invoice","description":"Legacy alias of /v1/organizations/{orgId}/invoices/{invoiceId}. Prefer the canonical path. ","operationId":"getInvoiceAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/invoices/{invoiceId}","x-legacy-alias":true}},"/organizations/{orgId}/estimates":{"get":{"tags":["Estimates"],"summary":"List estimates","description":"Legacy alias of /v1/organizations/{orgId}/estimates. Prefer the canonical path. Owners and admins only. Active technicians receive 403. Read only. organizations/{orgId}/estimates. Default limit is 50.","operationId":"listEstimatesAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/estimates","x-legacy-alias":true}},"/organizations/{orgId}/estimates/{estimateId}":{"get":{"tags":["Estimates"],"summary":"Get one estimate","description":"Legacy alias of /v1/organizations/{orgId}/estimates/{estimateId}. Prefer the canonical path. Owners and admins only. Active technicians receive 403.","operationId":"getEstimateAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"estimateId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/estimates/{estimateId}","x-legacy-alias":true}},"/organizations/{orgId}/subscriptions":{"get":{"tags":["Subscriptions"],"summary":"List service subscriptions","description":"Legacy alias of /v1/organizations/{orgId}/subscriptions. Prefer the canonical path. Owners and admins only. Active technicians receive 403. Read only. organizations/{orgId}/service_subscriptions. These are organization service billing subscriptions, not Pool Club subscriptions. Default limit is 50.","operationId":"listServiceSubscriptionsAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/subscriptions","x-legacy-alias":true}},"/organizations/{orgId}/subscriptions/{subscriptionId}":{"get":{"tags":["Subscriptions"],"summary":"Get one service subscription","description":"Legacy alias of /v1/organizations/{orgId}/subscriptions/{subscriptionId}. Prefer the canonical path. Owners and admins only. Active technicians receive 403.","operationId":"getServiceSubscriptionAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"subscriptionId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/subscriptions/{subscriptionId}","x-legacy-alias":true}},"/organizations/{orgId}/payments":{"get":{"tags":["Payments"],"summary":"List payments","description":"Legacy alias of /v1/organizations/{orgId}/payments. Prefer the canonical path. Read only. Owners and admins only. An active technician receives 403. Reads payment_history under this organization's invoices, estimates, and service subscriptions. Optional invoiceId, estimateId, or subscriptionId limits the parent. id is parentType~parentId~paymentId. Stripe ids are kept. Card numbers, CVC, expiry, and last4 are removed. Default limit is 50.","operationId":"listPaymentsAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"name":"invoiceId","in":"query","required":false,"schema":{"type":"string"}},{"name":"estimateId","in":"query","required":false,"schema":{"type":"string"}},{"name":"subscriptionId","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/PaymentRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/payments","x-legacy-alias":true}},"/organizations/{orgId}/payments/{paymentId}":{"get":{"tags":["Payments"],"summary":"Get one payment","description":"Legacy alias of /v1/organizations/{orgId}/payments/{paymentId}. Prefer the canonical path. paymentId is the composite id returned by the list.","operationId":"getPaymentAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"paymentId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/payments/{paymentId}","x-legacy-alias":true}},"/organizations/{orgId}/products":{"get":{"tags":["Products"],"summary":"List the organization product catalog","description":"Legacy alias of /v1/organizations/{orgId}/products. Prefer the canonical path. Read only. organizations/{orgId}/products. Default limit is 50. stripeProductId and stripePriceId are kept.","operationId":"listProductsAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/products","x-legacy-alias":true}},"/organizations/{orgId}/products/{productId}":{"get":{"tags":["Products"],"summary":"Get one catalog product","description":"Legacy alias of /v1/organizations/{orgId}/products/{productId}. Prefer the canonical path. ","operationId":"getProductAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"productId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/products/{productId}","x-legacy-alias":true}},"/organizations/{orgId}/equipment":{"get":{"tags":["Equipment"],"summary":"List installed equipment","description":"Legacy alias of /v1/organizations/{orgId}/equipment. Prefer the canonical path. Read only. organizations/{orgId}/installed_equipment. Default limit is 50.","operationId":"listEquipmentAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/equipment","x-legacy-alias":true}},"/organizations/{orgId}/equipment/{equipmentId}":{"get":{"tags":["Equipment"],"summary":"Get one installed equipment item","description":"Legacy alias of /v1/organizations/{orgId}/equipment/{equipmentId}. Prefer the canonical path. ","operationId":"getEquipmentAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"equipmentId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/equipment/{equipmentId}","x-legacy-alias":true}},"/organizations/{orgId}/service-visits":{"get":{"tags":["Service visits"],"summary":"List service visits","description":"Legacy alias of /v1/organizations/{orgId}/service-visits. Prefer the canonical path. Read only. organizations/{orgId}/jobs. Customer signatures are omitted. Default limit is 50.","operationId":"listServiceVisitsAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/OrgRecord"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/service-visits","x-legacy-alias":true}},"/organizations/{orgId}/service-visits/{visitId}":{"get":{"tags":["Service visits"],"summary":"Get one service visit","description":"Legacy alias of /v1/organizations/{orgId}/service-visits/{visitId}. Prefer the canonical path. ","operationId":"getServiceVisitAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRecord"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/service-visits/{visitId}","x-legacy-alias":true}},"/organizations/{orgId}/service-reports":{"get":{"tags":["Service reports"],"summary":"List service reports","description":"Legacy alias of /v1/organizations/{orgId}/service-reports. Prefer the canonical path. Read only projection of service visits that are completed, sending a report, or already have report fields. Default limit is 50.","operationId":"listServiceReportsAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/startAfter"},{"$ref":"#/components/parameters/envelope"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Default body is the collection JSON (array, or null for empty logs and empty inventory). envelope=1 returns ListEnvelope instead. X-Next-Cursor, X-Has-More, and X-Page-Limit describe the page.","headers":{"X-Next-Cursor":{"schema":{"type":"string"},"description":"Present when another page is available."},"X-Has-More":{"schema":{"type":"string","enum":["true","false"]}},"X-Page-Limit":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/ServiceReport"}},{"$ref":"#/components/schemas/ListEnvelope"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/service-reports","x-legacy-alias":true}},"/organizations/{orgId}/service-reports/{visitId}":{"get":{"tags":["Service reports"],"summary":"Get one service report","description":"Legacy alias of /v1/organizations/{orgId}/service-reports/{visitId}. Prefer the canonical path. ","operationId":"getServiceReportAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceReport"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/service-reports/{visitId}","x-legacy-alias":true}},"/organizations/{orgId}/routes/me":{"get":{"tags":["Routes"],"summary":"Get my route for a day","description":"Legacy alias of /v1/organizations/{orgId}/routes/me. Prefer the canonical path. The calling user's own route for one local calendar date (default today in the organization time zone). Same projection as GET routes with date and technicianUserId, so the order, travel time and completed flag match. With X-Pooli-Act-As the route is the acted-as user's. A day with no stops returns a route with empty stopIds and occurrences, not 404. Each occurrence adds poolId, poolName, customerId, address, requiresBeforePhoto, requiresGatePhoto, sendJobReports, and visit. visit is null until a visit exists, otherwise { id, status } for the active visit (inProgress, paused) or the completed one, so a client knows whether to start, resume or complete. Use stopId with the start route and visit.id with the other visit routes. Gate and access codes are never returned. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"getMyRouteAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":false,"description":"Local calendar date YYYY-MM-DD in the organization time zone. Defaults to today.","schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyRouteDay"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/routes/me","x-legacy-alias":true}},"/organizations/{orgId}/stops/{stopId}/start":{"post":{"tags":["Service visits"],"summary":"Start a stop (create or resume the visit)","description":"Legacy alias of /v1/organizations/{orgId}/stops/{stopId}/start. Prefer the canonical path. Owners, admins, and active technicians. Does what Start in the app does: it creates the visit in organizations/{orgId}/jobs with status inProgress, startTime now, the stop embedded as routeStop, estimatedDuration and cost from the stop, technicianCosts from each technician's defaultVisitCost, and timeZoneOffset from the organization zone. 201 with created true when a new visit is made. 200 with changed false and the existing visit when this stop is already in progress for the day, so a retry is safe. 200 with changed true when an existing preview or scheduled visit is started. date defaults to today in the organization time zone and selects the occurrence of a repeating stop. technicianUserId (owner or admin only) records another active technician as the starter. A technician must be assigned to the stop that day or gets 403. 409 reasons: not_scheduled and occurrence_skipped (send allowOffSchedule true to start anyway, as the app's off-schedule confirmation does), visit_paused (resume it), already_completed (send additionalService true for another visit the same week), stop_has_no_pool. Not mirrored: the app's route-start Heading Your Way email and the passive location capture, and the app's write that assigns the starting technician onto an unassigned stop. An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"startStopVisitAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stopId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"The visit was already in progress, or an existing preview or scheduled visit was started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartVisitRequest"}}}},"x-canonical-path":"/v1/organizations/{orgId}/stops/{stopId}/start","x-legacy-alias":true}},"/organizations/{orgId}/service-visits/{visitId}/pause":{"post":{"tags":["Service visits"],"summary":"Pause a visit","description":"Legacy alias of /v1/organizations/{orgId}/service-visits/{visitId}/pause. Prefer the canonical path. Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. No body. Sets status paused and pausedAt now, as Pause does in the app. Already paused returns 200 with changed false. 409 not_in_progress when the visit is not in progress (not started, completed, cancelled). An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"pauseServiceVisitAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/service-visits/{visitId}/pause","x-legacy-alias":true}},"/organizations/{orgId}/service-visits/{visitId}/resume":{"post":{"tags":["Service visits"],"summary":"Resume a paused visit","description":"Legacy alias of /v1/organizations/{orgId}/service-visits/{visitId}/resume. Prefer the canonical path. Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. No body. Sets status inProgress, clears pausedAt, and adds the time spent paused (milliseconds) to pauseDuration, as Resume does in the app. Already in progress returns 200 with changed false. 409 not_paused when the visit is not paused. An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"resumeServiceVisitAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/service-visits/{visitId}/resume","x-legacy-alias":true}},"/organizations/{orgId}/service-visits/{visitId}/complete":{"post":{"tags":["Service visits"],"summary":"Complete a visit","description":"Legacy alias of /v1/organizations/{orgId}/service-visits/{visitId}/complete. Prefer the canonical path. Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. No body. Does what Complete does in the app: status completed, completedDate and endTime now, timeZoneOffset, serviceLogIds extended with every non-deleted, non-job log on the pool created since startTime, and a type job log written under the pool with the completed job embedded. Completing a completed visit returns 200 with changed false and writes nothing again. Before it completes, the photo requirements on the visit's embedded stop are checked like the app: a before photo unless the stop sets requiresBeforePhoto false, and a gate photo when the stop sets requiresGateImage true. A missing photo returns 409 photos_required with details.missing (before, gate) and the app's message, for example \"A before photo is required before completing this service\". Add photos with the photos route first. Other 409 reasons: visit_paused (resume first), not_started. requirements.sendJobReports is the stop's setting, the app's default for whether to send the report next. An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"completeServiceVisitAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitAction"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"x-canonical-path":"/v1/organizations/{orgId}/service-visits/{visitId}/complete","x-legacy-alias":true}},"/organizations/{orgId}/service-visits/{visitId}/report":{"post":{"tags":["Service visits"],"summary":"Preview, draft, or send the service report email","description":"Legacy alias of /v1/organizations/{orgId}/service-visits/{visitId}/report. Prefer the canonical path. Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. Sending needs an explicit confirmation. Without confirm true nothing is sent: the call returns 409 with details.reason confirmation_required and a preview, so an assistant can show it to the person and ask. details matches the ServiceVisitReportPreview schema: recipients (kind customer or admin, name, email, subject), subjects, summary (poolName, serviceDate, technicianName, durationMinutes, logCount, readings, notes, photo counts), bodyPreview (plain text of what the report says), customerNote, adminNote, confirmWith { confirm: true } and draftWith { previewTo: \"me\" }. A preview needs no Idempotency-Key and has no side effects. 409 no_recipients is returned instead when nobody would receive the report. previewTo \"me\" emails a draft of the customer version to the calling user's own email (users/{uid}.email, see GET /v1/me) only. It is marked [Draft], is never sent to the customer or to adminNote.recipients, and changes no document. 409 no_self_email when the account has no email. It cannot be combined with confirm. Both previewTo me and confirm true require an Idempotency-Key because they send email. A replayed key returns the original response and sends once; to confirm after a draft use a new key. With confirm true it runs the same code as the app's technicians-sendJobCompletionReport callable: the customer on the visit's pool gets the report when they have an email on file (unless adminNote.skipCustomer is true), and adminNote.recipients get the report with adminNote.note. Emails are queued in the mail collection like every other email. The visit must be completed (409 not_completed). customerNote and adminNote.note are plain text and are HTML escaped before they go in the email. At most 10 recipients, each a valid email address. A report can be sent again, as in the app. Only the visit's assigned technician, an owner or an admin can preview, draft or send (403 otherwise). An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"sendServiceVisitReportAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitReportResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitReportRequest"}}}},"x-canonical-path":"/v1/organizations/{orgId}/service-visits/{visitId}/report","x-legacy-alias":true}},"/organizations/{orgId}/service-visits/{visitId}/photos":{"post":{"tags":["Service visits"],"summary":"Add before, after, or gate photos to a visit","description":"Legacy alias of /v1/organizations/{orgId}/service-visits/{visitId}/photos. Prefer the canonical path. Owners and admins can act on any visit. An active technician can act only on a visit that lists them in technicianUserIds. Idempotency-Key is required. photos is an array of base64 image strings or objects { data, filename }, with the same rules as note photos: data may be raw base64 or a data URL, contentType is ignored, the server accepts JPEG, PNG, GIF and WebP after reading the file bytes, each photo is at most 1500000 decoded bytes (413 above that), at most 4 photos per request. The server stores no recompressed copy, so send images already sized for upload. Files are saved at organizations/{orgId}/jobs/{visitId}/{milliseconds}-{index}{ext}, the app's job photo folder, and each is appended to beforePhotos, afterPhotos, or gatePhotos as { id, url, note, timestamp, type }. note is optional text (500 characters) saved on each photo. A visit can have at most 12 photos of each type. Allowed while the visit is inProgress, paused, or completed. 409 not_started and photo_limit. Download URLs in responses and in GET service visits are returned without their access token, like every other read. An invalid state returns 409 with details.reason so a client can react without parsing the message. One call counts as one request against the shared hourly limit (10, or 150 for Pool Club).","operationId":"addServiceVisitPhotosAlias","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/idempotencyKey"},{"$ref":"#/components/parameters/actAs"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitPhotosResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitPhotosRequest"}}}},"x-canonical-path":"/v1/organizations/{orgId}/service-visits/{visitId}/photos","x-legacy-alias":true}},"/v1/content-ingest":{"post":{"tags":["Content ingest"],"summary":"Create a content ingest item","description":"Service route. Bearer API key. If the key document has a non-empty scopes array, it must include content_management. Keys with no scopes array are allowed. Not an organization-scoped route.","operationId":"createContentIngest","parameters":[{"$ref":"#/components/parameters/actAsContent"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentIngestResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentIngestCreate"}}}}}},"/v1/content-ingest/{id}":{"patch":{"tags":["Content ingest"],"summary":"Patch a content ingest item","description":"Partial update. Same service key rules as create.","operationId":"patchContentIngest","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/actAsContent"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentIngestResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentIngestPatch"}}}}}},"/v1/auth/token":{"post":{"tags":["Authentication"],"summary":"Exchange a long-lived API key for a short-lived access token","description":"Authorization: Bearer <long-lived API key>. The key is not changed. Default lifetime is 900 seconds. expiresInSeconds may be from 60 to 3600. Send the returned accessToken as Bearer on later calls. Existing clients that send the long-lived key directly keep working.","operationId":"exchangeAccessToken","parameters":[],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessToken"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenExchangeRequest"}}}}}},"/v1/auth/token/refresh":{"post":{"tags":["Authentication"],"summary":"Refresh a short-lived access token","description":"Authorization: Bearer <unexpired access token>. Issues a new token for the same API key and deletes the presented token. An expired token cannot be refreshed. A revoked or regenerated key cannot refresh.","operationId":"refreshAccessToken","parameters":[],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessToken"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenExchangeRequest"}}}}}},"/v1/auth/keys/regenerate":{"post":{"tags":["Authentication"],"summary":"Revoke short-lived tokens for this API key","description":"Authorization: Bearer <long-lived API key>. Increments the key generation and deletes apiTokens for that key. The long-lived key string is not changed. Use POST /v1/auth/keys/rotate to issue a new key. Outstanding access tokens fail. Deleting the key with apiKeys-deleteApiKey also revokes its tokens.","operationId":"regenerateApiKeyTokens","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRegeneration"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/v1/auth/keys/rotate":{"post":{"tags":["Authentication"],"summary":"Issue a new API key and start the grace period on this key","description":"Authorization: Bearer <long-lived API key>. Creates a new apiKeys document for the same user and returns its secret once. The presented key, or apiKeyId when that key belongs to the same user, stays valid until graceEndsAt. Default grace is 7 days. gracePeriodDays may be 0 through 90. Zero revokes the old key immediately and deletes its access tokens. A non-zero grace leaves those tokens valid until the old key is revoked. expiresAt on the new key is null and is not enforced. apiKeys-rotateApiKey is the signed-in callable for the same behavior.","operationId":"rotateApiKey","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRotation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRotationRequest"}}}}}},"/v1/auth/keys/revoke":{"post":{"tags":["Authentication"],"summary":"Revoke an API key before its grace period ends","description":"Authorization: Bearer <long-lived API key>. Revokes that key, or apiKeyId when it belongs to the same user. Sets status revoked, bumps generation, and deletes apiTokens minted from the revoked key. A key past graceEndsAt is revoked the same way the next time it or one of its tokens is used. apiKeys-revokeApiKey is the signed-in callable. apiKeys-deleteApiKey still deletes the key document after its tokens are removed.","operationId":"revokeApiKey","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRevocation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRevokeRequest"}}}}}},"/v1/me":{"get":{"tags":["Authentication"],"summary":"Session context for the API key user","description":"Call this once at the start of a session. It returns everything a client needs to act as this user without more lookups: identity, organizations with the user's role and technician record, Club and seat status, each organization's time zone, and the effective hourly rate limit with what is left of it. Authorization: Bearer <API key or access token from POST /v1/auth/token>. uid is apiKeys.uid on that key (the parent key, for an access token) and is also the technicianUserId to put in technicianUserIds. organizationIds and organizations are the organizations that user can call: owner (organizations.ownerUserId), admin (organizations.admins, or organizations/{orgId}/members/{uid} with role admin), or an active technician (organizations/{orgId}/technicians userId with status active). Owner and listed admins are collection queries. Technicians use the existing technicians userId collection-group query. A members/{uid} admin is included by a direct document read when that organization id is already known from users/{uid}.organizationId or from a technician document. Listing does not query collection group members by role, so it does not need a members.role collection-group index. uid is still returned when those lookups fail or match nothing, and an organization whose detail lookup fails is listed with role null. Ids are sorted. There are no billing fields or card data. Roles come from the user: role is owner, admin or technician for that organization. technicianId is the organizations/{orgId}/technicians document id for this user (null for an owner without one). Seat coverage mirrors the app (Organization.isClubMemberAndSeatCompliant): the organization is a Club member and its active and pending technicians fit in 1 + grandfathered + purchased additional seats. seatCovered is true when this user belongs to such an organization. club.active is true, and rateLimit.tier is club, when the user has an active Club subscription of their own (via subscription) or their seat is covered by the Club organization on their user record (via organization_seat). Otherwise the tier is free. timeZone is the IANA name the organization uses for route days and for offset-less times, or null when none is saved (timeZoneSource utc-fallback). Then send timeZone with local times or an explicit offset. A uid query parameter, JSON body, or X-Pooli-Act-As header is ignored. Missing, malformed, unknown, revoked, and expired credentials return 401. Auth routes have no unversioned alias, so GET /me is not served. GET /v1/me is rate limited like other authenticated routes and counts as one request. Club allows 150 requests per hour and the free tier allows 10 requests per hour. The limit is shared by all of that user's API keys, including keys made by signing in from an AI assistant. Over that limit the response is 429 Rate limit exceeded. Sign up for Club at https://pooli.app/select-plan/ for the higher Club limit. Caching: the server keeps each user's organization role, organization document and seat status in memory for five minutes per instance, so a role, time zone or seat change can take up to five minutes to show. The API key itself is checked on every request, so revoking a key is immediate.","operationId":"getMe","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"security":[{"bearerAuth":[]},{"oauth2":["pooli"]}]}},"/openapi.json":{"get":{"tags":["Documentation"],"summary":"OpenAPI document","operationId":"getOpenApi","security":[],"responses":{"200":{"description":"OpenAPI 3.0 document","content":{"application/json":{"schema":{"type":"object","description":"This document."}}}}}}},"/v1/openapi.json":{"get":{"tags":["Documentation"],"summary":"OpenAPI document (versioned alias)","operationId":"getOpenApiV1","security":[],"responses":{"200":{"description":"OpenAPI 3.0 document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/docs":{"get":{"tags":["Documentation"],"summary":"API documentation page","description":"HTML page that links to /openapi.json and states the canonical paths, development host, error format, pagination, and API key rules.","operationId":"getDocs","security":[],"responses":{"200":{"description":"HTML documentation","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/v1/docs":{"get":{"tags":["Documentation"],"summary":"API documentation page (versioned alias)","operationId":"getDocsV1","security":[],"responses":{"200":{"description":"HTML documentation","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["OAuth"],"summary":"Authorization server metadata (RFC 8414)","description":"Issuer is exactly https://api.pooli.app. Lists the authorize, token, register, and revoke endpoints, code_challenge_methods_supported S256, scopes_supported pooli, and authorization_response_iss_parameter_supported true.","operationId":"getOAuthMetadata","security":[],"responses":{"200":{"description":"RFC 8414 authorization server metadata.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/.well-known/openid-configuration":{"get":{"tags":["OAuth"],"summary":"Authorization server metadata (same document)","description":"Same document as /.well-known/oauth-authorization-server, for clients that look here.","operationId":"getOAuthMetadataOpenIdPath","security":[],"responses":{"200":{"description":"RFC 8414 authorization server metadata.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/oauth/register":{"post":{"tags":["OAuth"],"summary":"Register a client (RFC 7591)","description":"Dynamic client registration for public clients. No client secret is issued. Nothing is stored: client_id is a signed token that holds the cleaned name and the redirect URIs.","operationId":"registerOAuthClient","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientRegistration"}}}},"responses":{"201":{"description":"Client registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientInformation"}}}},"400":{"description":"OAuth error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/oauth/authorize":{"get":{"tags":["OAuth"],"summary":"Sign in and consent page","description":"Open this in a browser. Parameters: response_type=code, client_id, redirect_uri (exact match), code_challenge, code_challenge_method=S256 (required), state (returned unchanged), scope, resource. The user signs in with a Pooli account (email and password, Google, or Apple), then presses Allow or Deny. The browser returns to redirect_uri with code, state, and iss (RFC 9207), or with error. A bad client_id or redirect_uri shows an error page and never redirects.","operationId":"authorizeOAuthPage","security":[],"parameters":[{"name":"response_type","in":"query","required":true,"schema":{"type":"string","enum":["code"]}},{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","required":true,"schema":{"type":"string","enum":["S256"]}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","example":"pooli"}},{"name":"resource","in":"query","required":false,"schema":{"type":"string","example":"https://mcp.pooli.app/mcp"}}],"responses":{"200":{"description":"HTML sign in and consent page.","content":{"text/html":{"schema":{"type":"string"}}}},"302":{"description":"Redirect to redirect_uri with error and state (for example invalid_request)."},"400":{"description":"HTML error page. The client or redirect URI is not valid."}}},"post":{"tags":["OAuth"],"summary":"Submit Allow or Deny (used by the consent page)","description":"Used by the page itself. Body is JSON with the authorize parameters, decision allow or deny, and id_token (a Firebase ID token). The server verifies the ID token, requires a sign in within the last 5 minutes, and binds the code to that uid, the client, the redirect URI, and the PKCE challenge. Returns { redirect }. The code is a signed token that lasts 60 seconds.","operationId":"submitOAuthConsent","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["client_id","redirect_uri","code_challenge","code_challenge_method","decision"],"properties":{"client_id":{"type":"string"},"redirect_uri":{"type":"string"},"code_challenge":{"type":"string"},"code_challenge_method":{"type":"string","enum":["S256"]},"state":{"type":"string"},"scope":{"type":"string"},"resource":{"type":"string"},"decision":{"type":"string","enum":["allow","deny"]},"id_token":{"type":"string","description":"Firebase ID token. Required for allow."}}}}}},"responses":{"200":{"description":"Where to send the browser next.","content":{"application/json":{"schema":{"type":"object","properties":{"redirect":{"type":"string"}}}}}},"400":{"description":"OAuth error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"401":{"description":"login_required. The ID token is missing, invalid, or the sign in is too old.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/oauth/token":{"post":{"tags":["OAuth"],"summary":"Exchange a code for an API key","description":"Body is application/x-www-form-urlencoded (JSON is also accepted). grant_type authorization_code needs code, redirect_uri, client_id, and code_verifier. The response access_token is a new API key (pooli_oak_ prefix) labeled with the client name. The response has no expires_in and no refresh_token because the key does not expire. A code that was already redeemed is refused with invalid_grant. grant_type refresh_token is not supported.","operationId":"oauthToken","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/OAuthTokenRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenRequest"}}}},"responses":{"200":{"description":"Tokens. Cache-Control is no-store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"400":{"description":"OAuth error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"401":{"description":"invalid_client. Unknown client_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/oauth/revoke":{"post":{"tags":["OAuth"],"summary":"Revoke a key (RFC 7009)","description":"Send token (the access token, which is the API key). The key is revoked at once and later requests with it return 401 invalid_token. Unknown tokens also return 200.","operationId":"oauthRevoke","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"token_type_hint":{"type":"string","enum":["access_token"]}}}}}},"responses":{"200":{"description":"Revoked, or the token was not known."},"400":{"description":"OAuth error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Long-lived API key from apiKeys-generateApiKey, or a short-lived access token from POST /v1/auth/token. Send Authorization: Bearer <key or access token>. A key created by the OAuth flow (pooli_oak_) is an ordinary API key and is sent the same way. See the oauth2 scheme."},"oauth2":{"type":"oauth2","description":"OAuth 2.1 authorization code flow with PKCE (S256 is required, plain is rejected). Used by AI assistants such as Claude, ChatGPT, and Grok through https://mcp.pooli.app/mcp. The user signs in with a Pooli account and presses Allow. Clients register themselves with POST /oauth/register (public clients, no secret). The access token is an ordinary Pooli API key (it starts with pooli_oak_) created in the user's apiKeys with source oauth and a label from the client name. It does not expire, and there is no refresh token. It is sent as Authorization: Bearer <token>, reaches only the signed-in user's own data, and shares the user's one rate limit with all of their other keys and assistants (10 requests per hour, 150 for Pool Club). The user can delete it in the Pooli app, or the client can call POST /oauth/revoke. A revoked or deleted key returns 401 with WWW-Authenticate error invalid_token.","flows":{"authorizationCode":{"authorizationUrl":"https://api.pooli.app/oauth/authorize","tokenUrl":"https://api.pooli.app/oauth/token","scopes":{"pooli":"Read and write the signed-in user's own Pooli data: pools, tests, notes, maintenance, and products."}}}}},"parameters":{"actAs":{"name":"X-Pooli-Act-As","in":"header","required":false,"description":"User id to run this organization request as. Only the organization owner may name someone else. The target must belong to this organization. A higher role is rejected. The effective role is the target user's role, including billing visibility. Omit the header, or send the caller's own id, to use the API key user. If X-Pooli-Organization is also sent, it must equal the organization id in the path.","schema":{"type":"string"}},"actAsRejected":{"name":"X-Pooli-Act-As","in":"header","required":false,"description":"Rejected with 403 when this names a user other than the API key user. Personal /v1/users routes do not support acting as another user. The path uid must be the key user.","schema":{"type":"string"}},"actAsContent":{"name":"X-Pooli-Act-As","in":"header","required":false,"description":"Rejected with 403. Content ingest does not support acting as another user.","schema":{"type":"string"}},"idempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"8 to 200 characters. Required when creating a customer, organization pool, stop, inventory item, or reminder, and when sending a service report or adding visit photos. The same key and JSON body replay the original status and body. A different body returns 409. The role check runs before the key is recorded. A failed validation does not store a replay.","schema":{"type":"string","minLength":8,"maxLength":200}},"limit":{"name":"limit","in":"query","required":false,"description":"Page size. Positive integer, maximum 200. Logs and the organization business reads (customers, routes, stops, invoices, estimates, subscriptions, payments, products, equipment, service visits, service reports) default to 50 when omitted. Pools, inventory, reminders, and technicians return the full array when omitted.","schema":{"type":"integer","minimum":1,"maximum":200}},"cursor":{"name":"cursor","in":"query","required":false,"description":"Page token. Logs: date string (same as startAfter). Other lists: id of the last item from the previous page.","schema":{"type":"string"}},"startAfter":{"name":"startAfter","in":"query","required":false,"description":"Alias of cursor. Existing log clients already send this.","schema":{"type":"string"}},"envelope":{"name":"envelope","in":"query","required":false,"description":"Pass 1 or true to wrap the list as { data, page: { limit, nextCursor, hasMore } }. Omit to keep the historical JSON array (or null).","schema":{"type":"string","enum":["1","true"]}},"logType":{"name":"type","in":"query","required":false,"description":"Log type. Required on create. On list, filtered after the page is read. Implemented types: test, product, maintenance, note, water, temperature, pressure, swg, feeder, swim.","schema":{"type":"string","enum":["test","product","maintenance","note","water","temperature","pressure","swg","feeder","swim"]}},"technicianStatus":{"name":"status","in":"query","required":false,"description":"If this parameter is present, only pending technicians are returned. The value is not matched.","schema":{"type":"string"}},"assigned":{"name":"assigned","in":"query","required":false,"description":"Compared as a string to the pool isAssigned field. Example: true matches the string true, not a boolean.","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or malformed bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Key rejected, uid mismatch, or not allowed for the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Document not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"The request conflicts with the current state. details.reason is a stable code such as visit_paused, already_completed, photos_required, not_completed, no_recipients, not_scheduled, or occurrence_skipped. details also carries the visitId and any data needed to fix the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"PayloadTooLarge":{"description":"A note photo is larger than 1500000 decoded bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"Rate limit exceeded. Pool Club users, and technicians whose seat is covered by a Pool Club organization, allow 150 requests per hour, including on GET /v1/me. Other users allow 10 requests per hour. The limit is shared by all of the user's keys. The window is one hour. Sign up at https://pooli.app/select-plan/ for the higher Club limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error","message","status"],"description":"Every error response uses this object. message is the human-readable text. error is a short title; for responses that used to be plain text, error and message are the same string.","properties":{"error":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"details":{},"position":{"type":"string"},"requiredScope":{"type":"string"}}},"Page":{"type":"object","required":["hasMore"],"properties":{"limit":{"type":"integer","nullable":true},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}}},"ListEnvelope":{"type":"object","required":["data","page"],"properties":{"data":{"type":"array","items":{}},"page":{"$ref":"#/components/schemas/Page"}}},"SuccessFlag":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}},"SuccessMessage":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"CreatedLog":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"string","description":"New log document id."}}},"Pool":{"type":"object","description":"Pool document. List responses omit location and weather. supplimentalSanitizers is an intentional legacy field name. Do not rename it.","additionalProperties":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"poolType":{"type":"string","enum":["vinyl","plaster","fiberglass"]},"filterCategory":{"type":"string","description":"cartrige is an intentional legacy spelling used by the app, by CSV import, and as the value stored when filterCategory is omitted on pool create. Do not rename it. When a client sends filterCategory, the create-pool validator currently accepts de, sand, and cartridge."},"sanitizingChemical":{"type":"string"},"gallonEstimate":{"type":"number"},"isIndoor":{"type":"boolean"},"supplimentalSanitizers":{"type":"array","description":"supplimentalSanitizers is an intentional legacy field name. Do not rename it.","items":{"type":"string","enum":["mineral","ozone","uv","ionize","aop","enzyme","unknown"]}},"deleted":{"type":"boolean"}}},"PoolCreate":{"type":"object","required":["name","gallonEstimate"],"description":"supplimentalSanitizers is an intentional legacy field name. Do not rename it. cartrige is an intentional legacy spelling used by the app, by CSV import, and as the value stored when filterCategory is omitted on pool create. Do not rename it. When a client sends filterCategory, the create-pool validator currently accepts de, sand, and cartridge.","properties":{"name":{"type":"string"},"poolType":{"type":"string","enum":["vinyl","plaster","fiberglass"],"default":"plaster"},"filterCategory":{"type":"string","description":"cartrige is an intentional legacy spelling used by the app, by CSV import, and as the value stored when filterCategory is omitted on pool create. Do not rename it. When a client sends filterCategory, the create-pool validator currently accepts de, sand, and cartridge.","enum":["de","sand","cartridge"]},"sanitizingChemical":{"type":"string","enum":["chlorine","bromine","swg","biguanides","peroxide","natural","freshwater","mineral"],"default":"chlorine"},"gallonEstimate":{"type":"number"},"isIndoor":{"type":"boolean","default":false},"supplimentalSanitizers":{"type":"array","description":"Intentional legacy spelling of supplemental sanitizers. Do not rename this field.","items":{"type":"string","enum":["mineral","ozone","uv","ionize","aop","enzyme","unknown"]},"default":[]}}},"PoolPatch":{"type":"object","description":"At least one field. supplimentalSanitizers is the intentional legacy spelling. Do not rename it.","properties":{"name":{"type":"string"},"gallonEstimate":{"type":"number"},"poolType":{"type":"string","enum":["vinyl","plaster","fiberglass"]},"filterCategory":{"type":"string","enum":["de","sand","cartridge"],"description":"Sent values accept de, sand, and cartridge. The stored default spelling cartrige is unchanged and must not be renamed."},"sanitizingChemical":{"type":"string"},"isIndoor":{"type":"boolean"},"supplimentalSanitizers":{"type":"array","items":{"type":"string"},"description":"Intentional legacy spelling of supplemental sanitizers. Do not rename this field."}}},"NoteAttachment":{"type":"object","description":"Same object the app writes from Attachment.toJson for a gallery or camera photo.","required":["attachmentType","firestorePath","description","url"],"properties":{"attachmentType":{"type":"string","enum":["photo","camera","pdf","url","algaeScan"],"description":"API uploads use photo, the AttachmentType.photo name. Notes created in the app may also use camera, pdf, url, or algaeScan."},"firestorePath":{"type":"string","description":"Storage path users/{uploaderUid}/{sha256}{ext}. ext is .jpg, .png, .gif, or .webp from the file bytes.","example":"users/abc123/9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.jpg"},"description":{"type":"string","description":"filename when one was sent, otherwise {sha256}{ext}."},"url":{"type":"string","description":"Firebase download URL (alt=media and a token). The app also loads the file from firestorePath."}}},"NotePhotoInput":{"type":"object","required":["data"],"properties":{"data":{"type":"string","description":"Standard base64 or a data URL (data:image/jpeg;base64,...). The declared media type is not trusted."},"filename":{"type":"string","description":"Optional display name stored as description. The Storage path uses the content hash, not this name."},"contentType":{"type":"string","description":"Ignored. Send it only if a client already has it."}}},"LogPatch":{"type":"object","properties":{"note":{"type":"string"},"creatorName":{"type":"string"},"chemicalReading":{"type":"object","additionalProperties":true},"equipmentReading":{"type":"object","additionalProperties":true},"photos":{"type":"array","maxItems":4,"description":"Appends photos to a note. Ignored when the array is empty. Rejected when the log type is not note.","items":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/NotePhotoInput"}]}}}},"InventoryWrite":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"notes":{"type":"string"}}},"ReminderWrite":{"type":"object","required":["reminderType"],"properties":{"reminderType":{"type":"string"},"message":{"type":"string"},"dueDate":{"type":"string","format":"date-time"}}},"CustomerCreate":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"notes":{"type":"string"}}},"StopCreate":{"type":"object","required":["poolId","scheduledDateTime"],"properties":{"poolId":{"type":"string"},"scheduledDateTime":{"type":"string","description":"Local wall-clock time such as 2026-11-10T14:00, read in timeZone or the organization zone, or a value with an explicit offset such as 2026-11-10T14:00:00-08:00 or Z. Never assumed to be UTC.","example":"2026-11-10T14:00"},"timeZone":{"type":"string","description":"IANA zone used for a scheduledDateTime that has no offset, for example America/Los_Angeles. Wins over the organization zone. Required for an offset-less time when the organization has no saved zone.","example":"America/Los_Angeles"},"technicianUserIds":{"type":"array","items":{"type":"string"},"description":"User ids. Defaults to the caller. A technician may send only their own id."},"duration":{"type":"integer"},"fixedArrival":{"type":"boolean"}}},"PoolCreateRequest":{"type":"object","required":["pool"],"properties":{"pool":{"$ref":"#/components/schemas/PoolCreate"}}},"ChemicalReading":{"type":"object","additionalProperties":true,"description":"Every water test reading the app saves. Keys are the stored keys, so total hardness is calcium and calcium hardness is cch. totalHardness and calciumHardness are accepted as aliases and are rewritten to those keys. Keys that are not listed are ignored on create. Whole number readings are truncated the way the app does when it analyzes them. Calculated values (CSI, adjusted alkalinity) are not readings. They are returned as csi and in relatedProblems. Readings hidden for the pool in the app (for example cch, kh, mg, nitrites and nitrates by default) are stored but do not raise problems until the test is visible for that pool.","properties":{"totalChlorine":{"type":"number","nullable":true,"description":"Total Chlorine (tc), ppm."},"freeChlorine":{"type":"number","nullable":true,"description":"Free Chlorine (fc), ppm."},"totalBromine":{"type":"number","nullable":true,"description":"Total Bromine (tb), ppm."},"peroxide":{"type":"number","nullable":true,"description":"Hydrogen Peroxide (h202), ppm. Whole number."},"ph":{"type":"number","nullable":true,"description":"pH."},"temp":{"type":"number","nullable":true,"description":"Water Temperature, degrees Fahrenheit. Stored as sent."},"cyanuricAcid":{"type":"number","nullable":true,"description":"Cyanuric Acid (cya), ppm. Whole number."},"calcium":{"type":"number","nullable":true,"description":"TOTAL HARDNESS (TH, app test ch), ppm. Whole number. Legacy name: this key holds total hardness, not calcium hardness. Calcium hardness is cch. When only this is sent, the analysis estimates calcium hardness from it for CSI, calcium dosing and problems. No total hardness is estimated from cch."},"totalHardness":{"type":"number","nullable":true,"description":"Alias for calcium. Accepted on create and PATCH and always stored under calcium. If both are sent they must match."},"cch":{"type":"number","nullable":true,"description":"CALCIUM HARDNESS (app test cch), ppm. Whole number. Send it only when calcium hardness was measured separately. Legacy name: calcium hardness is cch and total hardness is calcium."},"calciumHardness":{"type":"number","nullable":true,"description":"Alias for cch. Accepted on create and PATCH and always stored under cch. If both are sent they must match."},"salt":{"type":"number","nullable":true,"description":"Salt, ppm. Whole number."},"alkalinity":{"type":"number","nullable":true,"description":"Total Alkalinity (ta), ppm as CaCO3. Whole number."},"kh":{"type":"number","nullable":true,"description":"Carbonate Hardness (kh), ppm. Whole number. Not the same as alkalinity. Used as the alkalinity input for CSI when alkalinity is missing."},"phosphates":{"type":"number","nullable":true,"description":"Phosphates (phos), ppb. Whole number."},"totalDissolvedSolids":{"type":"number","nullable":true,"description":"Total Dissolved Solids (tds), ppm. Whole number."},"combinedChlorine":{"type":"number","nullable":true,"description":"Combined Chlorine (cc), ppm. Optional. When not sent, problem detection infers it from total minus free chlorine."},"copper":{"type":"number","nullable":true,"description":"Copper (cu), ppm."},"borates":{"type":"number","nullable":true,"description":"Borates (bor), ppm."},"iron":{"type":"number","nullable":true,"description":"Iron (fe), ppm."},"orp":{"type":"number","nullable":true,"description":"ORP, mV. Whole number."},"biguanide":{"type":"number","nullable":true,"description":"Biguanide (big), ppm. Whole number."},"swgProduction":{"type":"number","nullable":true,"description":"Salt generator output percent saved with the test. Not a water test analyte."},"mg":{"type":"number","nullable":true,"description":"Magnesium (mg), ppm. Used for CSI."},"nitrites":{"type":"number","nullable":true,"description":"Nitrites, ppm."},"nitrates":{"type":"number","nullable":true,"description":"Nitrates, ppm. Whole number."},"testMethod":{"type":"string","nullable":true,"description":"How the test was taken, for example strip or liquid."}}},"EquipmentReading":{"type":"object","description":"Optional readings nested on a test log. Not a standalone equipment resource.","properties":{"otherMethod":{"type":"string","nullable":true},"swgPercent":{"type":"number","nullable":true},"observation":{"type":"string","nullable":true},"filterPressure":{"type":"number","nullable":true},"testMethod":{"type":"string","nullable":true}}},"MaintenanceLogItem":{"type":"object","description":"One task on a maintenance log. name and category are required. id is the catalog id and is stored when sent. duration is seconds, the same unit the app writes. aggregationName is set for supplemental sanitizer tasks.","required":["name","category"],"properties":{"id":{"type":"string","description":"Catalog id. Built-in ids are reminder type names such as cleanSkimmers. Custom ids are the stored id, or the task name when no id was saved."},"name":{"type":"string"},"category":{"type":"string","description":"MaintenanceCategory value, such as emptySkimmers, sweepWalls, cleanFilter, supplementalSanitizer, or custom."},"duration":{"type":"number","nullable":true,"description":"Seconds until the next reminder."},"aggregationName":{"type":"string","description":"Display label the app prefers when set. Supplemental sanitizer tasks include it."}},"example":{"id":"cleanSkimmers","name":"Empty Skimmer Basket(s)","category":"emptySkimmers","duration":345600}},"MaintenanceCatalogItem":{"type":"object","description":"One catalog task. id, name, category, duration, and aggregationName (when present) are the fields a maintenance log create stores. group is the duration bucket the app uses (Weekly, Monthly, Semi-Yearly, Yearly). custom is false for built-in tasks and true for users/{uid}.prefs.customMaintenance. aliases is omitted unless the stored custom task has that array.","required":["id","name","category","group","custom","duration"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"},"description":"Present only when the stored custom task has aliases. Built-in tasks do not."},"category":{"type":"string"},"group":{"type":"string","enum":["Weekly","Monthly","Semi-Yearly","Yearly"]},"custom":{"type":"boolean"},"duration":{"type":"number","description":"Seconds. Same unit as MaintenanceLogItem.duration."},"aggregationName":{"type":"string"}}},"Log":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"creatorName":{"type":"string"},"createdAt":{},"updatedAt":{},"userId":{"type":"string"},"poolId":{"type":"string"},"organizationId":{"type":"string","nullable":true},"customerId":{"type":"string","nullable":true},"locationId":{"type":"string","nullable":true},"isDeleted":{"type":"boolean"},"numSwimmers":{"type":"integer","description":"Swim logs only. Positive integer."},"duration":{"type":"integer","description":"Swim logs store duration as whole seconds. SWG logs store milliseconds."},"swimTime":{"type":"integer","description":"Swim logs only. Derived seconds: numSwimmers times duration. Not accepted on create."},"note":{"type":"string"},"attachments":{"type":"array","nullable":true,"description":"Note photos in the app's attachment shape. Null when the note was created without photos. Omitted fields are not invented.","items":{"$ref":"#/components/schemas/NoteAttachment"}},"gallonEstimate":{"type":"number"},"relatedProblems":{"type":"array","description":"Present on type=test logs after create. Generated by the server to match an in-app save. Each item is a test problem (waterTestType, testVal, lowRange, highRange, problemType, problemClass, doseToCenter, adjustedForCYA, and cyaValUsedForAdjustment when chlorine was adjusted for CYA) or a combo problem. Not accepted on create.","items":{"type":"object","additionalProperties":true}},"recommendations":{"type":"array","description":"Present on type=test logs after create. One entry per problem, in the order the app shows them. Each has problemType and items. Each item has product (name, productType, percent, custom, or null when no product fits), amount, unit (fluidOunces, ounces, pounds, gallons, and so on, in US units), and waits. A wait has until (nextTreatment, retest or swim), minutes (or null), and an optional condition and testType. A combined problem has one item per fix, with optionProblemType naming the problem each item fixes. Retest minutes scale with pool size, pool type, how far the dose moves the reading, and how close the reading is to the edge of its range. Not accepted on create.","items":{"type":"object","additionalProperties":true}},"csi":{"type":"object","description":"Present on type=test logs after create. value is the Langelier saturation index, or null when it cannot be worked out. confidence is high, medium or low, and drops when hardness or temperature had to be estimated. Not accepted on create.","properties":{"value":{"type":"number","nullable":true},"confidence":{"type":"string","nullable":true}}},"targets":{"type":"object","additionalProperties":true,"description":"Present on type=test logs. The target ranges the analysis used, in the app's targets shape."},"chemicalReading":{"$ref":"#/components/schemas/ChemicalReading"},"equipmentReading":{"$ref":"#/components/schemas/EquipmentReading"}}},"LogCreate":{"type":"object","description":"Shape depends on the type query. Common optional fields: creatorName, createdAt, updatedAt, includeReminders. For type=test, send chemicalReading. The server generates relatedProblems, recommendations and csi and ignores client-sent values for them. A client-sent targets object is used as sent. For type=swim the required fields are numSwimmers (positive integer) and duration (positive integer seconds). note is optional. Do not send swimTime. The server derives it.","additionalProperties":true,"properties":{"creatorName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"includeReminders":{"type":"boolean"},"chemicalReading":{"$ref":"#/components/schemas/ChemicalReading"},"equipmentReading":{"$ref":"#/components/schemas/EquipmentReading"},"scan":{"type":"object","nullable":true},"targets":{"type":"object"},"gallonEstimate":{"type":"number"},"amount":{"type":"number"},"productName":{"type":"string"},"unitType":{"type":"string"},"form":{"type":"string"},"productType":{"type":"string"},"solution":{"type":"object"},"maintenances":{"type":"array","description":"Required when type=maintenance. Copy id, name, category, duration, and aggregationName from a maintenance catalog entry. group and custom are ignored.","items":{"$ref":"#/components/schemas/MaintenanceLogItem"}},"note":{"type":"string"},"photos":{"type":"array","maxItems":4,"description":"Note create only (type=note). Base64 images uploaded onto attachments. Omit for a text-only note. An empty array is ignored. Do not send this together with a non-null attachments value.","items":{"oneOf":[{"type":"string","description":"Raw base64 or a data URL."},{"$ref":"#/components/schemas/NotePhotoInput"}]}},"attachments":{"description":"Legacy pass-through stored as sent when photos is omitted. After a photo upload the server writes a NoteAttachment array instead. Text-only notes that omit both fields store null.","nullable":true},"temperature":{"type":"number","nullable":true},"gallons":{"type":"number","nullable":true},"gallonsAddition":{"type":"number","nullable":true},"pressure":{"type":"number","nullable":true},"rpm":{"type":"number","nullable":true},"flowRate":{"type":"number","nullable":true},"trackingUnit":{"type":"string","nullable":true},"swgPercentage":{"type":"number","nullable":true},"startPercentage":{"type":"number","nullable":true},"duration":{"type":"number","nullable":true,"description":"For type=swim, a positive integer number of seconds. For type=swg, milliseconds. Maintenance items carry their own duration."},"numSwimmers":{"type":"integer","minimum":1,"description":"Required for type=swim. Positive integer."},"swimTime":{"type":"integer","readOnly":true,"description":"Derived on create for type=swim. Seconds equal to numSwimmers times duration. Ignored if a client sends it."},"feederConfigId":{"type":"string"},"feederName":{"type":"string"},"setting":{"type":"number"},"previousSetting":{"type":"number","nullable":true}}},"Reminder":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"poolId":{"type":"string"}}},"InventoryItem":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"}}},"Technician":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"userId":{"type":"string"},"status":{"type":"string","description":"App values include pending, active, rejected, inactive."}}},"TechnicianStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["active","inactive","rejected"],"description":"Write values are active, inactive, and rejected. approved and any other value return 400. Stored technician documents may still show pending."},"message":{"type":"string"}}},"CsvImportRequest":{"type":"object","required":["csvText"],"properties":{"csvText":{"type":"string"},"mapping":{"type":"object","additionalProperties":true},"defaults":{"type":"object","description":"Optional defaults. filterCategory may be the legacy spelling cartrige.","additionalProperties":true}}},"CsvImportResult":{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"counts":{"type":"object","additionalProperties":true},"sampleErrors":{"type":"array","items":{}},"jobId":{"type":"string"}}},"ContentIngestCreate":{"type":"object","additionalProperties":true,"description":"Same payload as the ingestContent callable."},"ContentIngestPatch":{"type":"object","additionalProperties":true},"TokenExchangeRequest":{"type":"object","description":"Optional. Omit expiresInSeconds for a 900 second token. The body may be an empty object.","properties":{"expiresInSeconds":{"type":"integer","minimum":60,"maximum":3600}}},"AccessToken":{"type":"object","required":["accessToken","tokenType","expiresAt","expiresInSeconds"],"properties":{"accessToken":{"type":"string"},"tokenType":{"type":"string","enum":["Bearer"]},"expiresAt":{"type":"string","format":"date-time"},"expiresInSeconds":{"type":"integer"}}},"KeyRegeneration":{"type":"object","required":["generation","tokensRevoked","keyRotated"],"properties":{"generation":{"type":"integer"},"tokensRevoked":{"type":"integer"},"keyRotated":{"type":"boolean","description":"Always false. Regenerate does not issue a new key string. POST /keys/rotate does."}}},"KeyRotationRequest":{"type":"object","description":"Optional. Omit gracePeriodDays for 7 days. apiKeyId defaults to the Bearer key and must belong to that same user.","properties":{"gracePeriodDays":{"type":"integer","minimum":0,"maximum":90},"apiKeyId":{"type":"string"}}},"KeyRotation":{"type":"object","required":["apiKey","previousKeyId","gracePeriodDays","graceEndsAt","status"],"properties":{"apiKey":{"type":"string","description":"New long-lived key secret. Store it. The response is the only place the new secret is required."},"previousKeyId":{"type":"string"},"gracePeriodDays":{"type":"integer"},"graceEndsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["rotating","revoked"]},"tokensRevoked":{"type":"integer"}}},"KeyRevokeRequest":{"type":"object","description":"Optional. apiKeyId defaults to the Bearer key and must belong to that same user.","properties":{"apiKeyId":{"type":"string"}}},"Me":{"type":"object","additionalProperties":false,"required":["uid","technicianUserId","organizationIds","organizations","club","rateLimit"],"description":"Caller identity and capabilities for the whole session. uid is apiKeys.uid and is returned even when organization listing fails. No billing or card fields.","properties":{"uid":{"type":"string","description":"User id on the presented apiKeys document, or on the parent key of an access token."},"name":{"type":"string","nullable":true,"description":"users/{uid}.name."},"email":{"type":"string","nullable":true,"description":"users/{uid}.email. A report draft (previewTo me) is emailed here."},"technicianUserId":{"type":"string","description":"The id to use in technicianUserIds for this user. Same as uid."},"primaryOrganizationId":{"type":"string","nullable":true,"description":"users/{uid}.organizationId, the organization the app opens."},"primaryTechnicianId":{"type":"string","nullable":true,"description":"users/{uid}.technicianId."},"organizationIds":{"type":"array","items":{"type":"string"},"description":"Organization ids where this user is owner, admin, or an active technician. A members/{uid} admin is included when that organization id is already known. Sorted by id. Empty when none or when the lookup cannot be completed."},"organizations":{"type":"array","description":"One entry per organizationIds item, same order.","items":{"$ref":"#/components/schemas/MeOrganization"}},"club":{"type":"object","additionalProperties":false,"required":["active","via","personalSubscription"],"properties":{"active":{"type":"boolean","description":"True when the effective tier is club."},"via":{"type":"string","nullable":true,"enum":["subscription","organization_seat",null]},"personalSubscription":{"type":"boolean","description":"The user has an active Club subscription of their own."}}},"rateLimit":{"type":"object","additionalProperties":false,"required":["tier","limit","used","remaining","windowSeconds","resetsAt","via"],"properties":{"tier":{"type":"string","enum":["club","free"]},"limit":{"type":"integer","description":"150 for club, 10 for free, per hour."},"used":{"type":"integer","description":"Requests in the current window across all of the user's keys, including this one."},"remaining":{"type":"integer"},"windowSeconds":{"type":"integer","enum":[3600]},"resetsAt":{"type":"string","format":"date-time","description":"When this key's current one-hour window ends."},"via":{"type":"string","nullable":true,"enum":["subscription","organization_seat",null]}}}}},"MeOrganization":{"type":"object","additionalProperties":false,"required":["id","role"],"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"role":{"type":"string","nullable":true,"enum":["owner","admin","technician",null],"description":"This user's role in the organization. Null if its detail lookup failed."},"technicianId":{"type":"string","nullable":true,"description":"organizations/{orgId}/technicians document id for this user. Null for an owner or admin without one."},"technicianStatus":{"type":"string","nullable":true},"clubMember":{"type":"boolean","description":"organizations.isClubMember, synced from the owner's subscription."},"seatCompliant":{"type":"boolean","description":"Active and pending technicians fit in allowedTechnicians."},"seatCovered":{"type":"boolean","description":"This user is a member and the organization is a compliant Club member, so this user gets the Club rate limit through it."},"activeTechnicians":{"type":"integer","nullable":true,"description":"Active plus pending technicians. Null when not counted (not a Club organization)."},"allowedTechnicians":{"type":"integer","nullable":true,"description":"1 + grandfatheredAdditionalSeats + purchasedAdditionalSeats."},"timeZone":{"type":"string","nullable":true,"description":"IANA zone used for route days and for local times without an offset. Null when the organization has none saved."},"timeZoneOffsetMinutes":{"type":"integer","nullable":true,"description":"Set instead of timeZone when only a numeric offset is saved. Local minus UTC."},"timeZoneSource":{"type":"string","nullable":true,"enum":["organization.timeZone","organization.timezone","organization.timeZoneOffset","organization.timezoneOffset","utc-fallback",null]}}},"KeyRevocation":{"type":"object","required":["apiKeyId","status"],"properties":{"apiKeyId":{"type":"string"},"status":{"type":"string","enum":["revoked"]},"tokensRevoked":{"type":"integer"},"generation":{"type":"integer"},"alreadyRevoked":{"type":"boolean"}}},"ContentIngestResult":{"type":"object","properties":{"id":{"type":"string"},"item":{"type":"object","additionalProperties":true}}},"OrgRecord":{"type":"object","additionalProperties":true,"description":"Organization document after redaction. Card numbers, CVC, expiry, last4, customer signatures, and secret fields are removed. stripe*Id fields are kept. organizationId is the organization in the path. A stored organizationId for a different organization is omitted entirely.","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"stripeCustomerId":{"type":"string"},"stripeProductId":{"type":"string"},"stripePriceId":{"type":"string"}}},"RouteDay":{"type":"object","additionalProperties":false,"description":"Active stops for one technician on one local calendar date, derived from stops. Not a stored collection. id is YYYY-MM-DD:technicianUserId, or YYYY-MM-DD:unassigned. date follows the organization time zone, or UTC when that zone is missing.","required":["id","organizationId","date","stopIds","timeZoneSource"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"date":{"type":"string","description":"Calendar date YYYY-MM-DD in the organization time zone, or UTC when timeZoneSource is utc-fallback."},"technicianUserId":{"type":"string","nullable":true},"scheduleId":{"type":"string","nullable":true},"stopIds":{"type":"array","items":{"type":"string"}},"timeZone":{"type":"string","nullable":true,"description":"IANA zone from organization.timeZone or organization.timezone. UTC when the fallback is used. Omitted when a numeric offset is used instead."},"timeZoneOffsetMinutes":{"type":"integer","nullable":true,"description":"Present when the organization has timeZoneOffset or timezoneOffset and no IANA zone. Local minus UTC. PDT is -420."},"timeZoneSource":{"type":"string","enum":["organization.timeZone","organization.timezone","organization.timeZoneOffset","organization.timezoneOffset","utc-fallback"]},"occurrences":{"type":"array","description":"One row per occurrence on this route, including a skipped week. stopIds omits skipped rows. Absent on clients that ignore unknown fields.","items":{"$ref":"#/components/schemas/RouteOccurrence"}},"expanded":{"type":"boolean","description":"True when date, or from and to, expanded repeating stops. False when the list used each stop's stored anchor date."},"warnings":{"type":"array","description":"Present when two changes land on the same day. The first copy is kept.","items":{"type":"string"}}}},"RouteOccurrence":{"type":"object","additionalProperties":false,"description":"One visit of a stop on the route date. occurrenceDate is the series key for a repeating stop, or the shown date for a one-off.","required":["stopId","occurrenceDate","scheduledStart","duration","technicianUserIds","travelTime","travelTimeSource","fixedArrival","overridden","skipped","completed"],"properties":{"stopId":{"type":"string"},"occurrenceDate":{"type":"string","description":"Calendar date YYYY-MM-DD."},"scheduledStart":{"type":"string","description":"UTC instant of the organization wall-clock start."},"duration":{"type":"integer","description":"Minutes."},"technicianUserIds":{"type":"array","items":{"type":"string"},"description":"Technicians active on the shown date."},"travelTime":{"type":"integer","description":"Minutes the technician sees."},"travelTimeSource":{"type":"string","enum":["measured","estimated","manual"]},"fixedArrival":{"type":"boolean"},"overridden":{"type":"boolean"},"skipped":{"type":"boolean"},"completed":{"type":"boolean","description":"True when a completed visit for this stop and pool falls in the Monday to Sunday week of the shown date. Always false when expanded is false."}}},"StopUpdate":{"type":"object","additionalProperties":false,"description":"Partial update. At least one writable field besides scope and occurrenceDate is required. occurrenceOverrides cannot be sent.","properties":{"scope":{"type":"string","enum":["series","occurrence"]},"occurrenceDate":{"type":"string","description":"YYYY-MM-DD. Required when scope is occurrence."},"fixedArrival":{"type":"boolean"},"duration":{"type":"integer","minimum":1,"maximum":1440,"description":"Minutes. This cap applies to updates. Create still accepts the previous duration check."},"scheduledDateTime":{"type":"string","description":"Local wall-clock time such as 2026-11-10T14:00 (read in timeZone or the organization zone) or a value with an explicit offset. Never assumed to be UTC.","example":"2026-11-10T14:00"},"timeZone":{"type":"string","description":"IANA zone for a scheduledDateTime without an offset. Only valid together with scheduledDateTime."},"technicianUserIds":{"type":"array","items":{"type":"string"},"description":"Owners and admins: active technicians in this organization, the owner, or ids already on this stop. Technicians: only their own id, and only when no one else is on the stop."},"travelTime":{"type":"integer","minimum":0,"maximum":1440},"travelFromStopId":{"type":"string"},"travelTimeManual":{"type":"boolean"},"skip":{"type":"boolean"}}},"StopUpdateResult":{"type":"object","additionalProperties":false,"required":["id","organizationId","scope","updatedFields"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"scope":{"type":"string","enum":["stop","series","occurrence"]},"occurrenceDate":{"type":"string","nullable":true},"updatedFields":{"type":"array","items":{"type":"string"},"description":"Field paths that were written, joined with /."},"scheduledDateTimeUtc":{"type":"string","format":"date-time","description":"Present when scheduledDateTime was sent. The instant that was understood."},"scheduledLocal":{"type":"string","nullable":true,"description":"The local wall time that was read, null when an offset was sent."},"scheduledTimeZone":{"type":"string","nullable":true},"scheduledTimeZoneSource":{"type":"string","enum":["request.timeZone","organization.timeZone","organization.timezone","organization.timeZoneOffset","organization.timezoneOffset","input.offset"]}}},"PaymentRecord":{"type":"object","additionalProperties":true,"description":"payment_history row. id is parentType~parentId~paymentId. Amount, status, notes, paymentMethod, and stripe*Id fields are kept. Card numbers, CVC, expiry, brand, and last4 are removed.","properties":{"id":{"type":"string"},"paymentId":{"type":"string"},"parentType":{"type":"string","enum":["invoice","estimate","subscription"]},"parentId":{"type":"string"},"organizationId":{"type":"string"},"amount":{"type":"number"},"status":{"type":"string"},"paymentMethod":{"type":"string"},"notes":{"type":"string"},"stripePaymentIntentId":{"type":"string"},"stripeChargeId":{"type":"string"}}},"ServiceReport":{"type":"object","additionalProperties":true,"description":"Projection of a service visit that is completed, sending a report, or already has report fields. customerSignature is omitted. Photo arrays are included. photoCount is their combined length.","properties":{"id":{"type":"string"},"visitId":{"type":"string"},"organizationId":{"type":"string"},"poolId":{"type":"string"},"status":{"type":"string"},"notes":{"type":"string"},"reportLinkUrl":{"type":"string"},"reportMessageId":{"type":"string"},"reportGeneratedAt":{},"photoCount":{"type":"integer"},"technicianUserIds":{"type":"array","items":{"type":"string"}},"beforePhotos":{"type":"array","items":{}},"afterPhotos":{"type":"array","items":{}},"gatePhotos":{"type":"array","items":{}}}},"MyRouteDay":{"type":"object","additionalProperties":false,"description":"The calling user's route for one date. Same fields as RouteDay, with enriched occurrences.","required":["id","organizationId","date","stopIds","timeZoneSource"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"date":{"type":"string","description":"Calendar date YYYY-MM-DD in the organization time zone, or UTC when timeZoneSource is utc-fallback."},"technicianUserId":{"type":"string","nullable":true},"scheduleId":{"type":"string","nullable":true},"stopIds":{"type":"array","items":{"type":"string"}},"timeZone":{"type":"string","nullable":true,"description":"IANA zone from organization.timeZone or organization.timezone. UTC when the fallback is used. Omitted when a numeric offset is used instead."},"timeZoneOffsetMinutes":{"type":"integer","nullable":true,"description":"Present when the organization has timeZoneOffset or timezoneOffset and no IANA zone. Local minus UTC. PDT is -420."},"timeZoneSource":{"type":"string","enum":["organization.timeZone","organization.timezone","organization.timeZoneOffset","organization.timezoneOffset","utc-fallback"]},"occurrences":{"type":"array","items":{"$ref":"#/components/schemas/MyRouteOccurrence"}},"expanded":{"type":"boolean","description":"True when date, or from and to, expanded repeating stops. False when the list used each stop's stored anchor date."},"warnings":{"type":"array","description":"Present when two changes land on the same day. The first copy is kept.","items":{"type":"string"}}}},"MyRouteOccurrence":{"type":"object","additionalProperties":false,"description":"A RouteOccurrence with the stop details and visit state a technician needs.","required":["stopId","occurrenceDate","scheduledStart","duration","technicianUserIds","travelTime","travelTimeSource","fixedArrival","overridden","skipped","completed"],"properties":{"stopId":{"type":"string"},"occurrenceDate":{"type":"string","description":"Calendar date YYYY-MM-DD."},"scheduledStart":{"type":"string","description":"UTC instant of the organization wall-clock start."},"duration":{"type":"integer","description":"Minutes."},"technicianUserIds":{"type":"array","items":{"type":"string"},"description":"Technicians active on the shown date."},"travelTime":{"type":"integer","description":"Minutes the technician sees."},"travelTimeSource":{"type":"string","enum":["measured","estimated","manual"]},"fixedArrival":{"type":"boolean"},"overridden":{"type":"boolean"},"skipped":{"type":"boolean"},"completed":{"type":"boolean","description":"True when a completed visit for this stop and pool falls in the Monday to Sunday week of the shown date. Always false when expanded is false."},"poolId":{"type":"string","nullable":true},"poolName":{"type":"string","nullable":true},"customerId":{"type":"string","nullable":true,"description":"Customer id on the stop's pool. Use it to look up the customer."},"address":{"type":"string","nullable":true},"requiresBeforePhoto":{"type":"boolean","description":"The stop requires a before photo to complete. The app default is true."},"requiresGatePhoto":{"type":"boolean","description":"The stop requires a gate photo to complete."},"sendJobReports":{"type":"boolean","description":"The stop is set to send a report after the visit. Default true."},"visit":{"type":"object","nullable":true,"description":"The visit for this occurrence, or null when none has started. Active visits win over a completed one.","properties":{"id":{"type":"string","description":"Visit id for the visit routes."},"status":{"type":"string","enum":["preview","scheduled","inProgress","paused","completed"]}}}}},"StartVisitRequest":{"type":"object","additionalProperties":false,"description":"All fields are optional. An empty body starts today's occurrence.","properties":{"date":{"type":"string","description":"YYYY-MM-DD in the organization time zone. Defaults to today. Picks the occurrence of a repeating stop."},"technicianUserId":{"type":"string","description":"Owner or admin only. An active technician to record as the starter. Defaults to the caller."},"additionalService":{"type":"boolean","description":"Start another visit for this stop even though one is completed for the same week. Default false."},"allowOffSchedule":{"type":"boolean","description":"Start a stop that is not scheduled, or was skipped, on date. The visit is scheduled for date at the stop's usual time. Default false."}}},"VisitRequirements":{"type":"object","description":"Photo requirements from the visit's embedded stop and what the visit has so far. Complete returns 409 photos_required while satisfied is false.","properties":{"requiresBeforePhoto":{"type":"boolean"},"requiresGatePhoto":{"type":"boolean"},"sendJobReports":{"type":"boolean"},"beforePhotoCount":{"type":"integer"},"afterPhotoCount":{"type":"integer"},"gatePhotoCount":{"type":"integer"},"missing":{"type":"array","items":{"type":"string","enum":["before","gate"]}},"satisfied":{"type":"boolean"}}},"ServiceVisitAction":{"type":"object","required":["visitId","status","visit","requirements"],"properties":{"visitId":{"type":"string"},"status":{"type":"string","enum":["preview","scheduled","inProgress","paused","completed","cancelled"]},"changed":{"type":"boolean","description":"False when the visit was already in the requested state."},"created":{"type":"boolean","description":"Start only. True when a new visit document was created."},"visit":{"$ref":"#/components/schemas/OrgRecord"},"requirements":{"$ref":"#/components/schemas/VisitRequirements"}}},"ServiceVisitReportRequest":{"type":"object","additionalProperties":false,"description":"All fields are optional. confirm true sends. Without confirm and without previewTo the call is a preview and nothing is sent. previewTo me emails only the caller. confirm and previewTo cannot be combined. With no adminNote the report goes to the customer on the pool.","properties":{"confirm":{"type":"boolean","description":"Must be true to email the customer and recipients. Without it the response is a 409 confirmation_required preview."},"previewTo":{"type":"string","enum":["me"],"description":"Email a draft to the calling user only. The customer and adminNote recipients are not emailed."},"customerNote":{"type":"string","maxLength":5000,"description":"Plain text shown to the customer. HTML escaped."},"adminNote":{"type":"object","additionalProperties":false,"properties":{"note":{"type":"string","maxLength":5000,"description":"Plain text shown only to recipients."},"recipients":{"type":"array","maxItems":10,"items":{"type":"string","format":"email"}},"skipCustomer":{"type":"boolean","description":"Do not email the customer. Needs at least one recipient."}}}}},"ServiceVisitReportPreview":{"type":"object","description":"details of the 409 confirmation_required response. Nothing was sent.","required":["reason","visitId","sent","recipients","subjects","summary","bodyPreview","confirmWith","draftWith"],"properties":{"reason":{"type":"string","enum":["confirmation_required"]},"visitId":{"type":"string"},"sent":{"type":"boolean","enum":[false]},"recipients":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["customer","admin"]},"name":{"type":"string","nullable":true},"email":{"type":"string"},"subject":{"type":"string"}}}},"subjects":{"type":"object","properties":{"customer":{"type":"string","nullable":true},"admin":{"type":"string","nullable":true}}},"invalidRecipients":{"type":"array","items":{"type":"string"}},"summary":{"type":"object","properties":{"poolName":{"type":"string","nullable":true},"serviceDate":{"type":"string"},"technicianName":{"type":"string","nullable":true},"durationMinutes":{"type":"integer","nullable":true},"logCount":{"type":"integer"},"readings":{"type":"object","additionalProperties":{"type":"number"}},"notes":{"type":"array","items":{"type":"string"}},"beforePhotos":{"type":"integer"},"afterPhotos":{"type":"integer"},"gatePhotos":{"type":"integer"}}},"bodyPreview":{"type":"string","description":"Plain text of what the report says, for showing to a person."},"customerNote":{"type":"string","nullable":true},"adminNote":{"type":"string","nullable":true},"confirmWith":{"type":"object","description":"Fields to add to the same request to send it.","properties":{"confirm":{"type":"boolean","enum":[true]}}},"draftWith":{"type":"object","description":"Fields to send instead to email a draft to yourself.","properties":{"previewTo":{"type":"string","enum":["me"]}}}}},"ServiceVisitReportResult":{"type":"object","required":["visitId","emailsSent","message"],"description":"200 after a confirmed send (success true), or after a draft to the caller (draft true, sentTo, customerNotified false).","properties":{"visitId":{"type":"string"},"success":{"type":"boolean"},"draft":{"type":"boolean","description":"True when previewTo me was used."},"sentTo":{"type":"string","description":"Draft only. The caller's email."},"customerNotified":{"type":"boolean","description":"Draft only. Always false."},"emailsSent":{"type":"integer","description":"Number of emails queued (customer and recipients are one each)."},"message":{"type":"string"}}},"ServiceVisitPhotosRequest":{"type":"object","additionalProperties":false,"required":["type","photos"],"properties":{"type":{"type":"string","enum":["before","after","gate"]},"photos":{"type":"array","minItems":1,"maxItems":4,"items":{"oneOf":[{"type":"string","description":"Base64 image or data URL."},{"type":"object","required":["data"],"properties":{"data":{"type":"string"},"filename":{"type":"string"}}}]}},"note":{"type":"string","maxLength":500}}},"ServiceVisitPhotosResult":{"type":"object","required":["visitId","type","added","requirements"],"properties":{"visitId":{"type":"string"},"status":{"type":"string"},"type":{"type":"string","enum":["before","after","gate"]},"added":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"note":{"type":"string","nullable":true},"timestamp":{},"type":{"type":"string","enum":["before","after","gate"]},"path":{"type":"string","description":"Storage path of the uploaded image."}}}},"requirements":{"$ref":"#/components/schemas/VisitRequirements"}}},"OAuthError":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"invalid_request, invalid_client, invalid_grant, invalid_target, unsupported_grant_type, server_error, or invalid_client_metadata and invalid_redirect_uri on registration."},"error_description":{"type":"string"}}},"OAuthClientRegistration":{"type":"object","required":["redirect_uris"],"properties":{"client_name":{"type":"string","description":"Shown on the consent screen and used as the key label. Cleaned (markup and control characters removed, 40 characters). Empty becomes AI Assistant.","example":"Claude"},"redirect_uris":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"string","maxLength":500},"description":"https URIs, or http://localhost or http://127.0.0.1 (any port at request time). No fragments, no credentials, no custom schemes. Matched exactly at authorize time.","example":["https://claude.ai/api/mcp/auth_callback"]},"token_endpoint_auth_method":{"type":"string","enum":["none"]},"grant_types":{"type":"array","items":{"type":"string","enum":["authorization_code","refresh_token"]},"description":"Must include authorization_code. refresh_token is accepted and not offered."},"response_types":{"type":"array","items":{"type":"string","enum":["code"]}},"scope":{"type":"string","example":"pooli"}}},"OAuthClientInformation":{"type":"object","properties":{"client_id":{"type":"string","description":"A signed token holding the cleaned client name and redirect URIs. Nothing is stored. It cannot be revoked."},"client_id_issued_at":{"type":"integer"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"grant_types":{"type":"array","items":{"type":"string","enum":["authorization_code"]}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string","enum":["none"]},"scope":{"type":"string"}}},"OAuthTokenRequest":{"type":"object","required":["grant_type","client_id","code","redirect_uri","code_verifier"],"properties":{"grant_type":{"type":"string","enum":["authorization_code"]},"client_id":{"type":"string"},"code":{"type":"string","description":"From the authorize redirect. Valid for 60 seconds."},"redirect_uri":{"type":"string","description":"Must equal the authorize request."},"code_verifier":{"type":"string","description":"PKCE verifier, 43 to 128 characters."},"resource":{"type":"string","description":"RFC 8707. https://mcp.pooli.app/mcp or https://mcp.pooli.app. Must match the authorize request when sent."}}},"OAuthTokenResponse":{"type":"object","properties":{"access_token":{"type":"string","description":"An API key that starts with pooli_oak_. It does not expire."},"token_type":{"type":"string","enum":["Bearer"]},"scope":{"type":"string","example":"pooli"}}}}},"x-pooli-api-keys":{"creation":"Created in the Pooli app via Firebase callable apiKeys-generateApiKey while the user is signed in. The callable writes apiKeys/{token} with uid, token, counters, generation 0, status active, and expiresAt null. expiresAt is reserved for a future maximum lifetime and is not enforced. Web dashboard organization key management is not this API.","scoping":"The key is the user in apiKeys.uid. GET /v1/me returns that uid and does not read a client-supplied uid. GET /v1/me counts against the same hourly rate limit as other authenticated routes (Pool Club or a Club-covered seat 150 requests per hour, otherwise 10 requests per hour, shared by all of the user's keys). User routes require the path uid to equal that uid. Organization routes resolve access as owner (ownerUserId), admin (organization.admins or members/{uid}.role admin), or a technicians document for that userId with status active. GET /v1/me organizationIds uses ownerUserId, admins array-contains, and technicians by userId, plus a direct members/{uid} read under an organization id already known from the user document or a technician record. It does not depend on a members.role collection-group index. uid is returned even when organization listing fails. Billing reads, including invoices, payments, estimates, and service subscriptions, require owner or admin. No separate organization credential is minted. Fine-grained scopes are not applied on user or organization routes. content_management is consulted only by /v1/content-ingest, and only when scopes is a non-empty array.","regenerateOnRequest":"POST /v1/auth/keys/regenerate and a later generate call do not replace the key string. Regenerate only bumps generation and deletes that key's access tokens. That is not rotation.","rotate":"POST /v1/auth/keys/rotate and callable apiKeys-rotateApiKey issue a new key. The previous key stays active until graceEndsAt (default 7 days, body gracePeriodDays 0 through 90). gracePeriodDays 0 revokes the previous key immediately. After graceEndsAt, the next use of the old key or of a token minted from it sets status revoked and deletes those tokens.","revoke":"POST /v1/auth/keys/revoke and callable apiKeys-revokeApiKey revoke one key that belongs to the caller and delete its access tokens. apiKeys-deleteApiKey deletes the key document after removing its tokens.","list":"apiKeys-fetchApiKeys returns the signed-in user's keys, including status, graceEndsAt, successorKeyId, and expiresAt when those fields are set."},"x-legacy-spellings":{"supplimentalSanitizers":"Intentional field name on pool create and stored pool documents. Do not rename.","cartrige":"Intentional filterCategory spelling in the app, CSV import, and the create-pool default when the field is omitted. Do not rename."},"x-development-host":"https://dev-api.pooli.app","x-pooli-roles":{"reads":"Organization reads allow the owner, an admin, or an active technician. Billing reads (invoices, payments, estimates, service subscriptions, and billing fields on customers) are owner or admin.","structuralWrites":"Owner or admin: create a customer, create, update, or delete an organization pool, import CSV, and set technician status. Active technicians receive 403.","operationalWrites":"Owner, admin, or active technician: create or update a stop, and create, update, or delete an organization log. A stop update never replaces occurrenceOverrides.","userWrites":"The path uid must be the API key user. X-Pooli-Act-As naming someone else is rejected. Covers user pool create, update, and delete, user log create, update, and delete, inventory create and update, and reminder create and update.","technicianStatus":"POST /v1/organizations/{orgId}/technicians/{techId}/status accepts active, inactive, or rejected. approved and any other value return 400. Owners and admins only."},"x-pooli-oauth":{"issuer":"https://api.pooli.app","metadata":"https://api.pooli.app/.well-known/oauth-authorization-server","resource":"https://mcp.pooli.app/mcp","scopes":["pooli"],"pkce":"S256 required. plain and missing code_challenge are rejected.","clients":"Dynamic registration only (public clients, token_endpoint_auth_method none), stateless: client_id is a signed token. Client ID Metadata Documents are not supported.","redirectUris":"Exact match. https only, plus http://localhost and http://127.0.0.1 with any port. Claude: https://claude.ai/api/mcp/auth_callback and https://claude.com/api/mcp/auth_callback. ChatGPT: https://chatgpt.com/connector_platform_oauth_redirect.","tokens":"The access token is a normal API key: pooli_oak_ plus 40 hex characters, stored in apiKeys with source oauth and label set to the client name. No expiry and no refresh token. The authorization code is a signed token valid for 60 seconds. Redeeming the same code twice is refused.","rateLimit":"One limit per user, shared by all of the user's API keys and assistants: 10 requests per hour, 150 for Pool Club, 429 Rate limit exceeded.","revocation":"POST /oauth/revoke, or the user deletes the key in the Pooli app (API screen). Both end access at once. A revoked or deleted pooli_oak_ key returns 401 with WWW-Authenticate error invalid_token."}}