{"openapi":"3.1.0","info":{"title":"Tjati Orchestrator API","version":"1.25.0","description":"API for managing adaptive productivity state and scoped agent automation. The stable API major is v1; the release version is reported separately in info.version. Canonical specification: https://api.tjati.com/openapi/v1.json","contact":{"name":"API Support","email":"support@tjati.com"}},"servers":[{"url":"https://api.tjati.com","description":"Production server"},{"url":"http://localhost:7003","description":"Current environment or local Core API server"}],"externalDocs":{"description":"Interactive Tjati API reference","url":"https://api.tjati.com/api-docs"},"tags":[{"name":"Health","description":"Health check endpoints"},{"name":"Capabilities","description":"Which worker-backed capabilities can actually be executed right now"},{"name":"Members","description":"Member profile and preferences management"},{"name":"Integrations","description":"Provider-neutral Google and Microsoft account capabilities"},{"name":"Goals","description":"Goal creation and management"},{"name":"Areas","description":"Area management for organizing goals"},{"name":"Tasks","description":"Task management and tracking"},{"name":"Approvals","description":"Durable member approval requests"},{"name":"Audit","description":"Actor-attributed durable change receipts"},{"name":"Always-on","description":"Durable webhooks, deliveries, and schedules"},{"name":"Briefings","description":"Morning and weekly agent context payloads"},{"name":"Projects","description":"Project management and progress tracking"},{"name":"Habits","description":"Habit tracking with check-ins and streaks"},{"name":"Trash","description":"Trash management for soft-deleted items"},{"name":"Insights","description":"AI-generated productivity insights"},{"name":"Flows","description":"Pomodoro-style focused work session tracking"},{"name":"Stats","description":"Read-only aggregation endpoints powering the Insights surface"},{"name":"Reminders","description":"Task reminder management"},{"name":"Notes","description":"Notes — a first-class peer medium connectable to any entity"},{"name":"Suggestions","description":"AI-powered contextual chat suggestions"},{"name":"Search","description":"Cross-entity trigram search"},{"name":"Graph","description":"Entity hierarchy graph and context for visualization and LLM injection"},{"name":"Reconciliation","description":"Internal observable-effect queries for agent mutation reconciliation"},{"name":"Calendar","description":"Normalized calendar agenda over existing productivity primitives"},{"name":"Notifications","description":"Push notification device-token registration"},{"name":"Billing","description":"Member subscription state and RevenueCat reconciliation"},{"name":"Agent Platform","description":"External-agent installations, authorization grants, and PAT credentials"},{"name":"Workflows","description":"Agent-native deterministic workflow compositions"}],"security":[{"bearerAuth":[]}],"paths":{"/health":{"get":{"operationId":"healthCheck","tags":["Health"],"summary":"Liveness check (process-local)","description":"Process-local health. Touches NO dependency and always answers immediately, so it is a LIVENESS answer only. Never point a readinessProbe here — doing so lets traffic reach a replica that cannot reach its database. Use `/health/ready` for readiness.","security":[],"responses":{"200":{"description":"Process is running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheckResponse"}}}}}}},"/health/ready":{"get":{"operationId":"readinessCheck","tags":["Health"],"summary":"Readiness check","description":"The only endpoint a readinessProbe may target. Returns 503 when a REQUIRED dependency is down (today: the database). Non-required dependencies — NATS and the background workers — are reported in `services` and return 200 with `status: \"degraded\"`, because they fail fleet-wide and unreadiness could not shift traffic anywhere. Alert on the `tjati.dependency.up` gauge for those.","security":[],"responses":{"200":{"description":"Ready to serve traffic (possibly degraded)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheckResponse"}}}},"503":{"description":"A required dependency is down — do not send traffic","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheckResponse"}}}}}}},"/health/live":{"get":{"operationId":"livenessCheck","tags":["Health"],"summary":"Liveness check","description":"Process-local liveness under the conventional name — identical to `/health`. Dependency-free on purpose: a liveness probe that fails on a dependency outage restarts every replica at once, turning a recoverable outage into a crash loop.","security":[],"responses":{"200":{"description":"Process is running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheckResponse"}}}}}}},"/health/detailed":{"get":{"operationId":"detailedHealthCheck","tags":["Health"],"summary":"Detailed health diagnostics","description":"Operator diagnostics: every dependency the readiness probe evaluates, plus process memory. NEVER a probe target — it always returns 200 (it describes state rather than voting on it) and does more work than a probe should.","security":[],"responses":{"200":{"description":"Detailed health information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailedHealthCheckResponse"}}}}}}},"/api/v1/members/check-username":{"get":{"operationId":"checkUsernameAvailability","tags":["Members"],"summary":"Check username availability","description":"Check if a username is available for registration","security":[],"parameters":[{"name":"username","in":"query","required":true,"description":"Username to check for availability (3-30 characters)","schema":{"type":"string","minLength":3,"maxLength":30,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Username availability check completed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/UsernameAvailability"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid username format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me":{"get":{"operationId":"getProfile","tags":["Members"],"summary":"Get current member profile","description":"Retrieve the profile of the authenticated member","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Member profile retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"member":{"$ref":"#/components/schemas/Member"},"preferences":{"$ref":"#/components/schemas/MemberPreferences"}},"required":["member","preferences"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized - Invalid or missing authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Member not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateProfile","tags":["Members"],"summary":"Update member profile","description":"Update the profile of the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Profile fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileRequest"}}}},"responses":{"200":{"description":"Profile updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Member"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict - Username already taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteAccount","tags":["Members"],"summary":"Request account erasure","description":"Confirms account deletion. Raises the deletion fence (no further state-changing requests are accepted) and queues the durable cross-service erasure job. Returns the erasure status rather than a completion: erasure spans Clerk, billing, OAuth providers, three services and object storage, and cannot honestly be completed inside a request. Idempotent — a repeat call returns the existing state. Poll GET /api/v1/members/me/deletion for progress.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Deletion confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}}},"responses":{"200":{"description":"Erasure requested (or already in progress)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/AccountDeletionStatus"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request - Missing confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Account erasure is not configured on this deployment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/deletion":{"get":{"operationId":"getAccountDeletionStatus","tags":["Members"],"summary":"Account erasure status","description":"Per-component progress of the authenticated member's account erasure. A safe read, so it remains available behind the deletion fence. `incomplete` lists classes of erasure that could NOT be completed (for example a provider OAuth grant with no revocation endpoint) — an empty array means everything committed to was erased.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current erasure status","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/AccountDeletionStatus"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No deletion request exists for this member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/preferences":{"get":{"operationId":"getPreferences","tags":["Members"],"summary":"Get member preferences","description":"Retrieve preferences for the authenticated member","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Preferences retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemberPreferences"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Preferences not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updatePreferences","tags":["Members"],"summary":"Update member preferences","description":"Update preferences for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Preference fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePreferencesRequest"}}}},"responses":{"200":{"description":"Preferences updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemberPreferences"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/export":{"get":{"operationId":"exportMemberData","tags":["Members"],"summary":"Export member data","description":"Download a portable JSON or Markdown attachment of the member's data. Members with neither current Mastra lifecycle participation nor a persisted Mastra export obligation receive the existing v4 shape. Current lifecycle participation or a historical per-member Mastra obligation emits additive v5 with a distinct `agentMastra` component and payload; Python remains `agent`. **Read `manifest` first**: `manifest.complete` is true only when every active component returned all of its data, and `manifest.unavailable` names the components that did not. A component that times out, is not deployed, or is not configured is reported there rather than silently omitted — the export never claims completeness it cannot support. Secrets, internal prompt policy, raw observability payloads and other members' data are excluded by rule (see docs/2026-08-08-member-export-service-contract.md §7).","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"format","schema":{"default":"json","type":"string","enum":["json","markdown"]}}],"responses":{"200":{"description":"Member data export generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"version":{"anyOf":[{"type":"string","const":"4"},{"type":"string","const":"5"}],"description":"Export payload version. v5 is used for current Mastra lifecycle participation or a persisted historical Mastra export obligation"},"exportedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Export generation timestamp"},"manifest":{"type":"object","properties":{"complete":{"type":"boolean","description":"True only when every component is included. Computed, never set"},"generatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"components":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string","enum":["core","chat","rag","agent","agentMastra"]},"source":{"type":"string"},"status":{"type":"string","enum":["included","partial","unavailable"]},"reason":{"description":"Machine class, never a message. Absent when included","type":"string"},"incomplete":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string"},"class":{"type":"string"}},"required":["component","class"],"additionalProperties":false}}},"required":["component","source","status"],"additionalProperties":false}},"unavailable":{"type":"array","items":{"type":"string","enum":["core","chat","rag","agent","agentMastra"]},"description":"Components the member is missing data from (partial included)"}},"required":["complete","generatedAt","components","unavailable"],"additionalProperties":false,"description":"What this export does and does not contain"},"member":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Member profile record"},"activities":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Member activity history"},"preferences":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Member preferences"},"tasks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Member's tasks (uncapped, non-deleted)"},"habits":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Member's habits, each including its check-ins"},"areas":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"goals":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"projects":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"projectGoals":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"notes":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"noteConnections":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"folders":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"reminders":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"flows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"goalActivities":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"goalCheckIns":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"recurrence":{"type":"object","properties":{"series":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"occurrences":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["series","occurrences"],"additionalProperties":false},"insights":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"dailyStats":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"memberStatus":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"pushTokens":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Registered devices. The raw push token is redacted"},"emailPreferences":{"type":"object","properties":{"optOuts":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["optOuts"],"additionalProperties":false},"integrations":{"type":"object","properties":{"connections":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"capabilityGrants":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["connections","capabilityGrants"],"additionalProperties":false},"billing":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Subscription status, or null when the member has no row"},"deletion":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Account-deletion request status, or null when none was opened"},"agentPlatform":{"type":"object","properties":{"installations":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"principals":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"authorizationGrants":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["installations","principals","authorizationGrants"],"additionalProperties":false},"automation":{"type":"object","properties":{"schedules":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"webhookSubscriptions":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Signing-secret ciphertext and key id are redacted"},"scheduleRuns":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each run, including the payload snapshot it executed — the only record of a schedule version the member has since edited. Dispatcher lease fields are redacted"},"webhookDeliveries":{"type":"object","properties":{"total":{"type":"number"},"byStatus":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"firstAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["total","byStatus","firstAt","lastAt"],"additionalProperties":false,"description":"Summary only: the table carries no payload or body column, so there is nothing here the member authored"}},"required":["schedules","webhookSubscriptions","scheduleRuns","webhookDeliveries"],"additionalProperties":false,"description":"Agent schedules and webhook subscriptions, and their execution record"},"trash":{"type":"object","properties":{"areas":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"goals":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"projects":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"tasks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"habits":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"notes":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"flows":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["areas","goals","projects","tasks","habits","notes","flows"],"additionalProperties":false},"memorySources":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Exact retained Core source versions, revisions and relationship records with bounded coverage"},"chat":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Canonical retained source records plus legacy display sessions, or unavailable; opaque ModelMessage content is preserved"},"rag":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Document metadata and content from rag-service, or null when the component is unavailable — see manifest"},"agent":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Assistant personalization and usage summary from agent-service, or null when unavailable — see manifest"},"agentMastra":{"description":"Present in v5 exports required by current lifecycle participation or a persisted historical Mastra obligation: Mastra assistant state and usage, kept distinct from the Python agent component","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"trust":{"type":"object","properties":{"changeSets":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"changeOperations":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"approvalRequests":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"approvalDecisions":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"auditEvents":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"artifacts":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["changeSets","changeOperations","approvalRequests","approvalDecisions","auditEvents","artifacts"],"additionalProperties":false,"description":"Durable attribution, approvals, receipts, and artifact metadata"}},"required":["version","exportedAt","manifest","member","activities","preferences","tasks","habits","areas","goals","projects","projectGoals","notes","noteConnections","folders","reminders","flows","goalActivities","goalCheckIns","recurrence","insights","dailyStats","memberStatus","pushTokens","emailPreferences","integrations","billing","deletion","agentPlatform","automation","trash","memorySources","chat","rag","agent","trust"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}},"text/markdown":{"schema":{"type":"string","description":"Complete Markdown projection of the v4 or v5 export"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Member not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/preferences/entity-types":{"get":{"operationId":"getEntityTypes","tags":["Members"],"summary":"Get unlocked entity types","description":"Retrieve the set of entity types the member has unlocked through progressive disclosure (onboarding conversations with Tjati). Returns an array of type identifiers like \"area\", \"goal\", \"task\", \"habit\".","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Entity types retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"},"description":"Entity type identifiers unlocked for this member"}},"required":["types"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateEntityTypes","tags":["Members"],"summary":"Update unlocked entity types","description":"Replace the set of entity types the member has unlocked. Used by the onboarding flow to unlock types that came up in the conversation with Tjati.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Entity types to unlock","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEntityTypesRequest"}}}},"responses":{"200":{"description":"Entity types updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}}},"required":["types"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/onboarding":{"get":{"operationId":"getOnboardingStatus","tags":["Members"],"summary":"Get onboarding status","description":"Retrieve the onboarding status of the authenticated member","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Onboarding status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/OnboardingStatus"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Onboarding status not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/onboarding/checkpoint":{"patch":{"operationId":"updateOnboardingCheckpoint","tags":["Members"],"summary":"Advance the onboarding checkpoint","description":"Optimistically advances flow v2 by one checkpoint. Exact desired-state retries are idempotent; stale or non-linear transitions return the latest canonical status in error.context.latest.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Desired checkpoint and the revision from the latest status read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOnboardingCheckpointRequest"}}}},"responses":{"200":{"description":"Checkpoint advanced or the desired state was already current","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/OnboardingStatus"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Unknown checkpoint/flow version or invalid session binding","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Onboarding status not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Revision conflict, illegal transition, terminal state, or conflicting AI session; error.context.latest contains canonical onboarding status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingCheckpointConflictResponse"}}}}}}},"/api/v1/members/me/onboarding/step":{"patch":{"operationId":"updateOnboardingStep","tags":["Members"],"summary":"Update onboarding step","description":"Update the current onboarding step for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"New onboarding step","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOnboardingStepRequest"}}}},"responses":{"200":{"description":"Onboarding step updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid step progression - Cannot move backwards","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict - Onboarding already completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/onboarding/complete":{"post":{"operationId":"completeOnboarding","tags":["Members"],"summary":"Complete onboarding","description":"Mark onboarding as complete for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Onboarding completion confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteOnboardingRequest"}}}},"responses":{"200":{"description":"Onboarding completed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Bad request - Must complete all steps first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict - Onboarding already completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/onboarding/skip":{"post":{"operationId":"skipOnboarding","tags":["Members"],"summary":"Skip onboarding","description":"Skip the onboarding process for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Skip onboarding confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkipOnboardingRequest"}}}},"responses":{"200":{"description":"Onboarding skipped successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid request - Missing confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict - Onboarding already completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/activities":{"get":{"operationId":"getMemberActivities","tags":["Members"],"summary":"Get member activities","description":"Retrieve activity history for the authenticated member with pagination","security":[{"bearerAuth":[]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default: 1)","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","required":false,"description":"Items per page (default: 20, max: 100)","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Activities retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Activity UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"activityType":{"type":"string","description":"Type of activity"},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Activity metadata"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Activity timestamp"}},"required":["id","memberId","activityType","metadata","createdAt"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"type":"object","properties":{"page":{"type":"number","description":"Current page"},"limit":{"type":"number","description":"Items per page"},"total":{"type":"number","description":"Total number of activities"}},"required":["page","limit","total"],"additionalProperties":false},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"},"count":{"description":"Number of activities returned","type":"number"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/status":{"get":{"operationId":"getMemberStatus","tags":["Members"],"summary":"Get current productivity status","description":"Retrieve the authenticated member's effective productivity status (Productive / Sick / On Vacation), honoring lazy auto-revert when a planned end date has passed.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current productivity status","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemberStatusResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"setMemberStatus","tags":["Members"],"summary":"Set productivity status","description":"Set the productivity status for the authenticated member at their local \"today\". Freeze statuses (sick / on_vacation) pause habit streaks and suppress certain notifications. Returns the same shape as GET.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Status to set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberStatusRequest"}}}},"responses":{"200":{"description":"Updated productivity status","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemberStatusResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/status/history":{"get":{"operationId":"getMemberStatusHistory","tags":["Members"],"summary":"Get productivity status history","description":"Retrieve the authenticated member's productivity status periods, newest first.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"from","schema":{"description":"Only include periods that started on or after this date (YYYY-MM-DD)","type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"Only include periods that started on or after this date (YYYY-MM-DD)"},{"in":"query","name":"to","schema":{"description":"Only include periods that started on or before this date (YYYY-MM-DD)","type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"description":"Only include periods that started on or before this date (YYYY-MM-DD)"}],"responses":{"200":{"description":"Status history","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/MemberStatusPeriod"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/search":{"get":{"operationId":"searchGoals","tags":["Goals"],"summary":"Search goals (full-text)","description":"Search goals by title and description using full-text matching","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search query string"},"required":true,"description":"Search query string"},{"in":"query","name":"limit","schema":{"description":"Maximum number of results","default":20,"type":"integer","minimum":1,"maximum":50},"description":"Maximum number of results"},{"in":"query","name":"include_completed","schema":{"description":"Include completed goals","default":false,"type":"boolean"},"description":"Include completed goals"}],"responses":{"200":{"description":"Search results retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Goal"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals":{"get":{"operationId":"listGoals","tags":["Goals"],"summary":"List goals","description":"Retrieve a paginated list of goals for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"status","schema":{"description":"Filter by status","type":"string","enum":["not_started","in_progress","on_hold","completed"]},"description":"Filter by status"},{"in":"query","name":"priority","schema":{"description":"Filter by priority","type":"string","enum":["low","medium","high","critical"]},"description":"Filter by priority"},{"in":"query","name":"areaId","schema":{"description":"Filter by area UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by area UUID"},{"in":"query","name":"orderBy","schema":{"default":"createdAt","description":"Field to order by","type":"string","enum":["createdAt","updatedAt","dueDate","priority"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"},{"in":"query","name":"search","schema":{"description":"Search query","type":"string","minLength":2},"description":"Search query"},{"in":"query","name":"include","schema":{"description":"Comma-separated extras to embed on each goal. Phase 0 supports 'progress'.","type":"string"},"description":"Comma-separated extras to embed on each goal. Phase 0 supports 'progress'."}],"responses":{"200":{"description":"Goals retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"title":{"type":"string","description":"Goal title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Goal description"},"status":{"type":"string","enum":["not_started","in_progress","on_hold","completed"],"description":"Goal status"},"priority":{"type":"string","enum":["low","medium","high","critical"],"description":"Priority level"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Due date (target date)"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Completion timestamp"},"horizon":{"anyOf":[{"type":"string","enum":["someday","year","quarter","month","date"]},{"type":"null"}],"description":"Time horizon"},"metricKind":{"anyOf":[{"type":"string","enum":["number","currency","boolean"]},{"type":"null"}],"description":"Outcome metric kind"},"metricDirection":{"anyOf":[{"type":"string","enum":["reach","increase","decrease","maintain"]},{"type":"null"}],"description":"Outcome metric direction"},"metricUnit":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Metric unit"},"metricStart":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric value at creation / last re-scope"},"metricTarget":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric target value"},"metricCurrent":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Denormalized latest metric value"},"outcome":{"anyOf":[{"type":"string","enum":["achieved","released"]},{"type":"null"}],"description":"Terminal outcome"},"reflection":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reflection captured at close"},"checkinCadence":{"anyOf":[{"type":"string","enum":["weekly","biweekly","monthly","off"]},{"type":"null"}],"description":"Check-in prompt cadence"},"lastCheckinAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Last check-in timestamp"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Additional metadata"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"progress":{"$ref":"#/components/schemas/GoalProgress"}},"required":["id","memberId","areaId","title","description","status","priority","dueDate","completedAt","horizon","metricKind","metricDirection","metricUnit","metricStart","metricTarget","metricCurrent","outcome","reflection","checkinCadence","lastCheckinAt","metadata","createdAt","updatedAt"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createGoal","tags":["Goals"],"summary":"Create a goal","description":"Create a new goal for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Goal data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGoalRequest"}}}},"responses":{"201":{"description":"Goal created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Goal"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Area not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/bulk":{"post":{"operationId":"createBulkGoals","tags":["Goals"],"summary":"Create multiple goals","description":"Create multiple goals at once (maximum 50 per request)","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Array of goals to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBulkGoalsRequest"}}}},"responses":{"200":{"description":"Bulk operation completed successfully (all goals created)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Goal"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"number"},"successCount":{"type":"number"},"failureCount":{"type":"number"}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"206":{"description":"Partial success (some goals created, some failed)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Goal"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"number"},"successCount":{"type":"number"},"failureCount":{"type":"number"}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/suggestions":{"get":{"operationId":"getGoalSuggestions","tags":["Goals"],"summary":"Get goal suggestions","description":"Get AI-powered goal suggestions for a specific area or general suggestions","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"areaId","schema":{"description":"UUID of the area to get suggestions for","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"UUID of the area to get suggestions for"},{"in":"query","name":"count","schema":{"default":5,"description":"Number of suggestions to return","type":"integer","minimum":1,"maximum":10},"description":"Number of suggestions to return"},{"in":"query","name":"timeframe","schema":{"default":"medium","description":"Timeframe for goal suggestions","type":"string","enum":["short","medium","long"]},"description":"Timeframe for goal suggestions"}],"responses":{"200":{"description":"Goal suggestions retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"areaId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["title","description"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable - AI service not configured or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/suggestions/all-areas":{"get":{"operationId":"getAllAreaGoalSuggestions","tags":["Goals"],"summary":"Get goal suggestions for all areas","description":"Get AI-powered goal suggestions for all member areas","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"goalsPerArea","schema":{"default":3,"description":"Number of goal suggestions per area","type":"integer","minimum":1,"maximum":5},"description":"Number of goal suggestions per area"}],"responses":{"200":{"description":"Goal suggestions for all areas retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"type":"object","properties":{"areaId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"areaName":{"type":"string"},"areaColor":{"type":"string"},"areaIcon":{"type":"string"},"suggestions":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}},"required":["title","description"],"additionalProperties":false}}},"required":["areaId","areaName","suggestions"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable - AI service not configured or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/upcoming":{"get":{"operationId":"getUpcomingGoals","tags":["Goals"],"summary":"Get upcoming goals","description":"Retrieve goals with upcoming due dates","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"days","schema":{"default":7,"description":"Number of days to look ahead (default: 7)","type":"integer","minimum":1,"maximum":365},"description":"Number of days to look ahead (default: 7)"}],"responses":{"200":{"description":"Upcoming goals retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Goal"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/overdue":{"get":{"operationId":"getOverdueGoals","tags":["Goals"],"summary":"Get overdue goals","description":"Retrieve goals that are past their due date","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Overdue goals retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Goal"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/{id}":{"get":{"operationId":"getGoal","tags":["Goals"],"summary":"Get a goal","description":"Retrieve a specific goal by ID","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"}],"responses":{"200":{"description":"Goal retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Goal"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Goal belongs to another user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateGoal","tags":["Goals"],"summary":"Update a goal","description":"Update an existing goal","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Goal fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGoalRequest"}}}},"responses":{"200":{"description":"Goal updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Goal"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Goal belongs to another user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal or Area not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteGoal","tags":["Goals"],"summary":"Delete a goal","description":"Delete a goal permanently","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Deletion confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteGoalRequest"}}}},"responses":{"200":{"description":"Goal deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"deletedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"softDelete":{"type":"boolean","description":"Whether this was a soft delete"},"cascade":{"$ref":"#/components/schemas/GoalCascadeResult"}},"required":["id","deletedAt","softDelete","cascade"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request - Missing confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Goal belongs to another user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/{id}/complete":{"post":{"operationId":"completeGoal","tags":["Goals"],"summary":"Complete a goal","description":"Complete a goal with a terminal outcome — achieve (default) or release. Both set status=completed; the body is optional (defaults to achieved).","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":false,"description":"Terminal outcome + optional reflection (defaults to achieved)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteGoalRequest"}}}},"responses":{"200":{"description":"Goal completed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Goal"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Goal belongs to another user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Goal already completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/{id}/activities":{"get":{"operationId":"getGoalActivities","tags":["Goals"],"summary":"Get goal activities","description":"Retrieve activity log for a specific goal","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"},{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"activityType","schema":{"description":"Filter by activity type","type":"string"},"description":"Filter by activity type"}],"responses":{"200":{"description":"Goal activities retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/GoalActivity"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Goal belongs to another user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/{id}/recalibrate":{"post":{"operationId":"recalibrateGoal","tags":["Goals"],"summary":"Recalibrate a goal metric","description":"Change a goal's metric target (and optionally baseline) with a reason. Requires a metric to be configured; logs a recalibrated activity.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"New target/baseline + reason","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecalibrateGoalRequest"}}}},"responses":{"200":{"description":"Goal recalibrated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Goal"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Goal has no metric configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/{id}/progress":{"get":{"operationId":"getGoalProgress","tags":["Goals"],"summary":"Get goal progress signals","description":"Compute the goal progress signals (RFC §3.2). Phase 0 returns the server-side execution (structural rollup) signal; effort, outcome, pace, and check-in fields are present and null until Phase 1.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"}],"responses":{"200":{"description":"Goal progress computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/GoalProgress"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Goal belongs to another user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/goals/{id}/check-ins":{"post":{"operationId":"createGoalCheckIn","tags":["Goals"],"summary":"Log a goal check-in","description":"Record a check-in for a goal (feeling + optional metric value/note). Updates the goal's last_checkin_at (+ metric_current when a value is given), logs an activity, and publishes core.goal.checked_in. Response includes achievementProposed when a metric value reaches the target.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Check-in data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGoalCheckInRequest"}}}},"responses":{"201":{"description":"Check-in recorded successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Check-in UUID"},"goalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"feeling":{"type":"string","enum":["on_track","unsure","off_track"],"description":"How the member feels about the goal"},"metricValue":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Latest metric reading, if provided"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional free-text note"},"source":{"type":"string","enum":["manual","prompted","agent"],"description":"How the check-in was initiated"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Check-in timestamp"},"achievementProposed":{"type":"boolean","description":"True when a metric value reached the target"}},"required":["id","goalId","memberId","feeling","metricValue","note","source","createdAt","achievementProposed"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Metric value supplied but the goal has no metric configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"getGoalCheckIns","tags":["Goals"],"summary":"Get goal check-in history","description":"Retrieve paginated check-in history for a goal (newest first)","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"required":true,"description":"Goal UUID"},{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"}],"responses":{"200":{"description":"Check-in history retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/GoalCheckIn"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/areas/search":{"get":{"operationId":"searchAreas","tags":["Areas"],"summary":"Search areas (full-text)","description":"Search areas by name and intention using full-text matching","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search query string"},"required":true,"description":"Search query string"},{"in":"query","name":"limit","schema":{"description":"Maximum number of results","default":20,"type":"integer","minimum":1,"maximum":50},"description":"Maximum number of results"}],"responses":{"200":{"description":"Search results retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Area"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/areas/deleted":{"get":{"operationId":"listDeletedAreas","tags":["Areas"],"summary":"List deleted areas","description":"Retrieve a paginated list of soft-deleted areas for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"orderBy","schema":{"default":"createdAt","description":"Field to order by","type":"string","enum":["createdAt","updatedAt","name"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"}],"responses":{"200":{"description":"Deleted areas retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Area"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/areas":{"get":{"operationId":"listAreas","tags":["Areas"],"summary":"List areas with counts","description":"Retrieve a paginated list of areas for the authenticated member, including counts of non-completed goals, projects, and incomplete tasks","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"orderBy","schema":{"default":"createdAt","description":"Field to order by","type":"string","enum":["createdAt","updatedAt","name"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"}],"responses":{"200":{"description":"Areas retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AreaWithCounts"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createArea","tags":["Areas"],"summary":"Create an area","description":"Create a new area for organizing goals","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Area data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAreaRequest"}}}},"responses":{"200":{"description":"Validated dry-run preview","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"201":{"description":"Area created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Area"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Area with this name already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/areas/bulk":{"post":{"operationId":"createBulkAreas","tags":["Areas"],"summary":"Create multiple areas","description":"Create multiple areas at once (maximum 50 per request)","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Array of areas to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBulkAreasRequest"}}}},"responses":{"200":{"description":"Bulk operation completed successfully (all areas created)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Area"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"number"},"successCount":{"type":"number"},"failureCount":{"type":"number"}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"206":{"description":"Partial success (some areas created, some failed)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Area"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"number"},"successCount":{"type":"number"},"failureCount":{"type":"number"}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/areas/{id}":{"get":{"operationId":"getArea","tags":["Areas"],"summary":"Get an area","description":"Retrieve a specific area by ID","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"required":true,"description":"Area UUID"}],"responses":{"200":{"description":"Area retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Area"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Area not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateArea","tags":["Areas"],"summary":"Update an area","description":"Update an existing area","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"required":true,"description":"Area UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Area fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAreaRequest"}}}},"responses":{"200":{"description":"Area updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Area"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Area not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Area with this name already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteArea","tags":["Areas"],"summary":"Soft delete an area (cascades to children)","description":"Soft delete an area and cascade-soft-delete its goals, projects, habits, and tasks (incl. recursive subtasks). The area and its cascade can be restored later. Provide an optional `keep` set to preserve specific children: kept ids are unlinked from the area (and from any deleted parent project/goal) and survive instead of being deleted.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"required":true,"description":"Area UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":false,"description":"Optional selective cascade keep-set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAreaRequest"}}}},"responses":{"200":{"description":"Area soft deleted or durable agent approval requested","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"ID of deleted resource"},"deletedAt":{"type":"string","description":"ISO 8601 timestamp of deletion"},"softDelete":{"description":"Whether soft delete was used","type":"boolean"},"cascade":{"$ref":"#/components/schemas/AreaCascadeResult"}},"required":["id","deletedAt","cascade"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"400":{"description":"Invalid keep-set body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Area not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/areas/{id}/restore":{"post":{"operationId":"restoreArea","tags":["Areas"],"summary":"Restore a deleted area","description":"Restore a soft-deleted area. Fails if an area with the same name already exists.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"required":true,"description":"Area UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Area restored successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"name":{"type":"string","description":"Area name"},"intention":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area intention"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area color name"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tabler icon slug (e.g. \"barbell\", \"ball-basketball\"). Emoji is supported as an explicit member choice."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"},"cascade":{"$ref":"#/components/schemas/AreaCascadeResult"}},"required":["id","memberId","name","intention","color","icon","createdAt","updatedAt","deletedAt","cascade"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Cannot restore: an area with this name already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Deleted area not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/bulk":{"post":{"operationId":"createTasksBulk","tags":["Tasks"],"summary":"Create tasks with per-item partial success","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"minItems":1,"maxItems":50,"type":"array","items":{}}},"required":["tasks"],"additionalProperties":false}}}},"responses":{"200":{"description":"All items succeeded or all failed deterministically","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"successCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failureCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"206":{"description":"Some task items succeeded and some failed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"successCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failureCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid bulk request envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks":{"get":{"operationId":"listTasks","tags":["Tasks"],"summary":"List tasks","description":"Retrieve a paginated list of tasks for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"cursor","schema":{"description":"Opaque keyset cursor from the previous page","type":"string","minLength":1},"description":"Opaque keyset cursor from the previous page"},{"in":"query","name":"parentTaskId","schema":{"description":"Filter by parent task UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by parent task UUID"},{"in":"query","name":"rootOnly","schema":{"description":"Show only root tasks (no parent)","type":"boolean"},"description":"Show only root tasks (no parent)"},{"in":"query","name":"projectId","schema":{"description":"Filter by project UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by project UUID"},{"in":"query","name":"goalId","schema":{"description":"Filter by goal UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by goal UUID"},{"in":"query","name":"areaId","schema":{"description":"Filter by area UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by area UUID"},{"in":"query","name":"priority","schema":{"description":"Filter by priority","type":"string","enum":["low","medium","high","critical"]},"description":"Filter by priority"},{"in":"query","name":"isCompleted","schema":{"description":"Filter by completion status","type":"boolean"},"description":"Filter by completion status"},{"in":"query","name":"tags","schema":{"description":"Filter by tags (comma-separated)","type":"string"},"description":"Filter by tags (comma-separated)"},{"in":"query","name":"orderBy","schema":{"default":"createdAt","description":"Field to order by","type":"string","enum":["createdAt","updatedAt","dueAtUtc","priority"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"},{"in":"query","name":"search","schema":{"description":"Search query","type":"string","minLength":2},"description":"Search query"},{"in":"query","name":"dueBefore","schema":{"description":"Filter tasks due before this date","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Filter tasks due before this date"},{"in":"query","name":"dueAfter","schema":{"description":"Filter tasks due after this date","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Filter tasks due after this date"}],"responses":{"200":{"description":"Tasks retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createTask","tags":["Tasks"],"summary":"Create a task","description":"Create a new task for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Stable operation UUID. Required for agents; members opt into the durable operation contract when enabled.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Stable operation UUID. Required for agents; members opt into the durable operation contract when enabled."},{"in":"header","name":"X-Tjati-Agent-Run-Id","schema":{"type":"string","maxLength":256}},{"in":"header","name":"X-Tjati-Chat-Session-Id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"header","name":"X-Tjati-Chat-Message-Id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"description":"Task data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"200":{"description":"Validated dry-run preview or durable agent mutation result","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endpoint":{"type":"string","enum":["task.create","task.update"]},"state":{"type":"string","enum":["received","executing","committed","verifying","verified","recovery_required","definitely_absent","inconclusive","quarantined","compensated","failed","expired","cancelled"]},"replayed":{"type":"boolean"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"compensatedByChangeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"receiptArtifactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalRequestId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalDecisionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"traceId":{"type":"string","minLength":1,"maxLength":256},"effects":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"receipt":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"classification":{"anyOf":[{"type":"string"},{"type":"null"}]},"code":{"type":"string"}},"required":["classification","code"],"additionalProperties":false},{"type":"null"}]},"correlation":{"type":"object","properties":{"agentRunId":{"anyOf":[{"type":"string"},{"type":"null"}]},"chatSessionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chatMessageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["agentRunId","chatSessionId","chatMessageId"],"additionalProperties":false},"timeline":{"type":"object","properties":{"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"executingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"committedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifyingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"expiredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"quarantinedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["receivedAt","executingAt","committedAt","verifyingAt","verifiedAt","expiredAt","cancelledAt","quarantinedAt"],"additionalProperties":false},"operations":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"resultRevision":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["action","entityType","entityId","resultRevision"],"additionalProperties":false}}},"required":["operationId","endpoint","state","changeSetId","compensatedByChangeSetId","receiptArtifactId","approvalRequestId","approvalDecisionId","traceId","effects","receipt","error","correlation","timeline","operations"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"201":{"description":"Task created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Task"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Area or Goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Conflicting parent references (PARENT_REFERENCE_CONFLICT) — e.g. areaId conflicts with the goal, or projectId conflicts with the parent task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/upcoming":{"get":{"operationId":"getUpcomingTasks","tags":["Tasks"],"summary":"Get upcoming tasks","description":"Retrieve tasks with upcoming due dates","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"days","schema":{"default":7,"description":"Number of days to look ahead","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Number of days to look ahead"}],"responses":{"200":{"description":"Upcoming tasks retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/overdue":{"get":{"operationId":"getOverdueTasks","tags":["Tasks"],"summary":"Get overdue tasks","description":"Retrieve tasks that are past their due date","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Overdue tasks retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/stats":{"get":{"operationId":"getTaskStats","tags":["Tasks"],"summary":"Get task statistics","description":"Retrieve statistics about tasks for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"projectId","schema":{"description":"Filter stats by project UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter stats by project UUID"},{"in":"query","name":"areaId","schema":{"description":"Filter stats by area UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter stats by area UUID"},{"in":"query","name":"goalId","schema":{"description":"Filter stats by goal UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter stats by goal UUID"}],"responses":{"200":{"description":"Task statistics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/TaskStatistics"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/today":{"get":{"operationId":"getTasksDueToday","tags":["Tasks"],"summary":"Get tasks due today","description":"Retrieve all tasks that are due today for the authenticated member","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Tasks due today retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/due-soon":{"get":{"operationId":"getTasksDueSoon","tags":["Tasks"],"summary":"Get tasks due soon","description":"Retrieve tasks that are due within the specified number of minutes","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"minutes","schema":{"default":60,"description":"Number of minutes to look ahead (default: 60)","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Number of minutes to look ahead (default: 60)"}],"responses":{"200":{"description":"Tasks due soon retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/stats/by-priority":{"get":{"operationId":"getTaskStatsByPriority","tags":["Tasks"],"summary":"Get task stats by priority","description":"Retrieve count of pending tasks grouped by priority level","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Priority statistics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/PriorityStatistics"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/search":{"get":{"operationId":"searchTasks","tags":["Tasks"],"summary":"Search tasks","description":"Full-text search across task titles and descriptions","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":2,"description":"Search query (minimum 2 characters)"},"required":true,"description":"Search query (minimum 2 characters)"},{"in":"query","name":"limit","schema":{"default":20,"description":"Maximum results to return","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Maximum results to return"},{"in":"query","name":"include_completed","schema":{"default":false,"description":"Include completed tasks in results","type":"boolean"},"description":"Include completed tasks in results"}],"responses":{"200":{"description":"Search results retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid search query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/{id}":{"get":{"operationId":"getTask","tags":["Tasks"],"summary":"Get a task","description":"Retrieve a specific task by ID","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task UUID"},"required":true,"description":"Task UUID"}],"responses":{"200":{"description":"Task retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Task"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateTask","tags":["Tasks"],"summary":"Update a task","description":"Update an existing task","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task UUID"},"required":true,"description":"Task UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Stable operation UUID. Required for agents; members opt into the durable operation contract when enabled.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Stable operation UUID. Required for agents; members opt into the durable operation contract when enabled."},{"in":"header","name":"X-Tjati-Agent-Run-Id","schema":{"type":"string","maxLength":256}},{"in":"header","name":"X-Tjati-Chat-Session-Id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"header","name":"X-Tjati-Chat-Message-Id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"header","name":"If-Match","schema":{"description":"Exact opaque PostgreSQL task revision. Required when Idempotency-Key selects operation mode.","type":"string","minLength":1},"description":"Exact opaque PostgreSQL task revision. Required when Idempotency-Key selects operation mode."}],"requestBody":{"required":true,"description":"Task fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskRequest"}}}},"responses":{"200":{"description":"Task updated successfully","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Task"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endpoint":{"type":"string","enum":["task.create","task.update"]},"state":{"type":"string","enum":["received","executing","committed","verifying","verified","recovery_required","definitely_absent","inconclusive","quarantined","compensated","failed","expired","cancelled"]},"replayed":{"type":"boolean"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"compensatedByChangeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"receiptArtifactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalRequestId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalDecisionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"traceId":{"type":"string","minLength":1,"maxLength":256},"effects":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"receipt":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"classification":{"anyOf":[{"type":"string"},{"type":"null"}]},"code":{"type":"string"}},"required":["classification","code"],"additionalProperties":false},{"type":"null"}]},"correlation":{"type":"object","properties":{"agentRunId":{"anyOf":[{"type":"string"},{"type":"null"}]},"chatSessionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chatMessageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["agentRunId","chatSessionId","chatMessageId"],"additionalProperties":false},"timeline":{"type":"object","properties":{"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"executingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"committedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifyingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"expiredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"quarantinedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["receivedAt","executingAt","committedAt","verifyingAt","verifiedAt","expiredAt","cancelledAt","quarantinedAt"],"additionalProperties":false},"operations":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"resultRevision":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["action","entityType","entityId","resultRevision"],"additionalProperties":false}}},"required":["operationId","endpoint","state","changeSetId","compensatedByChangeSetId","receiptArtifactId","approvalRequestId","approvalDecisionId","traceId","effects","receipt","error","correlation","timeline","operations"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Operation fingerprint conflict or stale If-Match revision","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteTask","tags":["Tasks"],"summary":"Delete a task","description":"Delete a task permanently","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task UUID"},"required":true,"description":"Task UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Deletion confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteTaskRequest"}}}},"responses":{"200":{"description":"Task deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"deletedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"softDelete":{"type":"boolean"},"cascade":{"$ref":"#/components/schemas/TaskCascade"}},"required":["id","deletedAt","softDelete","cascade"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request - Missing confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/{id}/complete":{"post":{"operationId":"completeTask","tags":["Tasks"],"summary":"Complete a task","description":"Mark a task as completed","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task UUID"},"required":true,"description":"Task UUID"},{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"If-Match","schema":{"description":"Optional exact task object version. Completion returns TASK_VERSION_CONFLICT if the task changed.","type":"string","minLength":1},"description":"Optional exact task object version. Completion returns TASK_VERSION_CONFLICT if the task changed."},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":false,"description":"Completion details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteTaskRequest"}}}},"responses":{"200":{"description":"Task completed successfully","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Task"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"400":{"description":"Task is already completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Task changed after the supplied If-Match version was observed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/series":{"post":{"operationId":"createTaskSeries","tags":["Recurrence"],"summary":"Make a task recurring","description":"Attaches an RFC-5545 recurrence rule to an existing task, turning it into the template for a series. Fails if the task already has a series.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskSeriesRequest"}}}},"responses":{"201":{"description":"Series created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/TaskSeriesResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Task already has a recurring series","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/series/{seriesId}":{"patch":{"operationId":"updateTaskSeries","tags":["Recurrence"],"summary":"Update a recurring series","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"seriesId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Series identifier"},"required":true,"description":"Series identifier"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskSeriesRequest"}}}},"responses":{"200":{"description":"Series updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/TaskSeriesResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteTaskSeries","tags":["Recurrence"],"summary":"Delete a recurring series","description":"Hard-deletes the series and cascades to its occurrences. The template task itself is left intact and simply stops recurring.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"seriesId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Series identifier"},"required":true,"description":"Series identifier"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Series deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/tasks/{taskId}/series":{"get":{"operationId":"getTaskSeries","tags":["Recurrence"],"summary":"Get a task's recurrence series","description":"Returns 404 when the task exists but is not recurring.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task identifier"},"required":true,"description":"Task identifier"}],"responses":{"200":{"description":"Series retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/TaskSeriesResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/tasks/{taskId}/occurrences":{"get":{"operationId":"listTaskOccurrences","tags":["Recurrence"],"summary":"List generated occurrences for a date range","description":"Expands the RRULE across the requested window and merges any stored overrides, completions, and skips.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task identifier"},"required":true,"description":"Task identifier"},{"in":"query","name":"startDate","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Start date for occurrence generation"},"required":true,"description":"Start date for occurrence generation"},{"in":"query","name":"endDate","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"End date for occurrence generation"},"required":true,"description":"End date for occurrence generation"},{"in":"query","name":"includeOverrides","schema":{"default":true,"description":"Include occurrence overrides in response","type":"boolean"},"description":"Include occurrence overrides in response"},{"in":"query","name":"includeCompleted","schema":{"default":true,"description":"Include completed occurrences","type":"boolean"},"description":"Include completed occurrences"},{"in":"query","name":"includeSkipped","schema":{"default":false,"description":"Include skipped occurrences","type":"boolean"},"description":"Include skipped occurrences"}],"responses":{"200":{"description":"Occurrences generated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/OccurrenceWithTaskResponse"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/tasks/{taskId}/occurrences/override":{"post":{"operationId":"createOccurrenceOverride","tags":["Recurrence"],"summary":"Override a single occurrence","description":"Creates or updates the stored occurrence row for one date, letting that instance diverge from the template task without affecting the rest of the series.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task identifier"},"required":true,"description":"Task identifier"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOccurrenceOverrideRequest"}}}},"responses":{"201":{"description":"Override stored","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/TaskOccurrenceResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/tasks/{taskId}/occurrences/{date}":{"patch":{"operationId":"updateTaskOccurrence","tags":["Recurrence"],"summary":"Update an occurrence with a modification scope","description":"Scope `this` overrides the single occurrence. `this_and_following` splits the series, returning the NEW series. `entire_series` edits the template task.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task identifier"},"required":true,"description":"Task identifier"},{"in":"path","name":"date","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Local calendar date (YYYY-MM-DD)"},"required":true,"description":"Local calendar date (YYYY-MM-DD)"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOccurrenceRequest"}}}},"responses":{"200":{"description":"Updated occurrence, or the newly created series when scope is this_and_following","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"$ref":"#/components/schemas/TaskOccurrenceResponse"},{"$ref":"#/components/schemas/TaskSeriesResponse"}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/tasks/{taskId}/occurrences/{date}/complete":{"post":{"operationId":"completeTaskOccurrence","tags":["Recurrence"],"summary":"Complete one occurrence of a recurring task","description":"Marks a single date done without touching the rest of the series. The occurrence row is created on demand if the date had not been materialised yet.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task identifier"},"required":true,"description":"Task identifier"},{"in":"path","name":"date","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Local calendar date (YYYY-MM-DD)"},"required":true,"description":"Local calendar date (YYYY-MM-DD)"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteOccurrenceRequest"}}}},"responses":{"200":{"description":"Occurrence completed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/TaskOccurrenceResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/tasks/{taskId}/occurrences/{date}/skip":{"post":{"operationId":"skipTaskOccurrence","tags":["Recurrence"],"summary":"Skip one occurrence of a recurring task","description":"Marks the date skipped and adds it to the series exception dates so it is not regenerated.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task identifier"},"required":true,"description":"Task identifier"},{"in":"path","name":"date","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Local calendar date (YYYY-MM-DD)"},"required":true,"description":"Local calendar date (YYYY-MM-DD)"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkipOccurrenceRequest"}}}},"responses":{"200":{"description":"Occurrence skipped","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/TaskOccurrenceResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/tasks/{taskId}/next-occurrence":{"get":{"operationId":"getNextTaskOccurrence","tags":["Recurrence"],"summary":"Get the next occurrence date","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task identifier"},"required":true,"description":"Task identifier"}],"responses":{"200":{"description":"Next occurrence resolved (null when the task is not recurring)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/NextOccurrenceResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/recurrence/tasks/{taskId}/recurrence-description":{"get":{"operationId":"getTaskRecurrenceDescription","tags":["Recurrence"],"summary":"Get a human-readable recurrence description","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task identifier"},"required":true,"description":"Task identifier"}],"responses":{"200":{"description":"Description resolved (null when the task is not recurring)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/RecurrenceDescriptionResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task, series, or occurrence not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects/bulk":{"post":{"operationId":"createProjectsBulk","tags":["Projects"],"summary":"Create projects with per-item partial success","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"minItems":1,"maxItems":50,"type":"array","items":{}}},"required":["projects"],"additionalProperties":false}}}},"responses":{"200":{"description":"All items succeeded or all failed deterministically","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"successCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failureCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"206":{"description":"Some project items succeeded and some failed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"successCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failureCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid bulk request envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects/search":{"get":{"operationId":"searchProjects","tags":["Projects"],"summary":"Search projects (full-text)","description":"Search projects by name and description using full-text matching","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search query string"},"required":true,"description":"Search query string"},{"in":"query","name":"limit","schema":{"description":"Maximum number of results","default":20,"type":"integer","minimum":1,"maximum":50},"description":"Maximum number of results"},{"in":"query","name":"include_completed","schema":{"description":"Include completed projects in results","default":false,"type":"boolean"},"description":"Include completed projects in results"}],"responses":{"200":{"description":"Search results retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects/upcoming":{"get":{"operationId":"getUpcomingProjects","tags":["Projects"],"summary":"Get upcoming projects","description":"Retrieve projects with deadlines within the next N days","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"days","schema":{"default":7,"description":"Number of days to look ahead","type":"integer","minimum":1,"maximum":90},"description":"Number of days to look ahead"}],"responses":{"200":{"description":"Upcoming projects retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects/overdue":{"get":{"operationId":"getOverdueProjects","tags":["Projects"],"summary":"Get overdue projects","description":"Retrieve projects that are past their deadline and not completed","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Overdue projects retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects/stats":{"get":{"operationId":"getProjectStats","tags":["Projects"],"summary":"Get project statistics","description":"Retrieve project statistics for the authenticated member","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Project statistics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/ProjectStats"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects":{"get":{"operationId":"listProjects","tags":["Projects"],"summary":"List projects","description":"Retrieve a paginated list of projects for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"cursor","schema":{"description":"Opaque keyset cursor from the previous page","type":"string","minLength":1},"description":"Opaque keyset cursor from the previous page"},{"in":"query","name":"status","schema":{"description":"Filter by status","type":"string","enum":["not_started","in_progress","on_hold","completed"]},"description":"Filter by status"},{"in":"query","name":"areaId","schema":{"description":"Filter by area UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by area UUID"},{"in":"query","name":"goalId","schema":{"description":"Filter by goal UUID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by goal UUID"},{"in":"query","name":"orderBy","schema":{"default":"createdAt","description":"Field to order by","type":"string","enum":["createdAt","updatedAt","deadline","name","progress"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"},{"in":"query","name":"search","schema":{"description":"Search query for name and description","type":"string","minLength":2},"description":"Search query for name and description"}],"responses":{"200":{"description":"Projects retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectWithProgress"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createProject","tags":["Projects"],"summary":"Create a project","description":"Create a new project for organizing tasks","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Project data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"201":{"description":"Project created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/ProjectWithGoals"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Linked area or goal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects/{id}":{"get":{"operationId":"getProject","tags":["Projects"],"summary":"Get a project","description":"Retrieve a specific project by ID with calculated progress","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"required":true,"description":"Project UUID"}],"responses":{"200":{"description":"Project retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/ProjectDetail"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateProject","tags":["Projects"],"summary":"Update a project","description":"Update an existing project","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"required":true,"description":"Project UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Project fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectRequest"}}}},"responses":{"200":{"description":"Project updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/ProjectWithGoals"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteProject","tags":["Projects"],"summary":"Delete a project","description":"Permanently delete a project. Tasks linked to this project will also be deleted.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"required":true,"description":"Project UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Project deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Deleted project ID"},"deletedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Deletion timestamp"},"softDelete":{"type":"boolean","description":"Whether this was a soft delete"},"cascade":{"type":"object","properties":{"areas":{"type":"number","description":"Number of areas soft-deleted"},"goals":{"type":"number","description":"Number of goals soft-deleted"},"projects":{"type":"number","description":"Number of projects soft-deleted"},"habits":{"type":"number","description":"Number of habits soft-deleted"},"tasks":{"type":"number","description":"Number of tasks soft-deleted"},"kept":{"description":"Counts of children preserved rather than deleted","type":"object","properties":{"goals":{"type":"number","description":"Goals preserved (unlinked)"},"projects":{"type":"number","description":"Projects preserved (unlinked)"},"habits":{"type":"number","description":"Habits preserved (unlinked)"},"tasks":{"type":"number","description":"Tasks preserved (unlinked)"}},"required":["goals","projects","habits","tasks"],"additionalProperties":false}},"required":["areas","goals","projects","habits","tasks"],"additionalProperties":false,"description":"Cascade soft-delete counts"}},"required":["id","deletedAt","softDelete","cascade"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects/{id}/tasks":{"get":{"operationId":"getProjectTasks","tags":["Projects"],"summary":"Get project tasks","description":"Retrieve tasks associated with a project","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"required":true,"description":"Project UUID"},{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"isCompleted","schema":{"description":"Filter by completion status","type":"boolean"},"description":"Filter by completion status"}],"responses":{"200":{"description":"Project tasks retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectTask"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/projects/{id}/progress":{"get":{"operationId":"getProjectProgress","tags":["Projects"],"summary":"Get project progress","description":"Get detailed progress and task statistics for a project","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"required":true,"description":"Project UUID"}],"responses":{"200":{"description":"Project progress retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/ProjectProgress"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits/bulk":{"post":{"operationId":"createHabitsBulk","tags":["Habits"],"summary":"Create habits with per-item partial success","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"habits":{"minItems":1,"maxItems":50,"type":"array","items":{}}},"required":["habits"],"additionalProperties":false}}}},"responses":{"200":{"description":"All items succeeded or all failed deterministically","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Habit"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"successCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failureCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"206":{"description":"Some habit items succeeded and some failed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"successful":{"type":"array","items":{"$ref":"#/components/schemas/Habit"}},"failed":{"type":"array","items":{"type":"object","properties":{"item":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["item","error"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"successCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failureCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["successful","failed","total","successCount","failureCount"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid bulk request envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits/search":{"get":{"operationId":"searchHabits","tags":["Habits"],"summary":"Search habits (full-text)","description":"Search habits by name and description using full-text matching","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search query string"},"required":true,"description":"Search query string"},{"in":"query","name":"limit","schema":{"description":"Maximum number of results","default":20,"type":"integer","minimum":1,"maximum":50},"description":"Maximum number of results"},{"in":"query","name":"include_inactive","schema":{"description":"Include inactive habits in results","default":false,"type":"boolean"},"description":"Include inactive habits in results"}],"responses":{"200":{"description":"Search results retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Habit"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits/deleted":{"get":{"operationId":"listDeletedHabits","tags":["Habits"],"summary":"List deleted habits","description":"Retrieve a paginated list of soft-deleted habits","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"cursor","schema":{"description":"Opaque keyset cursor from the previous page","type":"string","minLength":1},"description":"Opaque keyset cursor from the previous page"},{"in":"query","name":"category","schema":{"description":"Filter by category","type":"string"},"description":"Filter by category"},{"in":"query","name":"frequency","schema":{"description":"Filter by frequency","type":"string","enum":["daily","weekly","monthly"]},"description":"Filter by frequency"},{"in":"query","name":"isActive","schema":{"description":"Filter by active status","type":"boolean"},"description":"Filter by active status"},{"in":"query","name":"orderBy","schema":{"default":"createdAt","description":"Field to order by","type":"string","enum":["createdAt","updatedAt","name","currentStreak"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"}],"responses":{"200":{"description":"Deleted habits retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Habit"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits":{"get":{"operationId":"listHabits","tags":["Habits"],"summary":"List habits","description":"Retrieve a paginated list of habits for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"cursor","schema":{"description":"Opaque keyset cursor from the previous page","type":"string","minLength":1},"description":"Opaque keyset cursor from the previous page"},{"in":"query","name":"category","schema":{"description":"Filter by category","type":"string"},"description":"Filter by category"},{"in":"query","name":"frequency","schema":{"description":"Filter by frequency","type":"string","enum":["daily","weekly","monthly"]},"description":"Filter by frequency"},{"in":"query","name":"isActive","schema":{"description":"Filter by active status","type":"boolean"},"description":"Filter by active status"},{"in":"query","name":"orderBy","schema":{"default":"createdAt","description":"Field to order by","type":"string","enum":["createdAt","updatedAt","name","currentStreak"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"}],"responses":{"200":{"description":"Habits retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Habit"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createHabit","tags":["Habits"],"summary":"Create a habit","description":"Create a new habit for tracking","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Habit data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHabitRequest"}}}},"responses":{"201":{"description":"Habit created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Habit"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Linked goal not found (goalId references a non-existent goal)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Habit with this name already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Provided areaId conflicts with the linked goal's area","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits/{id}":{"get":{"operationId":"getHabit","tags":["Habits"],"summary":"Get a habit","description":"Retrieve a specific habit by ID with statistics","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"}],"responses":{"200":{"description":"Habit retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/HabitWithStats"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Habit not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateHabit","tags":["Habits"],"summary":"Update a habit","description":"Update an existing habit","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Habit fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHabitRequest"}}}},"responses":{"200":{"description":"Habit updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Habit"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Habit not found, or linked goal not found (goalId references a non-existent goal)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Provided areaId conflicts with the linked goal's area","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteHabit","tags":["Habits"],"summary":"Soft delete a habit","description":"Soft delete a habit. The habit can be restored later.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Habit soft deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/DeletedResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Habit not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits/{id}/restore":{"post":{"operationId":"restoreHabit","tags":["Habits"],"summary":"Restore a deleted habit","description":"Restore a soft-deleted habit","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Habit restored successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Habit"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Deleted habit not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Cannot restore: a habit with this name already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits/{id}/stats":{"get":{"operationId":"getHabitStats","tags":["Habits"],"summary":"Get habit statistics","description":"Get detailed statistics for a habit","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"}],"responses":{"200":{"description":"Habit statistics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/HabitStats"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Habit not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits/{id}/check-ins":{"get":{"operationId":"listHabitCheckIns","tags":["Habits"],"summary":"List habit check-ins","description":"Retrieve check-ins for a habit","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"},{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"startDate","schema":{"description":"Start date filter (inclusive)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Start date filter (inclusive)"},{"in":"query","name":"endDate","schema":{"description":"End date filter (inclusive)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"End date filter (inclusive)"}],"responses":{"200":{"description":"Check-ins retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/HabitCheckIn"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Habit not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createHabitCheckIn","tags":["Habits"],"summary":"Create a check-in","description":"Log a check-in for a habit","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Check-in data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckInRequest"}}}},"responses":{"201":{"description":"Check-in created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/HabitCheckIn"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data or check-in already exists for date","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Habit not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/habits/{id}/check-ins/{checkInId}":{"get":{"operationId":"getHabitCheckIn","tags":["Habits"],"summary":"Get a check-in","description":"Retrieve a specific check-in","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"},{"in":"path","name":"checkInId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Check-in UUID"},"required":true,"description":"Check-in UUID"}],"responses":{"200":{"description":"Check-in retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/HabitCheckIn"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Check-in not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateHabitCheckIn","tags":["Habits"],"summary":"Update a check-in","description":"Update an existing check-in","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"},{"in":"path","name":"checkInId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Check-in UUID"},"required":true,"description":"Check-in UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Check-in fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCheckInRequest"}}}},"responses":{"200":{"description":"Check-in updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/HabitCheckIn"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Check-in not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteHabitCheckIn","tags":["Habits"],"summary":"Delete a check-in","description":"Delete a check-in","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"required":true,"description":"Habit UUID"},{"in":"path","name":"checkInId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Check-in UUID"},"required":true,"description":"Check-in UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Check-in deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/DeletedResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Check-in not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/trash":{"get":{"operationId":"listTrash","tags":["Trash"],"summary":"List trashed items","description":"Get all soft-deleted items for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"type","schema":{"description":"Filter by entity type","$ref":"#/components/schemas/TrashEntityType"},"description":"Filter by entity type"},{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","minimum":1,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","minimum":1,"maximum":100},"description":"Items per page"}],"responses":{"200":{"description":"List of trashed items","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TrashItem"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"emptyTrash","tags":["Trash"],"summary":"Empty trash","description":"Permanently delete all items older than specified days","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"type","schema":{"description":"Only empty items of this type","$ref":"#/components/schemas/TrashEntityType"},"description":"Only empty items of this type"},{"in":"query","name":"olderThanDays","schema":{"default":30,"description":"Delete items older than N days","type":"integer","minimum":1,"maximum":9007199254740991},"description":"Delete items older than N days"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Trash emptied with counts","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"deleted":{"type":"object","properties":{"areas":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Areas affected"},"goals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Goals affected"},"projects":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Projects affected"},"tasks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tasks affected"},"notes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Notes affected"},"folders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Folders affected"}},"required":["areas","goals","projects","tasks","notes","folders"],"additionalProperties":false},"olderThanDays":{"type":"number"},"cutoffDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["deleted","olderThanDays","cutoffDate"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/trash/stats":{"get":{"operationId":"getTrashStats","tags":["Trash"],"summary":"Get trash statistics","description":"Get counts of soft-deleted items by type","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Trash statistics","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/TrashStats"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/trash/{type}/{id}/restore":{"post":{"operationId":"restoreTrashItem","tags":["Trash"],"summary":"Restore a trashed item","description":"Restore a soft-deleted item and all cascade-deleted children","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"type","schema":{"description":"Entity type","$ref":"#/components/schemas/TrashEntityType"},"required":true,"description":"Entity type"},{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Entity ID"},"required":true,"description":"Entity ID"},{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for agent actors and optional for member actors. Same-key replay returns the original restore response; a different key after restore may return 404.","type":"string","minLength":8,"maxLength":255},"description":"Required for agent actors and optional for member actors. Same-key replay returns the original restore response; a different key after restore may return 404."}],"responses":{"200":{"description":"Item restored with cascade counts","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string"},"restored":{"type":"object","properties":{"areas":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Areas restored"},"goals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Goals restored"},"projects":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Projects restored"},"habits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Habits restored"},"tasks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tasks restored"},"notes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Notes restored"},"folders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Folders restored (a subtree restores as a unit)"}},"additionalProperties":false}},"required":["id","type","restored"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"400":{"description":"Validation error (e.g., duplicate name)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Trashed item not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency key conflict or original restore outcome unknown","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required idempotency storage unavailable before restore execution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/trash/{type}/{id}":{"delete":{"operationId":"permanentlyDeleteTrashItem","tags":["Trash"],"summary":"Permanently delete a trashed item","description":"Hard delete a soft-deleted item (cannot be undone)","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"type","schema":{"description":"Entity type","$ref":"#/components/schemas/TrashEntityType"},"required":true,"description":"Entity type"},{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Entity ID"},"required":true,"description":"Entity ID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Item permanently deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string"},"deletedAt":{"type":"string"},"softDelete":{"type":"boolean","const":false}},"required":["id","deletedAt","softDelete"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Trashed item not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/insights/weekly/share":{"get":{"operationId":"getWeeklyShareCard","tags":["Insights"],"summary":"Get the Weekly Share Card","description":"Returns a consolidated, presentation-ready share-card payload for a member's week: momentum score + tier + delta vs prior week, AI headline, habit consistency, top focus area, tasks done, and deep-focus minutes.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"week","schema":{"description":"Week start date (YYYY-MM-DD). Defaults to the current week (Monday).","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Week start date (YYYY-MM-DD). Defaults to the current week (Monday)."}],"responses":{"200":{"description":"Weekly share card computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/WeeklyShareCard"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/insights/momentum":{"get":{"operationId":"getMomentum","tags":["Insights"],"summary":"Get the composite Momentum score","description":"Returns the 0-100 composite Momentum score for a day with its four named drivers (focus, completion, consistency, balance), traffic-light band and a growth-framed directive.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"date","schema":{"description":"Day to score (YYYY-MM-DD). Defaults to today (UTC).","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Day to score (YYYY-MM-DD). Defaults to today (UTC)."}],"responses":{"200":{"description":"Momentum computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Momentum"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/insights/weekly":{"get":{"operationId":"getWeeklyReview","tags":["Insights"],"summary":"Get the Weekly Review","description":"Returns the Weekly Review payload (momentum trend, wins, habit consistency, suggested focus area) for the given week start (defaults to the current week).","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"week","schema":{"description":"Week start date (YYYY-MM-DD). Defaults to the current week (Monday).","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Week start date (YYYY-MM-DD). Defaults to the current week (Monday)."}],"responses":{"200":{"description":"Weekly review computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/WeeklyReview"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/insights":{"get":{"operationId":"listInsights","tags":["Insights"],"summary":"List insights","description":"Retrieve a paginated list of AI-generated insights for the authenticated member with optional filtering","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"type","schema":{"description":"Filter by insight type","type":"string","enum":["daily_outlook","productivity_trend","recommendation","pattern_detection"]},"description":"Filter by insight type"},{"in":"query","name":"priority","schema":{"description":"Filter by priority level","type":"string","enum":["low","medium","high","critical"]},"description":"Filter by priority level"},{"in":"query","name":"isRead","schema":{"description":"Filter by read status","type":"string","enum":["true","false"]},"description":"Filter by read status"},{"in":"query","name":"isDismissed","schema":{"description":"Filter by dismissed status","type":"string","enum":["true","false"]},"description":"Filter by dismissed status"},{"in":"query","name":"includeExpired","schema":{"default":"false","description":"Include expired insights","type":"string","enum":["true","false"]},"description":"Include expired insights"},{"in":"query","name":"orderBy","schema":{"default":"generatedAt","description":"Field to order by","type":"string","enum":["generatedAt","priority","createdAt"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"}],"responses":{"200":{"description":"Insights retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/InsightResponse"}},"meta":{"type":"object","properties":{"requestId":{"type":"string","description":"Unique request identifier"},"timestamp":{"type":"string","description":"ISO 8601 timestamp"},"version":{"description":"API version","type":"string"},"processingTime":{"description":"Processing time in milliseconds","type":"number"},"warnings":{"description":"Warning messages","type":"array","items":{"type":"string"}},"documentation":{"description":"Link to documentation","type":"string"},"operation":{"description":"Operation type","type":"string","enum":["created","updated"]},"changes":{"description":"List of changes made","type":"array","items":{"type":"string"}},"location":{"description":"Location of created resource","type":"string"},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of unread insights"},"highPriorityCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of high/critical priority insights"}},"required":["requestId","timestamp","unreadCount","highPriorityCount"],"additionalProperties":false},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","meta","pagination"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/insights/daily":{"get":{"operationId":"getDailyOutlook","tags":["Insights"],"summary":"Get daily outlook","description":"Retrieve today's daily outlook insight for the authenticated member. Returns null if not yet generated.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Daily outlook retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"$ref":"#/components/schemas/InsightResponse"},{"type":"object","properties":{"insight":{"type":"null"},"message":{"type":"string"}},"required":["insight","message"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/insights/{id}":{"get":{"operationId":"getInsight","tags":["Insights"],"summary":"Get insight by ID","description":"Retrieve a specific insight by its ID","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Insight UUID"},"required":true,"description":"Insight UUID"}],"responses":{"200":{"description":"Insight retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/InsightResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Not authorized to access this insight","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Insight not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteInsight","tags":["Insights"],"summary":"Delete insight","description":"Soft delete an insight","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Insight UUID"},"required":true,"description":"Insight UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Insight deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/DeletedResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Not authorized to delete this insight","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Insight not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/insights/{id}/mark-read":{"post":{"operationId":"markInsightRead","tags":["Insights"],"summary":"Mark insight as read","description":"Mark a specific insight as read","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Insight UUID"},"required":true,"description":"Insight UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Insight marked as read","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/InsightResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Not authorized to access this insight","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Insight not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/insights/{id}/dismiss":{"post":{"operationId":"dismissInsight","tags":["Insights"],"summary":"Dismiss insight","description":"Dismiss an insight so it will not be shown again","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Insight UUID"},"required":true,"description":"Insight UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Insight dismissed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/InsightResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Not authorized to access this insight","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Insight not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/flows/stats":{"get":{"operationId":"getFlowStats","tags":["Flows"],"summary":"Range-scoped flow analytics","description":"Totals, planned-vs-actual, by-area rollup, by-hour histogram and rating distribution for a date range","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Inclusive start date (YYYY-MM-DD)"},"required":true,"description":"Inclusive start date (YYYY-MM-DD)"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Inclusive end date (YYYY-MM-DD)"},"required":true,"description":"Inclusive end date (YYYY-MM-DD)"}],"responses":{"200":{"description":"Stats computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/FlowStats"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/flows/today":{"get":{"operationId":"getTodayFlows","tags":["Flows"],"summary":"Get today's sessions with stats","description":"Retrieve all flow sessions for today with aggregated statistics","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"timezone","schema":{"default":"UTC","description":"Timezone for determining \"today\" (IANA timezone, e.g., \"America/New_York\")","type":"string"},"description":"Timezone for determining \"today\" (IANA timezone, e.g., \"America/New_York\")"}],"responses":{"200":{"description":"Today's sessions retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Flow"}},"stats":{"$ref":"#/components/schemas/TodayStats"}},"required":["sessions","stats"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/flows":{"get":{"operationId":"listFlows","tags":["Flows"],"summary":"List flow sessions","description":"Retrieve a paginated list of flow sessions for the authenticated member","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"startDate","schema":{"description":"Filter sessions starting from this date (inclusive)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Filter sessions starting from this date (inclusive)"},{"in":"query","name":"endDate","schema":{"description":"Filter sessions up to this date (inclusive)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Filter sessions up to this date (inclusive)"},{"in":"query","name":"status","schema":{"description":"Filter by status","type":"string","enum":["completed","cancelled"]},"description":"Filter by status"},{"in":"query","name":"areaId","schema":{"description":"Filter by area","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by area"},{"in":"query","name":"goalId","schema":{"description":"Filter by goal","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by goal"},{"in":"query","name":"projectId","schema":{"description":"Filter by project","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by project"},{"in":"query","name":"taskId","schema":{"description":"Filter by task","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter by task"},{"in":"query","name":"orderBy","schema":{"default":"startTime","description":"Field to order by","type":"string","enum":["createdAt","startTime","endTime","actualDuration"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"}],"responses":{"200":{"description":"Sessions retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Flow"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createFlow","tags":["Flows"],"summary":"Create a flow session","description":"Create a new flow session (from timer or manual log)","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Session data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlowRequest"}}}},"responses":{"201":{"description":"Session created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Flow"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/flows/{id}":{"get":{"operationId":"getFlow","tags":["Flows"],"summary":"Get a flow session","description":"Retrieve a specific flow session by ID","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Flow session UUID"},"required":true,"description":"Flow session UUID"}],"responses":{"200":{"description":"Session retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Flow"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateFlow","tags":["Flows"],"summary":"Update a flow session","description":"Update an existing flow session","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Flow session UUID"},"required":true,"description":"Flow session UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Session fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFlowRequest"}}}},"responses":{"200":{"description":"Session updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Flow"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteFlow","tags":["Flows"],"summary":"Soft delete a flow session","description":"Soft delete a flow session","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Flow session UUID"},"required":true,"description":"Flow session UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Session soft deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Deleted session ID"},"deletedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Soft deletion timestamp"},"softDelete":{"type":"boolean","description":"Whether this was a soft delete"}},"required":["id","deletedAt","softDelete"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/stats/timeseries":{"get":{"operationId":"getStatsTimeseries","tags":["Stats"],"summary":"Daily-bucketed metric series","description":"Returns a gap-filled daily series for completions or focus minutes over a date range, plus the member-baseline mean.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"metric","schema":{"type":"string","enum":["completions","focus_minutes"],"description":"Which metric to bucket: task completions or focus minutes"},"required":true,"description":"Which metric to bucket: task completions or focus minutes"},{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Inclusive start date (YYYY-MM-DD)"},"required":true,"description":"Inclusive start date (YYYY-MM-DD)"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Inclusive end date (YYYY-MM-DD)"},"required":true,"description":"Inclusive end date (YYYY-MM-DD)"},{"in":"query","name":"bucket","schema":{"default":"day","description":"Bucket granularity (only \"day\" supported in v1)","type":"string","enum":["day"]},"description":"Bucket granularity (only \"day\" supported in v1)"}],"responses":{"200":{"description":"Timeseries computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/StatsTimeseriesResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/stats/time-of-day":{"get":{"operationId":"getStatsTimeOfDay","tags":["Stats"],"summary":"Hour-of-day histogram","description":"Returns a contiguous 24-bucket hour-of-day histogram for completions or focus minutes.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"metric","schema":{"type":"string","enum":["completions","focus"],"description":"Which metric to bucket by hour-of-day: task completions or focus minutes"},"required":true,"description":"Which metric to bucket by hour-of-day: task completions or focus minutes"}],"responses":{"200":{"description":"Histogram computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/StatsTimeOfDayResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/stats/metrics":{"get":{"operationId":"getStatsMetrics","tags":["Stats"],"summary":"Four orthogonal productivity indices","description":"Returns Output, Focus, Sustainability and Consistency for a day, each banded against the member's own baseline, plus a sustainability-first directive and a burnout guardrail flag.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"date","schema":{"description":"Day to compute the indices for (YYYY-MM-DD); defaults to today (UTC)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Day to compute the indices for (YYYY-MM-DD); defaults to today (UTC)"}],"responses":{"200":{"description":"Metrics computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/StatsMetricsResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/stats/today":{"get":{"operationId":"getStatsToday","tags":["Stats"],"summary":"Rings-today summary","description":"Compact summary powering the Apple Watch glance + complication: today's habit check-ins vs habits scheduled today (recurrence-aware), tasks completed vs due today, focus minutes vs the adaptive target, the consistency index + best streak, and the composite momentum score + band.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"date","schema":{"description":"Day to summarise (YYYY-MM-DD); defaults to today (UTC)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Day to summarise (YYYY-MM-DD); defaults to today (UTC)"}],"responses":{"200":{"description":"Rings-today summary computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/StatsTodayResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/stats/ai-usage":{"get":{"operationId":"getStatsAiUsage","tags":["Stats"],"summary":"AI usage and estimated cost summary","description":"Returns current AI interaction usage, estimated monthly cost, seven daily buckets, and role-level cost breakdown.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"AI usage computed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/StatsAiUsageResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reminders/due-soon":{"get":{"operationId":"getRemindersDueSoon","tags":["Reminders"],"summary":"Get reminders due soon","description":"Retrieve pending reminders that are due within a specified time window","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"minutes","schema":{"default":60,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Reminders due soon retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Reminder"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reminders/pending":{"get":{"operationId":"getPendingReminders","tags":["Reminders"],"summary":"Get pending reminders","description":"Retrieve all pending reminders for the authenticated member","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Pending reminders retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Reminder"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reminders/{id}":{"get":{"operationId":"getReminder","tags":["Reminders"],"summary":"Get a reminder","description":"Retrieve a specific reminder by ID","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Reminder retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Reminder"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reminder not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteReminder","tags":["Reminders"],"summary":"Delete a reminder","description":"Delete a reminder by ID","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Reminder deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Deleted reminder ID"},"deletedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"ISO 8601 timestamp of deletion"},"softDelete":{"type":"boolean","description":"Whether a soft delete was used"}},"required":["id","deletedAt","softDelete"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reminder not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reminders/{id}/status":{"patch":{"operationId":"updateReminderStatus","tags":["Reminders"],"summary":"Update reminder status","description":"Update the status of a reminder (triggered or dismissed)","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Status update data","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["triggered","dismissed"]},"sourceProvenance":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["mail_message","calendar_event"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string","minLength":1,"maxLength":1000},"sourceUrl":{"type":"string","maxLength":4000,"format":"uri"},"label":{"type":"string","maxLength":200}},"required":["kind","connectionId","externalId"],"additionalProperties":false},{"type":"null"}]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Reminder status updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Reminder"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reminder not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/{taskId}/reminders":{"get":{"operationId":"getRemindersForTask","tags":["Reminders"],"summary":"Get reminders for a task","description":"Retrieve all reminders associated with a specific task","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Task reminders retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Reminder"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createReminder","tags":["Reminders"],"summary":"Create a reminder for a task","description":"Create a new reminder associated with a task","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Reminder data","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":1000},"remindAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"sourceProvenance":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["mail_message","calendar_event"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string","minLength":1,"maxLength":1000},"sourceUrl":{"type":"string","maxLength":4000,"format":"uri"},"label":{"type":"string","maxLength":200}},"required":["kind","connectionId","externalId"],"additionalProperties":false},{"type":"null"}]}},"required":["message","remindAt"],"additionalProperties":false}}}},"responses":{"201":{"description":"Reminder created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Reminder"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{noteId}/reminders":{"get":{"operationId":"getRemindersForNote","tags":["Reminders"],"summary":"Get reminders for a note","description":"Retrieve all reminders associated with a specific note","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"noteId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Note reminders retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Reminder"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createNoteReminder","tags":["Reminders"],"summary":"Create a reminder for a note","description":"Create a new reminder associated with a note. The notifications worker deep-links the push to notes/[id].","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"noteId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Reminder data","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":1000},"remindAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"sourceProvenance":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["mail_message","calendar_event"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string","minLength":1,"maxLength":1000},"sourceUrl":{"type":"string","maxLength":4000,"format":"uri"},"label":{"type":"string","maxLength":200}},"required":["kind","connectionId","externalId"],"additionalProperties":false},{"type":"null"}]}},"required":["message","remindAt"],"additionalProperties":false}}}},"responses":{"201":{"description":"Reminder created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Reminder"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{id}/append":{"post":{"operationId":"appendNote","tags":["Notes"],"summary":"Append Markdown with exact-version concurrency and durable retry protection","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"required":true,"description":"Note UUID"},{"in":"header","name":"If-Match","schema":{"type":"string","minLength":1,"maxLength":100},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":8,"maxLength":255},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":100000}},"required":["content"],"additionalProperties":false}}}},"responses":{"200":{"description":"Durable agent mutation receipt (applied or awaiting approval)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale note or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{id}/suggest-connections":{"post":{"operationId":"suggestNoteConnections","tags":["Notes"],"summary":"Suggest connections","description":"Return grounded candidate connections for a note, ranked by semantic similarity against the member's real indexed entities (via rag-service). READ-ONLY — never writes; the client confirms which to apply. Biases precision over recall and excludes the note itself and already-linked targets.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"required":true,"description":"Note UUID"}],"responses":{"200":{"description":"Candidate connections retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"noteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedConnection"}}},"required":["noteId","candidates"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes":{"get":{"operationId":"listNotes","tags":["Notes"],"summary":"List notes","description":"List notes for the authenticated member. Supports filtering by tag, connected entity, archived state, and full-text search.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Page number","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Page number"},{"in":"query","name":"limit","schema":{"default":20,"description":"Items per page","type":"integer","exclusiveMinimum":0,"maximum":100},"description":"Items per page"},{"in":"query","name":"orderBy","schema":{"default":"updatedAt","description":"Field to order by","type":"string","enum":["createdAt","updatedAt","title"]},"description":"Field to order by"},{"in":"query","name":"order","schema":{"default":"desc","description":"Sort order","type":"string","enum":["asc","desc"]},"description":"Sort order"},{"in":"query","name":"tag","schema":{"description":"Filter to notes carrying this tag","type":"string","minLength":1,"maxLength":50},"description":"Filter to notes carrying this tag"},{"in":"query","name":"connectedType","schema":{"description":"Filter to notes connected to an entity of this type (requires connectedId)","type":"string","enum":["area","goal","project","task","habit","note"]},"description":"Filter to notes connected to an entity of this type (requires connectedId)"},{"in":"query","name":"connectedId","schema":{"description":"Filter to notes connected to this entity id (requires connectedType)","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter to notes connected to this entity id (requires connectedType)"},{"in":"query","name":"archived","schema":{"description":"When true, return only archived notes; omit for active notes only","type":"boolean"},"description":"When true, return only archived notes; omit for active notes only"},{"in":"query","name":"q","schema":{"description":"Full-text search over title and content","type":"string","minLength":1,"maxLength":200},"description":"Full-text search over title and content"},{"in":"query","name":"folderId","schema":{"description":"Filter to notes filed in this knowledge folder (mutually exclusive with unfiled)","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Filter to notes filed in this knowledge folder (mutually exclusive with unfiled)"},{"in":"query","name":"unfiled","schema":{"description":"When true, return only notes in the virtual \"Unfiled\" bucket (folder_id IS NULL); omit otherwise","type":"boolean"},"description":"When true, return only notes in the virtual \"Unfiled\" bucket (folder_id IS NULL); omit otherwise"}],"responses":{"200":{"description":"Notes retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Note"}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createNote","tags":["Notes"],"summary":"Create a note","description":"Create a note. The title is auto-derived from the first line / H1 of content when omitted. Optional initial connections are validated against the member's entities before insert. An optional `folderId` files the note in the same transaction as the insert — an invalid or foreign folder fails the create rather than silently landing the note in Unfiled.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Note data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNoteRequest"}}}},"responses":{"200":{"description":"Durable agent mutation receipt (applied or awaiting approval)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"201":{"description":"Note created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/NoteWithConnections"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data (e.g. a connection target was not found)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The requested folder does not exist, is in trash, or is not the member's","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{id}":{"get":{"operationId":"getNote","tags":["Notes"],"summary":"Get a note","description":"Retrieve a single note with its outgoing connections and note backlinks.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"required":true,"description":"Note UUID"}],"responses":{"200":{"description":"Note retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/NoteWithRelations"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateNote","tags":["Notes"],"summary":"Update a note","description":"Update a note's content, title, tags, or archived state. The title is re-derived from content on a content change unless an explicit title is supplied.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"required":true,"description":"Note UUID"},{"in":"header","name":"If-Match","schema":{"description":"Required for agent edits: exact opaque version from note_get, optionally quoted","type":"string","minLength":1,"maxLength":100},"description":"Required for agent edits: exact opaque version from note_get, optionally quoted"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Note fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNoteRequest"}}}},"responses":{"200":{"description":"Note updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"$ref":"#/components/schemas/Note"},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteNote","tags":["Notes"],"summary":"Soft delete a note","description":"Soft delete a note. The note can be restored later via the trash module.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"required":true,"description":"Note UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Note soft deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/DeletedResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{id}/connections":{"post":{"operationId":"addNoteConnection","tags":["Notes"],"summary":"Add a connection","description":"Connect a note to another entity (area, goal, project, task, habit, or note). The target is validated to exist and belong to the member. Idempotent on the (note, target) pair.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"required":true,"description":"Note UUID"},{"in":"header","name":"If-Match","schema":{"description":"Required for agent edits: exact opaque version from note_get, optionally quoted","type":"string","minLength":1,"maxLength":100},"description":"Required for agent edits: exact opaque version from note_get, optionally quoted"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Connection target","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteConnectionInput"}}}},"responses":{"200":{"description":"Durable agent mutation receipt (applied or awaiting approval)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"201":{"description":"Connection created (or already existed)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/NoteConnection"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data or target not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{id}/connections/{connectionId}":{"delete":{"operationId":"removeNoteConnection","tags":["Notes"],"summary":"Remove a connection","description":"Remove a connection from a note.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"required":true,"description":"Note UUID"},{"in":"path","name":"connectionId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Connection UUID"},"required":true,"description":"Connection UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Connection removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/DeletedResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note or connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid, unauthorized, missing, conflicting or unavailable note operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/folders/tree":{"get":{"operationId":"getFolderTree","tags":["Folders"],"summary":"Get the folder tree","description":"The only read the sidebar makes: a flat folder list plus flat note stubs, both in sibling order, assembled into a tree by the client. Deliberately one round trip — never a request per node. \"Unfiled\" (folderId === null) is a virtual permanent root-level bucket, not a folder row: it cannot be renamed, moved, or deleted.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Folder tree retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/FolderTree"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/folders":{"post":{"operationId":"createFolder","tags":["Folders"],"summary":"Create a folder","description":"Create a knowledge folder. Sibling names are unique case-insensitively (a collision returns 409) — this is for agent name-resolution, which cannot choose between two siblings that render identically. Optional beforeId/afterId position the folder among its new siblings; both must be genuinely adjacent, in that order.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Folder data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolderRequest"}}}},"responses":{"201":{"description":"Folder created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Folder"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data, or beforeId/afterId are not adjacent siblings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Parent folder or area not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"A sibling folder already has that name (case-insensitive)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/folders/{id}":{"patch":{"operationId":"updateFolder","tags":["Folders"],"summary":"Update a folder","description":"Rename, re-icon, recolor, or relink a folder to an area. Does NOT move it — use POST /folders/{id}/move. Sending icon/color/areaId as null clears them.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Folder UUID"},"required":true,"description":"Folder UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderRequest"}}}},"responses":{"200":{"description":"Folder updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Folder"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Folder or area not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"A sibling folder already has that name (case-insensitive)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteFolder","tags":["Folders"],"summary":"Delete a folder subtree","description":"Soft-deletes the folder, every descendant folder, and every note filed anywhere in the subtree, into trash — recoverable as a unit via POST /trash/folder/{id}/restore. Notes are NOT unfiled: this matches Notion, Apple Notes, Obsidian, Drive and Finder.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Folder UUID"},"required":true,"description":"Folder UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Folder subtree moved to trash","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/FolderDeleteResult"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Folder not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/folders/{id}/move":{"post":{"operationId":"moveFolder","tags":["Folders"],"summary":"Move a folder","description":"Reparent and reorder in one call, writing exactly one row. Omit parentId to keep the current parent (a pure reorder); send null to move to the root level. A move that would make the folder its own ancestor is rejected (400) by an ancestor-walk recursive CTE. beforeId/afterId must reference genuinely adjacent siblings of the DESTINATION parent, in that order.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Folder UUID"},"required":true,"description":"Folder UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Destination parent and sibling placement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveFolderRequest"}}}},"responses":{"200":{"description":"Folder moved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/Folder"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Cycle would be created, folder is its own parent, or beforeId/afterId are not adjacent siblings in the destination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Folder or destination parent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"A folder with that name already exists in the destination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{id}/move":{"post":{"operationId":"moveNote","tags":["Notes"],"summary":"Move a note into a folder","description":"File a note into a folder and position it among its siblings. Omit folderId to keep the current folder (a pure reorder); send null to move the note to the virtual \"Unfiled\" bucket. The first placement that references an as-yet-unpositioned sibling materializes fractional indexes for that folder's notes, preserving their current display order.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"required":true,"description":"Note UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Destination folder and sibling placement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveNoteRequest"}}}},"responses":{"200":{"description":"Note moved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{},"additionalProperties":{},"description":"The updated note"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"beforeId/afterId are not adjacent siblings in the destination folder","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Note or destination folder not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/suggestions/chat":{"get":{"operationId":"getChatSuggestions","tags":["Suggestions"],"summary":"Get chat suggestions","description":"Get AI-powered contextual chat suggestions based on the member's current productivity data. Returns cold-start defaults for new members.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Chat suggestions retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/ChatSuggestion"}}},"required":["suggestions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/search":{"get":{"operationId":"searchEntities","tags":["Search"],"summary":"Search across all entities","description":"Trigram-based text search across tasks, areas, goals, projects, habits, and knowledge folders. Folders are searchable only when the `note` entity type is unlocked; an unfiltered search silently omits them, while an explicit `type=folder` returns 422 ENTITY_TYPE_LOCKED.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search query string"},"required":true,"description":"Search query string"},{"in":"query","name":"type","schema":{"description":"Entity type filter. `folder` requires the `note` entity type to be unlocked (folders are containers for notes, not a primitive of their own).","type":"string","enum":["task","area","goal","project","habit","folder"]},"description":"Entity type filter. `folder` requires the `note` entity type to be unlocked (folders are containers for notes, not a primitive of their own)."},{"in":"query","name":"limit","schema":{"description":"Maximum number of results (default 5, max 20)","default":5,"type":"integer","minimum":1,"maximum":20},"description":"Maximum number of results (default 5, max 20)"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}},"required":["results"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The requested entity type is locked for this member (e.g. `type=folder` while `note` is locked)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/entities/index":{"get":{"operationId":"getEntitiesIndex","tags":["Entities"],"summary":"Get compact entity index","description":"Returns a lightweight entity graph for the authenticated user, containing areas, goals, projects, active tasks (max 50), habits with last check-in dates, and knowledge folders. Folders are present only when the `note` entity type is unlocked. This is the catalog an agent binds names to ids against in a single turn.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Entity index retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/EntitiesIndexResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/internal/memory-evidence/native/sources":{"post":{"operationId":"readNativeMemorySources","summary":"Resolve exact retained native source revisions","tags":["Memory evidence"],"security":[{"bearerAuth":[]}],"description":"Read-only internal service evidence. Requires INTERNAL_API_KEY and X-User-Id; member sessions and third-party agents are refused. Text is untrusted member data, never mutation authority. One repeatable-read snapshot per request; cursor pages can miss late commits and do not prove complete history. Evidence data is limited to 1 MiB; oversized requests fail without truncating source content.","parameters":[{"in":"header","name":"X-User-Id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryNativeSourcesRequest"}}}},"responses":{"200":{"description":"Bounded authorized evidence and honest coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemoryNativeSourcesResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request or cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Internal service credentials required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Evidence response exceeds 1 MiB; narrow the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/internal/memory-evidence/native/selections":{"post":{"operationId":"readNativeMemorySelections","summary":"Replay authorized native query receipts","tags":["Memory evidence"],"security":[{"bearerAuth":[]}],"description":"Read-only internal service evidence. Requires INTERNAL_API_KEY and X-User-Id; member sessions and third-party agents are refused. Text is untrusted member data, never mutation authority. One repeatable-read snapshot per request; cursor pages can miss late commits and do not prove complete history. Evidence data is limited to 1 MiB; oversized requests fail without truncating source content.","parameters":[{"in":"header","name":"X-User-Id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryNativeSelectionsRequest"}}}},"responses":{"200":{"description":"Bounded authorized evidence and honest coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemoryNativeSelectionsResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request or cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Internal service credentials required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Evidence response exceeds 1 MiB; narrow the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/internal/memory-evidence/native":{"post":{"operationId":"readNativeMemorySelection","summary":"Calculate a bounded native query from exact captured original sources","tags":["Memory evidence"],"security":[{"bearerAuth":[]}],"description":"Read-only internal service evidence. Requires INTERNAL_API_KEY and X-User-Id; member sessions and third-party agents are refused. Text is untrusted member data, never mutation authority. One repeatable-read snapshot per request; cursor pages can miss late commits and do not prove complete history. Evidence data is limited to 1 MiB; oversized requests fail without truncating source content.","parameters":[{"in":"header","name":"X-User-Id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryNativeRequest"}}}},"responses":{"200":{"description":"Bounded authorized evidence and honest coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemoryNativeResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request or cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Internal service credentials required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Evidence response exceeds 1 MiB; narrow the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/internal/memory-evidence/entities":{"post":{"operationId":"readMemoryCanonicalEntities","summary":"Hydrate exact canonical entity identities","tags":["Memory evidence"],"security":[{"bearerAuth":[]}],"description":"Read-only internal service evidence. Requires INTERNAL_API_KEY and X-User-Id; member sessions and third-party agents are refused. Text is untrusted member data, never mutation authority. One repeatable-read snapshot per request; cursor pages can miss late commits and do not prove complete history. Evidence data is limited to 1 MiB; oversized requests fail without truncating source content.","parameters":[{"in":"header","name":"X-User-Id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryEntitiesRequest"}}}},"responses":{"200":{"description":"Bounded authorized evidence and honest coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemoryEntitiesResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request or cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Internal service credentials required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Evidence response exceeds 1 MiB; narrow the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/internal/memory-evidence/graph":{"post":{"operationId":"readMemoryCanonicalGraph","summary":"Read explicit canonical relationships in both directions","tags":["Memory evidence"],"security":[{"bearerAuth":[]}],"description":"Read-only internal service evidence. Requires INTERNAL_API_KEY and X-User-Id; member sessions and third-party agents are refused. Text is untrusted member data, never mutation authority. One repeatable-read snapshot per request; cursor pages can miss late commits and do not prove complete history. Evidence data is limited to 1 MiB; oversized requests fail without truncating source content.","parameters":[{"in":"header","name":"X-User-Id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryGraphRequest"}}}},"responses":{"200":{"description":"Bounded authorized evidence and honest coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemoryGraphResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request or cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Internal service credentials required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Evidence response exceeds 1 MiB; narrow the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/internal/memory-evidence/history":{"post":{"operationId":"readMemoryRecordedHistory","summary":"Read recorded revisions, outcomes and check-ins","tags":["Memory evidence"],"security":[{"bearerAuth":[]}],"description":"Read-only internal service evidence. Requires INTERNAL_API_KEY and X-User-Id; member sessions and third-party agents are refused. Text is untrusted member data, never mutation authority. One repeatable-read snapshot per request; cursor pages can miss late commits and do not prove complete history. Evidence data is limited to 1 MiB; oversized requests fail without truncating source content.","parameters":[{"in":"header","name":"X-User-Id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryHistoryRequest"}}}},"responses":{"200":{"description":"Bounded authorized evidence and honest coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemoryHistoryResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request or cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Internal service credentials required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Evidence response exceeds 1 MiB; narrow the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/memory":{"get":{"operationId":"inspectMemberMemory","summary":"Inspect retained memory and controls","tags":["Member memory"],"security":[{"bearerAuth":[]}],"description":"Member session only. Internal credentials and third-party PAT/OAuth are refused, including reserved memory scopes. Saved memory is advisory. Pending erasure/journal/correction receipts are not completion. Full typed schemas are enforced before sending; transport records preserve exact source fields under the global response validator.","parameters":[{"in":"query","name":"sessionId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"maxClaims","schema":{"default":50,"type":"integer","minimum":1,"maximum":50}},{"in":"query","name":"maxEpisodes","schema":{"default":5,"type":"integer","minimum":1,"maximum":5}},{"in":"query","name":"maxSources","schema":{"default":200,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Actual bounded memory result; inspect status and coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/memory/controls":{"patch":{"operationId":"setMemberMemoryControls","summary":"Set journaled memory controls with generation CAS","tags":["Member memory"],"security":[{"bearerAuth":[]}],"description":"Member session only. Internal credentials and third-party PAT/OAuth are refused, including reserved memory scopes. Saved memory is advisory. Pending erasure/journal/correction receipts are not completion. Full typed schemas are enforced before sending; transport records preserve exact source fields under the global response validator.","parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedControlGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"collectionPaused":{"type":"boolean"},"useSavedMemory":{"type":"boolean"}},"required":["requestId","expectedControlGeneration"],"additionalProperties":false}}}},"responses":{"200":{"description":"Actual bounded memory result; inspect status and coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/memory/erasures":{"post":{"operationId":"eraseMemberSavedMemory","summary":"Request physical erasure of saved derivations","tags":["Member memory"],"security":[{"bearerAuth":[]}],"description":"Member session only. Internal credentials and third-party PAT/OAuth are refused, including reserved memory scopes. Saved memory is advisory. Pending erasure/journal/correction receipts are not completion. Full typed schemas are enforced before sending; transport records preserve exact source fields under the global response validator.","parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scope":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"all_memory"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"predicate"},"predicate":{"type":"string","enum":["task.priority","task.duration_minutes","communication.language","communication.style","schedule.preferred_window","schedule.unavailable_window","preference.statement","constraint.statement","decision.statement","commitment.statement"]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"session"},"sessionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"sources"},"sources":{"minItems":1,"maxItems":200,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"core_native"},"nativeType":{"type":"string","enum":["task_series","task_occurrence","habit_check_in","goal_check_in","flow","member_status"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","nativeType","id","version"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"field":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"kind":{"type":"string","const":"core_entity"},"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]}},"required":["id","version","kind","entityType"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"field":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"kind":{"type":"string","const":"core_event"},"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","version","kind","entityType","entityId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"field":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"kind":{"type":"string","const":"core_relationship"},"relationshipType":{"type":"string","enum":["goal_area","project_area","project_goal","task_area","task_goal","task_project","task_parent","habit_area","habit_goal","note_connection"]},"fromType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"fromId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"toId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","version","kind","relationshipType","fromType","fromId","toType","toId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"field":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"kind":{"type":"string","const":"chat_message"},"sessionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"leafId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","version","kind","sessionId","messageId","leafId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"field":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"kind":{"type":"string","const":"document_version"},"documentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"documentVersionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"page":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]}},"required":["id","version","kind","documentId","documentVersionId"],"additionalProperties":false}],"type":"object"}}},"required":["kind","sources"],"additionalProperties":false}],"type":"object"}},"required":["requestId","scope"],"additionalProperties":false}}}},"responses":{"200":{"description":"Actual bounded memory result; inspect status and coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/memory/erasures/{requestId}":{"get":{"operationId":"readMemberMemoryErasure","summary":"Read actual erasure progress","tags":["Member memory"],"security":[{"bearerAuth":[]}],"description":"Member session only. Internal credentials and third-party PAT/OAuth are refused, including reserved memory scopes. Saved memory is advisory. Pending erasure/journal/correction receipts are not completion. Full typed schemas are enforced before sending; transport records preserve exact source fields under the global response validator.","parameters":[{"in":"path","name":"requestId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Actual bounded memory result; inspect status and coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/memory/corrections":{"post":{"operationId":"correctMemberMemory","summary":"Record a visible Chat correction and commit its exact claim","tags":["Member memory"],"security":[{"bearerAuth":[]}],"description":"Member session only. Internal credentials and third-party PAT/OAuth are refused, including reserved memory scopes. Saved memory is advisory. Pending erasure/journal/correction receipts are not completion. Full typed schemas are enforced before sending; transport records preserve exact source fields under the global response validator.","parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sessionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"predicate":{"type":"string","enum":["task.priority","task.duration_minutes","communication.language","communication.style","schedule.preferred_window","schedule.unavailable_window","preference.statement","constraint.statement","decision.statement","commitment.statement"]},"scope":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"global"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"entity"},"entity":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["entityType","id"],"additionalProperties":false}},"required":["kind","entity"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"session"},"sessionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","sessionId"],"additionalProperties":false}],"type":"object"},"value":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"value":{"type":"string","minLength":1,"maxLength":2000}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"integer"},"value":{"type":"integer","minimum":-1000000000,"maximum":1000000000}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"time_window"},"startLocal":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"endLocal":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"timezone":{"type":"string","minLength":1,"maxLength":128},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}}},"required":["kind","startLocal","endLocal","timezone","weekdays"],"additionalProperties":false}],"type":"object"},"effectiveAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"supersedes":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["requestId","predicate","scope","value"],"additionalProperties":false}}}},"responses":{"200":{"description":"Actual bounded memory result; inspect status and coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/memory/sources/{bundleId}":{"get":{"operationId":"resolveMemberMemorySources","summary":"Reauthorize retained answer source details","tags":["Member memory"],"security":[{"bearerAuth":[]}],"description":"Member session only. Internal credentials and third-party PAT/OAuth are refused, including reserved memory scopes. Saved memory is advisory. Pending erasure/journal/correction receipts are not completion. Full typed schemas are enforced before sending; transport records preserve exact source fields under the global response validator.","parameters":[{"in":"query","name":"evidenceId","schema":{"type":"string","minLength":1,"maxLength":128}},{"in":"path","name":"bundleId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Actual bounded memory result; inspect status and coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/memory/export":{"get":{"operationId":"exportMemberMemory","summary":"Export all six memory lanes with truthful gaps","tags":["Member memory"],"security":[{"bearerAuth":[]}],"description":"Member session only. Internal credentials and third-party PAT/OAuth are refused, including reserved memory scopes. Saved memory is advisory. Pending erasure/journal/correction receipts are not completion. Full typed schemas are enforced before sending; transport records preserve exact source fields under the global response validator.","responses":{"200":{"description":"Actual bounded memory result; inspect status and coverage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Content-free validation, authorization, conflict or owner availability error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/graph":{"get":{"operationId":"getGraph","tags":["Graph"],"summary":"Get entity graph","description":"Returns the full entity hierarchy graph for the authenticated member, including all areas, goals, projects, tasks, subtasks, and habits as nodes with parent-child edges.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Entity graph retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/GraphResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/graph/context":{"get":{"operationId":"getGraphContext","tags":["Graph"],"summary":"Get graph context for LLM injection","description":"Returns graph context with a natural language summary, aggregate stats, and related entities. When entityId is provided, returns ancestor chain, siblings, and 2-hop neighborhood. Otherwise returns the full hierarchy summary.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"entityId","schema":{"description":"Entity ID to get context for","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Entity ID to get context for"},{"in":"query","name":"entityType","schema":{"description":"Type of the entity","type":"string","enum":["member","area","goal","project","task","habit"]},"description":"Type of the entity"}],"responses":{"200":{"description":"Graph context retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/GraphContextResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reconciliation/observed-effect":{"get":{"operationId":"getObservedEffect","tags":["Reconciliation"],"summary":"Check whether a recently-proposed mutation observably landed","description":"Voice v2 HITL rule 4 (contracts §7.2). Given a proposed mutation (entity type + operation, a create fingerprint or the target id, and the proposal time), reports whether its observable effect already exists in durable state. agent-service calls this when a spoken-confirmation proposal is stuck in the crash window (exec_state \"executing\") to reconcile before any retry, so an ambiguous drop never double-executes. Internal read: Bearer INTERNAL_API_KEY + X-User-Id (member-scoped).","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"entityType","schema":{"type":"string","enum":["task","goal","area","project","habit"],"description":"The mutated entity type (derived from the proposal tool name)."},"required":true,"description":"The mutated entity type (derived from the proposal tool name)."},{"in":"query","name":"operation","schema":{"type":"string","enum":["create","update","complete","delete"],"description":"The mutation verb (derived from the proposal tool name)."},"required":true,"description":"The mutation verb (derived from the proposal tool name)."},{"in":"query","name":"since","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"The proposal's proposedAt (offset-aware ISO-8601). A conservative lower bound on when the write would have landed; the query looks for the effect at/after this instant (minus a small clock-skew tolerance)."},"required":true,"description":"The proposal's proposedAt (offset-aware ISO-8601). A conservative lower bound on when the write would have landed; the query looks for the effect at/after this instant (minus a small clock-skew tolerance)."},{"in":"query","name":"entityId","schema":{"description":"The target entity id. REQUIRED for operation update/complete/delete; ignored for create.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"The target entity id. REQUIRED for operation update/complete/delete; ignored for create."},{"in":"query","name":"fingerprint","schema":{"description":"The created entity's title (task/goal) or name (area/project/habit). REQUIRED for operation=create; ignored otherwise.","type":"string","minLength":1,"maxLength":500},"description":"The created entity's title (task/goal) or name (area/project/habit). REQUIRED for operation=create; ignored otherwise."}],"responses":{"200":{"description":"Observed-effect verdict","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/ObservedEffectResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/capabilities":{"get":{"operationId":"getCapabilities","tags":["Capabilities"],"summary":"Get worker-backed capability state","description":"Report which worker-backed capabilities can actually be executed right now. A capability is `available` only when configuration declares it AND a live worker reports itself able to run it; every other case — no worker, an expired heartbeat, an unreadable health signal — resolves to `unavailable`, so a client can never be told an action will happen when nothing can execute it.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current capability state","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/CapabilityView"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/calendar":{"get":{"operationId":"getCalendarAgenda","tags":["Calendar"],"summary":"Get calendar agenda","description":"Returns a normalized member-scoped calendar agenda over existing tasks, recurring task occurrences, habits, reminders, and flows.","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Inclusive start date in YYYY-MM-DD format"},"required":true,"description":"Inclusive start date in YYYY-MM-DD format"},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Inclusive end date in YYYY-MM-DD format"},"required":true,"description":"Inclusive end date in YYYY-MM-DD format"},{"in":"query","name":"timezone","schema":{"description":"IANA timezone used to bucket timed items into local dates","type":"string","minLength":1,"maxLength":100},"description":"IANA timezone used to bucket timed items into local dates"},{"in":"query","name":"includeCompleted","schema":{"description":"Whether completed task and task-occurrence items are included","default":true,"type":"boolean"},"required":true,"description":"Whether completed task and task-occurrence items are included"},{"in":"query","name":"includeHabits","schema":{"description":"Whether scheduled habit occurrences are included","default":true,"type":"boolean"},"required":true,"description":"Whether scheduled habit occurrences are included"},{"in":"query","name":"includeReminders","schema":{"description":"Whether reminder items are included","default":true,"type":"boolean"},"required":true,"description":"Whether reminder items are included"},{"in":"query","name":"includeFlows","schema":{"description":"Whether logged flows are included","default":true,"type":"boolean"},"required":true,"description":"Whether logged flows are included"},{"in":"query","name":"includeExternalEvents","schema":{"description":"Whether synced external calendar events are included","default":true,"type":"boolean"},"required":true,"description":"Whether synced external calendar events are included"},{"in":"query","name":"includeSkipped","schema":{"description":"Whether skipped recurring-task occurrences are included","default":false,"type":"boolean"},"required":true,"description":"Whether skipped recurring-task occurrences are included"}],"responses":{"200":{"description":"Calendar agenda retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/CalendarAgendaResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid calendar query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/calendar/integrations":{"get":{"operationId":"getCalendarIntegrations","tags":["Calendar"],"summary":"Get calendar integrations","description":"Returns provider availability plus connected read-only Google and Outlook calendar accounts and sources.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Calendar integrations retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/CalendarIntegrationsResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/calendar/integrations/sources/{sourceId}":{"patch":{"operationId":"updateCalendarSource","tags":["Calendar"],"summary":"Update external calendar source visibility","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"sourceId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCalendarSourceRequest"}}}},"responses":{"200":{"description":"Calendar source updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/CalendarIntegrationsResponse"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Calendar source not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/members/me/push-tokens":{"post":{"operationId":"registerPushToken","tags":["Notifications"],"summary":"Register a push token","description":"Register (or refresh) an Expo push token for the authenticated member. Idempotent on (member, token): re-registering the same token refreshes its metadata and re-enables it.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Push token registration payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPushTokenRequest"}}}},"responses":{"201":{"description":"Push token registered","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/MemberPushToken"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"unregisterPushToken","tags":["Notifications"],"summary":"Unregister a push token","description":"Unregister an Expo push token for the authenticated member. Idempotent — returns success even if the token was not registered.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"description":"Push token to unregister","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePushTokenRequest"}}}},"responses":{"200":{"description":"Push token unregistered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid request data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/billing/subscription":{"get":{"operationId":"getBillingSubscription","tags":["Billing"],"summary":"Get the current member subscription","description":"Returns the member's SubscriptionView (plan, status, entitlements, resolved plan limits, enforcement mode, requiresSubscription, trial). Under 'preview' enforcement a member with no active entitlement gets the preview-default plan (isPreviewDefault: true); under 'launch' they get plan 'none' with requiresSubscription: true (the hard paywall).","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Subscription view","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/SubscriptionView"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/billing/reconcile":{"post":{"operationId":"reconcileBillingSubscription","tags":["Billing"],"summary":"Reconcile the member subscription from RevenueCat","description":"Force-fetches RevenueCat REST v2 for the current member, upserts the subscription row, and returns the SubscriptionView. When RevenueCat keys are unset this is a no-op that returns the current/preview view (200, never 5xx). Mobile calls this immediately after a purchase as a fast path.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Reconciled subscription view","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/SubscriptionView"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent/credentials/self":{"get":{"operationId":"introspectAgentPat","tags":["Agent Platform"],"summary":"Inspect the authenticated PAT authority","description":"PAT-only, read-only synthetic-monitoring surface. Returns no member or domain content. Credential, installation, grant, expiry, and effective scopes are resolved server-side; member JWTs and OAuth credentials are rejected.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current PAT authority","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"$ref":"#/components/schemas/PatSelfIntrospection"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"PAT lacks state:read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent/installations":{"get":{"operationId":"listAgentInstallations","tags":["Agent Platform"],"summary":"List the member’s agent installations","description":"Returns active installations with label, principal, resolved scopes, status, kind, last_used_at, and masked credential summaries.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Installations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createAgentInstallation","tags":["Agent Platform"],"summary":"Create a PAT agent installation","description":"Creates an installation (principal defaults to \"headless\") and its authorization grant (default scopes [state:read, capture:create, work:propose]). Does not issue a secret — use POST …/credentials.","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentInstallationRequest"}}}},"responses":{"201":{"description":"Installation created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent/installations/{id}":{"get":{"operationId":"getAgentInstallation","tags":["Agent Platform"],"summary":"Get an installation with grant + masked credentials","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Installation UUID"},"required":true,"description":"Installation UUID"}],"responses":{"200":{"description":"Installation detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateAgentInstallation","tags":["Agent Platform"],"summary":"Rename / adjust scopes + policy","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Installation UUID"},"required":true,"description":"Installation UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentInstallationRequest"}}}},"responses":{"200":{"description":"Installation updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"revokeAgentInstallation","tags":["Agent Platform"],"summary":"Revoke an installation (cascade credentials + grants, purge Redis)","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Installation UUID"},"required":true,"description":"Installation UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Installation revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent/installations/{id}/credentials":{"post":{"operationId":"issueAgentCredential","tags":["Agent Platform"],"summary":"Issue a PAT (secret shown once)","description":"Mints a `tjati_sk_…` secret, stores only its sha256 hash, mirrors it to Redis for the gateway, and returns the plaintext ONCE. Credential scopes must be a subset of the grant.","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Installation UUID"},"required":true,"description":"Installation UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueAgentCredentialRequest"}}}},"responses":{"201":{"description":"PAT issued (secret present once)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent/credentials/{id}/rotate":{"post":{"operationId":"rotateAgentCredential","tags":["Agent Platform"],"summary":"Rotate a PAT (issue new, revoke old, swap Redis)","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Credential UUID"},"required":true,"description":"Credential UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"201":{"description":"PAT rotated (new secret present once)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent/credentials/{id}":{"delete":{"operationId":"revokeAgentCredential","tags":["Agent Platform"],"summary":"Revoke a single PAT (purge Redis)","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Credential UUID"},"required":true,"description":"Credential UUID"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Credential revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/connections":{"get":{"operationId":"listIntegrationConnections","tags":["Integrations"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Provider accounts and capability grants","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["google","microsoft"]},"configured":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"string","enum":["calendar.read","mail.read","mail.compose","mail.send","mail.modify","calendar.write"]}}},"required":["provider","configured","capabilities"],"additionalProperties":false}},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["google","microsoft"]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["connecting","active","needs_reauth","error","disconnected"]},"lastSyncAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"lastErrorCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastErrorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"dataPurgedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"capabilities":{"type":"array","items":{"type":"object","properties":{"capability":{"type":"string","enum":["calendar.read","mail.read","mail.compose","mail.send","mail.modify","calendar.write"]},"status":{"type":"string","enum":["pending","granted","revoked"]},"scopes":{"type":"array","items":{"type":"string"}}},"required":["capability","status","scopes"],"additionalProperties":false}}},"required":["id","provider","email","displayName","status","lastSyncAt","lastErrorCode","lastErrorMessage","dataPurgedAt","capabilities"],"additionalProperties":false}}},"required":["providers","connections"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/oauth/{provider}/connect":{"post":{"operationId":"connectIntegrationProvider","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"provider","schema":{"type":"string","enum":["google","microsoft"]},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"capabilities":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["calendar.read","mail.read","mail.compose","mail.send","mail.modify","calendar.write"]}},"redirectUri":{"type":"string","minLength":1,"maxLength":500}},"required":["capabilities","redirectUri"],"additionalProperties":false}}}},"responses":{"200":{"description":"System-browser OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["authorizationUrl","expiresAt"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/oauth/{provider}/callback":{"get":{"operationId":"integrationOAuthCallback","tags":["Integrations"],"security":[],"parameters":[{"in":"path","name":"provider","schema":{"type":"string","enum":["google","microsoft"]},"required":true},{"in":"query","name":"code","schema":{"type":"string","minLength":1,"maxLength":4096}},{"in":"query","name":"state","schema":{"type":"string","minLength":20,"maxLength":1024},"required":true},{"in":"query","name":"error","schema":{"type":"string","maxLength":200}},{"in":"query","name":"error_description","schema":{"type":"string","maxLength":1000}}],"responses":{"302":{"description":"Redirects to the exact allowlisted app return URI"}}}},"/api/v1/integrations/connections/{connectionId}/sync":{"post":{"operationId":"syncIntegrationConnection","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"connectionId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Synchronization queued","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"queued":{"type":"boolean","const":true}},"required":["queued"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/connections/{connectionId}":{"delete":{"operationId":"disconnectIntegrationConnection","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"connectionId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purge":{"default":true,"type":"boolean"},"revokeProvider":{"default":true,"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Connection disconnected","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"disconnected":{"type":"boolean","const":true},"dataPurged":{"type":"boolean"},"providerRevocation":{"type":"string","enum":["not_requested","revoked","failed","manual_required"]},"subscriptionCleanup":{"type":"object","properties":{"status":{"type":"string","enum":["not_attempted","completed","partial","failed"]},"attempted":{"type":"integer","minimum":0,"maximum":9007199254740991},"succeeded":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["status","attempted","succeeded"],"additionalProperties":false}},"required":["id","disconnected","dataPurged","providerRevocation","subscriptionCleanup"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/connections/{connectionId}/drafts":{"post":{"operationId":"createIntegrationMailDraft","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"connectionId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotencyKey":{"type":"string","minLength":16,"maxLength":200},"from":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"to":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string","minLength":1,"maxLength":998},"bodyText":{"type":"string","minLength":1,"maxLength":100000},"replyToMessageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["idempotencyKey","to","subject","bodyText"],"additionalProperties":false}}}},"responses":{"201":{"description":"Provider-visible draft created; no send operation exists","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"providerDraftId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"}},"required":["id","providerDraftId","status"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/mail/actionable":{"get":{"operationId":"listActionableMailSignals","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":30,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Active mail-derived signals; empty when no mail account is connected","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["google","microsoft"]},"messageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"threadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string","enum":["reply_needed","commitment","deadline","meeting","preparation","follow_up"]},"title":{"type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"confidence":{"type":"number","minimum":0,"maximum":1},"dueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"dueLocalDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"sourceUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"detectedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","connectionId","provider","messageId","threadId","externalId","kind","title","summary","confidence","dueAt","dueLocalDate","sourceUrl","detectedAt"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/connections/{connectionId}/drafts/{draftId}":{"put":{"operationId":"updateIntegrationMailDraft","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"connectionId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"path","name":"draftId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"to":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string","minLength":1,"maxLength":998},"bodyText":{"type":"string","minLength":1,"maxLength":100000}},"required":["to","subject","bodyText"],"additionalProperties":false}}}},"responses":{"200":{"description":"Provider-visible draft updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"providerDraftId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"}},"required":["id","providerDraftId","status"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/mail/actionable/{signalId}/dismiss":{"post":{"operationId":"dismissActionableMailSignal","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"signalId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Signal dismissed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","const":"dismissed"}},"required":["id","status"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/mail/search":{"get":{"operationId":"searchIntegrationMail","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":2,"maxLength":200},"required":true},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":50}},{"in":"query","name":"connectionId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Bounded normalized metadata search; message bodies are never returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string"},"threadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["google","microsoft"]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"sender":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"}},"required":["name","address"],"additionalProperties":false},{"type":"null"}]},"preview":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"isRead":{"type":"boolean"},"hasAttachments":{"type":"boolean"},"sourceUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]}},"required":["id","externalId","threadId","connectionId","provider","subject","sender","preview","receivedAt","isRead","hasAttachments","sourceUrl"],"additionalProperties":false}},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/mail/threads/{threadId}":{"get":{"operationId":"getIntegrationMailThread","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"threadId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Normalized thread metadata and bounded previews; no body or attachments","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["google","microsoft"]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"latestPreview":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"sender":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"}},"required":["name","address"],"additionalProperties":false},{"type":"null"}]},"recipientsTo":{"type":"array","items":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"}},"required":["name","address"],"additionalProperties":false}},"recipientsCc":{"type":"array","items":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"}},"required":["name","address"],"additionalProperties":false}},"preview":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"isRead":{"type":"boolean"},"hasAttachments":{"type":"boolean"},"sourceUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]}},"required":["id","externalId","subject","sender","recipientsTo","recipientsCc","preview","receivedAt","sentAt","isRead","hasAttachments","sourceUrl"],"additionalProperties":false}}},"required":["id","connectionId","provider","subject","latestPreview","sourceUrl","messages"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/mail/messages/{messageId}":{"get":{"operationId":"getIntegrationMailMessage","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"messageId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Member-scoped normalized message body and metadata; attachments are never returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string"},"threadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["google","microsoft"]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"sender":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"}},"required":["name","address"],"additionalProperties":false},{"type":"null"}]},"recipientsTo":{"type":"array","items":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"}},"required":["name","address"],"additionalProperties":false}},"recipientsCc":{"type":"array","items":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"}},"required":["name","address"],"additionalProperties":false}},"receivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"hasAttachments":{"type":"boolean"},"sourceUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"bodyText":{"type":"string","maxLength":50000},"truncated":{"type":"boolean"}},"required":["id","externalId","threadId","connectionId","provider","subject","sender","recipientsTo","recipientsCc","receivedAt","sentAt","hasAttachments","sourceUrl","bodyText","truncated"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/calendar/events/{eventId}":{"get":{"operationId":"getIntegrationCalendarEvent","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"eventId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Member-scoped external event detail with normalized provenance","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["google","microsoft"]},"providerEventId":{"type":"string"},"externalId":{"type":"string"},"iCalUid":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"anyOf":[{"type":"string"},{"type":"null"}]},"startAtUtc":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"endAtUtc":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"allDay":{"type":"boolean"},"localStartDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"localEndDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"visibility":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"sourceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceName":{"type":"string"},"sourceColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"provenance":{"type":"string","const":"external_calendar"},"readOnly":{"type":"boolean","const":true}},"required":["id","connectionId","provider","providerEventId","externalId","iCalUid","title","description","location","startAtUtc","endAtUtc","allDay","localStartDate","localEndDate","timezone","status","visibility","sourceUrl","sourceId","sourceName","sourceColor","provenance","readOnly"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/calendar/availability":{"get":{"operationId":"getIntegrationCalendarAvailability","tags":["Integrations"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"startAt","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true},{"in":"query","name":"endAt","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true},{"in":"query","name":"durationMinutes","schema":{"default":30,"type":"integer","minimum":15,"maximum":480}},{"in":"query","name":"timezone","schema":{"type":"string","minLength":1,"maxLength":100},"required":true}],"responses":{"200":{"description":"Bounded canonical busy intervals, overlap conflicts, and free windows","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"endAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"durationMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"timezone":{"type":"string"},"busy":{"type":"array","items":{"type":"object","properties":{"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"endAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"itemIds":{"type":"array","items":{"type":"string"}}},"required":["startAt","endAt","itemIds"],"additionalProperties":false}},"conflicts":{"type":"array","items":{"type":"object","properties":{"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"endAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"itemIds":{"type":"array","items":{"type":"string"}}},"required":["startAt","endAt","itemIds"],"additionalProperties":false}},"free":{"type":"array","items":{"type":"object","properties":{"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"endAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"itemIds":{"type":"array","items":{"type":"string"}}},"required":["startAt","endAt","itemIds"],"additionalProperties":false}}},"required":["startAt","endAt","durationMinutes","timezone","busy","conflicts","free"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Member not provisioned yet (valid token, no member row — async webhook provisioning). Error code MEMBER_NOT_PROVISIONED; clients retry, they do NOT sign out.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Integration unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/notes/{id}":{"get":{"operationId":"workflowNoteGet","tags":["Workflows"],"summary":"Fetch the complete current note and exact version, with original session capture separately","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/resume-project":{"get":{"operationId":"workflowResumeProject","tags":["Workflows"],"summary":"Get bounded project or repository resume context","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"projectId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"repository","schema":{"type":"string","minLength":1,"maxLength":1000}},{"in":"query","name":"limit","schema":{"default":10,"type":"integer","minimum":1,"maximum":20}}],"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/session-checkpoint":{"post":{"operationId":"workflowSessionCheckpoint","tags":["Workflows"],"summary":"Save an immutable session checkpoint as an editable note","security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":8,"maxLength":255,"description":"Required for every checkpoint save; reuse unchanged when retrying."},"required":true,"description":"Required for every checkpoint save; reuse unchanged when retrying."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sourceClient":{"type":"string","enum":["codex","claude-code","chatgpt","claude","other"]},"externalSessionId":{"type":"string","minLength":1,"maxLength":255},"checkpointId":{"type":"string","minLength":1,"maxLength":255},"repository":{"type":"string","minLength":1,"maxLength":1000},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"summary":{"type":"string","minLength":1,"maxLength":20000},"decisions":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"completed":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"remaining":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"blockers":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"sourceLinks":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":2000,"format":"uri"}}},"required":["sourceClient","externalSessionId","checkpointId","summary"],"additionalProperties":false}}}},"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/capabilities":{"get":{"operationId":"workflowCapabilities","tags":["Workflows"],"summary":"Get stable server and effective actor capabilities","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Capabilities for the authenticated actor","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"capabilities":{"type":"object","properties":{"workflows":{"type":"array","items":{"type":"string"}},"bulk":{"type":"array","items":{"type":"string"}},"durableMutations":{"type":"array","items":{"type":"string"}},"pagination":{"type":"object","properties":{"keyset":{"type":"array","items":{"type":"string"}},"legacyOffset":{"type":"boolean"}},"required":["keyset","legacyOffset"],"additionalProperties":false},"idempotency":{"type":"object","properties":{"agentMutationsRequired":{"type":"boolean"},"memberKeysSupported":{"type":"boolean"}},"required":["agentMutationsRequired","memberKeysSupported"],"additionalProperties":false},"dryRun":{"type":"array","items":{"type":"string"}}},"required":["workflows","bulk","durableMutations","pagination","idempotency","dryRun"],"additionalProperties":false},"actor":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"scopes":{"type":"array","items":{"type":"string"}},"effectiveDbScopes":{"type":"array","items":{"type":"string"}},"unlockedEntityTypes":{"type":"array","items":{"type":"string","enum":["area","goal","project","task","habit","note"]}}},"required":["schemaVersion","capabilities","actor","scopes","effectiveDbScopes","unlockedEntityTypes"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/capture":{"post":{"operationId":"workflowCapture","tags":["Workflows"],"summary":"Capture text into an explicit workflow entity","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for agent actors when capture commits product state; optional for member actors.","type":"string","minLength":8,"maxLength":255},"description":"Required for agent actors when capture commits product state; optional for member actors."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCaptureRestInput"}}}},"responses":{"200":{"description":"Validated dry-run preview","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/today":{"get":{"operationId":"workflowToday","tags":["Workflows"],"summary":"Get today workflow view","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/agenda":{"get":{"operationId":"workflowAgenda","tags":["Workflows"],"summary":"Get deterministic agenda","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"days","schema":{"default":7,"type":"integer","minimum":1,"maximum":30}}],"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/search-state":{"post":{"operationId":"workflowSearchState","tags":["Workflows"],"summary":"Search member state through hybrid RAG","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000},"limit":{"default":10,"type":"integer","minimum":1,"maximum":50},"rerank":{"default":true,"type":"boolean"},"entityTypes":{"type":"array","items":{"type":"string","enum":["area","goal","project","task","habit","reminder","note","flow"]}},"cursor":{"type":"string","minLength":1}},"required":["query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/open-loops":{"get":{"operationId":"workflowOpenLoops","tags":["Workflows"],"summary":"Review open loops and waiting-for items","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/plan-goal":{"post":{"operationId":"workflowPlanGoal","tags":["Workflows"],"summary":"Build a proposal-first goal plan","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"goalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"maxSteps":{"default":8,"type":"integer","minimum":1,"maximum":20}},"required":["goalId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/propose":{"post":{"operationId":"workflowProposeChanges","tags":["Workflows"],"summary":"Persist an ephemeral proposed change set","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for agent actors; optional for member actors, where it still enables safe replay.","type":"string","minLength":8,"maxLength":255},"description":"Required for agent actors; optional for member actors, where it still enables safe replay."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string","minLength":1,"maxLength":500},"changes":{"minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"operation":{"type":"string","const":"task.create"},"payload":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}]},"due":{"anyOf":[{"$ref":"#/components/schemas/DateInput"},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10080},{"type":"null"}]},"tags":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":100}}},"required":["title"],"additionalProperties":false}},"required":["operation","payload"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"task.update"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedRevision":{"type":"string","minLength":1,"maxLength":128},"payload":{"type":"object","properties":{"correction":{"description":"Explicit member correction context linking this edit to the original durable operation.","type":"object","properties":{"originalOperationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mutationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:/+-]+$"}},"required":["originalOperationId","mutationId","reason"],"additionalProperties":false},"title":{"description":"Task title","type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Task description"},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the parent task for subtasks"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated project"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated goal"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}],"description":"Priority level"},"sortRank":{"description":"Sort rank for ordering among siblings","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"due":{"anyOf":[{"$ref":"#/components/schemas/DateInput"},{"type":"null"}],"description":"Due date with timezone and granularity support"},"durationMinutes":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10080},{"type":"null"}],"description":"Planned duration in minutes (1..10080 = up to 7 days); explicit null clears it, omitted leaves it untouched"},"tags":{"description":"Task tags","type":"array","items":{"type":"string"}},"isCompleted":{"description":"Task completion status","type":"boolean"}},"additionalProperties":false}},"required":["operation","targetId","expectedRevision","payload"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"task.complete"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["operation","targetId"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"note.create"},"payload":{"$ref":"#/components/schemas/CreateNoteRequest"},"checkpoint":{"type":"object","properties":{"sourceClient":{"type":"string","enum":["codex","claude-code","chatgpt","claude","other"]},"externalSessionId":{"type":"string","minLength":1,"maxLength":255},"checkpointId":{"type":"string","minLength":1,"maxLength":255},"repository":{"type":"string","minLength":1,"maxLength":1000},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"summary":{"type":"string","minLength":1,"maxLength":20000},"decisions":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"completed":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"remaining":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"blockers":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"sourceLinks":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":2000,"format":"uri"}}},"required":["sourceClient","externalSessionId","checkpointId","summary"],"additionalProperties":false}},"required":["operation","payload"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"note.update"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedVersion":{"type":"string","minLength":1,"maxLength":100},"payload":{"$ref":"#/components/schemas/UpdateNoteRequest"}},"required":["operation","targetId","expectedVersion","payload"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"note.append"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedVersion":{"type":"string","minLength":1,"maxLength":100},"payload":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":100000}},"required":["content"],"additionalProperties":false}},"required":["operation","targetId","expectedVersion","payload"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"note.link"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedVersion":{"type":"string","minLength":1,"maxLength":100},"payload":{"$ref":"#/components/schemas/NoteConnectionInput"}},"required":["operation","targetId","expectedVersion","payload"],"additionalProperties":false}],"type":"object"}},"ttlSeconds":{"default":900,"type":"integer","minimum":60,"maximum":3600}},"required":["summary","changes"],"additionalProperties":false}}}},"responses":{"200":{"description":"Validated dry-run preview","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/apply":{"post":{"operationId":"workflowApplyChanges","tags":["Workflows"],"summary":"Apply a reviewed change set","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"dryRun","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"X-Dry-Run","schema":{"description":"Validate and preview without writing","type":"string","enum":["true","false"]},"description":"Validate and preview without writing"},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for agent actors; optional for member actors, where it still enables safe replay.","type":"string","minLength":8,"maxLength":255},"description":"Required for agent actors; optional for member actors, where it still enables safe replay."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["proposalId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Validated dry-run preview","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"dryRun":{"type":"boolean","const":true},"committed":{"type":"boolean","const":false},"operation":{"type":"string"},"preview":{}},"required":["dryRun","committed","operation","preview"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}]}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/context":{"get":{"operationId":"workflowContext","tags":["Workflows"],"summary":"Get deterministic graph context","security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"variant","schema":{"default":"standard","type":"string","enum":["standard","morning","weekly_review"]}},{"in":"query","name":"weekStart","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"in":"query","name":"entityId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"entityType","schema":{"type":"string","enum":["area","goal","project","task","habit"]}}],"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/workflows/methodology/{view}":{"get":{"operationId":"workflowMethodologyView","tags":["Workflows"],"summary":"Get a methodology-specific task view","security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"view","schema":{"type":"string","enum":["today","overdue","next","upcoming"]},"required":true},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"days","schema":{"default":7,"type":"integer","minimum":1,"maximum":30}}],"responses":{"200":{"description":"Workflow result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"1.0"},"data":{},"requestId":{"type":"string"},"identity":{"type":"object","properties":{"actorType":{"type":"string","enum":["member","agent"]},"memberId":{"type":"string"},"principalId":{"type":"string"},"installationId":{"type":"string"},"credentialKind":{"type":"string","enum":["oauth","pat"]}},"required":["actorType","memberId"],"additionalProperties":false},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"freshness":{"type":"object","properties":{"status":{"type":"string","enum":["live","cached","stale"]},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["status","asOf"],"additionalProperties":false},"objectVersions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"version":{"type":"string"}},"required":["id","version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"recoverable":{"type":"boolean"},"nextAction":{"type":"string"},"details":{}},"required":["code","message","recoverable"],"additionalProperties":false}},"required":["schemaVersion","requestId","identity","observedAt","freshness","objectVersions"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid workflow request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workflow target or proposal not found or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency or proposal conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Workflow business rule or idempotency violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Required workflow storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/approvals":{"get":{"operationId":"listApprovals","tags":["Approvals"],"parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["pending","approved","denied","expired","canceled"]}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","approved","denied","expired","canceled"]},"reason":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"changeSet":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["proposed","pending_approval","approved","applying","applied","denied","failed","conflicted","expired","canceled"]},"summary":{"type":"string"},"impactSummary":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["member","agent","system"]},"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","installationId","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"appliedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","status","summary","impactSummary","actor","createdAt","appliedAt"],"additionalProperties":false},"operations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ordinal":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["proposed","applied","failed","skipped"]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"impactSummary":{"anyOf":[{"type":"string"},{"type":"null"}]},"before":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"after":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","ordinal","action","entityType","entityId","status","summary","impactSummary","before","after"],"additionalProperties":false}},"decision":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["approved","denied","expired","canceled"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["decision","reason","decidedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","reason","createdAt","expiresAt","resolvedAt","changeSet","operations","decision"],"additionalProperties":false}},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","hasMore","nextCursor"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/approvals/{id}":{"get":{"operationId":"getApproval","tags":["Approvals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","approved","denied","expired","canceled"]},"reason":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"changeSet":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["proposed","pending_approval","approved","applying","applied","denied","failed","conflicted","expired","canceled"]},"summary":{"type":"string"},"impactSummary":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["member","agent","system"]},"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","installationId","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"appliedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","status","summary","impactSummary","actor","createdAt","appliedAt"],"additionalProperties":false},"operations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ordinal":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["proposed","applied","failed","skipped"]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"impactSummary":{"anyOf":[{"type":"string"},{"type":"null"}]},"before":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"after":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","ordinal","action","entityType","entityId","status","summary","impactSummary","before","after"],"additionalProperties":false}},"decision":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["approved","denied","expired","canceled"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["decision","reason","decidedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","reason","createdAt","expiresAt","resolvedAt","changeSet","operations","decision"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/approvals/{id}/approve":{"post":{"operationId":"approveChangeSet","tags":["Approvals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"decisionId":{"description":"Client-stable decision mutation UUID. Required for exact retry guarantees; omitted only for legacy callers.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","maxLength":1000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["denied","approved"]},"approvalRequestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"replayed":{"type":"boolean"}},"required":["status","approvalRequestId","replayed"],"additionalProperties":false},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Applied or conflicted atomic change-set result"}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/approvals/{id}/deny":{"post":{"operationId":"denyChangeSet","tags":["Approvals"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"decisionId":{"description":"Client-stable decision mutation UUID. Required for exact retry guarantees; omitted only for legacy callers.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","maxLength":1000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["denied","approved"]},"approvalRequestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"replayed":{"type":"boolean"}},"required":["status","approvalRequestId","replayed"],"additionalProperties":false},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Applied or conflicted atomic change-set result"}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/audit":{"get":{"operationId":"listAuditEvents","tags":["Audit"],"description":"For SF-05, before/after state, correctionTarget, canUndo, reversibleUntil, and compensation fields are authoritative only on the exact canonical receipt-linked audit event; lookalike events are redacted.","parameters":[{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"action","schema":{"type":"string","minLength":1,"maxLength":100}},{"in":"query","name":"installationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventType":{"type":"string"},"action":{"type":"string"},"outcome":{"type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"entityType":{"anyOf":[{"type":"string"},{"type":"null"}]},"entityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["member","agent","system"]},"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","installationId","label"],"additionalProperties":false},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"changeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"canUndo":{"type":"boolean","description":"True for SF-05 only on the exact canonical receipt-linked audit event; lookalike events are redacted and cannot authorize undo."},"compensatedByChangeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"compensationStatus":{"anyOf":[{"type":"string","enum":["proposed","pending_approval","approved","applying","applied","denied","failed","conflicted","expired","canceled"]},{"type":"null"}]},"correctionTarget":{"anyOf":[{"type":"object","properties":{"originalOperationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["originalOperationId","taskId"],"additionalProperties":false},{"type":"null"}]},"before":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Authoritative pre-mutation state, or null for a non-receipt-linked SF-05 lookalike."},"after":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Authoritative post-mutation state, or null for a non-receipt-linked SF-05 lookalike."}},"required":["id","eventType","action","outcome","summary","entityType","entityId","actor","occurredAt","changeSetId","reversibleUntil","canUndo","compensatedByChangeSetId","compensationStatus","correctionTarget","before","after"],"additionalProperties":false,"description":"SF-05 authority fields and before/after state are exposed only on the exact canonical receipt-linked audit event; lookalike events are redacted."}},"hasMore":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","hasMore","nextCursor"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/audit/{id}":{"get":{"operationId":"getAuditEvent","tags":["Audit"],"description":"For SF-05, before/after state, correctionTarget, canUndo, reversibleUntil, and compensation fields are authoritative only on the exact canonical receipt-linked audit event; lookalike events are redacted.","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventType":{"type":"string"},"action":{"type":"string"},"outcome":{"type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"entityType":{"anyOf":[{"type":"string"},{"type":"null"}]},"entityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["member","agent","system"]},"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","installationId","label"],"additionalProperties":false},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"changeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"canUndo":{"type":"boolean","description":"True for SF-05 only on the exact canonical receipt-linked audit event; lookalike events are redacted and cannot authorize undo."},"compensatedByChangeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"compensationStatus":{"anyOf":[{"type":"string","enum":["proposed","pending_approval","approved","applying","applied","denied","failed","conflicted","expired","canceled"]},{"type":"null"}]},"correctionTarget":{"anyOf":[{"type":"object","properties":{"originalOperationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["originalOperationId","taskId"],"additionalProperties":false},{"type":"null"}]},"before":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Authoritative pre-mutation state, or null for a non-receipt-linked SF-05 lookalike."},"after":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Authoritative post-mutation state, or null for a non-receipt-linked SF-05 lookalike."}},"required":["id","eventType","action","outcome","summary","entityType","entityId","actor","occurredAt","changeSetId","reversibleUntil","canUndo","compensatedByChangeSetId","compensationStatus","correctionTarget","before","after"],"additionalProperties":false,"description":"SF-05 authority fields and before/after state are exposed only on the exact canonical receipt-linked audit event; lookalike events are redacted."},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/audit/{id}/undo":{"post":{"operationId":"undoAuditEvent","tags":["Audit"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":8,"maxLength":255,"description":"Required for member and agent undo requests. Same-key retries replay the original compensating change."},"required":true,"description":"Required for member and agent undo requests. Same-key retries replay the original compensating change."}],"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"status":{"type":"string"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"compensatesChangeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"replayed":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["status","changeSetId","compensatesChangeSetId"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/operations/{operationId}":{"get":{"operationId":"getTaskOperation","tags":["Operations"],"summary":"Reconnect to a durable task operation","parameters":[{"in":"path","name":"operationId","schema":{"description":"Stable operation ID carried in Idempotency-Key. Reuse it for retries, reconnects, and handoffs.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true,"description":"Stable operation ID carried in Idempotency-Key. Reuse it for retries, reconnects, and handoffs."}],"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endpoint":{"type":"string","enum":["task.create","task.update"]},"state":{"type":"string","enum":["received","executing","committed","verifying","verified","recovery_required","definitely_absent","inconclusive","quarantined","compensated","failed","expired","cancelled"]},"replayed":{"type":"boolean"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"compensatedByChangeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"receiptArtifactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalRequestId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalDecisionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"traceId":{"type":"string","minLength":1,"maxLength":256},"effects":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"receipt":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"classification":{"anyOf":[{"type":"string"},{"type":"null"}]},"code":{"type":"string"}},"required":["classification","code"],"additionalProperties":false},{"type":"null"}]},"correlation":{"type":"object","properties":{"agentRunId":{"anyOf":[{"type":"string"},{"type":"null"}]},"chatSessionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chatMessageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["agentRunId","chatSessionId","chatMessageId"],"additionalProperties":false},"timeline":{"type":"object","properties":{"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"executingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"committedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifyingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"expiredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"quarantinedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["receivedAt","executingAt","committedAt","verifyingAt","verifiedAt","expiredAt","cancelledAt","quarantinedAt"],"additionalProperties":false},"operations":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"resultRevision":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["action","entityType","entityId","resultRevision"],"additionalProperties":false}}},"required":["operationId","endpoint","state","changeSetId","compensatedByChangeSetId","receiptArtifactId","approvalRequestId","approvalDecisionId","traceId","effects","receipt","error","correlation","timeline","operations"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/operations/{operationId}/cancel":{"post":{"operationId":"cancelTaskOperation","tags":["Operations"],"summary":"Cancel an operation that has not started executing","parameters":[{"in":"path","name":"operationId","schema":{"description":"Stable operation ID carried in Idempotency-Key. Reuse it for retries, reconnects, and handoffs.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true,"description":"Stable operation ID carried in Idempotency-Key. Reuse it for retries, reconnects, and handoffs."},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endpoint":{"type":"string","enum":["task.create","task.update"]},"state":{"type":"string","enum":["received","executing","committed","verifying","verified","recovery_required","definitely_absent","inconclusive","quarantined","compensated","failed","expired","cancelled"]},"replayed":{"type":"boolean"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"compensatedByChangeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"receiptArtifactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalRequestId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalDecisionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"traceId":{"type":"string","minLength":1,"maxLength":256},"effects":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"receipt":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"classification":{"anyOf":[{"type":"string"},{"type":"null"}]},"code":{"type":"string"}},"required":["classification","code"],"additionalProperties":false},{"type":"null"}]},"correlation":{"type":"object","properties":{"agentRunId":{"anyOf":[{"type":"string"},{"type":"null"}]},"chatSessionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chatMessageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["agentRunId","chatSessionId","chatMessageId"],"additionalProperties":false},"timeline":{"type":"object","properties":{"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"executingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"committedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifyingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"expiredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"quarantinedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["receivedAt","executingAt","committedAt","verifyingAt","verifiedAt","expiredAt","cancelledAt","quarantinedAt"],"additionalProperties":false},"operations":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"resultRevision":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["action","entityType","entityId","resultRevision"],"additionalProperties":false}}},"required":["operationId","endpoint","state","changeSetId","compensatedByChangeSetId","receiptArtifactId","approvalRequestId","approvalDecisionId","traceId","effects","receipt","error","correlation","timeline","operations"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/operations/{operationId}/reconcile":{"post":{"operationId":"reconcileTaskOperation","tags":["Operations"],"summary":"Internally reconcile an ambiguous durable task operation","description":"Internal service call only: Bearer INTERNAL_API_KEY plus X-User-Id. Core owns classification and any retry authorization.","parameters":[{"in":"path","name":"operationId","schema":{"description":"Stable operation ID carried in Idempotency-Key. Reuse it for retries, reconnects, and handoffs.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true,"description":"Stable operation ID carried in Idempotency-Key. Reuse it for retries, reconnects, and handoffs."},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Trust record returned","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"operation":{"anyOf":[{"type":"object","properties":{"operationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endpoint":{"type":"string","enum":["task.create","task.update"]},"state":{"type":"string","enum":["received","executing","committed","verifying","verified","recovery_required","definitely_absent","inconclusive","quarantined","compensated","failed","expired","cancelled"]},"replayed":{"type":"boolean"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"compensatedByChangeSetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"receiptArtifactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalRequestId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"approvalDecisionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"traceId":{"type":"string","minLength":1,"maxLength":256},"effects":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"receipt":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","properties":{"classification":{"anyOf":[{"type":"string"},{"type":"null"}]},"code":{"type":"string"}},"required":["classification","code"],"additionalProperties":false},{"type":"null"}]},"correlation":{"type":"object","properties":{"agentRunId":{"anyOf":[{"type":"string"},{"type":"null"}]},"chatSessionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chatMessageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["agentRunId","chatSessionId","chatMessageId"],"additionalProperties":false},"timeline":{"type":"object","properties":{"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"executingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"committedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifyingAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"expiredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"quarantinedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["receivedAt","executingAt","committedAt","verifyingAt","verifiedAt","expiredAt","cancelledAt","quarantinedAt"],"additionalProperties":false},"operations":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"entityType":{"type":"string"},"entityId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"resultRevision":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["action","entityType","entityId","resultRevision"],"additionalProperties":false}}},"required":["operationId","endpoint","state","changeSetId","compensatedByChangeSetId","receiptArtifactId","approvalRequestId","approvalDecisionId","traceId","effects","receipt","error","correlation","timeline","operations"],"additionalProperties":false},{"type":"null"}]},"recovery":{"type":"object","properties":{"classification":{"type":"string","enum":["committed","definitely_absent","inconclusive","quarantined","terminal"]},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"advisoryObserved":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"advisoryUnavailable":{"type":"boolean"}},"required":["classification","attempts","advisoryObserved","advisoryUnavailable"],"additionalProperties":false}},"required":["operation","recovery"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhook-subscriptions":{"get":{"operationId":"listWebhookSubscriptions","tags":["Always-on"],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createWebhookSubscription","description":"Members may omit signingSecret to receive a show-once generated secret. Credentialed agents must supply a caller-possessed signingSecret and an Idempotency-Key; the durable result is applied immediately or returned as a pending approval ChangeSet.","tags":["Always-on"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"endpointUrl":{"type":"string","maxLength":2048,"format":"uri"},"eventFilters":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"critical":{"default":false,"type":"boolean"},"silenceThresholdSeconds":{"type":"integer","minimum":60,"maximum":2592000},"signingSecret":{"description":"Caller-possessed canonical unpadded base64url secret encoding exactly 32 random bytes. It is encrypted immediately, never echoed, and never stored in plaintext.","writeOnly":true,"type":"string"}},"required":["name","endpointUrl","eventFilters"],"additionalProperties":false}}}},"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","headers":{"Cache-Control":{"description":"Prevents caching of one-time secret material","schema":{"type":"string","const":"no-store, max-age=0"}},"Pragma":{"description":"Legacy cache prevention for one-time secret material","schema":{"type":"string","const":"no-cache"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"endpointUrl":{"type":"string","format":"uri"},"eventFilters":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"signingKeyId":{"type":"string"},"secretHint":{"type":"string"},"configVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"secret":{"description":"Show-once server-generated secret for member callers","readOnly":true,"type":"string"}},"required":["id","installationId","name","endpointUrl","eventFilters","enabled","signingKeyId","secretHint","configVersion"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhook-subscriptions/generate-secret":{"get":{"operationId":"generateWebhookSubscriptionSecret","summary":"Generate caller-possessed webhook signing material","description":"Read-only, stateless helper. The returned secret is not persisted and must be retained by the caller before a durable create or rotation is proposed.","tags":["Always-on"],"responses":{"200":{"description":"Fresh caller-possessed webhook signing secret. The response is never cached.","headers":{"Cache-Control":{"description":"Prevents caching of one-time secret material","schema":{"type":"string","const":"no-store, max-age=0"}},"Pragma":{"description":"Legacy cache prevention for one-time secret material","schema":{"type":"string","const":"no-cache"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"type":"object","properties":{"secret":{"type":"string","description":"Show-once canonical 32-byte base64url signing secret","readOnly":true},"encoding":{"type":"string","const":"base64url"},"bytes":{"type":"number","const":32}},"required":["secret","encoding","bytes"],"additionalProperties":false},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhook-subscriptions/{id}":{"get":{"operationId":"getWebhookSubscription","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateWebhookSubscription","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"endpointUrl":{"type":"string","maxLength":2048,"format":"uri"},"eventFilters":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}},"critical":{"type":"boolean"},"silenceThresholdSeconds":{"anyOf":[{"type":"integer","minimum":60,"maximum":2592000},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"endpointUrl":{"type":"string","format":"uri"},"eventFilters":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"signingKeyId":{"type":"string"},"secretHint":{"type":"string"},"configVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"secret":{"description":"Show-once server-generated secret for member callers","readOnly":true,"type":"string"}},"required":["id","installationId","name","endpointUrl","eventFilters","enabled","signingKeyId","secretHint","configVersion"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"disableWebhookSubscription","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"endpointUrl":{"type":"string","format":"uri"},"eventFilters":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"signingKeyId":{"type":"string"},"secretHint":{"type":"string"},"configVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"secret":{"description":"Show-once server-generated secret for member callers","readOnly":true,"type":"string"}},"required":["id","installationId","name","endpointUrl","eventFilters","enabled","signingKeyId","secretHint","configVersion"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhook-subscriptions/{id}/rotate-secret":{"post":{"operationId":"rotateWebhookSubscriptionSecret","description":"Members may omit signingSecret to receive a show-once generated replacement. Credentialed agents must supply a caller-possessed signingSecret and an Idempotency-Key; the durable result is applied immediately or returned as a pending approval ChangeSet.","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"signingSecret":{"description":"Caller-possessed canonical unpadded base64url secret encoding exactly 32 random bytes. It is encrypted immediately, never echoed, and never stored in plaintext.","writeOnly":true,"type":"string"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","headers":{"Cache-Control":{"description":"Prevents caching of one-time secret material","schema":{"type":"string","const":"no-store, max-age=0"}},"Pragma":{"description":"Legacy cache prevention for one-time secret material","schema":{"type":"string","const":"no-cache"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"endpointUrl":{"type":"string","format":"uri"},"eventFilters":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"signingKeyId":{"type":"string"},"secretHint":{"type":"string"},"configVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"secret":{"description":"Show-once server-generated secret for member callers","readOnly":true,"type":"string"}},"required":["id","installationId","name","endpointUrl","eventFilters","enabled","signingKeyId","secretHint","configVersion"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhook-deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["Always-on"],"parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["pending","leased","retry_wait","delivered","dead_lettered","canceled"]}},{"in":"query","name":"subscriptionId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhook-deliveries/{id}":{"get":{"operationId":"getWebhookDelivery","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhook-deliveries/{id}/event-context":{"get":{"operationId":"getWebhookDeliveryEventContext","summary":"Resolve authenticated canonical event provenance for a webhook delivery","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhook-deliveries/{id}/replay":{"post":{"operationId":"replayWebhookDelivery","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"subscriptionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string"},"attemptCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxAttempts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"replayOfDeliveryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","eventId","subscriptionId","status","attemptCount","maxAttempts","replayOfDeliveryId"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent-schedules":{"get":{"operationId":"listAgentSchedules","tags":["Always-on"],"parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["active","paused","disabled"]}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createAgentSchedule","tags":["Always-on"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookSubscriptionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"scheduleKind":{"default":"custom_event","type":"string","enum":["daily_plan","morning_brief","midday_replan","evening_closure","weekly_review","custom_event"]},"cronExpression":{"type":"string","minLength":9,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":120},"eventType":{"default":"core.schedule.custom_event","type":"string","maxLength":160,"pattern":"^core\\.schedule\\.[a-z0-9_-]+(?:\\.[a-z0-9_-]+)*$"},"payloadVersion":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":10000},"payload":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"critical":{"default":false,"type":"boolean"},"silenceThresholdSeconds":{"type":"integer","minimum":60,"maximum":2592000},"maxDeliveryAttempts":{"default":8,"type":"integer","minimum":1,"maximum":100},"startsAt":{"type":"string"},"endsAt":{"type":"string"}},"required":["webhookSubscriptionId","name","cronExpression","timezone"],"additionalProperties":false}}}},"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookSubscriptionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["active","paused","disabled"]},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"nextRunAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","installationId","webhookSubscriptionId","status","version","nextRunAt"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent-schedules/{id}":{"get":{"operationId":"getAgentSchedule","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateAgentSchedule","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"webhookSubscriptionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"scheduleKind":{"type":"string","enum":["daily_plan","morning_brief","midday_replan","evening_closure","weekly_review","custom_event"]},"cronExpression":{"type":"string","minLength":9,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":120},"eventType":{"type":"string","maxLength":160,"pattern":"^core\\.schedule\\.[a-z0-9_-]+(?:\\.[a-z0-9_-]+)*$"},"payloadVersion":{"type":"integer","exclusiveMinimum":0,"maximum":10000},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"critical":{"type":"boolean"},"silenceThresholdSeconds":{"anyOf":[{"type":"integer","minimum":60,"maximum":2592000},{"type":"null"}]},"maxDeliveryAttempts":{"type":"integer","minimum":1,"maximum":100},"startsAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookSubscriptionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["active","paused","disabled"]},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"nextRunAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","installationId","webhookSubscriptionId","status","version","nextRunAt"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"disableAgentSchedule","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookSubscriptionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["active","paused","disabled"]},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"nextRunAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","installationId","webhookSubscriptionId","status","version","nextRunAt"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent-schedules/{id}/pause":{"post":{"operationId":"pauseAgentSchedule","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookSubscriptionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["active","paused","disabled"]},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"nextRunAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","installationId","webhookSubscriptionId","status","version","nextRunAt"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent-schedules/{id}/resume":{"post":{"operationId":"resumeAgentSchedule","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"installationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhookSubscriptionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["active","paused","disabled"]},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"nextRunAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","installationId","webhookSubscriptionId","status","version","nextRunAt"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent-schedule-runs":{"get":{"operationId":"listAgentScheduleRuns","tags":["Always-on"],"parameters":[{"in":"query","name":"scheduleId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"status","schema":{"type":"string","enum":["pending","leased","enqueued","delivered","actionable_failure","canceled","skipped"]}},{"in":"query","name":"actionableOnly","schema":{"type":"boolean"},"required":true},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent-schedule-runs/{id}":{"get":{"operationId":"getAgentScheduleRun","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent-schedule-runs/{id}/acknowledge":{"post":{"operationId":"acknowledgeAgentScheduleFailure","tags":["Always-on"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response.","type":"string","minLength":8,"maxLength":255},"description":"Required for AGENT mutations. Optional for MEMBER callers; when supplied, same-key same-request retries replay the original deterministic response."}],"responses":{"200":{"description":"Member callers receive the resource directly. Credentialed agents receive the durable ChangeSet envelope and must poll when status is pending_approval.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scheduleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string"},"failure":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"acknowledgedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["code","message","acknowledgedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","scheduleId","status","failure"],"additionalProperties":{}},{"type":"object","properties":{"status":{"type":"string","enum":["proposed","pending_approval","approved","applied","conflicted"]},"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"changeSetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approvalRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string"},"summary":{"type":"string"},"requestedBy":{"type":"object","properties":{"installationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"installationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["installationId","installationLabel"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","action","summary","requestedBy","expiresAt"],"additionalProperties":false},"poll":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"],"additionalProperties":false},"results":{"type":"array","items":{}},"summary":{"type":"string"},"reversibleUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["status","changeSetId"],"additionalProperties":false}]},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/briefings/morning":{"get":{"operationId":"getMorningBriefing","tags":["Briefings"],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/briefings/weekly-review":{"get":{"operationId":"getWeeklyReviewBriefing","tags":["Briefings"],"parameters":[{"in":"query","name":"weekStart","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Always-on backbone result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"UpdateProfileRequest":{"type":"object","properties":{"username":{"description":"Unique username (3-30 characters)","type":"string","minLength":3,"maxLength":30},"fullName":{"description":"Full name of the member","type":"string","minLength":1,"maxLength":100},"avatarUrl":{"description":"URL to avatar image, or null to remove the current one","anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"metadata":{"description":"Additional metadata","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"description":"Request to update member profile","additionalProperties":false},"DeleteAccountRequest":{"type":"object","properties":{"confirm":{"type":"boolean","const":true,"description":"Confirmation flag for account deletion"}},"required":["confirm"],"description":"Request to delete member account","additionalProperties":false},"UpdatePreferencesRequest":{"type":"object","properties":{"theme":{"description":"UI theme preference","type":"string","enum":["light","dark","auto"]},"notifications":{"description":"Partial notification preferences (deep-merged into the existing v1 object)","$ref":"#/components/schemas/NotificationPreferencesPatch"},"settings":{"$ref":"#/components/schemas/MemberSettings"}},"description":"Request to update member preferences","additionalProperties":false},"NotificationPreferencesPatch":{"type":"object","properties":{"activity_tracking":{"type":"boolean"},"channels":{"type":"object","properties":{"push":{"type":"boolean"},"email":{"type":"boolean"}},"additionalProperties":{}},"categories":{"type":"object","properties":{"task_due":{"type":"boolean"},"task_reminders":{"type":"boolean"},"habit_reminders":{"type":"boolean"},"daily_digest":{"type":"boolean"},"agent_nudges":{"type":"boolean"},"goal_check_ins":{"type":"boolean"},"approval_requests":{"type":"boolean"},"weekly_review":{"type":"boolean"}},"additionalProperties":{}},"quietHours":{"type":"object","properties":{"enabled":{"type":"boolean"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"additionalProperties":{}},"timezone":{"type":"string"}},"additionalProperties":{},"description":"Partial notification preferences patch (deep-merged into the existing v1 object)"},"MemberSettings":{"type":"object","properties":{"unlockedEntityTypes":{"type":"array","items":{"type":"string","enum":["area","goal","project","task","habit","reminder","note","flow"]}},"ai":{"type":"object","properties":{"workContext":{"type":"string","maxLength":200},"personalInstructions":{"type":"string","maxLength":1000}},"additionalProperties":false},"defaults":{"type":"object","properties":{"taskPriority":{"type":"string","enum":["low","medium","high","critical"]}},"additionalProperties":false},"flow":{"type":"object","properties":{"dailySessionGoal":{"description":"Completed flow sessions per day the member aims for","type":"integer","minimum":1,"maximum":12}},"additionalProperties":false},"calibrationCompletedAt":{"description":"ISO timestamp of the calibration reveal moment (server-managed)","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"description":"Validated member settings (unknown keys stripped on write)","additionalProperties":false},"UpdateEntityTypesRequest":{"type":"object","properties":{"types":{"minItems":1,"type":"array","items":{"type":"string","enum":["area","goal","project","task","habit","reminder","note","flow"]},"description":"Entity types to unlock for the member"}},"required":["types"],"description":"Request to update unlocked entity types","additionalProperties":false},"UpdateOnboardingCheckpointRequest":{"oneOf":[{"type":"object","properties":{"checkpoint":{"type":"string","const":"ai-personalize","description":"AI personalization checkpoint to make current"},"expectedRevision":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Revision returned by the latest onboarding status read"},"flowVersion":{"type":"number","const":2,"description":"Onboarding flow version"},"sessionId":{"description":"AI personalization session to attach atomically","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["checkpoint","expectedRevision","flowVersion"],"additionalProperties":false},{"type":"object","properties":{"checkpoint":{"type":"string","enum":["personal-intro","greeting","compounding","areas-intro","areas","notifications","all-set","completed"],"description":"Non-AI flow-v2 checkpoint to make current"},"expectedRevision":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Revision returned by the latest onboarding status read"},"flowVersion":{"type":"number","const":2,"description":"Onboarding flow version"},"sessionId":{"description":"Forbidden outside the ai-personalize checkpoint","not":{}}},"required":["checkpoint","expectedRevision","flowVersion"],"additionalProperties":false}],"description":"Optimistic, idempotent flow-v2 onboarding checkpoint transition","type":"object"},"UpdateOnboardingStepRequest":{"type":"object","properties":{"step":{"type":"string","enum":["personal-intro","areas","goals"],"description":"Onboarding step identifier"}},"required":["step"],"description":"Request to update onboarding step","additionalProperties":false},"CompleteOnboardingRequest":{"type":"object","properties":{"confirm":{"type":"boolean","const":true,"description":"Confirmation flag for onboarding completion"}},"required":["confirm"],"description":"Request to complete onboarding","additionalProperties":false},"SkipOnboardingRequest":{"type":"object","properties":{"confirm":{"type":"boolean","const":true,"description":"Confirmation flag for skipping onboarding"}},"required":["confirm"],"description":"Request to skip onboarding","additionalProperties":false},"UpdateMemberStatusRequest":{"type":"object","properties":{"status":{"type":"string","enum":["productive","sick","on_vacation"],"description":"The productivity status to set (productive | sick | on_vacation)"},"until":{"description":"Member-local auto-revert date (YYYY-MM-DD), or null for \"until changed\"","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["status"],"description":"Request to set the member productivity status","additionalProperties":false},"CreateGoalRequest":{"type":"object","properties":{"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"title":{"type":"string","minLength":1,"maxLength":200,"description":"Goal title"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Goal description"},"status":{"default":"not_started","description":"Current status of the goal","type":"string","enum":["not_started","in_progress","on_hold","completed"]},"priority":{"description":"Priority level (null or omitted → medium)","anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}],"description":"Due date (target date) in ISO 8601 format"},"horizon":{"anyOf":[{"type":"string","enum":["someday","year","quarter","month","date"]},{"type":"null"}],"description":"Time horizon — presentational + default-driving"},"checkinCadence":{"anyOf":[{"type":"string","enum":["weekly","biweekly","monthly","off"]},{"type":"null"}],"description":"Check-in prompt cadence"},"metricKind":{"anyOf":[{"type":"string","enum":["number","currency","boolean"]},{"type":"null"}],"description":"Outcome metric kind (all-or-nothing with direction + target)"},"metricDirection":{"anyOf":[{"type":"string","enum":["reach","increase","decrease","maintain"]},{"type":"null"}],"description":"Outcome metric direction"},"metricUnit":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"description":"Metric unit ('kg', 'km', '$', 'books', …)"},"metricStart":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric value at goal creation / last re-scope"},"metricTarget":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric target value"},"metadata":{"default":{},"description":"Additional metadata","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["title"],"description":"Request to create a new goal","additionalProperties":false},"CreateBulkGoalsRequest":{"type":"object","properties":{"goals":{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/CreateBulkGoalItem"},"description":"Array of goals to create"}},"required":["goals"],"description":"Request to create multiple goals at once","additionalProperties":false},"CreateBulkGoalItem":{"type":"object","properties":{"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"title":{"type":"string","minLength":1,"maxLength":200,"description":"Goal title"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Goal description"},"status":{"description":"Current status of the goal","type":"string","enum":["not_started","in_progress","on_hold","completed"]},"priority":{"description":"Priority level","type":"string","enum":["low","medium","high","critical"]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}],"description":"Due date in ISO 8601 format"},"metadata":{"description":"Additional metadata","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["title"],"description":"Single goal item for bulk creation","additionalProperties":false},"UpdateGoalRequest":{"type":"object","properties":{"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"title":{"description":"Goal title","type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Goal description"},"status":{"description":"Current status of the goal","type":"string","enum":["not_started","in_progress","on_hold","completed"]},"priority":{"description":"Priority level (null → keep existing)","anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}],"description":"Due date (target date) in ISO 8601 format"},"horizon":{"anyOf":[{"type":"string","enum":["someday","year","quarter","month","date"]},{"type":"null"}],"description":"Time horizon — presentational + default-driving"},"checkinCadence":{"anyOf":[{"type":"string","enum":["weekly","biweekly","monthly","off"]},{"type":"null"}],"description":"Check-in prompt cadence"},"metricKind":{"anyOf":[{"type":"string","enum":["number","currency","boolean"]},{"type":"null"}],"description":"Outcome metric kind (all-or-nothing with direction + target)"},"metricDirection":{"anyOf":[{"type":"string","enum":["reach","increase","decrease","maintain"]},{"type":"null"}],"description":"Outcome metric direction"},"metricUnit":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"description":"Metric unit ('kg', 'km', '$', 'books', …)"},"metricStart":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric value at goal creation / last re-scope"},"metricTarget":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric target value"},"metadata":{"description":"Additional metadata","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"description":"Request to update an existing goal","additionalProperties":false},"DeleteGoalRequest":{"type":"object","properties":{"confirm":{"type":"boolean","const":true,"description":"Confirmation flag for goal deletion"}},"required":["confirm"],"description":"Request to delete a goal","additionalProperties":false},"CompleteGoalRequest":{"type":"object","properties":{"outcome":{"default":"achieved","description":"Terminal outcome — achieve or release (both set status=completed)","type":"string","enum":["achieved","released"]},"reflection":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"One-line reflection captured at close"}},"description":"Request to complete (achieve or release) a goal","additionalProperties":false},"RecalibrateGoalRequest":{"type":"object","properties":{"metricTarget":{"type":"number","description":"New metric target"},"metricStart":{"description":"New baseline; defaults to keeping the existing start","type":"number"},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Why the target changed (logged on the activity)"}},"required":["metricTarget"],"description":"Change a goal metric target/baseline (logged as a recalibrated activity)","additionalProperties":false},"CreateGoalCheckInRequest":{"type":"object","properties":{"feeling":{"type":"string","enum":["on_track","unsure","off_track"],"description":"How the member feels about the goal right now"},"metricValue":{"description":"Latest metric reading — only meaningful when the goal has a metric configured","type":"number"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Optional free-text note"},"source":{"default":"manual","description":"How the check-in was initiated","type":"string","enum":["manual","prompted","agent"]}},"required":["feeling"],"description":"Request to log a goal check-in","additionalProperties":false},"CreateAreaRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Area name"},"intention":{"description":"Area intention — an aspirational statement of how the member wants to show up in this area","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"color":{"description":"Area color name","type":"string"},"icon":{"description":"Tabler icon slug (e.g. \"barbell\", \"ball-basketball\"). Emoji is supported as an explicit member choice.","type":"string","maxLength":100}},"required":["name"],"description":"Request to create a new area","additionalProperties":false},"CreateBulkAreasRequest":{"type":"object","properties":{"areas":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Area name"},"intention":{"description":"Area intention — an aspirational statement of how the member wants to show up in this area","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"color":{"description":"Area color name","type":"string","minLength":1},"icon":{"description":"Tabler icon slug (e.g. \"barbell\", \"ball-basketball\"). Emoji is supported as an explicit member choice.","type":"string","maxLength":100}},"required":["name"],"additionalProperties":false},"description":"Array of areas to create"}},"required":["areas"],"description":"Request to create multiple areas at once","additionalProperties":false},"UpdateAreaRequest":{"type":"object","properties":{"name":{"description":"Area name","type":"string","minLength":1,"maxLength":100},"intention":{"description":"Area intention — an aspirational statement of how the member wants to show up in this area","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"color":{"description":"Area color name","type":"string"},"icon":{"description":"Tabler icon slug (e.g. \"barbell\", \"ball-basketball\"). Emoji is supported as an explicit member choice.","type":"string","maxLength":100}},"description":"Request to update an existing area","additionalProperties":false},"DeleteAreaRequest":{"type":"object","properties":{"keep":{"description":"Per-entity-type set of child ids to preserve from the cascade","type":"object","properties":{"goalIds":{"description":"Goal ids to preserve (unlinked, not deleted)","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"projectIds":{"description":"Project ids to preserve (unlinked, not deleted)","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"habitIds":{"description":"Habit ids to preserve (unlinked, not deleted)","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"taskIds":{"description":"Task ids to preserve (unlinked, not deleted)","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"additionalProperties":false}},"description":"Optional body for area delete: selectively preserve children from the cascade","additionalProperties":false},"CreateTaskRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Task title"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Task description"},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the parent task for subtasks"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated project"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated goal"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}],"description":"Priority level (no default)"},"due":{"anyOf":[{"$ref":"#/components/schemas/DateInput"},{"type":"null"}],"description":"Due date with timezone and granularity support"},"durationMinutes":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10080},{"type":"null"}],"description":"Planned duration in minutes (1..10080 = up to 7 days); null/omitted = unset"},"tags":{"default":[],"description":"Task tags","type":"array","items":{"type":"string"}},"sourceProvenance":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["mail_message","calendar_event"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string","minLength":1,"maxLength":1000},"sourceUrl":{"type":"string","maxLength":4000,"format":"uri"},"label":{"type":"string","maxLength":200}},"required":["kind","connectionId","externalId"],"additionalProperties":false},{"type":"null"}],"description":"Connected mail message or calendar event that this task was derived from"}},"required":["title"],"description":"Request to create a new task","additionalProperties":false},"DateInput":{"type":"object","properties":{"allDay":{"default":false,"description":"Whether this is an all-day task","type":"boolean"},"iso":{"description":"ISO 8601 datetime for timed tasks","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"localDate":{"description":"Local date (YYYY-MM-DD) for all-day tasks","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"intendedTz":{"description":"IANA timezone identifier (e.g., \"America/New_York\")","type":"string","minLength":1,"maxLength":100},"timeBehavior":{"default":"pinned","description":"Whether the time is pinned to a location or follows user timezone","type":"string","enum":["pinned","floating"]}},"description":"Date input with timezone and granularity support","additionalProperties":false},"UpdateTaskRequest":{"type":"object","properties":{"correction":{"description":"Explicit member correction context linking this edit to the original durable operation.","type":"object","properties":{"originalOperationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mutationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:/+-]+$"}},"required":["originalOperationId","mutationId","reason"],"additionalProperties":false},"title":{"description":"Task title","type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Task description"},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the parent task for subtasks"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated project"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated goal"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}],"description":"Priority level"},"sortRank":{"description":"Sort rank for ordering among siblings","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"due":{"anyOf":[{"$ref":"#/components/schemas/DateInput"},{"type":"null"}],"description":"Due date with timezone and granularity support"},"durationMinutes":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10080},{"type":"null"}],"description":"Planned duration in minutes (1..10080 = up to 7 days); explicit null clears it, omitted leaves it untouched"},"tags":{"description":"Task tags","type":"array","items":{"type":"string"}},"isCompleted":{"description":"Task completion status","type":"boolean"},"sourceProvenance":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["mail_message","calendar_event"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string","minLength":1,"maxLength":1000},"sourceUrl":{"type":"string","maxLength":4000,"format":"uri"},"label":{"type":"string","maxLength":200}},"required":["kind","connectionId","externalId"],"additionalProperties":false},{"type":"null"}],"description":"Connected source to attach; null clears existing provenance"}},"description":"Request to update an existing task","additionalProperties":false},"DeleteTaskRequest":{"type":"object","properties":{"confirm":{"type":"boolean","const":true,"description":"Confirmation flag for task deletion"}},"required":["confirm"],"description":"Request to delete a task","additionalProperties":false},"CompleteTaskRequest":{"type":"object","properties":{},"description":"Request to complete a task"},"CreateTaskSeriesRequest":{"type":"object","properties":{"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUID of the template task"},"rruleText":{"type":"string","minLength":1,"description":"RFC-5545 compliant RRULE string"},"rdates":{"description":"Additional inclusion dates (YYYY-MM-DD)","type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"exdates":{"description":"Exception dates to exclude (YYYY-MM-DD)","type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"intendedTz":{"type":"string","minLength":1,"description":"IANA timezone identifier"},"anchor":{"oneOf":[{"type":"object","properties":{"allDay":{"type":"boolean","const":true},"localDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Anchor date for all-day recurring tasks"}},"required":["allDay","localDate"],"additionalProperties":false},{"type":"object","properties":{"allDay":{"type":"boolean","const":false},"iso":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Anchor datetime for timed recurring tasks"},"localTime":{"description":"Local time for display (HH:MM or HH:MM:SS)","type":"string","pattern":"^\\d{2}:\\d{2}(:\\d{2})?$"}},"required":["allDay","iso"],"additionalProperties":false}],"description":"Anchor point for recurrence calculation","type":"object"},"durationMinutes":{"description":"Duration of each occurrence in minutes","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"missedPolicy":{"default":"skip","description":"Policy for handling missed occurrences","type":"string","enum":["skip","catch_up","roll_forward"]}},"required":["taskId","rruleText","intendedTz","anchor"],"description":"Request to create a recurring task series","additionalProperties":false},"UpdateTaskSeriesRequest":{"type":"object","properties":{"rruleText":{"type":"string","minLength":1,"description":"RFC-5545 compliant RRULE string"},"rdates":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"exdates":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"intendedTz":{"type":"string","minLength":1},"anchor":{"oneOf":[{"type":"object","properties":{"allDay":{"type":"boolean","const":true},"localDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["allDay","localDate"],"additionalProperties":false},{"type":"object","properties":{"allDay":{"type":"boolean","const":false},"iso":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"localTime":{"type":"string","pattern":"^\\d{2}:\\d{2}(:\\d{2})?$"}},"required":["allDay","iso"],"additionalProperties":false}],"type":"object"},"durationMinutes":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"missedPolicy":{"default":"skip","description":"Policy for handling missed occurrences","type":"string","enum":["skip","catch_up","roll_forward"]}},"description":"Request to update a recurring task series","additionalProperties":false},"CreateOccurrenceOverrideRequest":{"type":"object","properties":{"occurrenceDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Date of the occurrence to override (YYYY-MM-DD)"},"overrides":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"priority":{"type":"string","enum":["low","medium","high","critical"]},"tags":{"type":"array","items":{"type":"string"}},"due":{"anyOf":[{"type":"object","properties":{"allDay":{"type":"boolean"},"iso":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"localDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"intendedTz":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"available":{"anyOf":[{"type":"object","properties":{"allDay":{"type":"boolean"},"iso":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"localDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"intendedTz":{"type":"string"}},"additionalProperties":false},{"type":"null"}]}},"description":"Fields to override for this occurrence","additionalProperties":false},"notes":{"description":"Notes specific to this occurrence","type":"string","maxLength":1000}},"required":["occurrenceDate","overrides"],"description":"Request to override a specific occurrence","additionalProperties":false},"UpdateOccurrenceRequest":{"type":"object","properties":{"scope":{"type":"string","enum":["this","this_and_following","entire_series"],"description":"Scope of modification for recurring tasks"},"changes":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"priority":{"type":"string","enum":["low","medium","high","critical"]},"tags":{"type":"array","items":{"type":"string"}},"due":{"anyOf":[{"type":"object","properties":{"allDay":{"type":"boolean"},"iso":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"localDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"intendedTz":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"available":{"anyOf":[{"type":"object","properties":{"allDay":{"type":"boolean"},"iso":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"localDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"intendedTz":{"type":"string"}},"additionalProperties":false},{"type":"null"}]}},"additionalProperties":false}},"required":["scope","changes"],"description":"Request to update a task occurrence","additionalProperties":false},"CompleteOccurrenceRequest":{"type":"object","properties":{"notes":{"description":"Completion notes","type":"string","maxLength":1000}},"description":"Request to complete a task occurrence","additionalProperties":false},"SkipOccurrenceRequest":{"type":"object","properties":{"reason":{"description":"Reason for skipping","type":"string","maxLength":500}},"description":"Request to skip a task occurrence","additionalProperties":false},"CreateProjectRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Project name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Project description"},"goalIds":{"default":[],"description":"UUIDs of associated goals","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"deadline":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Project deadline in YYYY-MM-DD format"},"status":{"default":"not_started","description":"Current status of the project","type":"string","enum":["not_started","in_progress","on_hold","completed"]}},"required":["name"],"description":"Request to create a new project","additionalProperties":false},"UpdateProjectRequest":{"type":"object","properties":{"name":{"description":"Project name","type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Project description"},"goalIds":{"description":"UUIDs of associated goals","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"deadline":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Project deadline in YYYY-MM-DD format"},"status":{"description":"Current status of the project","type":"string","enum":["not_started","in_progress","on_hold","completed"]},"progress":{"description":"Manual progress override (0-100)","type":"number","minimum":0,"maximum":100}},"description":"Request to update an existing project","additionalProperties":false},"CreateHabitRequest":{"type":"object","properties":{"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated goal"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Habit name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Habit description"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Habit category"},"frequency":{"default":"daily","description":"How often the habit should be completed","type":"string","enum":["daily","weekly","monthly"]},"targetCount":{"default":1,"description":"Target completions per period","type":"integer","minimum":1,"maximum":100},"reminderTime":{"anyOf":[{"type":"string","pattern":"^([01]?[0-9]|2[0-3]):[0-5][0-9]$"},{"type":"null"}],"description":"Reminder time in HH:MM format"},"xpReward":{"default":10,"description":"XP reward for completing the habit","type":"integer","minimum":1,"maximum":1000},"isActive":{"default":true,"description":"Whether the habit is active","type":"boolean"},"recurrenceRule":{"description":"RFC 5545 RRULE string (without DTSTART). When provided, supersedes `frequency`.","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"icon":{"description":"Phosphor icon slug (e.g. \"barbell\", \"book-open\") or an emoji.","anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}},"required":["name"],"description":"Request to create a new habit","additionalProperties":false},"UpdateHabitRequest":{"type":"object","properties":{"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated area"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"UUID of the associated goal"},"name":{"description":"Habit name","type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Habit description"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Habit category"},"frequency":{"description":"How often the habit should be completed","type":"string","enum":["daily","weekly","monthly"]},"targetCount":{"description":"Target completions per period","type":"integer","minimum":1,"maximum":100},"reminderTime":{"anyOf":[{"type":"string","pattern":"^([01]?[0-9]|2[0-3]):[0-5][0-9]$"},{"type":"null"}],"description":"Reminder time in HH:MM format"},"xpReward":{"description":"XP reward for completing the habit","type":"integer","minimum":1,"maximum":1000},"isActive":{"description":"Whether the habit is active","type":"boolean"},"recurrenceRule":{"description":"RFC 5545 RRULE string (without DTSTART). When provided, supersedes `frequency`.","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"icon":{"description":"Phosphor icon slug (e.g. \"barbell\", \"book-open\") or an emoji.","anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}},"description":"Request to update an existing habit","additionalProperties":false},"CreateCheckInRequest":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Check-in date in YYYY-MM-DD format"},"count":{"default":1,"description":"Number of completions","type":"integer","minimum":1,"maximum":100},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Optional notes for the check-in"},"kind":{"default":"completed","description":"Whether this check-in is a completion or a deliberate rest day.","type":"string","enum":["completed","rest"]}},"required":["date"],"description":"Request to create a habit check-in","additionalProperties":false},"UpdateCheckInRequest":{"type":"object","properties":{"count":{"description":"Number of completions","type":"integer","minimum":1,"maximum":100},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Optional notes for the check-in"}},"description":"Request to update a check-in","additionalProperties":false},"TrashEntityType":{"type":"string","enum":["area","goal","project","task","note","folder"],"description":"Type of entity in trash"},"CreateFlowRequest":{"type":"object","properties":{"actualDuration":{"type":"integer","minimum":1,"maximum":1440,"description":"Actual session duration in minutes (max 24 hours)"},"plannedDuration":{"description":"Planned session duration in minutes (defaults to actualDuration)","type":"integer","minimum":1,"maximum":1440},"startTime":{"description":"Session start time (ISO 8601). If omitted, calculated as endTime - actualDuration","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"endTime":{"description":"Session end time (ISO 8601). If omitted, defaults to now","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Session title (default: \"Flow Session\")"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Session description"},"status":{"default":"completed","description":"Session status","type":"string","enum":["completed","cancelled"]},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked area UUID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked goal UUID"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked project UUID"},"taskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked task UUID"},"productivityRating":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}],"description":"Self-rated productivity (1-5)"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"description":"Post-session notes"}},"required":["actualDuration"],"description":"Request to create/log a flow session","additionalProperties":false},"UpdateFlowRequest":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Session title"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Session description"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked area UUID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked goal UUID"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked project UUID"},"taskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked task UUID"},"productivityRating":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}],"description":"Self-rated productivity (1-5)"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"description":"Post-session notes"}},"description":"Request to update a flow session","additionalProperties":false},"CreateNoteRequest":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":100000,"description":"Markdown note body (raw text)"},"title":{"description":"Note title. Auto-derived from the first line / H1 of content when omitted.","type":"string","minLength":1,"maxLength":200},"tags":{"description":"Free-form tags","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"connections":{"description":"Optional initial connections to create alongside the note","maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/NoteConnectionInput"}},"folderId":{"description":"Knowledge folder to file the note into. Omit or null for the virtual \"Unfiled\" bucket. A folder that does not exist, is in trash, or belongs to another member fails the create — it never degrades to Unfiled.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["content"],"description":"Request to create a new note","additionalProperties":false},"NoteConnectionInput":{"type":"object","properties":{"targetType":{"type":"string","enum":["area","goal","project","task","habit","note"],"description":"Entity type to connect to (area, goal, project, task, habit, note)"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUID of the target entity"}},"required":["targetType","targetId"],"description":"A connection from a note to another entity","additionalProperties":false},"UpdateNoteRequest":{"type":"object","properties":{"content":{"description":"Markdown note body (raw text)","type":"string","minLength":1,"maxLength":100000},"title":{"description":"Explicit note title (overrides content-derived title)","type":"string","minLength":1,"maxLength":200},"tags":{"description":"Free-form tags (replaces the existing set)","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"isArchived":{"description":"Archive / unarchive the note","type":"boolean"}},"description":"Request to update an existing note","additionalProperties":false},"CreateFolderRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Folder name — unique case-insensitively among its siblings"},"parentId":{"description":"Parent folder UUID. Omit or null to create at the root.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"areaId":{"description":"Optional bridge to an area of responsibility","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"icon":{"type":"string","minLength":1,"maxLength":64,"description":"Tabler icon slug (not emoji), e.g. \"folder\" or \"book\""},"color":{"type":"string","minLength":1,"maxLength":32,"description":"Palette color token"},"beforeId":{"description":"Sibling that should end up immediately BEFORE the moved item","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"afterId":{"description":"Sibling that should end up immediately AFTER the moved item","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["name"],"description":"Request to create a new knowledge folder","additionalProperties":false},"UpdateFolderRequest":{"type":"object","properties":{"name":{"description":"New folder name","type":"string","minLength":1,"maxLength":200},"icon":{"description":"New icon slug, or null to clear","anyOf":[{"type":"string","minLength":1,"maxLength":64,"description":"Tabler icon slug (not emoji), e.g. \"folder\" or \"book\""},{"type":"null"}]},"color":{"description":"New color token, or null to clear","anyOf":[{"type":"string","minLength":1,"maxLength":32,"description":"Palette color token"},{"type":"null"}]},"areaId":{"description":"Relink to an area, or null to unlink","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"description":"Request to rename / re-icon / recolor / relink a folder","additionalProperties":false},"MoveFolderRequest":{"type":"object","properties":{"parentId":{"description":"New parent folder UUID, or null to move to the root","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"beforeId":{"description":"Sibling that should end up immediately BEFORE the moved item","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"afterId":{"description":"Sibling that should end up immediately AFTER the moved item","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"description":"Reparent and reorder a folder in one call","additionalProperties":false},"MoveNoteRequest":{"type":"object","properties":{"folderId":{"description":"Destination folder UUID, or null for the virtual \"Unfiled\" bucket","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"beforeId":{"description":"Sibling that should end up immediately BEFORE the moved item","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"afterId":{"description":"Sibling that should end up immediately AFTER the moved item","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"description":"File a note into a folder and position it among its siblings","additionalProperties":false},"MemoryNativeSourcesRequest":{"type":"object","properties":{"sources":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","const":"core_native"},"nativeType":{"type":"string","enum":["task_series","task_occurrence","habit_check_in","goal_check_in","flow","member_status"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","nativeType","id","version"],"additionalProperties":false}}},"required":["sources"],"additionalProperties":false},"MemoryNativeSelectionsRequest":{"type":"object","properties":{"sources":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","const":"core_selection"},"queryType":{"type":"string","enum":["overdue_tasks","calendar_agenda","habit_status","goal_progress","free_windows","schedule_conflicts"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","const":"1"}},"required":["kind","queryType","id","version"],"additionalProperties":false}}},"required":["sources"],"additionalProperties":false},"MemoryNativeRequest":{"type":"object","properties":{"queryType":{"type":"string","enum":["overdue_tasks","calendar_agenda","habit_status","goal_progress","free_windows","schedule_conflicts"]},"timezone":{"type":"string","minLength":1,"maxLength":100},"startLocalDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endLocalDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"windowStart":{"default":"07:00","type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"windowEnd":{"default":"22:00","type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"durationMinutes":{"default":30,"type":"integer","minimum":1,"maximum":1440},"entityIds":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["queryType","timezone","startLocalDate","endLocalDate"],"additionalProperties":false},"MemoryEntitiesRequest":{"type":"object","properties":{"entities":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["entityType","entityId"],"additionalProperties":false}},"includeDeleted":{"description":"Internal projection reconciliation only: return owned content-free tombstone identity with an empty snapshot.","type":"boolean"}},"required":["entities"],"additionalProperties":false},"MemoryGraphRequest":{"type":"object","properties":{"seeds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["entityType","entityId"],"additionalProperties":false}},"depth":{"default":2,"type":"integer","minimum":0,"maximum":2},"fanout":{"default":25,"type":"integer","minimum":1,"maximum":25},"limit":{"default":200,"type":"integer","minimum":1,"maximum":200}},"required":["seeds"],"additionalProperties":false},"MemoryHistoryRequest":{"type":"object","properties":{"entities":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["entityType","entityId"],"additionalProperties":false}},"kinds":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["entity_revision","relationship_revision","outcome","goal_check_in","habit_check_in","operation"]}},"recordedFrom":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"recordedTo":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"limit":{"default":100,"type":"integer","minimum":1,"maximum":200},"cursor":{"type":"string","minLength":1,"maxLength":4096}},"required":["entities"],"additionalProperties":false},"UpdateCalendarSourceRequest":{"type":"object","properties":{"isSelected":{"type":"boolean"}},"additionalProperties":false},"RegisterPushTokenRequest":{"type":"object","properties":{"token":{"type":"string","minLength":1,"description":"Expo push token for the device"},"platform":{"type":"string","enum":["ios","android"],"description":"Device platform"},"deviceId":{"description":"Stable device identifier","type":"string"},"appVersion":{"description":"App version that registered the token","type":"string"}},"required":["token","platform"],"description":"Register (or refresh) a push token for the authenticated member","additionalProperties":false},"DeletePushTokenRequest":{"type":"object","properties":{"token":{"type":"string","minLength":1,"description":"Expo push token to unregister"}},"required":["token"],"description":"Unregister a push token for the authenticated member","additionalProperties":false},"CreateAgentInstallationRequest":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120,"description":"Human label, e.g. \"OpenClaw on home server\""},"principalSlug":{"description":"Catalog principal slug; defaults to \"headless\" for a generic API key","type":"string","minLength":1,"maxLength":64},"scopes":{"description":"Grant scopes; defaults to [state:read, capture:create, work:propose]","type":"array","items":{"type":"string","enum":["state:read","capture:create","work:propose","work:execute","calendar:read","calendar:write","memory:read","memory:write","automation:manage","communications:draft","communications:send","admin"]}},"policy":{"type":"object","properties":{"entityTypes":{"description":"Restrict to these entity types","type":"array","items":{"type":"string"}},"areaIds":{"description":"Restrict to these area ids","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"goalIds":{"description":"Restrict to these goal ids","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"requiresApproval":{"description":"Scopes/actions that require member approval regardless of scope","type":"array","items":{"type":"string"}},"maxActionsPerHour":{"description":"Per-hour action cap","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"budgetUsdPerDay":{"description":"Daily USD budget","type":"number","minimum":0}},"description":"Grant policy","additionalProperties":false}},"required":["label"],"description":"Create a PAT agent installation","additionalProperties":false},"UpdateAgentInstallationRequest":{"type":"object","properties":{"label":{"description":"New label","type":"string","minLength":1,"maxLength":120},"scopes":{"description":"Replace the grant scopes","type":"array","items":{"type":"string","enum":["state:read","capture:create","work:propose","work:execute","calendar:read","calendar:write","memory:read","memory:write","automation:manage","communications:draft","communications:send","admin"]}},"policy":{"description":"Replace the grant policy","type":"object","properties":{"entityTypes":{"description":"Restrict to these entity types","type":"array","items":{"type":"string"}},"areaIds":{"description":"Restrict to these area ids","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"goalIds":{"description":"Restrict to these goal ids","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"requiresApproval":{"description":"Scopes/actions that require member approval regardless of scope","type":"array","items":{"type":"string"}},"maxActionsPerHour":{"description":"Per-hour action cap","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"budgetUsdPerDay":{"description":"Daily USD budget","type":"number","minimum":0}},"additionalProperties":false}},"description":"Rename / adjust an installation","additionalProperties":false},"IssueAgentCredentialRequest":{"type":"object","properties":{"scopes":{"description":"Per-credential subset of the grant scopes; defaults to all grant scopes","type":"array","items":{"type":"string","enum":["state:read","capture:create","work:propose","work:execute","calendar:read","calendar:write","memory:read","memory:write","automation:manage","communications:draft","communications:send","admin"]}},"expiresInDays":{"description":"Days until expiry; null = no expiry (discouraged); default 90","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":3650},{"type":"null"}]},"budget":{"type":"object","properties":{"maxActionsPerHour":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"budgetUsdPerDay":{"type":"number","minimum":0}},"description":"Per-credential budget","additionalProperties":false}},"description":"Issue a PAT (secret shown once)","additionalProperties":false},"WorkflowCaptureRestInput":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":100000},"entityType":{"type":"string","enum":["area","goal","project","task","habit","reminder","note","flow"]},"commit":{"default":false,"type":"boolean"},"priority":{"type":"string","enum":["low","medium","high","critical"]},"areaId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"goalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"due":{"$ref":"#/components/schemas/DateInput"}},"required":["text"],"additionalProperties":false},"HealthCheckResponse":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","unhealthy"],"description":"Health status"},"uptime":{"type":"number","description":"Uptime in seconds"},"timestamp":{"type":"string","description":"ISO 8601 timestamp"},"services":{"description":"Individual dependency statuses (readiness and diagnostics only)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["up","down"],"description":"Service status"},"responseTime":{"description":"Response time in milliseconds","type":"number"},"lastChecked":{"description":"Last health check timestamp","type":"string"},"required":{"type":"boolean","description":"Whether a down state here fails the probe. Only required dependencies return 503; the rest degrade"},"detail":{"description":"Low-cardinality operator hint. Never member content","type":"string"}},"required":["status","required"],"additionalProperties":false}}},"required":["status","uptime","timestamp"],"additionalProperties":false},"DetailedHealthCheckResponse":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","degraded","unhealthy"],"description":"Health status"},"uptime":{"type":"number","description":"Uptime in seconds"},"timestamp":{"type":"string","description":"ISO 8601 timestamp"},"services":{"description":"Individual dependency statuses (readiness and diagnostics only)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["up","down"],"description":"Service status"},"responseTime":{"description":"Response time in milliseconds","type":"number"},"lastChecked":{"description":"Last health check timestamp","type":"string"},"required":{"type":"boolean","description":"Whether a down state here fails the probe. Only required dependencies return 503; the rest degrade"},"detail":{"description":"Low-cardinality operator hint. Never member content","type":"string"}},"required":["status","required"],"additionalProperties":false}},"memory":{"type":"object","properties":{"rss":{"type":"number","description":"Resident set size in bytes"},"heapTotal":{"type":"number","description":"Total V8 heap in bytes"},"heapUsed":{"type":"number","description":"Used V8 heap in bytes"}},"required":["rss","heapTotal","heapUsed"],"additionalProperties":false,"description":"Process memory usage"}},"required":["status","uptime","timestamp","memory"],"additionalProperties":false},"UsernameAvailability":{"type":"object","properties":{"username":{"type":"string","description":"The username that was checked"},"available":{"type":"boolean","description":"Whether the username is available"}},"required":["username","available"],"additionalProperties":false,"description":"Username availability check result"},"SuccessMetadata":{"type":"object","properties":{"requestId":{"type":"string","description":"Unique request identifier"},"timestamp":{"type":"string","description":"ISO 8601 timestamp"},"version":{"description":"API version","type":"string"},"processingTime":{"description":"Processing time in milliseconds","type":"number"},"warnings":{"description":"Warning messages","type":"array","items":{"type":"string"}},"documentation":{"description":"Link to documentation","type":"string"},"operation":{"description":"Operation type","type":"string","enum":["created","updated"]},"changes":{"description":"List of changes made","type":"array","items":{"type":"string"}},"location":{"description":"Location of created resource","type":"string"}},"required":["requestId","timestamp"],"additionalProperties":false},"ListMetadata":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total number of items"},"filteredTotal":{"description":"Total after filtering","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of items returned"}},"required":["total","count"],"additionalProperties":false},"PaginationInfo":{"type":"object","properties":{"page":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Current page number"},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Items per page"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total number of items"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of items in current page"},"filteredTotal":{"description":"Total after filtering","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total number of pages"},"hasNext":{"type":"boolean","description":"Has next page"},"hasPrev":{"type":"boolean","description":"Has previous page"},"nextCursor":{"description":"Opaque actor- and filter-bound keyset cursor for the next page","anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"description":"Whether a real keyset continuation exists","type":"boolean"}},"required":["page","limit","total","count","pages","hasNext","hasPrev"],"additionalProperties":false},"LinkInfo":{"type":"object","properties":{"self":{"description":"Link to current resource","type":"string"},"next":{"description":"Link to next page","type":"string"},"prev":{"description":"Link to previous page","type":"string"},"first":{"description":"Link to first page","type":"string"},"last":{"description":"Link to last page","type":"string"},"related":{"description":"Related resource links","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"additionalProperties":false},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Indicates failed operation"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"type":{"description":"Error category (e.g. validation_error)","type":"string"},"details":{"description":"Field-level validation errors","type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}},"context":{"description":"Additional error context (e.g. rate-limit info, stack in dev)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"],"additionalProperties":false},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"timestamp":{"description":"ISO 8601 timestamp","type":"string"},"path":{"description":"Request path","type":"string"},"meta":{"description":"Request metadata (present for handled AppErrors)","type":"object","properties":{"requestId":{"type":"string","description":"Unique request identifier"},"documentation":{"description":"Link to error documentation","type":"string"}},"required":["requestId"],"additionalProperties":false}},"required":["success","error"],"additionalProperties":false},"ErrorDetail":{"type":"object","properties":{"field":{"type":"string","description":"Field that caused the error"},"code":{"type":"string","description":"Machine-readable code for this detail"},"message":{"type":"string","description":"Human-readable detail message"},"localizedMessage":{"description":"Localized detail message","type":"string"},"locale":{"description":"Locale of the localized message","type":"string"},"value":{"description":"Invalid value provided"}},"required":["field","code","message"],"additionalProperties":false},"Member":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Member email address"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Unique username"},"fullName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Full name"},"avatarUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Avatar URL"},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Last activity timestamp"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Account creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Additional metadata"},"onboardingCompleted":{"type":"boolean","description":"Whether onboarding is completed (computed field)"},"onboardingStep":{"type":"string","enum":["not-started","personal-intro","areas","goals","completed"],"description":"Current onboarding step"},"onboardingFlowVersion":{"type":"number","description":"Onboarding flow version"},"onboardingStartedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"When onboarding started"},"onboardingCompletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"When onboarding was completed"},"onboardingCheckpoint":{"type":"string","enum":["personal-intro","greeting","compounding","areas-intro","areas","ai-personalize","notifications","all-set","completed"],"description":"Exact flow-v2 checkpoint (the next screen to display)"},"onboardingRevision":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Onboarding state revision"},"onboardingSessionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"AI personalization session attached at ai-personalize"},"onboardingUpdatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last onboarding state change"}},"required":["id","email","username","fullName","avatarUrl","lastSeenAt","createdAt","updatedAt","metadata","onboardingCompleted","onboardingStep","onboardingFlowVersion","onboardingStartedAt","onboardingCompletedAt","onboardingCheckpoint","onboardingRevision","onboardingSessionId","onboardingUpdatedAt"],"additionalProperties":false,"description":"Member entity"},"MemberPreferences":{"type":"object","properties":{"theme":{"type":"string","enum":["light","dark","auto"],"description":"UI theme"},"notifications":{"description":"Validated, versioned notification preferences","$ref":"#/components/schemas/NotificationPreferences"},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Additional settings"}},"required":["theme","notifications","settings"],"additionalProperties":false,"description":"Member preferences (effective view)"},"NotificationPreferences":{"type":"object","properties":{"version":{"type":"number","const":1},"activity_tracking":{"default":true,"type":"boolean"},"channels":{"type":"object","properties":{"push":{"type":"boolean"},"email":{"default":false,"type":"boolean"}},"required":["push","email"],"additionalProperties":{}},"categories":{"type":"object","properties":{"task_due":{"type":"boolean"},"task_reminders":{"type":"boolean"},"habit_reminders":{"type":"boolean"},"daily_digest":{"type":"boolean"},"agent_nudges":{"type":"boolean"},"goal_check_ins":{"default":true,"type":"boolean"},"approval_requests":{"default":true,"type":"boolean"},"weekly_review":{"default":false,"type":"boolean"}},"required":["task_due","task_reminders","habit_reminders","daily_digest","agent_nudges","goal_check_ins","approval_requests","weekly_review"],"additionalProperties":{}},"quietHours":{"type":"object","properties":{"enabled":{"type":"boolean"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["enabled","start","end"],"additionalProperties":{}},"timezone":{"type":"string"}},"required":["version","activity_tracking","channels","categories","quietHours","timezone"],"additionalProperties":{},"description":"Validated, versioned notification preferences (always coerced to v1 on read)"},"AccountDeletionStatus":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Erasure request id"},"state":{"type":"string","enum":["pending","erasing","completed","quarantined"],"description":"Lifecycle state of the erasure"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"When deletion was confirmed"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"When every erasure step finished, or null"},"steps":{"type":"object","properties":{"accessRevoked":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"clerkErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"outboxQuiesced":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"billingErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"analyticsErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"chatErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"ragErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"objectsErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"agentErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"agentMastraErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"coreApiErased":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["accessRevoked","clerkErased","outboxQuiesced","billingErased","analyticsErased","chatErased","ragErased","objectsErased","agentErased","agentMastraErased","coreApiErased"],"additionalProperties":false,"description":"Per-component completion timestamps; null means not yet done"},"incomplete":{"type":"array","items":{"type":"string"},"description":"Classes of erasure that could NOT be completed (e.g. a provider grant with no revocation endpoint). Empty means everything we committed to was erased."}},"required":["requestId","state","requestedAt","completedAt","steps","incomplete"],"additionalProperties":false,"description":"Progress and honesty record for an account-erasure request"},"OnboardingStatus":{"type":"object","properties":{"onboardingCompleted":{"type":"boolean","description":"Whether onboarding is completed"},"onboardingStep":{"type":"string","enum":["not-started","personal-intro","areas","goals","completed"],"description":"Current onboarding step"},"onboardingStartedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"When onboarding started"},"onboardingCompletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"When onboarding was completed"},"onboardingCheckpoint":{"type":"string","enum":["personal-intro","greeting","compounding","areas-intro","areas","ai-personalize","notifications","all-set","completed"],"description":"Exact flow-v2 checkpoint (the next screen to display)"},"onboardingRevision":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Onboarding state revision"},"onboardingSessionId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"AI personalization session attached at ai-personalize"},"onboardingUpdatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last onboarding state change"},"flowVersion":{"type":"number","const":2,"description":"Version of the onboarding flow"},"availableSteps":{"type":"array","items":{"type":"string"},"description":"Available steps in this flow"},"availableCheckpoints":{"type":"array","items":{"type":"string","enum":["personal-intro","greeting","compounding","areas-intro","areas","ai-personalize","notifications","all-set","completed"]},"description":"Ordered flow-v2 checkpoints"}},"required":["onboardingCompleted","onboardingStep","onboardingStartedAt","onboardingCompletedAt","onboardingCheckpoint","onboardingRevision","onboardingSessionId","onboardingUpdatedAt","flowVersion","availableSteps","availableCheckpoints"],"additionalProperties":false,"description":"Member onboarding status"},"OnboardingCheckpointConflictResponse":{"type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Indicates failed operation"},"error":{"type":"object","properties":{"code":{"type":"string","const":"CONFLICT","description":"Checkpoint conflict error code"},"message":{"type":"string","description":"Human-readable error message"},"type":{"type":"string","const":"conflict_error","description":"Checkpoint conflict error category"},"details":{"description":"Field-level validation errors","type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}},"context":{"type":"object","properties":{"latest":{"$ref":"#/components/schemas/OnboardingStatus"},"stack":{"description":"Development-only stack trace; never present in production","type":"string"}},"required":["latest"],"additionalProperties":false}},"required":["code","message","type","context"],"additionalProperties":false},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"timestamp":{"description":"ISO 8601 timestamp","type":"string"},"path":{"description":"Request path","type":"string"},"meta":{"description":"Request metadata (present for handled AppErrors)","type":"object","properties":{"requestId":{"type":"string","description":"Unique request identifier"},"documentation":{"description":"Link to error documentation","type":"string"}},"required":["requestId"],"additionalProperties":false}},"required":["success","error"],"additionalProperties":false,"description":"Checkpoint conflict response carrying the complete canonical onboarding status"},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true,"description":"Indicates successful operation"},"data":{"description":"Response data"},"meta":{"$ref":"#/components/schemas/SuccessMetadata"},"listMeta":{"$ref":"#/components/schemas/ListMetadata"},"pagination":{"$ref":"#/components/schemas/PaginationInfo"},"links":{"$ref":"#/components/schemas/LinkInfo"},"correlationId":{"description":"Correlation ID for request tracking","type":"string"},"path":{"description":"Request path","type":"string"}},"required":["success","data"],"additionalProperties":false},"MemberStatusResponse":{"type":"object","properties":{"status":{"type":"string","enum":["productive","sick","on_vacation"],"description":"Effective current status (after lazy auto-revert)"},"since":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Member-local date the current period began (or today if none)"},"until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}],"description":"Member-local auto-revert date the member picked, or null"},"isFrozen":{"type":"boolean","description":"Whether the effective status is a freeze status (sick / on_vacation)"}},"required":["status","since","until","isFrozen"],"additionalProperties":false,"description":"Member productivity status"},"MemberStatusPeriod":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Period UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"status":{"type":"string","enum":["productive","sick","on_vacation"],"description":"Status for this period"},"startedOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Member-local date the period began"},"endedOn":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}],"description":"Member-local date the period closed (null = ongoing)"},"plannedUntil":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}],"description":"Member-local auto-revert date, or null"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional note"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"}},"required":["id","memberId","status","startedOn","endedOn","plannedUntil","note","createdAt","updatedAt"],"additionalProperties":false,"description":"A single member productivity status period"},"Goal":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"title":{"type":"string","description":"Goal title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Goal description"},"status":{"type":"string","enum":["not_started","in_progress","on_hold","completed"],"description":"Goal status"},"priority":{"type":"string","enum":["low","medium","high","critical"],"description":"Priority level"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Due date (target date)"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Completion timestamp"},"horizon":{"anyOf":[{"type":"string","enum":["someday","year","quarter","month","date"]},{"type":"null"}],"description":"Time horizon"},"metricKind":{"anyOf":[{"type":"string","enum":["number","currency","boolean"]},{"type":"null"}],"description":"Outcome metric kind"},"metricDirection":{"anyOf":[{"type":"string","enum":["reach","increase","decrease","maintain"]},{"type":"null"}],"description":"Outcome metric direction"},"metricUnit":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Metric unit"},"metricStart":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric value at creation / last re-scope"},"metricTarget":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric target value"},"metricCurrent":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Denormalized latest metric value"},"outcome":{"anyOf":[{"type":"string","enum":["achieved","released"]},{"type":"null"}],"description":"Terminal outcome"},"reflection":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reflection captured at close"},"checkinCadence":{"anyOf":[{"type":"string","enum":["weekly","biweekly","monthly","off"]},{"type":"null"}],"description":"Check-in prompt cadence"},"lastCheckinAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Last check-in timestamp"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Additional metadata"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"}},"required":["id","memberId","areaId","title","description","status","priority","dueDate","completedAt","horizon","metricKind","metricDirection","metricUnit","metricStart","metricTarget","metricCurrent","outcome","reflection","checkinCadence","lastCheckinAt","metadata","createdAt","updatedAt"],"additionalProperties":false,"description":"Goal entity"},"GoalProgress":{"type":"object","properties":{"effort":{"anyOf":[{"$ref":"#/components/schemas/GoalEffortSignal"},{"type":"null"}],"description":"Habit adherence; null when the goal has no active linked habits"},"outcome":{"anyOf":[{"$ref":"#/components/schemas/GoalOutcomeSignal"},{"type":"null"}],"description":"Metric progress; null when no metric is configured"},"execution":{"anyOf":[{"$ref":"#/components/schemas/GoalExecutionSignal"},{"type":"null"}],"description":"Structural rollup; null when the goal has no tasks or projects"},"pace":{"anyOf":[{"type":"string","enum":["ahead","on_pace","behind"]},{"type":"null"}],"description":"Pace vs target date; null when no due date or nothing to measure"},"lastCheckinAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"ISO 8601 timestamp of the last check-in"},"nextCheckinDue":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"ISO 8601 timestamp of the next check-in due (null if cadence off/unset)"}},"required":["effort","outcome","execution","pace","lastCheckinAt","nextCheckinDue"],"additionalProperties":false,"description":"Combined goal progress signals (RFC §3.2)"},"GoalEffortSignal":{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1,"description":"Trailing habit adherence, 0..1"},"daysMet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Actual check-ins in the window (the \"n\" in \"n of m days\")"},"daysExpected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Expected occurrences in the window, rounded (the \"m\")"},"habitCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of active linked habits"},"window":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Adherence window in days (28)"}},"required":["value","daysMet","daysExpected","habitCount","window"],"additionalProperties":false,"description":"Effort (habit adherence) signal"},"GoalOutcomeSignal":{"type":"object","properties":{"value":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}],"description":"Metric progress 0..1; null for the maintain direction"},"current":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Latest metric reading, or null before any check-in sets it"},"target":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Metric target"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Metric unit"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Metric direction"},"inBand":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"maintain only: within ±tolerance of target (null otherwise)"}},"required":["value","current","target","unit","direction","inBand"],"additionalProperties":false,"description":"Outcome (metric) signal"},"GoalExecutionSignal":{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1,"description":"Structural completion, 0..1"},"tasksDone":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Completed direct tasks"},"tasksTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total direct tasks"},"projectCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Linked projects folded into value"}},"required":["value","tasksDone","tasksTotal","projectCount"],"additionalProperties":false,"description":"Execution (structural rollup) signal"},"GoalCascadeResult":{"type":"object","properties":{"areas":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Areas soft-deleted (always 0 for a goal delete)"},"goals":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Goals soft-deleted (includes the goal itself)"},"projects":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Projects soft-deleted"},"habits":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Habits soft-deleted"},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tasks (incl. subtasks) soft-deleted"},"kept":{"description":"Children preserved from the cascade (present only with a keep-set)","type":"object","properties":{"goals":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Goals preserved (unlinked)"},"projects":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Projects preserved (unlinked)"},"habits":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Habits preserved (unlinked)"},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tasks preserved (unlinked)"}},"required":["goals","projects","habits","tasks"],"additionalProperties":false}},"required":["areas","goals","projects","habits","tasks"],"additionalProperties":false,"description":"Per-entity counts of what a goal delete cascaded"},"GoalActivity":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Activity ID"},"goalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"activityType":{"type":"string","description":"Type of activity"},"previousValue":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Previous values before change"},"newValue":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"New values after change"},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Additional metadata"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Activity timestamp"}},"required":["id","goalId","memberId","activityType","previousValue","newValue","metadata","createdAt"],"additionalProperties":false,"description":"Goal activity log entry"},"GoalCheckIn":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Check-in UUID"},"goalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"feeling":{"type":"string","enum":["on_track","unsure","off_track"],"description":"How the member feels about the goal"},"metricValue":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Latest metric reading, if provided"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional free-text note"},"source":{"type":"string","enum":["manual","prompted","agent"],"description":"How the check-in was initiated"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Check-in timestamp"}},"required":["id","goalId","memberId","feeling","metricValue","note","source","createdAt"],"additionalProperties":false,"description":"Goal check-in log entry"},"Area":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"name":{"type":"string","description":"Area name"},"intention":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area intention"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area color name"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tabler icon slug (e.g. \"barbell\", \"ball-basketball\"). Emoji is supported as an explicit member choice."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"}},"required":["id","memberId","name","intention","color","icon","createdAt","updatedAt","deletedAt"],"additionalProperties":false,"description":"Area entity for organizing goals"},"AreaWithCounts":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"name":{"type":"string","description":"Area name"},"intention":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area intention"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area color name"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tabler icon slug (e.g. \"barbell\", \"ball-basketball\"). Emoji is supported as an explicit member choice."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"},"goalCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of non-completed goals in this area"},"projectCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of non-completed projects in this area"},"taskCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of incomplete tasks in this area"},"habitCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of active habits in this area"}},"required":["id","memberId","name","intention","color","icon","createdAt","updatedAt","deletedAt","goalCount","projectCount","taskCount","habitCount"],"additionalProperties":false,"description":"Area entity with aggregated counts for goals, projects, tasks, and habits"},"AreaCascadeResult":{"type":"object","properties":{"areas":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Areas soft-deleted (always 1)"},"goals":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Goals soft-deleted"},"projects":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Projects soft-deleted"},"habits":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Habits soft-deleted"},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tasks (incl. subtasks) soft-deleted"},"kept":{"description":"Children preserved from the cascade (present only with a keep-set)","type":"object","properties":{"goals":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Goals preserved (unlinked)"},"projects":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Projects preserved (unlinked)"},"habits":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Habits preserved (unlinked)"},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tasks preserved (unlinked)"}},"required":["goals","projects","habits","tasks"],"additionalProperties":false}},"required":["areas","goals","projects","habits","tasks"],"additionalProperties":false,"description":"Per-entity counts of what an area delete cascaded or preserved"},"Task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent task UUID for subtask hierarchy"},"title":{"type":"string","description":"Task title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Task description"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated project UUID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated goal UUID"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"areaName":{"description":"Resolved parent area name (derived, present on single-task responses)","anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}],"description":"Priority level"},"sortRank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Sort rank for ordering among siblings"},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Planned duration in minutes (null = unset)"},"due":{"description":"Due date with timezone support","$ref":"#/components/schemas/DateMetadata"},"recurrence":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable recurrence label (e.g., \"Daily\", \"Weekly\", \"3x/week\")"},"completedAtUtc":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Completion timestamp"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Task tags (null when the task has no tags)"},"isCompleted":{"type":"boolean","description":"Completion status"},"sourceProvenance":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["mail_message","calendar_event"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string","minLength":1,"maxLength":1000},"sourceUrl":{"type":"string","maxLength":4000,"format":"uri"},"label":{"type":"string","maxLength":200}},"required":["kind","connectionId","externalId"],"additionalProperties":false},{"type":"null"}],"description":"Connected source this task was derived from"},"subtaskCount":{"description":"Number of direct subtasks","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subtaskCompletedCount":{"description":"Number of completed direct subtasks","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"revision":{"description":"Exact opaque PostgreSQL task revision, present on single-task responses; echo unchanged in operation-mode If-Match","type":"string"}},"required":["id","memberId","parentTaskId","title","description","projectId","goalId","areaId","priority","sortRank","durationMinutes","due","recurrence","completedAtUtc","tags","isCompleted","sourceProvenance","createdAt","updatedAt"],"additionalProperties":false,"description":"Task entity with enhanced date handling"},"DateMetadata":{"anyOf":[{"type":"object","properties":{"allDay":{"type":"boolean","description":"Whether this is an all-day date"},"utc":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"UTC timestamp"},"localDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Local date (YYYY-MM-DD) for all-day tasks"},"intendedTz":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"IANA timezone identifier"},"timeBehavior":{"type":"string","enum":["pinned","floating"],"description":"Time behavior (pinned to location or floating with user)"}},"required":["allDay","utc","localDate","intendedTz","timeBehavior"],"additionalProperties":false},{"type":"null"}],"description":"Date with timezone and granularity metadata"},"TaskStatistics":{"type":"object","properties":{"total":{"type":"number","description":"Total number of tasks"},"completed":{"type":"number","description":"Number of completed tasks"},"pending":{"type":"number","description":"Number of pending tasks"},"overdue":{"type":"number","description":"Number of overdue tasks"},"upcoming":{"type":"number","description":"Number of upcoming tasks"},"highPriority":{"type":"number","description":"Number of high/critical priority tasks"}},"required":["total","completed","pending","overdue","upcoming","highPriority"],"additionalProperties":false,"description":"Task statistics"},"PriorityStatistics":{"type":"object","properties":{"critical":{"type":"number","description":"Number of critical pending tasks"},"high":{"type":"number","description":"Number of high priority pending tasks"},"medium":{"type":"number","description":"Number of medium priority pending tasks"},"low":{"type":"number","description":"Number of low priority pending tasks"}},"required":["critical","high","medium","low"],"additionalProperties":false,"description":"Task count by priority"},"TaskCascade":{"type":"object","properties":{"areas":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Areas soft-deleted (always 0 for a task delete)"},"goals":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Goals soft-deleted (always 0 for a task delete)"},"projects":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Projects soft-deleted (always 0 for a task delete)"},"habits":{"description":"Habits soft-deleted (always 0 for a task delete)","type":"integer","minimum":0,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tasks soft-deleted (the task itself + all nested subtasks)"},"kept":{"description":"Children preserved from the cascade (present only with a keep-set)","type":"object","properties":{"goals":{"type":"integer","minimum":0,"maximum":9007199254740991},"projects":{"type":"integer","minimum":0,"maximum":9007199254740991},"habits":{"type":"integer","minimum":0,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["goals","projects","habits","tasks"],"additionalProperties":false}},"required":["areas","goals","projects","tasks"],"additionalProperties":false,"description":"Per-entity counts of what a task delete cascaded"},"TaskSeriesResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Series identifier"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Template task this series recurs from"},"rruleText":{"type":"string","description":"RFC-5545 RRULE string"},"rruleDescription":{"type":"string","description":"Human-readable rendering of the RRULE"},"rdates":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Additional inclusion dates"},"exdates":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Excluded dates"},"intendedTz":{"type":"string","description":"IANA timezone the series is anchored in"},"anchor":{"type":"object","properties":{"allDay":{"type":"boolean"},"utc":{"anyOf":[{"type":"string","description":"ISO-8601 timestamp"},{"type":"null"}]},"localTime":{"anyOf":[{"type":"string"},{"type":"null"}]},"localDate":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["allDay","utc","localTime","localDate"],"additionalProperties":false},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"missedPolicy":{"type":"string","description":"skip | catch_up | roll_forward"},"createdAt":{"type":"string","description":"ISO-8601 timestamp"},"updatedAt":{"type":"string","description":"ISO-8601 timestamp"}},"required":["id","taskId","rruleText","rruleDescription","rdates","exdates","intendedTz","anchor","durationMinutes","missedPolicy","createdAt","updatedAt"],"additionalProperties":false,"description":"A recurring task series"},"OccurrenceWithTaskResponse":{"type":"object","properties":{"date":{"type":"string","description":"ISO-8601 timestamp"},"localDate":{"type":"string"},"task":{"type":"object","properties":{},"additionalProperties":{},"description":"Task as rendered by the shared task formatter"},"occurrence":{"anyOf":[{"$ref":"#/components/schemas/TaskOccurrenceResponse"},{"type":"null"}]},"isOverride":{"type":"boolean"},"isException":{"type":"boolean"}},"required":["date","localDate","task","occurrence","isOverride","isException"],"additionalProperties":false,"description":"A generated occurrence paired with its (possibly overridden) task"},"TaskOccurrenceResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Occurrence identifier"},"seriesId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Owning series"},"occurrenceDate":{"type":"string","description":"Local date of this occurrence (YYYY-MM-DD)"},"occurrenceUtc":{"anyOf":[{"type":"string","description":"ISO-8601 timestamp"},{"type":"null"}]},"status":{"type":"string","description":"open | done | skipped"},"taskInstance":{"anyOf":[{"type":"object","properties":{},"additionalProperties":{}},{"type":"null"}]},"overrides":{"type":"object","properties":{"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"due":{"anyOf":[{"type":"object","properties":{"allDay":{"type":"boolean"},"utc":{"anyOf":[{"type":"string","description":"ISO-8601 timestamp"},{"type":"null"}]},"localDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"intendedTz":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["allDay","utc","localDate","intendedTz"],"additionalProperties":false},{"type":"null"}]}},"additionalProperties":false,"description":"Per-occurrence overrides; absent keys inherit the template task"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAtUtc":{"anyOf":[{"type":"string","description":"ISO-8601 timestamp"},{"type":"null"}]}},"required":["id","seriesId","occurrenceDate","occurrenceUtc","status","taskInstance","overrides","notes","completedAtUtc"],"additionalProperties":false,"description":"A single materialised occurrence of a recurring task"},"NextOccurrenceResponse":{"type":"object","properties":{"nextOccurrence":{"anyOf":[{"type":"string","description":"ISO-8601 timestamp"},{"type":"null"}],"description":"Null when the task is not recurring"}},"required":["nextOccurrence"],"additionalProperties":false},"RecurrenceDescriptionResponse":{"type":"object","properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable recurrence; null when the task is not recurring"}},"required":["description"],"additionalProperties":false},"Project":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"name":{"type":"string","description":"Project name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project description"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"deadline":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project deadline (YYYY-MM-DD)"},"status":{"type":"string","enum":["not_started","in_progress","on_hold","completed"],"description":"Project status"},"progress":{"type":"number","description":"Manual progress value (0-100)"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"}},"required":["id","memberId","name","description","areaId","deadline","status","progress","createdAt","updatedAt"],"additionalProperties":false,"description":"Project entity for organizing tasks"},"ProjectStats":{"type":"object","properties":{"total":{"type":"number","description":"Total projects"},"notStarted":{"type":"number","description":"Projects not started"},"inProgress":{"type":"number","description":"Projects in progress"},"onHold":{"type":"number","description":"Projects on hold"},"completed":{"type":"number","description":"Completed projects"},"overdue":{"type":"number","description":"Overdue projects"}},"required":["total","notStarted","inProgress","onHold","completed","overdue"],"additionalProperties":false,"description":"Project statistics for member"},"ProjectWithProgress":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"name":{"type":"string","description":"Project name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project description"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"deadline":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project deadline (YYYY-MM-DD)"},"status":{"type":"string","enum":["not_started","in_progress","on_hold","completed"],"description":"Project status"},"progress":{"type":"number","description":"Manual progress value (0-100)"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"goalIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Associated goal UUIDs"},"goals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"title":{"type":"string","description":"Goal title"}},"required":["id","title"],"additionalProperties":false},"description":"Associated goals with titles"},"daysRemaining":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Days until deadline (negative = overdue, null = no deadline)"},"isOverdue":{"type":"boolean","description":"Whether project is past deadline and not completed"},"calculatedProgress":{"type":"object","properties":{"totalTasks":{"type":"number","description":"Total number of tasks"},"completedTasks":{"type":"number","description":"Number of completed tasks"},"incompleteTasks":{"type":"number","description":"Number of incomplete tasks"},"percentage":{"type":"number","description":"Completion percentage"}},"required":["totalTasks","completedTasks","incompleteTasks","percentage"],"additionalProperties":false,"description":"Progress calculated from linked tasks"}},"required":["id","memberId","name","description","areaId","deadline","status","progress","createdAt","updatedAt","goalIds","goals","daysRemaining","isOverdue","calculatedProgress"],"additionalProperties":false,"description":"Project with calculated progress from tasks"},"ProjectWithGoals":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"name":{"type":"string","description":"Project name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project description"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"deadline":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project deadline (YYYY-MM-DD)"},"status":{"type":"string","enum":["not_started","in_progress","on_hold","completed"],"description":"Project status"},"progress":{"type":"number","description":"Manual progress value (0-100)"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"goalIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Associated goal UUIDs"}},"required":["id","memberId","name","description","areaId","deadline","status","progress","createdAt","updatedAt","goalIds"],"additionalProperties":false,"description":"Project entity including linked goal UUIDs"},"ProjectDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"name":{"type":"string","description":"Project name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project description"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"deadline":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project deadline (YYYY-MM-DD)"},"status":{"type":"string","enum":["not_started","in_progress","on_hold","completed"],"description":"Project status"},"progress":{"type":"number","description":"Manual progress value (0-100)"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"goalIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Associated goal UUIDs"},"goals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"title":{"type":"string","description":"Goal title"}},"required":["id","title"],"additionalProperties":false},"description":"Associated goals with titles"},"calculatedProgress":{"type":"object","properties":{"totalTasks":{"type":"number","description":"Total number of tasks"},"completedTasks":{"type":"number","description":"Number of completed tasks"},"percentage":{"type":"number","description":"Completion percentage"}},"required":["totalTasks","completedTasks","percentage"],"additionalProperties":false,"description":"Progress calculated from linked tasks"}},"required":["id","memberId","name","description","areaId","deadline","status","progress","createdAt","updatedAt","goalIds","goals","calculatedProgress"],"additionalProperties":false,"description":"Project with goal links and calculated progress"},"ProjectTask":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent task UUID (subtasks)"},"title":{"type":"string","description":"Task title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Task description"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Project UUID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated goal UUID"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}],"description":"Task priority"},"sortRank":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Manual sort rank"},"dueAllDay":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the due date is all-day"},"dueAtUtc":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Due date in UTC"},"dueLocalDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Local due date (YYYY-MM-DD)"},"dueIntendedTz":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Intended timezone for the due date"},"dueTimeBehavior":{"anyOf":[{"type":"string","enum":["pinned","floating"]},{"type":"null"}],"description":"Due-time behavior"},"completedAtUtc":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Completion timestamp in UTC"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Task tags"},"isCompleted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether task is completed"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft-delete timestamp"},"deletedWithParentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent id this task was cascade-deleted with"},"deletedWithParentType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parent type this task was cascade-deleted with"},"rruleText":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Recurrence rule text (from linked task series)"}},"required":["id","memberId","parentTaskId","title","description","projectId","goalId","areaId","priority","sortRank","dueAllDay","dueAtUtc","dueLocalDate","dueIntendedTz","dueTimeBehavior","completedAtUtc","tags","isCompleted","createdAt","updatedAt","deletedAt","deletedWithParentId","deletedWithParentType","rruleText"],"additionalProperties":false,"description":"Task entity within a project"},"ProjectProgress":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"progress":{"type":"object","properties":{"totalTasks":{"type":"number","description":"Total number of tasks"},"completedTasks":{"type":"number","description":"Number of completed tasks"},"percentage":{"type":"number","description":"Completion percentage"}},"required":["totalTasks","completedTasks","percentage"],"additionalProperties":false},"taskStats":{"type":"object","properties":{"total":{"type":"number","description":"Total tasks"},"completed":{"type":"number","description":"Completed tasks"},"pending":{"type":"number","description":"Pending tasks"},"overdue":{"type":"number","description":"Overdue tasks"},"highPriority":{"type":"number","description":"High priority tasks"}},"required":["total","completed","pending","overdue","highPriority"],"additionalProperties":false}},"required":["projectId","progress","taskStats"],"additionalProperties":false,"description":"Project progress and task statistics"},"Habit":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated goal UUID"},"name":{"type":"string","description":"Habit name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Habit description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Habit category"},"frequency":{"type":"string","enum":["daily","weekly","monthly"],"description":"Habit frequency"},"targetCount":{"type":"number","description":"Target completions per period"},"currentStreak":{"type":"number","description":"Current streak count"},"longestStreak":{"type":"number","description":"Longest streak achieved"},"xpReward":{"type":"number","description":"XP reward for completion"},"reminderTime":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reminder time (HH:MM)"},"isActive":{"type":"boolean","description":"Whether habit is active"},"recurrenceRule":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RFC 5545 RRULE string (without DTSTART). When provided, supersedes `frequency`."},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Phosphor icon slug (e.g. \"barbell\", \"book-open\") or an emoji."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"},"areaName":{"description":"Resolved parent area name (derived enrichment; present on create/get/update/list responses, null when the habit has no area, absent on search/deleted/restore responses).","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","memberId","areaId","goalId","name","description","category","frequency","targetCount","currentStreak","longestStreak","xpReward","reminderTime","isActive","recurrenceRule","icon","createdAt","updatedAt","deletedAt"],"additionalProperties":false,"description":"Habit entity for tracking recurring behaviors"},"HabitWithStats":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated area UUID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated goal UUID"},"name":{"type":"string","description":"Habit name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Habit description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Habit category"},"frequency":{"type":"string","enum":["daily","weekly","monthly"],"description":"Habit frequency"},"targetCount":{"type":"number","description":"Target completions per period"},"currentStreak":{"type":"number","description":"Current streak count"},"longestStreak":{"type":"number","description":"Longest streak achieved"},"xpReward":{"type":"number","description":"XP reward for completion"},"reminderTime":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reminder time (HH:MM)"},"isActive":{"type":"boolean","description":"Whether habit is active"},"recurrenceRule":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RFC 5545 RRULE string (without DTSTART). When provided, supersedes `frequency`."},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Phosphor icon slug (e.g. \"barbell\", \"book-open\") or an emoji."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"},"areaName":{"description":"Resolved parent area name (derived enrichment; present on create/get/update/list responses, null when the habit has no area, absent on search/deleted/restore responses).","anyOf":[{"type":"string"},{"type":"null"}]},"stats":{"type":"object","properties":{"totalCheckIns":{"type":"number","description":"Total check-ins"},"currentStreak":{"type":"number","description":"Current streak"},"longestStreak":{"type":"number","description":"Longest streak"},"completionRate":{"type":"number","description":"Completion rate percentage"}},"required":["totalCheckIns","currentStreak","longestStreak","completionRate"],"additionalProperties":false}},"required":["id","memberId","areaId","goalId","name","description","category","frequency","targetCount","currentStreak","longestStreak","xpReward","reminderTime","isActive","recurrenceRule","icon","createdAt","updatedAt","deletedAt","stats"],"additionalProperties":false,"description":"Habit with statistics"},"DeletedResponse":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"ID of deleted resource"},"deletedAt":{"type":"string","description":"ISO 8601 timestamp of deletion"},"softDelete":{"description":"Whether soft delete was used","type":"boolean"}},"required":["id","deletedAt"],"additionalProperties":false},"HabitStats":{"type":"object","properties":{"habitId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"totalCheckIns":{"type":"number","description":"Total check-ins"},"currentStreak":{"type":"number","description":"Current streak"},"longestStreak":{"type":"number","description":"Longest streak"},"completionRate":{"type":"number","description":"Completion rate percentage"}},"required":["habitId","totalCheckIns","currentStreak","longestStreak","completionRate"],"additionalProperties":false,"description":"Habit statistics"},"HabitCheckIn":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Check-in UUID"},"habitId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"date":{"type":"string","description":"Check-in date (YYYY-MM-DD)"},"count":{"type":"number","description":"Number of completions"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Check-in notes"},"kind":{"type":"string","enum":["completed","rest"],"description":"Whether this check-in is a completion or a deliberate rest day."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"}},"required":["id","habitId","date","count","notes","kind","createdAt"],"additionalProperties":false,"description":"Habit check-in entry"},"TrashItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Entity ID"},"type":{"description":"Entity type","$ref":"#/components/schemas/TrashEntityType"},"name":{"type":"string","description":"Entity name/title"},"deletedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"When the entity was deleted"},"deletedWithParentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent ID if cascade deleted"},"deletedWithParentType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parent type if cascade deleted"},"descendantFolders":{"description":"Folder rows only — descendant folders this restore would bring back","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"descendantNotes":{"description":"Folder rows only — notes anywhere in the subtree this restore would bring back","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","type","name","deletedAt","deletedWithParentId","deletedWithParentType"],"additionalProperties":false,"description":"A deleted item in the trash"},"TrashStats":{"type":"object","properties":{"areas":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of deleted areas"},"goals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of deleted goals"},"projects":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of deleted projects"},"tasks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of deleted tasks"},"notes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of deleted notes"},"folders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of deleted folders. A cascaded subtree counts as ONE — descendants restore with their parent."},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total number of deleted items"},"oldestDeletionAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Oldest deletion timestamp"}},"required":["areas","goals","projects","tasks","notes","folders","total","oldestDeletionAt"],"additionalProperties":false,"description":"Statistics about items in trash"},"WeeklyShareCard":{"type":"object","properties":{"dateRange":{"type":"object","properties":{"start":{"type":"string","description":"Week start date (YYYY-MM-DD, Monday)"},"end":{"type":"string","description":"Week end date (YYYY-MM-DD, Sunday)"}},"required":["start","end"],"additionalProperties":false,"description":"Inclusive date range of the week"},"momentum":{"type":"object","properties":{"score":{"type":"integer","minimum":0,"maximum":100,"description":"Composite momentum score (0-100)"},"tier":{"type":"object","properties":{"key":{"type":"string","description":"Tier key (e.g. focused, balanced, needs_reset)"},"name":{"type":"string","description":"Human-readable tier name"},"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tier floor score"},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tier ceiling score"},"colorToken":{"type":"string","description":"Design-system color token for this tier"}},"required":["key","name","min","max","colorToken"],"additionalProperties":false,"description":"Named rank over the raw 0-100 score"},"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Score change vs the prior week (positive = improved)"}},"required":["score","tier","delta"],"additionalProperties":false,"description":"Momentum summary for the week"},"headline":{"type":"string","description":"AI-generated (or deterministic fallback) one-liner for the share card"},"habitConsistency":{"type":"object","properties":{"rate":{"type":"integer","minimum":0,"maximum":100,"description":"Habit adherence rate this week (0-100 %)"}},"required":["rate"],"additionalProperties":false,"description":"Habit consistency summary"},"topFocusArea":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"Area name"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area icon (nullable)"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area color token (nullable)"}},"required":["name","icon","color"],"additionalProperties":false},{"type":"null"}],"description":"The area with the most deep-focus minutes this week, or null"},"tasksDone":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tasks completed during the week"},"deepFocusMinutes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Total deep-focus minutes logged during the week"}},"required":["dateRange","momentum","headline","habitConsistency","topFocusArea","tasksDone","deepFocusMinutes"],"additionalProperties":false,"description":"Consolidated share-card payload for a member's weekly stats"},"Momentum":{"type":"object","properties":{"score":{"type":"integer","minimum":0,"maximum":100,"description":"Composite momentum score"},"band":{"type":"string","enum":["low","medium","high"],"description":"Traffic-light band"},"tier":{"type":"object","properties":{"key":{"type":"string","description":"Tier key (e.g. focused, balanced, needs_reset)"},"name":{"type":"string","description":"Human-readable tier name"},"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tier floor score"},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tier ceiling score"},"colorToken":{"type":"string","description":"Design-system color token for this tier"}},"required":["key","name","min","max","colorToken"],"additionalProperties":false,"description":"Named rank over the raw 0-100 score"},"directive":{"type":"string","description":"One growth-framed next-step"},"drivers":{"minItems":4,"maxItems":4,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["focus","completion","consistency","balance"],"description":"Driver key"},"label":{"type":"string","description":"Human-readable driver label"},"value":{"type":"number","description":"Driver sub-score (0-100)"},"baseline":{"type":"number","description":"Baseline anchor (50 = at your normal)"},"delta":{"type":"number","description":"value - baseline"}},"required":["key","label","value","baseline","delta"],"additionalProperties":false},"description":"The four named drivers"}},"required":["score","band","tier","directive","drivers"],"additionalProperties":false,"description":"Composite Momentum score with drivers"},"WeeklyReview":{"type":"object","properties":{"weekStart":{"type":"string","description":"Week start date (YYYY-MM-DD, Monday)"},"momentumTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Day (YYYY-MM-DD)"},"value":{"type":"number","description":"Momentum proxy value (0-100)"}},"required":["date","value"],"additionalProperties":false},"description":"Per-day momentum trend for the week"},"wins":{"type":"array","items":{"type":"string"},"description":"Encouraging callouts for the week"},"consistency":{"type":"object","properties":{"habitsChecked":{"type":"number","description":"Habit check-ins this week"},"habitsDue":{"type":"number","description":"Expected habit check-ins (active habits x 7)"},"rate":{"type":"number","description":"Adherence rate (0-1)"}},"required":["habitsChecked","habitsDue","rate"],"additionalProperties":false,"description":"Habit consistency summary"},"focusArea":{"type":"string","description":"One-line suggested focus area for next week"}},"required":["weekStart","momentumTrend","wins","consistency","focusArea"],"additionalProperties":false,"description":"Weekly Review payload"},"InsightResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Insight UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID"},"type":{"type":"string","enum":["daily_outlook","productivity_trend","recommendation","pattern_detection"],"description":"Insight type"},"priority":{"type":"string","enum":["low","medium","high","critical"],"description":"Priority level"},"title":{"type":"string","description":"Insight title"},"message":{"type":"string","description":"Insight message"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Icon identifier"},"gradient":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"CSS gradient class"},"theme":{"anyOf":[{"type":"string","enum":["time_morning","time_afternoon","time_evening","time_night","momentum","overload","slipping","streak","consistency","neglect","prioritize","focus","break_down","schedule","review","goal_progress","daily_outlook","all_clear","fresh_start","general"]},{"type":"null"}],"description":"Semantic theme discriminator that drives per-insight iconography (nullable for legacy rows)"},"actionItems":{"type":"array","items":{"$ref":"#/components/schemas/InsightActionItem"},"description":"Action items"},"entityReferences":{"description":"Related entities","$ref":"#/components/schemas/InsightEntityReferences"},"dataSnapshot":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Data snapshot"},"isRead":{"type":"boolean","description":"Read status"},"isDismissed":{"type":"boolean","description":"Dismissed status"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Expiration timestamp"},"generatedAt":{"type":"string","description":"Generation timestamp"},"readAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Read timestamp"},"dismissedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Dismissed timestamp"},"createdAt":{"type":"string","description":"Creation timestamp"},"updatedAt":{"type":"string","description":"Last update timestamp"}},"required":["id","memberId","type","priority","title","message","icon","gradient","theme","actionItems","entityReferences","dataSnapshot","isRead","isDismissed","expiresAt","generatedAt","readAt","dismissedAt","createdAt","updatedAt"],"additionalProperties":false,"description":"Insight response object"},"InsightActionItem":{"type":"object","properties":{"id":{"type":"string","description":"Action item ID"},"text":{"type":"string","description":"Action item text"},"priority":{"type":"string","enum":["low","medium","high"],"description":"Action priority"},"entityType":{"description":"Related entity type","type":"string","enum":["task","goal","project","area"]},"entityId":{"description":"Related entity ID","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","text","priority"],"additionalProperties":false,"description":"An actionable item within an insight"},"InsightEntityReferences":{"type":"object","properties":{"taskIds":{"description":"Referenced task IDs","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"goalIds":{"description":"Referenced goal IDs","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"projectIds":{"description":"Referenced project IDs","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"areaIds":{"description":"Referenced area IDs","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"additionalProperties":false,"description":"References to related entities"},"FlowStats":{"type":"object","properties":{"totalMinutes":{"type":"number","description":"Total focus minutes in range"},"sessionCount":{"type":"number","description":"Completed session count in range"},"avgProductivityRating":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Average productivity rating (1-5)"},"plannedVsActual":{"type":"object","properties":{"plannedMinutes":{"type":"number","description":"Sum of planned minutes"},"actualMinutes":{"type":"number","description":"Sum of actual minutes"}},"required":["plannedMinutes","actualMinutes"],"additionalProperties":false,"description":"Planned vs actual minute totals"},"byArea":{"type":"array","items":{"type":"object","properties":{"areaId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"areaName":{"type":"string","description":"Area name"},"minutes":{"type":"number","description":"Minutes spent on area"}},"required":["areaId","areaName","minutes"],"additionalProperties":false},"description":"Minutes rolled up by area"},"byHour":{"minItems":24,"maxItems":24,"type":"array","items":{"type":"object","properties":{"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Hour of day (UTC, 0-23)"},"minutes":{"type":"number","description":"Minutes in this hour"}},"required":["hour","minutes"],"additionalProperties":false},"description":"Contiguous 24-hour minute histogram"},"ratingDistribution":{"minItems":5,"maxItems":5,"type":"array","items":{"type":"object","properties":{"rating":{"type":"integer","minimum":1,"maximum":5,"description":"Productivity rating"},"count":{"type":"number","description":"Sessions with this rating"}},"required":["rating","count"],"additionalProperties":false},"description":"Rating distribution (1-5)"}},"required":["totalMinutes","sessionCount","avgProductivityRating","plannedVsActual","byArea","byHour","ratingDistribution"],"additionalProperties":false,"description":"Range-scoped flow analytics for the dashboard"},"Flow":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Session UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Session title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Session description"},"plannedDuration":{"type":"number","description":"Planned duration in minutes"},"actualDuration":{"type":"number","description":"Actual duration in minutes"},"startTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Session start time"},"endTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Session end time"},"status":{"type":"string","enum":["completed","cancelled"],"description":"Session status"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked area UUID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked goal UUID"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked project UUID"},"taskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Linked task UUID"},"productivityRating":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Self-rated productivity (1-5)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Post-session notes"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"}},"required":["id","memberId","title","description","plannedDuration","actualDuration","startTime","endTime","status","areaId","goalId","projectId","taskId","productivityRating","notes","createdAt","updatedAt","deletedAt"],"additionalProperties":false,"description":"Flow session entity for tracking focused work"},"TodayStats":{"type":"object","properties":{"totalSessions":{"type":"number","description":"Total sessions today"},"completedSessions":{"type":"number","description":"Completed sessions today"},"cancelledSessions":{"type":"number","description":"Cancelled sessions today"},"totalMinutes":{"type":"number","description":"Total minutes worked today"},"averageSessionDuration":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Average session duration in minutes"},"averageProductivityRating":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Average productivity rating"},"byProject":{"type":"array","items":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"projectName":{"type":"string","description":"Project name"},"minutes":{"type":"number","description":"Minutes spent on project"}},"required":["projectId","projectName","minutes"],"additionalProperties":false},"description":"Time breakdown by project"},"byGoal":{"type":"array","items":{"type":"object","properties":{"goalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"goalName":{"type":"string","description":"Goal name"},"minutes":{"type":"number","description":"Minutes spent on goal"}},"required":["goalId","goalName","minutes"],"additionalProperties":false},"description":"Time breakdown by goal"},"dailyGoal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Completed sessions per day the member aims for (settings.flow.dailySessionGoal, default 1)"},"currentStreak":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Consecutive local days meeting the daily goal; an unmet today does not break the streak"},"longestStreak":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Longest consecutive run of goal-met local days in history"},"goalMetToday":{"type":"boolean","description":"Whether today's completed sessions already meet the daily goal"}},"required":["totalSessions","completedSessions","cancelledSessions","totalMinutes","averageSessionDuration","averageProductivityRating","byProject","byGoal","dailyGoal","currentStreak","longestStreak","goalMetToday"],"additionalProperties":false,"description":"Today's flow session statistics"},"StatsTimeseriesResponse":{"type":"object","properties":{"metric":{"type":"string","enum":["completions","focus_minutes"],"description":"Metric requested"},"bucket":{"type":"string","enum":["day"],"description":"Bucket granularity"},"points":{"type":"array","items":{"$ref":"#/components/schemas/StatsTimeseriesPoint"},"description":"Gap-filled daily series"},"baseline":{"type":"number","description":"Mean of the gap-filled bucket values"}},"required":["metric","bucket","points","baseline"],"additionalProperties":false,"description":"Daily-bucketed metric series with baseline"},"StatsTimeseriesPoint":{"type":"object","properties":{"date":{"type":"string","description":"Bucket date (YYYY-MM-DD)"},"value":{"type":"number","description":"Metric value for this bucket"}},"required":["date","value"],"additionalProperties":false,"description":"A single daily bucket"},"StatsTimeOfDayResponse":{"type":"object","properties":{"metric":{"type":"string","enum":["completions","focus"],"description":"Metric requested"},"hours":{"minItems":24,"maxItems":24,"type":"array","items":{"$ref":"#/components/schemas/StatsHourPoint"},"description":"Contiguous 24-hour histogram"}},"required":["metric","hours"],"additionalProperties":false,"description":"Hour-of-day histogram for a metric"},"StatsHourPoint":{"type":"object","properties":{"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Hour of day (UTC, 0-23)"},"value":{"type":"number","description":"Metric value for this hour"}},"required":["hour","value"],"additionalProperties":false,"description":"A single hour-of-day bucket"},"StatsMetricsResponse":{"type":"object","properties":{"indices":{"type":"object","properties":{"output":{"$ref":"#/components/schemas/StatsMetricIndex"},"focus":{"$ref":"#/components/schemas/StatsMetricIndex"},"sustainability":{"$ref":"#/components/schemas/StatsMetricIndex"},"consistency":{"$ref":"#/components/schemas/StatsMetricIndex"}},"required":["output","focus","sustainability","consistency"],"additionalProperties":false,"description":"The four orthogonal indices"},"focusTargetMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Adaptive daily focus target (minutes)"},"directive":{"type":"string","description":"Single cross-index next step (sustainability-first)"},"guardrail":{"type":"string","enum":["none","rest"],"description":"Burnout override — 'rest' when Sustainability is in the low band"},"momentum":{"$ref":"#/components/schemas/StatsDeprecatedMomentum"},"calibration":{"$ref":"#/components/schemas/StatsCalibration"}},"required":["indices","focusTargetMin","directive","guardrail","momentum","calibration"],"additionalProperties":false,"description":"The four orthogonal productivity indices + directive + burnout guardrail + deprecated momentum composite"},"StatsMetricIndex":{"type":"object","properties":{"key":{"type":"string","enum":["output","focus","sustainability","consistency"],"description":"Index key"},"label":{"type":"string","description":"Display label, e.g. \"Sustainability\""},"value":{"type":"number","minimum":0,"maximum":100,"description":"0-100 vs the member's own baseline"},"baseline":{"type":"number","description":"Display anchor — always 50 (\"your normal range\")"},"delta":{"type":"number","description":"value - baseline"},"band":{"type":"string","enum":["low","moderate","high","optimal"],"description":"4-band scale: low 0-39, moderate 40-59, high 60-84, optimal 85-100"},"kind":{"type":"string","enum":["output","leading"],"description":"output = lagging (what got done); leading = predictive"},"signals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Raw inputs behind the score (keys vary per index)"},"trend":{"description":"Last <=14 persisted daily scores (oldest->newest, scored days only) — the sparkline series; empty/short until history accrues","type":"array","items":{"type":"number"}}},"required":["key","label","value","baseline","delta","band","kind","signals"],"additionalProperties":false,"description":"One orthogonal index, banded against the member baseline"},"StatsDeprecatedMomentum":{"type":"object","properties":{"score":{"type":"integer","minimum":0,"maximum":100,"description":"Composite momentum score (0-100)"},"band":{"type":"string","enum":["low","medium","high"],"description":"Traffic-light band"},"tier":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"colorToken":{"type":"string"}},"required":["key","name","min","max","colorToken"],"additionalProperties":false,"description":"Named rank over the raw score"},"directive":{"type":"string"},"drivers":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"},"baseline":{"type":"number"},"delta":{"type":"number"}},"required":["key","label","value","baseline","delta"],"additionalProperties":false}},"focusTargetMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["score","band","tier","directive","drivers","focusTargetMin"],"additionalProperties":false,"description":"Deprecated composite (retired in Phase 3)"},"StatsCalibration":{"type":"object","properties":{"status":{"type":"string","enum":["calibrating","calibrated"],"description":"`calibrating` until a baseline forms, then `calibrated` permanently"},"daysObserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Active days of data observed so far"},"daysTarget":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Time floor (days) before the reveal"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO timestamp of the reveal moment, or null while calibrating"},"confidence":{"type":"string","enum":["forming","good","high"],"description":"forming = calibrating; good = <28d history; high = >=28d history"},"activity":{"type":"object","properties":{"tasksCompleted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"focusMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"habitsKept":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tasksCompleted","focusMinutes","habitsKept","activeDays"],"additionalProperties":false,"description":"Raw-activity rollup for the \"getting to know you\" card"}},"required":["status","daysObserved","daysTarget","completedAt","confidence","activity"],"additionalProperties":false,"description":"Calibration phase status + raw-activity rollup"},"StatsTodayResponse":{"type":"object","properties":{"date":{"type":"string","description":"The day these rings summarise (YYYY-MM-DD)"},"habits":{"type":"object","properties":{"checked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Today's completed habit check-ins"},"due":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Active habits scheduled today (recurrence-aware)"}},"required":["checked","due"],"additionalProperties":false,"description":"Habits ring"},"tasks":{"type":"object","properties":{"completedToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tasks completed today"},"dueToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Tasks due today (timezone-aware, incl. all-day)"}},"required":["completedToday","dueToday"],"additionalProperties":false,"description":"Tasks ring"},"focus":{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Focus minutes logged today"},"targetMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Adaptive daily focus target (minutes)"}},"required":["minutes","targetMinutes"],"additionalProperties":false,"description":"Focus ring"},"consistency":{"type":"object","properties":{"score":{"type":"integer","minimum":0,"maximum":100,"description":"Consistency index (0-100)"},"bestStreak":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Longest current streak across active habits"}},"required":["score","bestStreak"],"additionalProperties":false,"description":"Consistency ring"},"momentum":{"type":"object","properties":{"score":{"type":"integer","minimum":0,"maximum":100,"description":"Composite momentum score (0-100)"},"band":{"type":"string","enum":["low","medium","high"],"description":"Traffic-light band"}},"required":["score","band"],"additionalProperties":false,"description":"Deprecated composite momentum — score + band for the glance badge"}},"required":["date","habits","tasks","focus","consistency","momentum"],"additionalProperties":false,"description":"Compact rings-today summary for the watch glance + complication"},"StatsAiUsageResponse":{"type":"object","properties":{"period":{"type":"object","properties":{"today":{"type":"string"},"monthStart":{"type":"string"},"monthEnd":{"type":"string"},"timezone":{"type":"string","const":"UTC"}},"required":["today","monthStart","monthEnd","timezone"],"additionalProperties":false},"meters":{"type":"object","properties":{"agentInteractions":{"type":"object","properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unit":{"type":"string","const":"calls"},"period":{"type":"string","const":"per day"}},"required":["used","limit","unit","period"],"additionalProperties":false},"aiCost":{"type":"object","properties":{"usedUsd":{"type":"number"},"limitUsd":{"anyOf":[{"type":"number"},{"type":"null"}]},"unit":{"type":"string","const":"usd"},"period":{"type":"string","const":"this month"}},"required":["usedUsd","limitUsd","unit","period"],"additionalProperties":false},"inputTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasoningTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agentInteractions","aiCost","inputTokens","outputTokens","reasoningTokens","totalTokens"],"additionalProperties":false},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"UTC date bucket (YYYY-MM-DD)"},"interactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Distinct agent runs in the bucket"},"costUsd":{"type":"number","description":"Estimated AI cost in USD"},"inputTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasoningTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","interactions","costUsd","inputTokens","outputTokens","reasoningTokens","totalTokens"],"additionalProperties":false}},"byRole":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","description":"Pipeline role, e.g. front_door or resolver"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Role-level ledger rows"},"costUsd":{"type":"number","description":"Estimated role cost in USD"},"inputTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reasoningTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["role","calls","costUsd","inputTokens","outputTokens","reasoningTokens","totalTokens"],"additionalProperties":false}}},"required":["period","meters","daily","byRole"],"additionalProperties":false,"description":"AI usage and estimated cost summary"},"Reminder":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Reminder UUID"},"taskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated task UUID"},"noteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Associated note UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"message":{"type":"string","description":"Reminder message"},"remindAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"When to trigger the reminder"},"status":{"type":"string","enum":["pending","triggered","dismissed"],"description":"Reminder status"},"sourceProvenance":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["mail_message","calendar_event"]},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalId":{"type":"string","minLength":1,"maxLength":1000},"sourceUrl":{"type":"string","maxLength":4000,"format":"uri"},"label":{"type":"string","maxLength":200}},"required":["kind","connectionId","externalId"],"additionalProperties":false},{"type":"null"}],"description":"Connected source this reminder was derived from"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"}},"required":["id","taskId","noteId","memberId","message","remindAt","status","sourceProvenance","createdAt","updatedAt"],"additionalProperties":false,"description":"Task reminder entity"},"SuggestedConnection":{"type":"object","properties":{"targetType":{"type":"string","enum":["area","goal","project","task","habit","note"],"description":"Candidate entity type"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Candidate entity UUID"},"title":{"type":"string","description":"Candidate entity title"},"score":{"type":"number","description":"Raw cosine similarity in [0, 1] (higher = more confident)"}},"required":["targetType","targetId","title","score"],"additionalProperties":false,"description":"A grounded candidate connection for a note (not yet applied)"},"Note":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"title":{"type":"string","description":"Note title (auto-derived from content unless overridden)"},"content":{"type":"string","description":"Markdown note body (raw text)"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Free-form tags"},"isArchived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the note is archived"},"folderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Owning knowledge folder; null is the virtual \"Unfiled\" bucket"},"position":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fractional index within the folder. Null until the note is first placed or dragged — sort `position ASC NULLS LAST, updatedAt DESC`. Compare byte-wise; never parse as a number."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"}},"required":["id","memberId","title","content","tags","isArchived","folderId","position","createdAt","updatedAt","deletedAt"],"additionalProperties":false,"description":"A note — a first-class peer medium connectable to any entity"},"NoteWithConnections":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"title":{"type":"string","description":"Note title (auto-derived from content unless overridden)"},"content":{"type":"string","description":"Markdown note body (raw text)"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Free-form tags"},"isArchived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the note is archived"},"folderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Owning knowledge folder; null is the virtual \"Unfiled\" bucket"},"position":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fractional index within the folder. Null until the note is first placed or dragged — sort `position ASC NULLS LAST, updatedAt DESC`. Compare byte-wise; never parse as a number."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"},"connections":{"type":"array","items":{"$ref":"#/components/schemas/NoteConnection"},"description":"Connections created with the note"}},"required":["id","memberId","title","content","tags","isArchived","folderId","position","createdAt","updatedAt","deletedAt","connections"],"additionalProperties":false,"description":"A note with the connections created alongside it"},"NoteConnection":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Connection UUID"},"noteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Owning note UUID"},"targetType":{"type":"string","enum":["area","goal","project","task","habit","note"],"description":"Connected entity type"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Connected entity UUID"},"targetName":{"description":"Display name of the target entity (area/project/habit → name, goal/task/note → title). Absent when the target was since-deleted.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"}},"required":["id","noteId","targetType","targetId","createdAt"],"additionalProperties":false,"description":"A polymorphic connection from a note to another entity"},"NoteWithRelations":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"title":{"type":"string","description":"Note title (auto-derived from content unless overridden)"},"content":{"type":"string","description":"Markdown note body (raw text)"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Free-form tags"},"isArchived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the note is archived"},"folderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Owning knowledge folder; null is the virtual \"Unfiled\" bucket"},"position":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fractional index within the folder. Null until the note is first placed or dragged — sort `position ASC NULLS LAST, updatedAt DESC`. Compare byte-wise; never parse as a number."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"},"connections":{"type":"array","items":{"$ref":"#/components/schemas/NoteConnection"},"description":"Outgoing connections from this note"},"backlinks":{"type":"array","items":{"$ref":"#/components/schemas/Note"},"description":"Other notes that connect to this note"}},"required":["id","memberId","title","content","tags","isArchived","folderId","position","createdAt","updatedAt","deletedAt","connections","backlinks"],"additionalProperties":false,"description":"A note with its connections and backlinks"},"FolderTree":{"type":"object","properties":{"folders":{"type":"array","items":{"$ref":"#/components/schemas/Folder"},"description":"Every active folder, flat, already in sibling order"},"notes":{"type":"array","items":{"$ref":"#/components/schemas/NoteStub"},"description":"Every active non-archived note, flat, in sibling order"},"meta":{"type":"object","properties":{"totalFolders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalNotes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unfiledNoteCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Notes with folderId === null, i.e. the virtual \"Unfiled\" bucket"}},"required":["totalFolders","totalNotes","unfiledNoteCount"],"additionalProperties":false}},"required":["folders","notes","meta"],"additionalProperties":false,"description":"The whole sidebar in one round trip. Both lists are FLAT — the client assembles the nesting from parentId/folderId. Empty folders must serialize children as [] client-side, not omit the key."},"Folder":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Folder UUID"},"memberId":{"type":"string","minLength":1,"description":"Member ID (Clerk user ID)"},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent folder UUID; null at the root level"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Optional bridge to an area of responsibility"},"name":{"type":"string","description":"Folder name — unique case-insensitively among siblings"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tabler icon slug (not emoji)"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Palette color token"},"position":{"type":"string","description":"Fractional index within the parent. Compare byte-wise; never parse as a number."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"Soft deletion timestamp"}},"required":["id","memberId","parentId","areaId","name","icon","color","position","createdAt","updatedAt","deletedAt"],"additionalProperties":false,"description":"A knowledge folder — a pure container in the note tree"},"NoteStub":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Note UUID"},"title":{"type":"string","description":"Note title"},"folderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Owning folder UUID; null means the virtual \"Unfiled\" bucket"},"position":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Fractional index within the folder. Null until the note is first placed or dragged — sort `position ASC NULLS LAST, updatedAt DESC`."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"}},"required":["id","title","folderId","position","updatedAt"],"additionalProperties":false,"description":"A note as it appears in the folder tree (no body)"},"FolderDeleteResult":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The folder that was deleted"},"deleted":{"type":"boolean","const":true},"cascade":{"type":"object","properties":{"folders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Folders soft-deleted, including the one requested"},"notes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Notes soft-deleted anywhere in the subtree"}},"required":["folders","notes"],"additionalProperties":false}},"required":["id","deleted","cascade"],"additionalProperties":false,"description":"Result of soft-deleting a folder subtree into trash"},"ChatSuggestion":{"type":"object","properties":{"text":{"type":"string","maxLength":50,"description":"Short actionable suggestion text"},"icon":{"type":"string","enum":["check-circle","alert-triangle","target","calendar","trending-up","zap","clock","sparkles"],"description":"Icon identifier for the suggestion"},"category":{"type":"string","enum":["task","goal","habit","review","planning"],"description":"Suggestion category"}},"required":["text","icon","category"],"additionalProperties":false,"description":"A contextual chat suggestion"},"SearchResult":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Entity UUID"},"entityType":{"type":"string","enum":["task","area","goal","project","habit","folder"],"description":"Entity type"},"label":{"type":"string","description":"Entity name or title"},"similarity":{"type":"number","minimum":0,"maximum":1,"description":"Trigram similarity score"},"areaId":{"description":"Associated area ID","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"priority":{"description":"Priority (tasks only)","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Status","anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent folder ID for folder results (null at the root); null for other types"}},"required":["id","entityType","label","similarity","parentId"],"additionalProperties":false,"description":"A single search result entry"},"EntitiesIndexResponse":{"type":"object","properties":{"areas":{"type":"array","items":{"$ref":"#/components/schemas/AreaIndexItem"},"description":"All active areas"},"goals":{"type":"array","items":{"$ref":"#/components/schemas/GoalIndexItem"},"description":"All active goals"},"projects":{"type":"array","items":{"$ref":"#/components/schemas/ProjectIndexItem"},"description":"All active projects"},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/TaskIndexItem"},"description":"Most recent 50 active tasks"},"habits":{"type":"array","items":{"$ref":"#/components/schemas/HabitIndexItem"},"description":"All active habits"},"folders":{"type":"array","items":{"$ref":"#/components/schemas/FolderIndexItem"},"description":"All active knowledge folders. EMPTY when the `note` entity type is locked — folders are containers for notes and inherit the note unlock gate."}},"required":["areas","goals","projects","tasks","habits","folders"],"additionalProperties":false,"description":"Compact entity graph for the authenticated member"},"AreaIndexItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Area UUID"},"name":{"type":"string","description":"Area name"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area color"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area Tabler icon slug or explicit emoji"},"intention":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area intention"}},"required":["id","name","color","icon","intention"],"additionalProperties":false,"description":"Compact area entry in the entity index"},"GoalIndexItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Goal UUID"},"title":{"type":"string","description":"Goal title"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent area ID"},"status":{"type":"string","enum":["not_started","in_progress","on_hold","completed"],"description":"Goal status"},"targetDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Target date (ISO string)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Goal description"}},"required":["id","title","areaId","status","targetDate","description"],"additionalProperties":false,"description":"Compact goal entry in the entity index"},"ProjectIndexItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project UUID"},"name":{"type":"string","description":"Project name"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent area ID"},"goalIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Linked goal IDs; empty when the project is not linked to a goal"},"status":{"anyOf":[{"type":"string","enum":["not_started","in_progress","on_hold","completed"]},{"type":"null"}],"description":"Project status"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Project description"}},"required":["id","name","areaId","goalIds","status","description"],"additionalProperties":false,"description":"Compact project entry in the entity index"},"TaskIndexItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Task UUID"},"title":{"type":"string","description":"Task title"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent area ID"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent project ID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent goal ID"},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}],"description":"Task priority"},"status":{"anyOf":[{"type":"string","enum":["not_started","in_progress","on_hold","completed"]},{"type":"null"}],"description":"Task status derived from isCompleted"},"due":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Due date (ISO string or local date)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Task description"},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent task ID for subtasks"}},"required":["id","title","areaId","projectId","goalId","priority","status","due","description","parentTaskId"],"additionalProperties":false,"description":"Compact task entry in the entity index"},"HabitIndexItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Habit UUID"},"name":{"type":"string","description":"Habit name"},"frequency":{"type":"string","enum":["daily","weekly","monthly"],"description":"Habit frequency"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent area ID"},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent goal ID"},"lastCheckIn":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Date of last check-in (YYYY-MM-DD)"}},"required":["id","name","frequency","areaId","goalId","lastCheckIn"],"additionalProperties":false,"description":"Compact habit entry in the entity index"},"FolderIndexItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Folder UUID"},"name":{"type":"string","description":"Folder name"},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Parent folder ID; null at the root"},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Optional area bridge"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tabler icon slug"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Palette color token"}},"required":["id","name","parentId","areaId","icon","color"],"additionalProperties":false,"description":"Compact folder entry in the entity index"},"MemoryNativeSourcesResponse":{"type":"object","properties":{"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"fences":{"anyOf":[{"type":"object","properties":{"memoryGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"controlGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"sourceGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["memoryGeneration","controlGeneration","sourceGeneration"],"additionalProperties":false},{"type":"null"}]},"complete":{"type":"boolean"},"gaps":{"type":"array","items":{"type":"string","enum":["byte_budget_exhausted","source_unavailable","selection_unavailable"]}},"sourceHashProjection":{"type":"string","const":"core-native-semantic-v1"},"items":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"sourceRef":{"type":"object","properties":{"kind":{"type":"string","const":"core_native"},"nativeType":{"type":"string","enum":["task_series","task_occurrence","habit_check_in","goal_check_in","flow","member_status"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","nativeType","id","version"],"additionalProperties":false},"status":{"type":"string","enum":["ready","not_found","erased","unavailable","budget_exceeded"]},"content":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"sourcePayloadHash":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"recordedAt":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]},"isCurrent":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["sourceRef","status","content","sourcePayloadHash","recordedAt","isCurrent"],"additionalProperties":false}}},"required":["readAt","fences","complete","gaps","sourceHashProjection","items"],"additionalProperties":false},"MemoryNativeSelectionsResponse":{"type":"object","properties":{"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"fences":{"anyOf":[{"type":"object","properties":{"memoryGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"controlGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"sourceGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["memoryGeneration","controlGeneration","sourceGeneration"],"additionalProperties":false},{"type":"null"}]},"complete":{"type":"boolean"},"gaps":{"type":"array","items":{"type":"string","enum":["byte_budget_exhausted","source_unavailable","selection_unavailable"]}},"items":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"sourceRef":{"type":"object","properties":{"kind":{"type":"string","const":"core_selection"},"queryType":{"type":"string","enum":["overdue_tasks","calendar_agenda","habit_status","goal_progress","free_windows","schedule_conflicts"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","const":"1"}},"required":["kind","queryType","id","version"],"additionalProperties":false},"status":{"type":"string","enum":["ready","not_found","stale","expired","erased","unavailable","budget_exceeded"]},"selection":{"anyOf":[{"type":"object","properties":{"request":{"$ref":"#/components/schemas/MemoryNativeRequestOutput"},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"results":{"type":"object","properties":{"overdueTasks":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}]},"status":{"type":"string","enum":["open","completed","skipped"]},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"seriesId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"occurrenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"dueAllDay":{"type":"boolean"},"dueLocalDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"dueAtUtc":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]}},"required":["itemId","taskId","title","priority","status","areaId","goalId","projectId","seriesId","occurrenceId","dueAllDay","dueLocalDate","dueAtUtc"],"additionalProperties":false}},{"type":"null"}]},"calendarAgenda":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"sourceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["task","task_occurrence","habit","reminder","flow"]},"title":{"type":"string"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"allDay":{"type":"boolean"},"localTime":{"anyOf":[{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startAtUtc":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]},"endAtUtc":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]},"status":{"type":"string","enum":["open","completed","skipped","rest","pending","triggered","dismissed","cancelled"]},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}]},"taskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"seriesId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"occurrenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"checkInId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["itemId","sourceId","type","title","date","allDay","localTime","startAtUtc","endAtUtc","status","priority","taskId","areaId","goalId","projectId","seriesId","occurrenceId","checkInId"],"additionalProperties":false}},{"type":"null"}]},"habitStatus":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"habitId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"targetCount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"todayLocalDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"scheduledToday":{"type":"boolean"},"isCompletedToday":{"type":"boolean"},"todayCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"restToday":{"type":"boolean"},"frozenToday":{"type":"boolean"},"currentStreak":{"type":"integer","minimum":0,"maximum":9007199254740991},"longestStreakWithinWindow":{"type":"integer","minimum":0,"maximum":9007199254740991},"streakWindowDays":{"type":"number","const":365}},"required":["habitId","name","frequency","targetCount","todayLocalDate","scheduledToday","isCompletedToday","todayCount","restToday","frozenToday","currentStreak","longestStreakWithinWindow","streakWindowDays"],"additionalProperties":false}},{"type":"null"}]},"goalProgress":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"goalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"progress":{"type":"object","properties":{"effort":{"anyOf":[{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1},"daysMet":{"type":"number"},"daysExpected":{"type":"number"},"habitCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"window":{"type":"number","const":28}},"required":["value","daysMet","daysExpected","habitCount","window"],"additionalProperties":false},{"type":"null"}]},"outcome":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"current":{"anyOf":[{"type":"number"},{"type":"null"}]},"target":{"anyOf":[{"type":"number"},{"type":"null"}]},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"type":"string"},{"type":"null"}]},"inBand":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["value","current","target","unit","direction","inBand"],"additionalProperties":false},{"type":"null"}]},"execution":{"anyOf":[{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1},"tasksDone":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tasksTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"projectCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["value","tasksDone","tasksTotal","projectCount"],"additionalProperties":false},{"type":"null"}]},"pace":{"anyOf":[{"type":"string","enum":["ahead","on_pace","behind"]},{"type":"null"}]},"lastCheckinAt":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]},"nextCheckinDue":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]}},"required":["effort","outcome","execution","pace","lastCheckinAt","nextCheckinDue"],"additionalProperties":false}},"required":["goalId","title","progress"],"additionalProperties":false}},{"type":"null"}]},"freeWindows":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"endAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"durationMinutes":{"type":"number","exclusiveMinimum":0}},"required":["date","startAt","endAt","durationMinutes"],"additionalProperties":false}},{"type":"null"}]},"scheduleConflicts":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"endAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"itemIds":{"minItems":2,"maxItems":200,"type":"array","items":{"type":"string"}}},"required":["date","startAt","endAt","itemIds"],"additionalProperties":false}},{"type":"null"}]}},"required":["overdueTasks","calendarAgenda","habitStatus","goalProgress","freeWindows","scheduleConflicts"],"additionalProperties":false},"originalSources":{"maxItems":199,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"core_entity"},"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","entityType","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"core_relationship"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"relationshipType":{"type":"string","enum":["goal_area","project_area","project_goal","task_area","task_goal","task_project","task_parent","habit_area","habit_goal","note_connection"]},"fromType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"fromId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"toId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","relationshipType","fromType","fromId","toType","toId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"core_native"},"nativeType":{"type":"string","enum":["task_series","task_occurrence","habit_check_in","goal_check_in","flow","member_status"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","nativeType","id","version"],"additionalProperties":false}],"type":"object"}},"sourceSetHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"inputComplete":{"type":"boolean"},"resultComplete":{"type":"boolean"},"gaps":{"type":"array","items":{"type":"string","enum":["source_capture_not_enabled","memory_state_unavailable","uncaptured_canonical_sources","source_budget_exhausted","byte_budget_exhausted","member_unavailable","selection_revised","expired","erased","evidence_source_budget","invalid_source","invalid_recurrence","unsupported_recurrence","ambiguous_local_time","recurrence_budget_exhausted","result_budget_exhausted","busy_duration_unknown","streak_window_exhausted","calculation_unavailable"]}},"calculationVersion":{"type":"string","const":"core-native-pdq-v1"},"selectionRevision":{"type":"string","pattern":"^(0|[1-9][0-9]{0,18})$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"externalEvidence":{"type":"string","const":"unavailable"},"claimSupportAuthority":{"type":"boolean","const":false},"scope":{"type":"string","const":"native_schedule_only"},"calculationScope":{"type":"object","properties":{"oneOffTasks":{"type":"string","enum":["all_current","request_range"]},"recurringTasks":{"type":"string","const":"request_range"},"habitStatus":{"type":"string","const":"read_at_local_day"},"goalEffortWindowDays":{"type":"number","const":28},"intervals":{"type":"string","const":"requested_native_timed_only"}},"required":["oneOffTasks","recurringTasks","habitStatus","goalEffortWindowDays","intervals"],"additionalProperties":false}},"required":["request","readAt","results","originalSources","sourceSetHash","inputComplete","resultComplete","gaps","calculationVersion","selectionRevision","expiresAt","externalEvidence","claimSupportAuthority","scope","calculationScope"],"additionalProperties":false},{"type":"null"}]}},"required":["sourceRef","status","selection"],"additionalProperties":false}}},"required":["readAt","fences","complete","gaps","items"],"additionalProperties":false},"MemoryNativeResponse":{"type":"object","properties":{"contractVersion":{"type":"number","const":1},"queryType":{"type":"string","enum":["overdue_tasks","calendar_agenda","habit_status","goal_progress","free_windows","schedule_conflicts"]},"status":{"type":"string","enum":["ready","unavailable"]},"request":{"$ref":"#/components/schemas/MemoryNativeRequestOutput"},"requestAuthority":{"type":"string","enum":["database_capture","core_validated"]},"readAt":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]},"utcBounds":{"anyOf":[{"type":"object","properties":{"startAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"endBefore":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]}},"required":["startAt","endBefore"],"additionalProperties":false},{"type":"null"}]},"selectionRevision":{"anyOf":[{"type":"string","pattern":"^(0|[1-9][0-9]{0,18})$"},{"type":"null"}]},"fences":{"anyOf":[{"type":"object","properties":{"memoryGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"controlGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"sourceGeneration":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["memoryGeneration","controlGeneration","sourceGeneration"],"additionalProperties":false},{"type":"null"}]},"inputComplete":{"type":"boolean"},"resultComplete":{"type":"boolean"},"scope":{"type":"string","const":"native_schedule_only"},"externalEvidence":{"type":"string","const":"unavailable"},"coverage":{"type":"string","enum":["committed_request_snapshot","unavailable"]},"historicalCoverage":{"type":"string","const":"uncaptured_prior_history"},"calculationScope":{"type":"object","properties":{"oneOffTasks":{"type":"string","enum":["all_current","request_range"]},"recurringTasks":{"type":"string","const":"request_range"},"habitStatus":{"type":"string","const":"read_at_local_day"},"goalEffortWindowDays":{"type":"number","const":28},"intervals":{"type":"string","const":"requested_native_timed_only"}},"required":["oneOffTasks","recurringTasks","habitStatus","goalEffortWindowDays","intervals"],"additionalProperties":false},"calculationVersion":{"type":"string","const":"core-native-pdq-v1"},"claimSupportAuthority":{"type":"boolean","const":false},"receipt":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"core_selection"},"queryType":{"type":"string","enum":["overdue_tasks","calendar_agenda","habit_status","goal_progress","free_windows","schedule_conflicts"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","const":"1"}},"required":["kind","queryType","id","version"],"additionalProperties":false},{"type":"null"}]},"originalSources":{"maxItems":199,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"core_entity"},"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","entityType","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"core_relationship"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"relationshipType":{"type":"string","enum":["goal_area","project_area","project_goal","task_area","task_goal","task_project","task_parent","habit_area","habit_goal","note_connection"]},"fromType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"fromId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"toId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","relationshipType","fromType","fromId","toType","toId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"core_native"},"nativeType":{"type":"string","enum":["task_series","task_occurrence","habit_check_in","goal_check_in","flow","member_status"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","nativeType","id","version"],"additionalProperties":false}],"type":"object"}},"sourceSetHash":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"sourceCountAtLeast":{"type":"integer","minimum":0,"maximum":9007199254740991},"countIsExact":{"type":"boolean"},"gaps":{"type":"array","items":{"type":"string","enum":["source_capture_not_enabled","memory_state_unavailable","uncaptured_canonical_sources","source_budget_exhausted","byte_budget_exhausted","member_unavailable","selection_revised","expired","erased","evidence_source_budget","invalid_source","invalid_recurrence","unsupported_recurrence","ambiguous_local_time","recurrence_budget_exhausted","result_budget_exhausted","busy_duration_unknown","streak_window_exhausted","calculation_unavailable"]}},"results":{"type":"object","properties":{"overdueTasks":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}]},"status":{"type":"string","enum":["open","completed","skipped"]},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"seriesId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"occurrenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"dueAllDay":{"type":"boolean"},"dueLocalDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"dueAtUtc":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]}},"required":["itemId","taskId","title","priority","status","areaId","goalId","projectId","seriesId","occurrenceId","dueAllDay","dueLocalDate","dueAtUtc"],"additionalProperties":false}},{"type":"null"}]},"calendarAgenda":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"sourceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["task","task_occurrence","habit","reminder","flow"]},"title":{"type":"string"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"allDay":{"type":"boolean"},"localTime":{"anyOf":[{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startAtUtc":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]},"endAtUtc":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]},"status":{"type":"string","enum":["open","completed","skipped","rest","pending","triggered","dismissed","cancelled"]},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}]},"taskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"seriesId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"occurrenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"checkInId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["itemId","sourceId","type","title","date","allDay","localTime","startAtUtc","endAtUtc","status","priority","taskId","areaId","goalId","projectId","seriesId","occurrenceId","checkInId"],"additionalProperties":false}},{"type":"null"}]},"habitStatus":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"habitId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"targetCount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"todayLocalDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"scheduledToday":{"type":"boolean"},"isCompletedToday":{"type":"boolean"},"todayCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"restToday":{"type":"boolean"},"frozenToday":{"type":"boolean"},"currentStreak":{"type":"integer","minimum":0,"maximum":9007199254740991},"longestStreakWithinWindow":{"type":"integer","minimum":0,"maximum":9007199254740991},"streakWindowDays":{"type":"number","const":365}},"required":["habitId","name","frequency","targetCount","todayLocalDate","scheduledToday","isCompletedToday","todayCount","restToday","frozenToday","currentStreak","longestStreakWithinWindow","streakWindowDays"],"additionalProperties":false}},{"type":"null"}]},"goalProgress":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"goalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"progress":{"type":"object","properties":{"effort":{"anyOf":[{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1},"daysMet":{"type":"number"},"daysExpected":{"type":"number"},"habitCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"window":{"type":"number","const":28}},"required":["value","daysMet","daysExpected","habitCount","window"],"additionalProperties":false},{"type":"null"}]},"outcome":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"current":{"anyOf":[{"type":"number"},{"type":"null"}]},"target":{"anyOf":[{"type":"number"},{"type":"null"}]},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"type":"string"},{"type":"null"}]},"inBand":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["value","current","target","unit","direction","inBand"],"additionalProperties":false},{"type":"null"}]},"execution":{"anyOf":[{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1},"tasksDone":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tasksTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"projectCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["value","tasksDone","tasksTotal","projectCount"],"additionalProperties":false},{"type":"null"}]},"pace":{"anyOf":[{"type":"string","enum":["ahead","on_pace","behind"]},{"type":"null"}]},"lastCheckinAt":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]},"nextCheckinDue":{"anyOf":[{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},{"type":"null"}]}},"required":["effort","outcome","execution","pace","lastCheckinAt","nextCheckinDue"],"additionalProperties":false}},"required":["goalId","title","progress"],"additionalProperties":false}},{"type":"null"}]},"freeWindows":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"endAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"durationMinutes":{"type":"number","exclusiveMinimum":0}},"required":["date","startAt","endAt","durationMinutes"],"additionalProperties":false}},{"type":"null"}]},"scheduleConflicts":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"endAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{6}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"itemIds":{"minItems":2,"maxItems":200,"type":"array","items":{"type":"string"}}},"required":["date","startAt","endAt","itemIds"],"additionalProperties":false}},{"type":"null"}]}},"required":["overdueTasks","calendarAgenda","habitStatus","goalProgress","freeWindows","scheduleConflicts"],"additionalProperties":false}},"required":["contractVersion","queryType","status","request","requestAuthority","readAt","utcBounds","selectionRevision","fences","inputComplete","resultComplete","scope","externalEvidence","coverage","historicalCoverage","calculationScope","calculationVersion","claimSupportAuthority","receipt","originalSources","sourceSetHash","sourceCountAtLeast","countIsExact","gaps","results"],"additionalProperties":false},"MemoryEntitiesResponse":{"type":"object","properties":{"contractVersion":{"type":"number","const":1},"readAt":{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},"sourceHashProjection":{"default":"core-memory-semantic-v1","type":"string","const":"core-memory-semantic-v1"},"items":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"isDeleted":{"type":"boolean"},"captureStatus":{"type":"string","enum":["captured","not_captured"]},"sourceRef":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"core_entity"},"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","entityType","id","version"],"additionalProperties":false},{"type":"null"}]},"sourceEventId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sourcePayloadHash":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"recordedAt":{"anyOf":[{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},{"type":"null"}]},"snapshot":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["entityType","entityId","isDeleted","captureStatus","sourceRef","sourceEventId","sourcePayloadHash","recordedAt","snapshot"],"additionalProperties":false}},"missing":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","const":"not_found"}},"required":["entityType","entityId","reason"],"additionalProperties":false}}},"required":["contractVersion","readAt","sourceHashProjection","items","missing"],"additionalProperties":false},"MemoryGraphResponse":{"type":"object","properties":{"contractVersion":{"type":"number","const":1},"readAt":{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},"edges":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"relationshipType":{"type":"string","enum":["goal_area","project_area","project_goal","task_area","task_goal","task_project","task_parent","habit_area","habit_goal","note_connection"]},"from":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["entityType","entityId"],"additionalProperties":false},"to":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["entityType","entityId"],"additionalProperties":false},"captureStatus":{"type":"string","enum":["captured","not_captured"]},"sourceRef":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"core_relationship"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"relationshipType":{"type":"string","enum":["goal_area","project_area","project_goal","task_area","task_goal","task_project","task_parent","habit_area","habit_goal","note_connection"]},"fromType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"fromId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"toId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","relationshipType","fromType","fromId","toType","toId"],"additionalProperties":false},{"type":"null"}]},"sourceEventId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"recordedAt":{"anyOf":[{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},{"type":"null"}]},"depth":{"type":"integer","minimum":1,"maximum":2}},"required":["relationshipType","from","to","captureStatus","sourceRef","sourceEventId","recordedAt","depth"],"additionalProperties":false}},"missing":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","const":"not_found"}},"required":["entityType","entityId","reason"],"additionalProperties":false}},"truncated":{"type":"boolean"},"truncationReasons":{"type":"array","items":{"type":"string","enum":["fanout","rows"]}},"bounds":{"type":"object","properties":{"depth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fanout":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["depth","fanout","limit"],"additionalProperties":false}},"required":["contractVersion","readAt","edges","missing","truncated","truncationReasons","bounds"],"additionalProperties":false},"MemoryHistoryResponse":{"type":"object","properties":{"contractVersion":{"type":"number","const":1},"readAt":{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},"sourceHashProjection":{"default":"core-memory-semantic-v1","type":"string","const":"core-memory-semantic-v1"},"coverageScope":{"default":"request_snapshot","type":"string","const":"request_snapshot"},"paginationConsistency":{"default":"cursor_pages_may_miss_late_commits","type":"string","const":"cursor_pages_may_miss_late_commits"},"items":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["entity_revision","relationship_revision","outcome","goal_check_in","habit_check_in","operation"]},"entity":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["entityType","entityId"],"additionalProperties":false},"sourceRef":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"core_entity"},"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"}},"required":["kind","entityType","id","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"core_relationship"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"relationshipType":{"type":"string","enum":["goal_area","project_area","project_goal","task_area","task_goal","task_project","task_parent","habit_area","habit_goal","note_connection"]},"fromType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"fromId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"toId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind","id","version","relationshipType","fromType","fromId","toType","toId"],"additionalProperties":false}]},{"type":"null"}]},"sourceEventId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"sourcePayloadHash":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"recordKind":{"type":"string","enum":["mutation","baseline_snapshot","recorded_fact"]},"operation":{"type":"string"},"recordedAt":{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},"effectiveAt":{"anyOf":[{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},{"type":"null"}]},"effectiveLocalDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"effectiveTimezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","kind","entity","sourceRef","sourceEventId","sourcePayloadHash","recordKind","operation","recordedAt","effectiveAt","effectiveLocalDate","effectiveTimezone","payload"],"additionalProperties":false}},"coverage":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string","enum":["area","goal","project","task","habit","note","reminder"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"availableSince":{"anyOf":[{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},{"type":"null"}]},"baselineAt":{"anyOf":[{"type":"string","minLength":1,"description":"Exact PostgreSQL UTC timestamp text, including microseconds; not a JavaScript Date."},{"type":"null"}]},"status":{"type":"string","enum":["recorded","baseline_only","not_captured","not_found"]},"earlierHistory":{"type":"string","const":"unknown"},"supportedKinds":{"type":"array","items":{"type":"string","enum":["entity_revision","relationship_revision","outcome","goal_check_in","habit_check_in","operation"]}},"gaps":{"type":"array","items":{"type":"string","enum":["pre_capture_unknown","baseline_snapshot","requested_version_missing","not_captured","source_not_found"]}}},"required":["entityType","entityId","availableSince","baselineAt","status","earlierHistory","supportedKinds","gaps"],"additionalProperties":false}},"truncated":{"type":"boolean"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["contractVersion","readAt","sourceHashProjection","coverageScope","paginationConsistency","items","coverage","truncated","nextCursor"],"additionalProperties":false},"GraphResponse":{"type":"object","properties":{"nodes":{"type":"array","items":{"$ref":"#/components/schemas/GraphNode"},"description":"All graph nodes"},"edges":{"type":"array","items":{"$ref":"#/components/schemas/GraphEdge"},"description":"All graph edges"},"meta":{"type":"object","properties":{"totalNodes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total number of nodes"},"totalEdges":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total number of edges"},"entityCounts":{"$ref":"#/components/schemas/EntityCounts"}},"required":["totalNodes","totalEdges","entityCounts"],"additionalProperties":false,"description":"Graph metadata"}},"required":["nodes","edges","meta"],"additionalProperties":false,"description":"Full entity graph with nodes, edges, and metadata"},"GraphNode":{"type":"object","properties":{"id":{"type":"string","description":"Entity UUID"},"type":{"type":"string","enum":["member","area","goal","project","task","habit"],"description":"Entity type"},"label":{"type":"string","description":"Display label (name or title)"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area color"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Area Tabler icon slug or explicit emoji"},"status":{"description":"Entity status","type":"string"},"priority":{"description":"Entity priority","type":"string"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parent entity ID"},"parentType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parent entity type"},"progress":{"description":"Goal nodes only: max(outcome, execution) progress 0..1 for lifemap sizing/ring; null when no signal","anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["id","type","label","color","icon","parentId","parentType"],"additionalProperties":false,"description":"A node in the entity graph"},"GraphEdge":{"type":"object","properties":{"id":{"type":"string","description":"Edge identifier (source->target)"},"source":{"type":"string","description":"Source node ID"},"target":{"type":"string","description":"Target node ID"},"type":{"type":"string","description":"Relationship type"}},"required":["id","source","target","type"],"additionalProperties":false,"description":"An edge connecting two nodes in the entity graph"},"EntityCounts":{"type":"object","properties":{"areas":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of area nodes"},"goals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of goal nodes"},"projects":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of project nodes"},"tasks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of task nodes"},"habits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of habit nodes"}},"required":["areas","goals","projects","tasks","habits"],"additionalProperties":false,"description":"Count of nodes by entity type"},"GraphContextResponse":{"type":"object","properties":{"summary":{"type":"string","description":"Natural language summary for LLM injection"},"stats":{"$ref":"#/components/schemas/ContextStats"},"ancestors":{"description":"Ancestor chain for the entity","type":"array","items":{"$ref":"#/components/schemas/GraphNode"}},"siblings":{"description":"Sibling entities","type":"array","items":{"$ref":"#/components/schemas/GraphNode"}},"neighborhood":{"description":"2-hop neighborhood nodes","type":"array","items":{"$ref":"#/components/schemas/GraphNode"}},"tree":{"description":"Full hierarchy tree (when no entityId)","type":"array","items":{"$ref":"#/components/schemas/GraphNode"}},"personalization":{"description":"Member-authored, untrusted personalization context","type":"object","properties":{"workContext":{"type":"string"},"personalInstructions":{"type":"string"}},"additionalProperties":false}},"required":["summary","stats"],"additionalProperties":false,"description":"Graph context with summary, stats, and related entities"},"ContextStats":{"type":"object","properties":{"completionRate":{"type":"number","description":"Percentage of completed tasks (0-100)"},"activeGoals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of non-completed goals"},"blockedProjects":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of on-hold projects"}},"required":["completionRate","activeGoals","blockedProjects"],"additionalProperties":false,"description":"Aggregate statistics for graph context"},"ObservedEffectResponse":{"type":"object","properties":{"observed":{"type":"boolean","description":"True when the proposed mutation's observable effect exists in durable state — the agent treats this as \"already done\" and does NOT re-execute."},"entityType":{"type":"string","enum":["task","goal","area","project","habit"]},"operation":{"type":"string","enum":["create","update","complete","delete"]},"match":{"anyOf":[{"$ref":"#/components/schemas/ObservedEffectMatch"},{"type":"null"}],"description":"The matched entity when one was found (a create match, or the target row for id-based operations even if the effect is not yet observed); null when no row matched."}},"required":["observed","entityType","operation","match"],"additionalProperties":false,"description":"Whether a recently-proposed mutation observably landed"},"ObservedEffectMatch":{"type":"object","properties":{"id":{"type":"string","description":"Matched entity UUID."},"label":{"type":"string","description":"Matched entity title (task/goal) or name (area/project/habit)."},"createdAt":{"type":"string","description":"created_at — exact database text (UTC, no timezone coercion)."},"updatedAt":{"type":"string","description":"updated_at — exact database text (UTC)."},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"deleted_at — exact database text (UTC), or null when not soft-deleted."},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Completion timestamp (task completed_at_utc / goal completed_at) — exact database text, or null."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lifecycle status (goal/project); null for task/area/habit."},"matchedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The timestamp of the observed effect for this operation (createdAt for create, updatedAt for update, completion ts for complete, deletedAt for delete); null when not observed."}},"required":["id","label","createdAt","updatedAt","deletedAt","completedAt","status","matchedAt"],"additionalProperties":false,"description":"The matched entity and the timestamps that evidence (or refute) the effect"},"CapabilityView":{"type":"object","properties":{"schemaVersion":{"type":"string","description":"Response shape version. Bumped only on a breaking shape change; a new capability key is additive and must be ignored by clients that do not know it"},"observedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"When this view was computed (ISO 8601)"},"capabilities":{"$ref":"#/components/schemas/CapabilityMap"}},"required":["schemaVersion","observedAt","capabilities"],"additionalProperties":false,"description":"Content-free capability state. Carries no member data and is identical for every member — a client uses it to decide whether a surface may promise an action, never to display anything about the member."},"CapabilityMap":{"type":"object","properties":{"push_notifications":{"$ref":"#/components/schemas/CapabilityEntry"},"email_delivery":{"$ref":"#/components/schemas/CapabilityEntry"},"integrations_sync":{"$ref":"#/components/schemas/CapabilityEntry"}},"required":["push_notifications","email_delivery","integrations_sync"],"additionalProperties":false,"description":"Every worker-backed capability, keyed by capability name"},"CapabilityEntry":{"type":"object","properties":{"state":{"type":"string","enum":["available","degraded","unavailable"],"description":"available = a worker is live and able to execute this work; degraded = live but impaired, the work will happen late or partially; unavailable = nothing can execute this work, so no surface may promise it"}},"required":["state"],"additionalProperties":false,"description":"The current executability of one worker-backed capability"},"CalendarAgendaResponse":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CalendarItem"}},"days":{"type":"array","items":{"$ref":"#/components/schemas/CalendarDay"}}},"required":["from","to","timezone","items","days"],"additionalProperties":false,"description":"Calendar agenda response"},"CalendarItem":{"type":"object","properties":{"id":{"type":"string","description":"Stable calendar item id"},"sourceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Underlying entity id"},"type":{"type":"string","enum":["task","task_occurrence","habit","reminder","flow","external_event"]},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Local calendar date bucket"},"allDay":{"type":"boolean"},"localTime":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"HH:MM local time when known"},"startAtUtc":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"endAtUtc":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"status":{"type":"string","enum":["open","completed","skipped","rest","pending","triggered","dismissed","cancelled","busy","free","tentative"]},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}]},"areaId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"goalId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"taskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"noteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"externalEventId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"occurrenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"checkInId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"area":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"goal":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","sourceId","type","title","description","date","allDay","localTime","startAtUtc","endAtUtc","status","priority","areaId","goalId","projectId","taskId","noteId","externalEventId","occurrenceId","checkInId","tags","area","goal","project","metadata"],"additionalProperties":false,"description":"Normalized calendar agenda item"},"CalendarDay":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CalendarItem"}},"stats":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completedTasks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"habits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completedHabits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reminders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"flows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"externalEvents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","tasks","completedTasks","habits","completedHabits","reminders","flows","externalEvents"],"additionalProperties":false}},"required":["date","items","stats"],"additionalProperties":false,"description":"One local calendar day with items and counts"},"CalendarIntegrationsResponse":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["google","outlook"]},"configured":{"type":"boolean"},"readOnly":{"type":"boolean"}},"required":["provider","configured","readOnly"],"additionalProperties":false}},"connections":{"type":"array","items":{"$ref":"#/components/schemas/CalendarConnection"}},"sources":{"type":"array","items":{"$ref":"#/components/schemas/CalendarSource"}}},"required":["providers","connections","sources"],"additionalProperties":false,"description":"Calendar integration connection and source state"},"CalendarConnection":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["google","outlook"]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","needs_reauth","revoked","error"]},"scopes":{"type":"array","items":{"type":"string"}},"lastSyncAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","provider","email","displayName","status","scopes","lastSyncAt","lastError","createdAt","updatedAt"],"additionalProperties":false,"description":"Connected external calendar account"},"CalendarSource":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["google","outlook"]},"providerCalendarId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"isPrimary":{"type":"boolean"},"isSelected":{"type":"boolean"},"accessRole":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","connectionId","provider","providerCalendarId","name","description","color","timezone","isPrimary","isSelected","accessRole","lastSyncAt"],"additionalProperties":false,"description":"A provider calendar selected for display"},"MemberPushToken":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Push token record ID"},"memberId":{"type":"string","minLength":1,"description":"Owning member ID (Clerk user ID)"},"token":{"type":"string","description":"Expo push token"},"platform":{"type":"string","enum":["ios","android"],"description":"Device platform"},"deviceId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Stable device identifier"},"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"App version that registered the token"},"disabledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}],"description":"When the token was disabled"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last update timestamp"},"lastSeenAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Last time this token was seen/refreshed"}},"required":["id","memberId","token","platform","deviceId","appVersion","disabledAt","createdAt","updatedAt","lastSeenAt"],"additionalProperties":false,"description":"A registered Expo push token for a member device"},"SubscriptionView":{"type":"object","properties":{"plan":{"type":"string","enum":["none","standard","max"]},"status":{"type":"string","enum":["active","in_trial","cancelled","expired","billing_issue","paused","none"]},"entitlements":{"type":"array","items":{"type":"string"}},"store":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currentPeriodEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO-8601"},"willRenew":{"type":"boolean"},"environment":{"type":"string","enum":["sandbox","production"]},"limits":{"type":"object","properties":{"agentInteractionsPerDay":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"aiCostUsdPerMonth":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["agentInteractionsPerDay","aiCostUsdPerMonth"],"additionalProperties":false},"isPreviewDefault":{"type":"boolean","description":"true when no real subscription row → serving PREVIEW_DEFAULT_PLAN"},"enforcement":{"type":"string","enum":["preview","launch"],"description":"active server-side billing enforcement mode (preview | launch)"},"requiresSubscription":{"type":"boolean","description":"true iff launch enforcement AND plan === \"none\" — drives the mobile hard paywall"},"trial":{"type":"object","properties":{"active":{"type":"boolean"},"endsAt":{"description":"ISO-8601; present only while the trial is active","type":"string"}},"required":["active"],"additionalProperties":false,"description":"free-trial visibility derived from status=\"in_trial\" + current_period_end"}},"required":["plan","status","entitlements","store","productId","currentPeriodEnd","willRenew","environment","limits","isPreviewDefault","enforcement","requiresSubscription","trial"],"additionalProperties":false,"description":"Member subscription state + resolved plan limits"},"PatSelfIntrospection":{"type":"object","properties":{"schemaVersion":{"type":"string","const":"agent-pat-self.v1"},"credentialKind":{"type":"string","const":"pat"},"installation":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Authenticated PAT installation UUID"},"active":{"type":"boolean","const":true}},"required":["id","active"],"additionalProperties":false},"grant":{"type":"object","properties":{"active":{"type":"boolean","const":true},"effectiveScopes":{"type":"array","items":{"type":"string","enum":["state:read","capture:create","work:propose","work:execute","calendar:read","calendar:write","memory:read","memory:write","automation:manage","communications:draft","communications:send","admin"]},"description":"Sorted effective scopes resolved from the current credential and grant"}},"required":["active","effectiveScopes"],"additionalProperties":false},"credential":{"type":"object","properties":{"active":{"type":"boolean","const":true},"revoked":{"type":"boolean","const":false},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z||([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}],"description":"Credential expiry as returned by the authoritative PostgreSQL resolver"},"currentNonExpired":{"type":"boolean","const":true}},"required":["active","revoked","expiresAt","currentNonExpired"],"additionalProperties":false},"tokenFingerprint":{"type":"object","properties":{"algorithm":{"type":"string","const":"sha256"},"valuePrefix":{"type":"string","pattern":"^[a-f0-9]{24}$","description":"First 24 hex characters of sha256(presented PAT); never the full digest"},"hexCharacters":{"type":"number","const":24}},"required":["algorithm","valuePrefix","hexCharacters"],"additionalProperties":false}},"required":["schemaVersion","credentialKind","installation","grant","credential","tokenFingerprint"],"additionalProperties":false,"description":"Content-free current authority for the authenticated PAT itself"},"MemoryNativeRequestOutput":{"type":"object","properties":{"queryType":{"type":"string","enum":["overdue_tasks","calendar_agenda","habit_status","goal_progress","free_windows","schedule_conflicts"]},"timezone":{"type":"string","minLength":1,"maxLength":100},"startLocalDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endLocalDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"windowStart":{"default":"07:00","type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"windowEnd":{"default":"22:00","type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"durationMinutes":{"default":30,"type":"integer","minimum":1,"maximum":1440},"entityIds":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["queryType","timezone","startLocalDate","endLocalDate","windowStart","windowEnd","durationMinutes","entityIds"],"additionalProperties":false}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT or tjati_sk_ PAT","description":"Bearer credential: a Clerk session JWT for a member, or a scoped OAuth access token / Tjati PAT for an agent. Agent authority and scopes are resolved server-side."}}},"x-tjati-api-major-version":"v1","x-tjati-canonical-document":"https://api.tjati.com/openapi/v1.json"}