{"openapi":"3.1.0","info":{"title":"360Onboard Public API","version":"2.0.0","description":"Server-to-server API for published V2 onboarding flows, clients, responses, webhook subscriptions, and Client Portal. Generate an API key in Settings → APIs, Webhooks & MCP → API Keys. Supply it as the `apiKey` query parameter; keep it on your server and never put it in browser or mobile code. API keys are associated with an account and may have a configured workspace scope. Each workspace operation also enforces the actor’s workspace access; effective access is limited by both. Use GET /v2/workspaces to list the workspaces available to the key. An inaccessible workspace or resource returns 404. Authenticated API responses include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. The general API limit is 100 requests per minute per key; 429 responses include Retry-After. Missing or invalid API keys may return 401 without rate-limit headers. Client creation supports Idempotency-Key for 24 hours; inbound triggers also retain workspace/flow/event idempotency beyond that cache. New self-service owners get full Agency access in one workspace for seven days from email verification, with no credit card and no AI allowance cap. Existing Free owners receive a fresh seven days at rollout. Trial API keys stop authenticating at expiry (401) until a paid plan is active; open the app to choose a plan. Trial expiry retains saved data and does not restart on sign-in or email changes.","contact":{"name":"360Onboard Support","email":"david@360onboard.com"},"summary":"Server-side API for onboarding and Client Portal automation"},"servers":[{"url":"https://api.360onboard.com","description":"Production API"}],"paths":{"/v2/workspaces/{workspaceId}/portal/files/upload-url":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_files_upload_url","summary":"Create a portal file upload URL","description":"Stage any attachment type, including Office documents, up to 50 MiB through the same signer used by agency Files, task attachments and milestone attachments. Requires Client Portal access and can_work_on_clients in the selected workspace. Send JSON metadata, PUT the raw bytes to signedUrl with the original Content-Type (application/octet-stream when unknown), then POST portal/files or portal/accounts/{accountId}/files with name, size, mimeType, storagePath:path and url:publicUrl plus the intended purpose/access. Staging alone does not create or share a file record, emit a portal.file.created webhook, or enqueue cloud storage transfer; saving the file through the normal create route performs those operations. Office files remain original downloads, not converted slides or workbooks. Unsupported and active content, including HTML, is delivered as a download. Upload URLs expire independently of the optional 24-hour idempotency cache. An identical keyed signing retry replays the original response; request a fresh signing operation after expiration. No automatic byte-upload retry or upsert is performed.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Optional key for an identical signing retry within 24 hours; a different body/actor conflicts. A replay does not extend the upload URL lifetime."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalFileUploadRequest"},"example":{"fileName":"Budget.xlsx","mimeType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","size":1024}}}},"responses":{"200":{"description":"Signed staging URL created; no bytes uploaded or file record created yet. Values are synthetic.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalFileUploadResponse"},"example":{"signedUrl":"https://storage.example.test/storage/v1/object/upload/sign/360onboard-files/00000000-0000-4000-8000-000000000001/portal-files/1792454400000-example.xlsx?token=synthetic","publicUrl":"https://storage.example.test/storage/v1/object/public/360onboard-files/00000000-0000-4000-8000-000000000001/portal-files/1792454400000-example.xlsx","path":"00000000-0000-4000-8000-000000000001/portal-files/1792454400000-example.xlsx"}}}},"400":{"description":"Invalid JSON or missing/invalid fileName","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal or can_work_on_clients permission unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Workspace not found or not accessible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Idempotency key conflict or request still processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"413":{"description":"Missing, invalid, negative, or oversized file size","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"API rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Storage not configured, context unavailable, or unexpected signing failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"502":{"description":"Storage provider could not create the signed upload URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"x-required-capabilities":["can_work_on_clients"]}},"/v2/workspaces":{"get":{"operationId":"listWorkspaces","summary":"List accessible workspaces","parameters":[],"responses":{"200":{"description":"Workspaces owned or accessible to the API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceList"},"examples":{"sample":{"summary":"Synthetic example response","value":{"object":"list","data":[{"id":"11111111-1111-4111-8111-111111111111","object":"workspace","name":"Acme Agency","slug":"acme-agency","api_url":"https://api.360onboard.com/v2/workspaces/11111111-1111-4111-8111-111111111111"}]}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Workspace or resource not found in the authenticated scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"workspace_not_found","message":"Workspace or resource not found in the authenticated scope."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Workspace or resource not found in the authenticated scope"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Unexpected server failure"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"tags":["Workspaces"],"security":[{"apiKey":[]}],"description":"Lists workspaces available to the account-level API key. Use one returned workspace ID for subsequent requests. Workspace names, slugs and API URLs are returned without exposing other accounts."}},"/v2/workspaces/{workspaceId}/flows":{"get":{"operationId":"listFlows","summary":"List published flows","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"1-based page number."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Page size; values above 100 are capped to 100."}],"responses":{"200":{"description":"Paginated published V2 flows (page defaults to 1, limit to 25, maximum 100)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowList"},"examples":{"sample":{"summary":"Synthetic example response","value":{"object":"list","data":[{"id":"22222222-2222-4222-8222-222222222222","object":"flow","workspace_id":"11111111-1111-4111-8111-111111111111","name":"Client Onboarding","type":"client","status":"published","schema_version":2,"public_url":"https://onboard.example.com/start","public_link":{"enabled":true,"id":"33333333-3333-4333-8333-333333333333","slug":"start","settings":{}},"design":{"selected_variants":{},"customization":{}},"step_count":1,"created_at":"2026-09-01T12:00:00Z","updated_at":"2026-09-02T12:00:00Z","api_url":"https://api.360onboard.com/v2/workspaces/11111111-1111-4111-8111-111111111111/flows/22222222-2222-4222-8222-222222222222"}],"page":1,"limit":25,"total":1,"has_more":false}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"API key missing or invalid."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"API key missing or invalid"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Workspace or resource not found in the authenticated scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"workspace_not_found","message":"Workspace or resource not found in the authenticated scope."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Workspace or resource not found in the authenticated scope"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Unexpected server failure"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"tags":["Flows"],"security":[{"apiKey":[]}],"description":"Lists only published V2 flows in this workspace. Flow records in this list omit detailed step definitions; fetch one flow for its sanitized steps. Page is 1-based; limit defaults to 25 and is capped at 100."}},"/v2/workspaces/{workspaceId}/flows/{flowId}":{"get":{"operationId":"getFlow","summary":"Get a published flow","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"flowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Published V2 flow ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFlowResponse"},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"id":"22222222-2222-4222-8222-222222222222","object":"flow","workspace_id":"11111111-1111-4111-8111-111111111111","name":"Client Onboarding","type":"client","status":"published","schema_version":2,"public_url":"https://onboard.example.com/start","public_link":{"enabled":true,"id":null,"slug":"start","settings":{}},"portal_description":null,"design":{"selected_variants":{},"customization":{}},"step_count":1,"steps":[{"id":"company-details","object":"flow_step","position":0,"type":"questionnaire","title":"Company details","fields":[{"id":"company_name","type":"text","label":"Company name"}]}],"created_at":"2026-09-01T12:00:00Z","updated_at":"2026-09-02T12:00:00Z","api_url":"https://api.360onboard.com/v2/workspaces/11111111-1111-4111-8111-111111111111/flows/22222222-2222-4222-8222-222222222222"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Invalid request"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic flow_not_found response","value":{"error":{"code":"flow_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"422":{"description":"The inherited workspace font is missing, unavailable, or unsupported. Re-upload the font in Client theme or select a built-in invoice font, then retry. The invoice and payment state are unchanged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Server error"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"tags":["Flows"],"security":[{"apiKey":[]}],"description":"Returns one published V2 flow, including sanitized step definitions, design and public-link settings. Private integration URLs, headers, secrets, static recipients and private integration target IDs are not exposed."}},"/v2/workspaces/{workspaceId}/flows/{flowId}/trigger":{"post":{"operationId":"triggerFlowFromInboundEvent","summary":"Start an onboarding from an inbound event","description":"Creates one new onboarding for an external event and maps configured payload values into editable questionnaire defaults. It never updates an existing onboarding. The flow must be published V2 with an enabled inbound-trigger mapping in its published definition. Initial invitation email is off by default; enable it in the flow configuration. invitation_requested reports that setting, not proof of email delivery. Idempotency is durable for this workspace/flow/key: the same key and canonical identical payload returns the existing onboarding beyond the general 24-hour API idempotency cache. A different payload conflicts. A removed or archived onboarding conflicts when durable event lookup is reached; an active cached response replays first. For processing, retry the identical body with the same key. For an unknown outcome, inspect the returned onboarding before acting; do not use a new key or resend. A generic idempotency-cache replay within its 24-hour window returns the cached original HTTP status and body plus Idempotent-Replayed: true (a cached 201 stays 201, including any original camel-case identity fields). When the route reaches the durable event check (for example, after the response cache expires), a completed durable replay returns HTTP 200 with Idempotent-Replayed: true and omits those optional camel-case fields. A fresh creation returns HTTP 201 without the replay header. Removed or archived onboarding conflicts are returned only after the durable event lookup is reached.","tags":["Flows"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the flow; access is limited by the API key and authenticated actor."},{"name":"flowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Published V2 client or employee flow configured for inbound triggers."},{"name":"Idempotency-Key","in":"header","required":true,"description":"Stable event identifier: 1–200 letters, numbers, dot, underscore, colon, or hyphen. Reuse only with the same request payload.","schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"crm-contact-evt-8472"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundTriggerRequest"},"example":{"client":{"email":"alex@example.test","first_name":"Alex","last_name":"Morgan","company_name":"Northstar Studio","phone":"+1-555-0100"},"data":{"crm_contact_id":"crm-8472","company":{"name":"Northstar Studio","website":"https://northstar.example.test"},"monthly_budget":2500}}}}},"responses":{"200":{"description":"Completed durable replay of an existing identical event when the route reaches the durable event check, including after the generic response cache expires. Includes Idempotent-Replayed: true; no duplicate onboarding is created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundTriggerResponse"},"example":{"data":{"id":"55555555-5555-4555-8555-555555555555","flow_id":"22222222-2222-4222-8222-222222222222","workspace_id":"11111111-1111-4111-8111-111111111111","email":"alex@example.test","link":"https://app.360onboard.com/c/0123456789abcdef0123456789abcdef","invitation_requested":false,"created_at":"2026-10-14T17:30:00.000Z","flow_version_id":null,"flow_version_generation":null,"setup_state":"complete"}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Present as true on a cached or durable idempotency replay; absent on a fresh creation."}}},"201":{"description":"New onboarding created and setup completed, or a replay from the active generic idempotency cache retaining the original 201 response. A fresh creation omits Idempotent-Replayed; a cached replay includes Idempotent-Replayed: true. Neither confirms invitation delivery.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundTriggerResponse"},"example":{"data":{"id":"55555555-5555-4555-8555-555555555555","flow_id":"22222222-2222-4222-8222-222222222222","workspace_id":"11111111-1111-4111-8111-111111111111","email":"alex@example.test","link":"https://app.360onboard.com/c/0123456789abcdef0123456789abcdef","invitation_requested":false,"created_at":"2026-10-14T17:30:00.000Z","flow_version_id":null,"flow_version_generation":null,"setup_state":"complete","firstName":"Alex","lastName":"Morgan","companyName":"Northstar Studio","phone":"+1-555-0100"}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Present as true on a cached or durable idempotency replay; absent on a fresh creation."}}},"202":{"description":"Setup is still processing. Retry the identical body with the same key after five seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundTriggerResponse"},"example":{"data":{"id":"55555555-5555-4555-8555-555555555555","flow_id":"22222222-2222-4222-8222-222222222222","workspace_id":"11111111-1111-4111-8111-111111111111","email":"alex@example.test","link":"https://app.360onboard.com/c/0123456789abcdef0123456789abcdef","invitation_requested":false,"created_at":"2026-10-14T17:30:00.000Z","flow_version_id":null,"flow_version_generation":null,"setup_state":"processing","firstName":"Alex","lastName":"Morgan","companyName":"Northstar Studio","phone":"+1-555-0100"}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer","const":5},"description":"Retry after five seconds."},"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Present when this is a durable event replay; absent on a fresh setup attempt."}}},"400":{"description":"Missing or malformed Idempotency-Key, invalid JSON/request shape, or invalid nested inbound payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"idempotencyKeyRequired":{"summary":"Missing or invalid event key","value":{"error":{"code":"idempotency_key_required","message":"Provide an Idempotency-Key of 1–200 letters, numbers, dot, underscore, colon, or hyphen."}}},"invalidPayload":{"summary":"Invalid event data","value":{"error":{"code":"invalid_request","message":"Inbound trigger payload must be a JSON object."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"missingApiKey":{"summary":"API key was not supplied","value":{"error":{"code":"missing_api_key","message":"Provide an apiKey query parameter."}}},"invalidApiKey":{"summary":"API key is invalid","value":{"error":{"code":"invalid_api_key","message":"The API key is invalid."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"403":{"description":"Public API access is unavailable for this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_access_unavailable","message":"API access is unavailable for this account."}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Workspace or published flow is unavailable in the authenticated workspace scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"workspaceNotFound":{"summary":"Workspace is outside the authenticated scope or unavailable","value":{"error":{"code":"workspace_not_found","message":"Workspace not found."}}},"flowNotFound":{"summary":"Published flow was not found","value":{"error":{"code":"flow_not_found","message":"Published V2 flow not found."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"409":{"description":"Idempotency-key conflict or in-progress request, invalid published trigger configuration, or unknown setup outcome. Unknown outcomes include the existing onboarding in data; inspect it before taking action and never create a new key. A removed or archived onboarding conflicts after durable lookup; a still-cached response replays first.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/InboundTriggerUnknownResponse"}]},"examples":{"conflict":{"summary":"Idempotency key used with different content","value":{"error":{"code":"idempotency_conflict","message":"This Idempotency-Key already identifies a different onboarding."}}},"unknown":{"summary":"Synthetic unknown setup outcome","value":{"error":{"code":"setup_outcome_unknown","message":"Setup did not reach a confirmed final state. Inspect this onboarding before further action."},"data":{"id":"55555555-5555-4555-8555-555555555555","flow_id":"22222222-2222-4222-8222-222222222222","workspace_id":"11111111-1111-4111-8111-111111111111","email":"alex@example.test","link":"https://app.360onboard.com/c/0123456789abcdef0123456789abcdef","invitation_requested":false,"created_at":"2026-10-14T17:30:00.000Z","flow_version_id":null,"flow_version_generation":null,"setup_state":"unknown"}}},"processing":{"summary":"Same event is currently processing","value":{"error":{"code":"idempotency_in_progress","message":"A request with this Idempotency-Key is still processing."}}},"invalidTriggerConfiguration":{"summary":"Flow trigger must be enabled and valid","value":{"error":{"code":"trigger_configuration_invalid","message":"Inbound webhook triggering is not enabled for this published flow."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Idempotent-Replayed":{"schema":{"type":"string","enum":["true"]},"description":"Present when this is a durable event replay; absent on a fresh setup attempt."}}},"413":{"description":"Serialized JSON request body exceeds 256,000 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"payload_too_large","message":"Inbound trigger JSON must be 256 KB or smaller."}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"422":{"description":"Onboarding creation or assignment failed due to a plan or setup constraint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"onboarding_creation_failed","message":"Failed to create onboarding."}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Per-key API rate limit exceeded; retry after the response header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}}},"500":{"description":"Unexpected trigger failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"trigger_failed","message":"The inbound event could not create an onboarding."}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"503":{"description":"Temporary lookup, version assignment, or setup verification failure. Retry with the same key; the server checks the existing event before creating another onboarding.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"onboarding_lookup_unavailable","message":"Could not verify whether this event was already processed."}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}}}},"/v2/workspaces/{workspaceId}/flows/{flowId}/stats":{"get":{"operationId":"getFlowStats","summary":"Get flow completion statistics","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"flowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Published V2 flow ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFlowStatsResponse"},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"object":"flow_stats","flow_id":"22222222-2222-4222-8222-222222222222","flow_name":"Client Onboarding","total_clients":10,"completed":6,"in_progress":2,"not_started":2,"completion_rate":60}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Invalid request"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic flow_not_found response","value":{"error":{"code":"flow_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic flow_stats_unavailable response","value":{"error":{"code":"flow_stats_unavailable","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Flows"],"security":[{"apiKey":[]}],"description":"Counts active client onboarding records for the flow and response rows by in_progress/completed. not_started is derived as max(0, total_clients - completed - in_progress); completion_rate is an integer percentage and is zero when there are no clients."}},"/v2/workspaces/{workspaceId}/clients":{"get":{"operationId":"listOrCreateClientsGet","summary":"List onboarding clients","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"1-based page number."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Page size; values above 100 are capped to 100."},{"name":"flow_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Optional flow ID filter."}],"responses":{"200":{"description":"Paginated clients (page defaults to 1, limit to 25, maximum 100)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientList"},"examples":{"sample":{"summary":"Synthetic example response","value":{"object":"list","data":[],"page":1,"limit":25,"total":0,"has_more":false}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"API key missing or invalid."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"API key missing or invalid"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Workspace or resource not found in the authenticated scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"workspace_not_found","message":"Workspace or resource not found in the authenticated scope."}},"examples":{"error":{"summary":"Synthetic flow_not_found response","value":{"error":{"code":"flow_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Unexpected server failure"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"tags":["Clients"],"security":[{"apiKey":[]}],"description":"Lists onboarding clients in the workspace, ordered newest first. page is 1-based; limit defaults to 25 and is capped at 100. Optional flow_id filters results to one flow."},"post":{"operationId":"listOrCreateClientsPost","summary":"Create an onboarding client","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Optional retry key, maximum 200 characters; allowed characters are letters, numbers, dot, underscore, colon, and hyphen. The reservation is keyed by workspace, route, and header value for 24 hours; a stored request-body hash detects changed requests. The same key and same body replays the original response; the same key with a different body returns 409; a matching request still in progress also returns 409."}],"responses":{"201":{"description":"Client created; the body is {data: client}. Invitation email is sent by default unless send_invitation is false.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataClientResponse"},"examples":{"created":{"summary":"Synthetic client creation response","value":{"data":{"id":"44444444-4444-4444-8444-444444444444","object":"client","workspace_id":"11111111-1111-4111-8111-111111111111","first_name":"Jane","last_name":"Smith","full_name":"Jane Smith","email":"jane@example.com","company_name":"Acme Studio","phone":"+1-415-555-0134","flow_id":"22222222-2222-4222-8222-222222222222","flow_name":"Client Onboarding","flow_type":"client","schema_version":2,"status":"not_started","url":"https://onboard.example.com/jane-smith","progress":{"current_step":0,"current_step_id":null,"first_opened_at":null,"started_at":null,"last_activity_at":null,"submitted_at":null,"time_spent_seconds":null},"notifications_silenced":false,"created_at":"2026-09-03T12:00:00Z","updated_at":"2026-09-03T12:00:00Z","api_url":"https://api.360onboard.com/v2/workspaces/11111111-1111-4111-8111-111111111111/clients/44444444-4444-4444-8444-444444444444"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic invalid_request response","value":{"error":{"code":"invalid_request","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Published flow not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Synthetic flow_not_found response","value":{"error":{"code":"flow_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"409":{"description":"Idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic idempotency_conflict response","value":{"error":{"code":"idempotency_conflict","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Unexpected server failure"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClientInput"},"examples":{"createClient":{"summary":"Create an onboarding client","value":{"flow_id":"22222222-2222-4222-8222-222222222222","email":"jane@example.com","first_name":"Jane","last_name":"Smith","company_name":"Acme Studio","phone":"+1-415-555-0134","send_invitation":true}}}}}},"tags":["Clients"],"security":[{"apiKey":[]}],"description":"Creates an onboarding client in the workspace. The flow_id must identify a published V2 flow. Invitation delivery defaults to enabled and may send an email. Optional Idempotency-Key makes retries safe for 24 hours: the same key and body replays the original result; reusing the key with a different body, or while the first request is pending, returns 409."}},"/v2/workspaces/{workspaceId}/clients/{clientId}":{"get":{"operationId":"manageClientGet","summary":"Get an onboarding client","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"V2 client onboarding ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataClientResponse"},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"id":"44444444-4444-4444-8444-444444444444","object":"client","workspace_id":"11111111-1111-4111-8111-111111111111","first_name":"Jane","last_name":"Smith","full_name":"Jane Smith","email":"jane@example.com","company_name":"Acme Studio","phone":"+1-415-555-0134","flow_id":"22222222-2222-4222-8222-222222222222","flow_name":"Client Onboarding","flow_type":"client","schema_version":2,"status":"not_started","url":"https://onboard.example.com/jane-smith","progress":{"current_step":0,"current_step_id":"company-details","last_activity_at":null},"notifications_silenced":false,"created_at":"2026-09-03T12:00:00Z","updated_at":"2026-09-03T12:00:00Z","api_url":"https://api.360onboard.com/v2/workspaces/11111111-1111-4111-8111-111111111111/clients/44444444-4444-4444-8444-444444444444","flow":null}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic invalid_request response","value":{"error":{"code":"invalid_request","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_not_found response","value":{"error":{"code":"client_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_update_failed response","value":{"error":{"code":"client_update_failed","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Clients"],"security":[{"apiKey":[]}],"description":"Returns, updates, or soft-deletes one V2 client onboarding. PATCH accepts one or more identity fields; it does not change the associated flow. DELETE marks the onboarding deleted and returns its ID."},"patch":{"operationId":"manageClientPatch","summary":"Update client identity fields","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"V2 client onboarding ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataClientResponse"},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"id":"44444444-4444-4444-8444-444444444444","object":"client","workspace_id":"11111111-1111-4111-8111-111111111111","first_name":"Jane","last_name":"Smith","full_name":"Jane Smith","email":"jane@example.com","company_name":"Acme Studio","phone":"+1-415-555-0134","flow_id":"22222222-2222-4222-8222-222222222222","flow_name":"Client Onboarding","flow_type":"client","schema_version":2,"status":"not_started","url":"https://onboard.example.com/jane-smith","progress":{"current_step":0,"current_step_id":"company-details","last_activity_at":null},"notifications_silenced":false,"created_at":"2026-09-03T12:00:00Z","updated_at":"2026-09-03T12:00:00Z","api_url":"https://api.360onboard.com/v2/workspaces/11111111-1111-4111-8111-111111111111/clients/44444444-4444-4444-8444-444444444444","flow":null}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic invalid_request response","value":{"error":{"code":"invalid_request","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_not_found response","value":{"error":{"code":"client_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_update_failed response","value":{"error":{"code":"client_update_failed","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateClientInput"},"examples":{"updateClient":{"summary":"Update client contact details","value":{"company_name":"Acme Creative","phone":"+1-415-555-0173"}}}}}},"tags":["Clients"],"security":[{"apiKey":[]}],"description":"Returns, updates, or soft-deletes one V2 client onboarding. PATCH accepts one or more identity fields; it does not change the associated flow. DELETE marks the onboarding deleted and returns its ID."},"delete":{"operationId":"manageClientDelete","summary":"Soft-delete a client onboarding","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"V2 client onboarding ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true},"id":{"type":"string","format":"uuid"}},"required":["deleted","id"],"additionalProperties":true},"examples":{"deleted":{"summary":"Synthetic soft-delete result","value":{"deleted":true,"id":"44444444-4444-4444-8444-444444444444"}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic invalid_request response","value":{"error":{"code":"invalid_request","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_not_found response","value":{"error":{"code":"client_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_update_failed response","value":{"error":{"code":"client_update_failed","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Clients"],"security":[{"apiKey":[]}],"description":"Returns, updates, or soft-deletes one V2 client onboarding. PATCH accepts one or more identity fields; it does not change the associated flow. DELETE marks the onboarding deleted and returns its ID."}},"/v2/workspaces/{workspaceId}/clients/{clientId}/progress":{"get":{"operationId":"getClientProgress","summary":"Get client progress","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"V2 client onboarding ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataClientProgressResponse"},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"object":"client_progress","client_id":"44444444-4444-4444-8444-444444444444","flow_id":"22222222-2222-4222-8222-222222222222","flow_name":"Client Onboarding","status":"in_progress","total_steps":4,"completed_steps":2,"percentage":50,"response_id":"55555555-5555-4555-8555-555555555555","started_at":"2026-09-03T12:00:00Z","completed_at":null,"last_activity_at":"2026-09-03T12:30:00Z"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Invalid request"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_not_found response","value":{"error":{"code":"client_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Server error"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Clients"],"security":[{"apiKey":[]}],"description":"Returns the latest response status and step counts. If there is no response yet, status falls back to the onboarding status (or not_started), and response_id and timestamps may be null."}},"/v2/workspaces/{workspaceId}/clients/{clientId}/remind":{"post":{"operationId":"sendClientReminder","summary":"Send a client reminder","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"V2 client onboarding ID."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Optional retry key. Client creation is retained for 24 hours."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reminded":{"type":"boolean","const":true},"client_id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"}},"required":["reminded","client_id","email"],"additionalProperties":true}},"required":["data"],"additionalProperties":true},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"reminded":true,"client_id":"44444444-4444-4444-8444-444444444444","email":"jane@example.com"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_email_missing response","value":{"error":{"code":"client_email_missing","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_not_found response","value":{"error":{"code":"client_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic reminder_failed response","value":{"error":{"code":"reminder_failed","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Clients"],"security":[{"apiKey":[]}],"description":"Sends an invitation reminder email for this onboarding. It returns 400 when the client has no email and 409 when onboarding is already complete. This action has an external email side effect."}},"/v2/workspaces/{workspaceId}/clients/lookup":{"get":{"operationId":"lookupClientByEmail","summary":"Look up a client by email","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email"},"description":"Client email address to look up in this workspace."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ClientLookupResult"}},"required":["data"],"additionalProperties":true},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"found":false,"client":null}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic invalid_email response","value":{"error":{"code":"invalid_email","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Resource not found"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic client_lookup_failed response","value":{"error":{"code":"client_lookup_failed","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Clients"],"security":[{"apiKey":[]}],"description":"Looks up a client onboarding by email within this workspace. The email query parameter is required and must be valid. The endpoint returns {found:false} when no matching client exists; it does not search outside the workspace."}},"/v2/workspaces/{workspaceId}/responses":{"get":{"operationId":"listResponses","summary":"List responses","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"1-based page number."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"description":"Page size; values above 50 are capped to 50."},{"name":"flow_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Optional flow ID filter."},{"name":"client_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Optional client onboarding ID filter."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["in_progress","completed","abandoned"]},"description":"Optional response status filter."}],"responses":{"200":{"description":"Paginated response records (page defaults to 1, limit to 20, maximum 50)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseList"},"examples":{"sample":{"summary":"Synthetic example response","value":{"object":"list","data":[],"page":1,"limit":20,"total":0,"has_more":false}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"API key missing or invalid."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"API key missing or invalid"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Workspace or resource not found in the authenticated scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"workspace_not_found","message":"Workspace or resource not found in the authenticated scope."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Workspace or resource not found in the authenticated scope"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Synthetic responses_unavailable response","value":{"error":{"code":"responses_unavailable","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"tags":["Responses"],"security":[{"apiKey":[]}],"description":"Lists rich V2 response snapshots, newest first. page defaults to 1 and limit to 20 (maximum 50). Optional flow_id, client_id and status filters are applied within the workspace. status may be in_progress, completed, or abandoned. Each response's steps reflect its assigned published flow definition: disabled steps with no recorded response or evidence are omitted, while recorded answers, receipts, signatures, and restart history remain visible."}},"/v2/workspaces/{workspaceId}/responses/{responseId}":{"get":{"operationId":"getResponse","summary":"Get a response","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"responseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"V2 response ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Response"}},"required":["data"],"additionalProperties":true},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"id":"55555555-5555-4555-8555-555555555555","object":"response","workspace_id":"11111111-1111-4111-8111-111111111111","schema_version":2,"status":"completed","flow_id":"22222222-2222-4222-8222-222222222222","client_id":"44444444-4444-4444-8444-444444444444","started_at":"2026-09-03T12:00:00Z","completed_at":"2026-09-03T12:45:00Z","steps":[{"id":"company-details","object":"response_step","type":"questionnaire","title":"Company details","status":"completed","completed_at":"2026-09-03T12:10:00Z","fields":[{"id":"company_name","label":"Company name","type":"text","value":"Acme Studio"}]}],"api_url":"https://api.360onboard.com/v2/workspaces/11111111-1111-4111-8111-111111111111/responses/55555555-5555-4555-8555-555555555555"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Invalid request"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic response_not_found response","value":{"error":{"code":"response_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic response_unavailable response","value":{"error":{"code":"response_unavailable","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Responses"],"security":[{"apiKey":[]}],"description":"Returns a rich V2 response with its related client, published flow and typed step results. Steps reflect the response's assigned published flow definition: disabled steps with no recorded response or evidence are omitted, while recorded answers, receipts, signatures, and restart history remain visible. Ephemeral field values and outbound integration secrets are excluded; uploaded-file values are represented as sanitized file objects. Finalized signed contracts stay on 360Onboard with an optional separate agency-storage copy. When V2 completion processing runs or retries, it recovers missing contract-copy queue requests; this does not sweep previously completed submissions. Existing copy jobs keep their original destination; if no job was saved, recovery uses the currently configured destination. Before submission completes, the initial copy request remains best effort. Authorized detail reads attempt to retain older external contracts, checking the recorded SHA-256 when available and updating the original artifact reference only after a successful copy. Failed copies preserve the existing reference and may retry on a later read. Automatic retention uses public downloads for legacy or hashless migrated links; private provider retrieval requires a server-recorded SHA-256 and matching configured provider. Inaccessible historical links stay unchanged, and PDF or hash validation failures are never served as contract media. Reused restart evidence remains owned by its original response; copying is not a new signing event. Bulk response lists and multi-response exports read existing contract references without starting historical copy-back; open an individual response or contract to attempt retention."}},"/v2/workspaces/{workspaceId}/webhook-endpoints":{"get":{"operationId":"listOrCreateWebhookEndpointsGet","summary":"List webhook endpoints","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"},"examples":{"empty":{"summary":"No webhook endpoints configured","value":{"object":"list","data":[]}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic invalid_request response","value":{"error":{"code":"invalid_request","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Resource not found"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic webhooks_unavailable response","value":{"error":{"code":"webhooks_unavailable","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Webhooks"],"security":[{"apiKey":[]}],"x-webhook-event-envelope":{"$ref":"#/components/schemas/WebhookEventEnvelope"},"description":"Lists webhook endpoints configured for the workspace. Signing secrets are never returned by this operation. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays."},"post":{"operationId":"listOrCreateWebhookEndpointsPost","summary":"Create a webhook endpoint","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."}],"responses":{"201":{"description":"Endpoint created; the body includes {data: endpoint} and a signing secret returned only once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataWebhookEndpointCreatedResponse"},"examples":{"created":{"summary":"Synthetic endpoint creation response; save the returned secret","value":{"data":{"id":"66666666-6666-4666-8666-666666666666","object":"webhook_endpoint","api_version":"v2","workspace_id":"11111111-1111-4111-8111-111111111111","url":"https://integrations.example.com/360onboard/events","events":["client.completed"],"active":true,"last_triggered_at":null,"last_error":null,"created_at":"2026-09-03T13:00:00Z","updated_at":"2026-09-03T13:00:00Z","secret":"whsec_synthetic_example_secret_returned_once"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid endpoint URL or events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Synthetic invalid_request response","value":{"error":{"code":"invalid_request","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"API key missing or invalid."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"API key missing or invalid"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Workspace or resource not found in the authenticated scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"workspace_not_found","message":"Workspace or resource not found in the authenticated scope."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Workspace or resource not found in the authenticated scope"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Synthetic webhooks_unavailable response","value":{"error":{"code":"webhooks_unavailable","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreateInput"},"examples":{"createEndpoint":{"summary":"Subscribe an HTTPS endpoint to events","value":{"url":"https://integrations.example.com/360onboard/events","events":["client.completed","portal.invoice.paid"]}}}}}},"tags":["Webhooks"],"security":[{"apiKey":[]}],"x-webhook-event-envelope":{"$ref":"#/components/schemas/WebhookEventEnvelope"},"description":"Registers an HTTPS endpoint and event subscriptions for this workspace. The signing secret is returned only in the creation response; save it securely. URLs must resolve only to public IP addresses and use standard HTTPS port 443. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays."}},"/v2/workspaces/{workspaceId}/webhook-endpoints/{endpointId}":{"patch":{"operationId":"manageWebhookEndpointPatch","summary":"Update a webhook endpoint","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint ID in the workspace."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataWebhookEndpointResponse"},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"id":"66666666-6666-4666-8666-666666666666","object":"webhook_endpoint","api_version":"v2","workspace_id":"11111111-1111-4111-8111-111111111111","url":"https://integrations.example.com/360onboard/events","events":["client.completed"],"active":false,"last_triggered_at":null,"last_error":null,"created_at":"2026-09-03T13:00:00Z","updated_at":"2026-09-04T08:00:00Z"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic invalid_request response","value":{"error":{"code":"invalid_request","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic webhook_endpoint_not_found response","value":{"error":{"code":"webhook_endpoint_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic webhook_delete_failed response","value":{"error":{"code":"webhook_delete_failed","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdateInput"},"examples":{"pauseEndpoint":{"summary":"Pause event delivery while retaining the endpoint","value":{"active":false}}}}}},"tags":["Webhooks"],"security":[{"apiKey":[]}],"x-webhook-event-envelope":{"$ref":"#/components/schemas/WebhookEventEnvelope"},"description":"Updates the endpoint URL, event subscriptions, or active state, or deletes the endpoint and its delivery history. At least one patch field is required. URLs must resolve to public IP addresses and use standard HTTPS port 443. Events are sent as signed HTTP POST requests with Content-Type: application/json and User-Agent: 360Onboard-Webhooks/2.0. The X-360Onboard-Signature value is t=<unix-seconds>,v1=<hex HMAC-SHA256>; calculate the MAC over the exact UTF-8 bytes of `${timestamp}.${rawBody}` using the endpoint secret, compare in constant time, and reject timestamps more than five minutes from current time. Also use X-360Onboard-Webhook-Id for delivery deduplication. Network errors and non-2xx responses are retried for up to eight total attempts: approximately 1m, 5m, 15m, 1h, 4h, 12h, then 24h. Return 2xx promptly after accepting an event and process slow work asynchronously. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays."},"delete":{"operationId":"manageWebhookEndpointDelete","summary":"Delete a webhook endpoint","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint ID in the workspace."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true},"id":{"type":"string","format":"uuid"}},"required":["deleted","id"],"additionalProperties":true},"examples":{"sample":{"summary":"Synthetic example response","value":{"deleted":true,"id":"66666666-6666-4666-8666-666666666666"}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic invalid_request response","value":{"error":{"code":"invalid_request","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic webhook_endpoint_not_found response","value":{"error":{"code":"webhook_endpoint_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic webhook_delete_failed response","value":{"error":{"code":"webhook_delete_failed","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Webhooks"],"security":[{"apiKey":[]}],"x-webhook-event-envelope":{"$ref":"#/components/schemas/WebhookEventEnvelope"},"description":"Updates the endpoint URL, event subscriptions, or active state, or deletes the endpoint and its delivery history. At least one patch field is required. URLs must resolve to public IP addresses and use standard HTTPS port 443. Events are sent as signed HTTP POST requests with Content-Type: application/json and User-Agent: 360Onboard-Webhooks/2.0. The X-360Onboard-Signature value is t=<unix-seconds>,v1=<hex HMAC-SHA256>; calculate the MAC over the exact UTF-8 bytes of `${timestamp}.${rawBody}` using the endpoint secret, compare in constant time, and reject timestamps more than five minutes from current time. Also use X-360Onboard-Webhook-Id for delivery deduplication. Network errors and non-2xx responses are retried for up to eight total attempts: approximately 1m, 5m, 15m, 1h, 4h, 12h, then 24h. Return 2xx promptly after accepting an event and process slow work asynchronously. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays."}},"/v2/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/rotate-secret":{"post":{"operationId":"rotateWebhookSecret","summary":"Rotate webhook signing secret","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint ID in the workspace."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}},"required":["data"],"additionalProperties":true},"examples":{"sample":{"summary":"Synthetic example response","value":{"data":{"secret":"whsec_synthetic_rotated_example_secret"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Invalid request"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Missing or invalid API key"}}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Capability unavailable"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"resource_not_found","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Synthetic webhook_endpoint_not_found response","value":{"error":{"code":"webhook_endpoint_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_error","message":"The request could not be completed. Check the response code and message."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Server error"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"tags":["Webhooks"],"security":[{"apiKey":[]}],"x-webhook-event-envelope":{"$ref":"#/components/schemas/WebhookEventEnvelope"},"description":"Replaces the endpoint signing secret and returns the new value once. Update your receiver configuration immediately; the previous secret is no longer the endpoint secret after rotation. Events are sent as signed HTTP POST requests with Content-Type: application/json and User-Agent: 360Onboard-Webhooks/2.0. The X-360Onboard-Signature value is t=<unix-seconds>,v1=<hex HMAC-SHA256>; calculate the MAC over the exact UTF-8 bytes of `${timestamp}.${rawBody}` using the endpoint secret, compare in constant time, and reject timestamps more than five minutes from current time. Also use X-360Onboard-Webhook-Id for delivery deduplication. Network errors and non-2xx responses are retried for up to eight total attempts: approximately 1m, 5m, 15m, 1h, 4h, 12h, then 24h. Return 2xx promptly after accepting an event and process slow work asynchronously. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays."}},"/v2/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"List webhook deliveries","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint ID in the workspace."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Number of recent deliveries; defaults to 25 and is capped at 100."}],"responses":{"200":{"description":"Recent deliveries (limit up to 100)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"},"examples":{"sample":{"summary":"Synthetic example response","value":{"object":"list","data":[]}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"API key missing or invalid."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"API key missing or invalid"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Workspace or resource not found in the authenticated scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"workspace_not_found","message":"Workspace or resource not found in the authenticated scope."}},"examples":{"error":{"summary":"Synthetic webhook_endpoint_not_found response","value":{"error":{"code":"webhook_endpoint_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Synthetic deliveries_unavailable response","value":{"error":{"code":"deliveries_unavailable","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"tags":["Webhooks"],"security":[{"apiKey":[]}],"x-webhook-event-envelope":{"$ref":"#/components/schemas/WebhookEventEnvelope"},"description":"Lists the most recent delivery attempts for an endpoint, newest first. limit defaults to 25 and is capped at 100. Each item includes the immutable payload, attempt state and response/error details. Events are sent as signed HTTP POST requests with Content-Type: application/json and User-Agent: 360Onboard-Webhooks/2.0. The X-360Onboard-Signature value is t=<unix-seconds>,v1=<hex HMAC-SHA256>; calculate the MAC over the exact UTF-8 bytes of `${timestamp}.${rawBody}` using the endpoint secret, compare in constant time, and reject timestamps more than five minutes from current time. Also use X-360Onboard-Webhook-Id for delivery deduplication. Network errors and non-2xx responses are retried for up to eight total attempts: approximately 1m, 5m, 15m, 1h, 4h, 12h, then 24h. Return 2xx promptly after accepting an event and process slow work asynchronously. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays."}},"/v2/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/deliveries/{deliveryId}/replay":{"post":{"operationId":"replayWebhookDelivery","summary":"Replay a webhook delivery","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint ID in the workspace."},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Delivery ID belonging to the specified endpoint."}],"responses":{"200":{"description":"Delivery replay queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookReplayResponse"},"examples":{"sample":{"summary":"Synthetic example response","value":{"id":"77777777-7777-4777-8777-777777777777","replayed":true,"result":"delivered"}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"API key missing or invalid."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"API key missing or invalid"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Synthetic delivery_not_found response","value":{"error":{"code":"delivery_not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Unexpected server failure"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"tags":["Webhooks"],"security":[{"apiKey":[]}],"x-webhook-event-envelope":{"$ref":"#/components/schemas/WebhookEventEnvelope"},"description":"Resets the selected delivery and immediately attempts to send its original immutable payload again. It does not rebuild data from current workspace records. Replays can trigger your downstream side effects, so deduplicate by X-360Onboard-Webhook-Id. Events are sent as signed HTTP POST requests with Content-Type: application/json and User-Agent: 360Onboard-Webhooks/2.0. The X-360Onboard-Signature value is t=<unix-seconds>,v1=<hex HMAC-SHA256>; calculate the MAC over the exact UTF-8 bytes of `${timestamp}.${rawBody}` using the endpoint secret, compare in constant time, and reject timestamps more than five minutes from current time. Also use X-360Onboard-Webhook-Id for delivery deduplication. Network errors and non-2xx responses are retried for up to eight total attempts: approximately 1m, 5m, 15m, 1h, 4h, 12h, then 24h. Return 2xx promptly after accepting an event and process slow work asynchronously. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays. Webhook receivers should verify the HMAC signature against the exact raw request body, compare signatures in constant time, deduplicate X-360Onboard-Webhook-Id, and reject timestamps more than 300 seconds from their current time. The five-minute tolerance is receiver guidance. Failed network requests and non-2xx responses are retried up to eight total attempts with increasing delays."}},"/v2/workspaces/{workspaceId}/portal/services":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_services","summary":"List service offerings","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Lists workspace service offerings and indicates whether the connected Stripe account can accept payments. Each service uses the mapped PortalService shape.","content":{"application/json":{"schema":{"type":"object","properties":{"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"features":{"type":"array","items":{"type":"string"}},"amountCents":{"type":"integer","minimum":1,"description":"The integer price in ISO minor units. Complete offers must be at least one major currency unit (JPY 1, USD 100, KWD 1000 minor units)."},"currency":{"type":"string","enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","ved","ves","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw","zwg"]},"billingType":{"type":"string","enum":["one_time","subscription"]},"recurringInterval":{"type":["string","null"],"enum":["week","month","year",null]},"active":{"type":"boolean","description":"Whether the service is published. False is team-only Draft and clears the client audience."},"clientAccountIds":{"oneOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}],"description":"Drafts have no client audience and return null. For active services, null means all clients and a nonempty array selects workspace account UUIDs. Publishing a draft requires an explicit clientAccountIds choice (null for all clients or a nonempty array of workspace account UUIDs); omission returns 400. Unpublishing clears the selection, so choose an audience again before republishing."},"updatedAt":{"type":"string","format":"date-time"},"onboardingFlowId":{"type":["string","null"],"format":"uuid","description":"Optional V2 client onboarding flow in this workspace that sells this service through its public Buy Now link; null when unlinked. The flow must be active (not archived) and each flow can sell at most one service. When a client pays that flow's payment step, the service purchase is recorded as paid on the client's portal account, adding the client to the portal without an invite if needed, with the amount and provider reference actually charged, and the service delivery runs once per payment."},"delivery":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["none"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["template"]},"templateId":{"type":"string","format":"uuid"}},"required":["type","templateId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["playbook"]},"playbookId":{"type":"string","format":"uuid"}},"required":["type","playbookId"],"additionalProperties":false}]}},"required":["id","title","description","features","amountCents","currency","billingType","recurringInterval","active","clientAccountIds","updatedAt","delivery","onboardingFlowId"],"additionalProperties":false,"allOf":[{"$ref":"#/components/schemas/PortalServiceCurrencyMinimum"},{"if":{"properties":{"active":{"const":false}},"required":["active"]},"then":{"properties":{"clientAccountIds":{"type":"null"}}}}]}},"paymentsEnabled":{"type":"boolean"}},"required":["services","paymentsEnabled"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"services":[{"id":"11111111-1111-4111-8111-111111111111","title":"Monthly strategy support","description":"Ongoing planning and review.","features":["Monthly planning call"],"amountCents":12500,"currency":"usd","billingType":"subscription","recurringInterval":"month","active":true,"clientAccountIds":null,"updatedAt":"2026-10-14T12:00:00.000Z","onboardingFlowId":null,"delivery":{"type":"none"}}],"paymentsEnabled":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List service offerings. Service offerings are workspace-scoped; inactive offerings are team-only drafts with no client audience and are not available for new purchases. `amountCents` is an integer in ISO minor units (USD 12500 = $125.00, JPY 100 = ¥100, KWD 1234 = KWD 1.234). A complete offer must cost at least one major currency unit (JPY 1, USD 100, or KWD 1000 minor units); partial updates accept at least 1 and validate against the resulting currency. Stripe purchases require a connected account and a currency and amount supported by Stripe. Requires the workspace client-view capability. Drafts are team-only and return clientAccountIds:null; published services expose only to all clients or the selected workspace accounts.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_services","summary":"Create service offering","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create service offering; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"service":{"$ref":"#/components/schemas/PortalService"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"service":{"id":"00000000-0000-4000-8000-000000000401","title":"Brand strategy","description":"A discovery and positioning package.","features":["Workshop","Strategy brief"],"amountCents":250000,"currency":"usd","billingType":"one_time","recurringInterval":null,"active":true,"clientAccountIds":null,"onboardingFlowId":null,"delivery":{"type":"none"},"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Creates an unpublished one-time service offering. For one_time billing, recurringInterval must be null. The offering remains unavailable for purchase until activated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_services_PortalServicePayload"},"examples":{"synthetic":{"summary":"Create an unpublished one-time service offering","value":{"title":"Brand strategy","amountCents":25000,"currency":"usd","billingType":"one_time","recurringInterval":null,"active":false,"delivery":{"type":"none"}}}}}}},"description":"Create service offering. Service offerings are workspace-scoped; inactive offerings are not available for new purchases. `amountCents` is an integer in ISO minor units (USD 12500 = $125.00, JPY 100 = ¥100, KWD 1234 = KWD 1.234). A complete offer must cost at least one major currency unit (JPY 1, USD 100, or KWD 1000 minor units); partial updates accept at least 1 and validate against the resulting currency. Stripe purchases require a connected account and a currency and amount supported by Stripe. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. active:false clears the client audience. Publishing a draft with active:true requires an explicit clientAccountIds choice: null for all clients or a nonempty array of workspace account UUIDs. Missing audience returns 400. Unpublishing clears the selection, so republishing requires a new choice. Existing purchases retain their agreed terms and delivery. Set onboardingFlowId to a V2 client onboarding flow in this workspace to sell the service through that flow's public Buy Now link, or null to unlink it. An archived, foreign, non-client, or already-linked flow returns 400. When a client pays that flow's payment step, the purchase is recorded as paid on their portal account (created and sent a portal invite if needed) and the delivery plan runs once per payment. The flow's payment step sets the price, so the service's own amountCents is not charged, and POST .../services/{serviceId}/purchase returns 409 for a linked service.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["PortalServicePayload"],"x-observed-response-keys":["error","service"],"x-required-capabilities":["can_manage_services"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/services/{serviceId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_services_serviceId","summary":"Get service offering","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"serviceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the requested non-archived service as `{ service }`.","content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"features":{"type":"array","items":{"type":"string"}},"amountCents":{"type":"integer","minimum":1,"description":"The integer price in ISO minor units. Complete offers must be at least one major currency unit (JPY 1, USD 100, KWD 1000 minor units)."},"currency":{"type":"string","enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","ved","ves","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw","zwg"]},"billingType":{"type":"string","enum":["one_time","subscription"]},"recurringInterval":{"type":["string","null"],"enum":["week","month","year",null]},"active":{"type":"boolean","description":"Whether the service is published. False is team-only Draft and clears the client audience."},"clientAccountIds":{"oneOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}],"description":"Drafts have no client audience and return null. For active services, null means all clients and a nonempty array selects workspace account UUIDs. Publishing a draft requires an explicit clientAccountIds choice (null for all clients or a nonempty array of workspace account UUIDs); omission returns 400. Unpublishing clears the selection, so choose an audience again before republishing."},"updatedAt":{"type":"string","format":"date-time"},"onboardingFlowId":{"type":["string","null"],"format":"uuid","description":"Optional V2 client onboarding flow in this workspace that sells this service through its public Buy Now link; null when unlinked. The flow must be active (not archived) and each flow can sell at most one service. When a client pays that flow's payment step, the service purchase is recorded as paid on the client's portal account, adding the client to the portal without an invite if needed, with the amount and provider reference actually charged, and the service delivery runs once per payment."},"delivery":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["none"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["template"]},"templateId":{"type":"string","format":"uuid"}},"required":["type","templateId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["playbook"]},"playbookId":{"type":"string","format":"uuid"}},"required":["type","playbookId"],"additionalProperties":false}]}},"required":["id","title","description","features","amountCents","currency","billingType","recurringInterval","active","clientAccountIds","updatedAt","delivery","onboardingFlowId"],"additionalProperties":false,"allOf":[{"$ref":"#/components/schemas/PortalServiceCurrencyMinimum"},{"if":{"properties":{"active":{"const":false}},"required":["active"]},"then":{"properties":{"clientAccountIds":{"type":"null"}}}}]}},"required":["service"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"service":{"id":"11111111-1111-4111-8111-111111111111","title":"Monthly strategy support","description":"Ongoing planning and review.","features":["Monthly planning call"],"amountCents":12500,"currency":"usd","billingType":"subscription","recurringInterval":"month","active":true,"clientAccountIds":null,"updatedAt":"2026-10-14T12:00:00.000Z","onboardingFlowId":null,"delivery":{"type":"none"}}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get service offering. Service offerings are workspace-scoped; inactive offerings are team-only drafts with no client audience and are not available for new purchases. `amountCents` is an integer in ISO minor units (USD 12500 = $125.00, JPY 100 = ¥100, KWD 1234 = KWD 1.234). A complete offer must cost at least one major currency unit (JPY 1, USD 100, or KWD 1000 minor units); partial updates accept at least 1 and validate against the resulting currency. Stripe purchases require a connected account and a currency and amount supported by Stripe. Requires the workspace client-view capability. Drafts are team-only and return clientAccountIds:null; published services expose only to all clients or the selected workspace accounts.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_services_serviceId","summary":"Update service offering","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"serviceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the updated service as `{ service }`.","content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"features":{"type":"array","items":{"type":"string"}},"amountCents":{"type":"integer","minimum":1,"description":"The integer price in ISO minor units. Complete offers must be at least one major currency unit (JPY 1, USD 100, KWD 1000 minor units)."},"currency":{"type":"string","enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","ved","ves","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw","zwg"]},"billingType":{"type":"string","enum":["one_time","subscription"]},"recurringInterval":{"type":["string","null"],"enum":["week","month","year",null]},"active":{"type":"boolean","description":"Whether the service is published. False is team-only Draft and clears the client audience."},"clientAccountIds":{"oneOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}],"description":"Drafts have no client audience and return null. For active services, null means all clients and a nonempty array selects workspace account UUIDs. Publishing a draft requires an explicit clientAccountIds choice (null for all clients or a nonempty array of workspace account UUIDs); omission returns 400. Unpublishing clears the selection, so choose an audience again before republishing."},"updatedAt":{"type":"string","format":"date-time"},"onboardingFlowId":{"type":["string","null"],"format":"uuid","description":"Optional V2 client onboarding flow in this workspace that sells this service through its public Buy Now link; null when unlinked. The flow must be active (not archived) and each flow can sell at most one service. When a client pays that flow's payment step, the service purchase is recorded as paid on the client's portal account, adding the client to the portal without an invite if needed, with the amount and provider reference actually charged, and the service delivery runs once per payment."},"delivery":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["none"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["template"]},"templateId":{"type":"string","format":"uuid"}},"required":["type","templateId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["playbook"]},"playbookId":{"type":"string","format":"uuid"}},"required":["type","playbookId"],"additionalProperties":false}]}},"required":["id","title","description","features","amountCents","currency","billingType","recurringInterval","active","clientAccountIds","updatedAt","delivery","onboardingFlowId"],"additionalProperties":false,"allOf":[{"$ref":"#/components/schemas/PortalServiceCurrencyMinimum"},{"if":{"properties":{"active":{"const":false}},"required":["active"]},"then":{"properties":{"clientAccountIds":{"type":"null"}}}}]}},"required":["service"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"service":{"id":"11111111-1111-4111-8111-111111111111","title":"Monthly strategy and review","description":"Ongoing planning and review.","features":["Monthly planning call"],"amountCents":12500,"currency":"usd","billingType":"subscription","recurringInterval":"month","active":true,"clientAccountIds":null,"updatedAt":"2026-10-14T12:00:00.000Z","onboardingFlowId":null,"delivery":{"type":"none"}}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Send only the service fields to change. Setting active=false removes it from new purchase selection; existing purchases remain historical records.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_services_PortalServicePatch"},"examples":{"synthetic":{"summary":"Update the service title and publication state","value":{"title":"Brand strategy","active":false,"expectedRevision":"2026-10-19T01:00:00.123456Z"}},"publishAll":{"summary":"Publish a draft to an explicitly chosen all-client audience","value":{"active":true,"clientAccountIds":null,"expectedRevision":"2026-10-26T12:00:00Z"}},"publishSelected":{"summary":"Publish a draft to a selected client","value":{"active":true,"clientAccountIds":["00000000-0000-4000-8000-000000000001"],"expectedRevision":"2026-10-26T12:00:00Z"}},"teamOnlyDraft":{"summary":"Return a service to team-only Draft and clear its client audience","value":{"active":false,"expectedRevision":"2026-10-26T12:00:00Z"}},"linkOnboardingFlow":{"summary":"Sell the service through an onboarding flow's Buy Now link","value":{"onboardingFlowId":"00000000-0000-4000-8000-000000000601","expectedRevision":"2026-10-26T12:00:00Z"}}}}}},"description":"Update service offering. Service offerings are workspace-scoped; inactive offerings are not available for new purchases. `amountCents` is an integer in ISO minor units (USD 12500 = $125.00, JPY 100 = ¥100, KWD 1234 = KWD 1.234). A complete offer must cost at least one major currency unit (JPY 1, USD 100, or KWD 1000 minor units); partial updates accept at least 1 and validate against the resulting currency. Stripe purchases require a connected account and a currency and amount supported by Stripe. Requires the workspace client-management capability. Beta: requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. active:false clears the client audience. Publishing a draft with active:true requires an explicit clientAccountIds choice: null for all clients or a nonempty array of workspace account UUIDs. Missing audience returns 400. Unpublishing clears the selection, so republishing requires a new choice. Existing purchases retain their agreed terms and delivery. Set onboardingFlowId to a V2 client onboarding flow in this workspace to sell the service through that flow's public Buy Now link, or null to unlink it. An archived, foreign, non-client, or already-linked flow returns 400. When a client pays that flow's payment step, the purchase is recorded as paid on their portal account (created and sent a portal invite if needed) and the delivery plan runs once per payment. The flow's payment step sets the price, so the service's own amountCents is not charged, and POST .../services/{serviceId}/purchase returns 409 for a linked service.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["PortalServicePatch","PortalServicePayload"],"x-observed-response-keys":["error"],"x-required-capabilities":["can_manage_services"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_services_serviceId","summary":"Delete or archive service offering","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"serviceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive service offering; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive service offering. Service offerings are workspace-scoped; inactive offerings are team-only drafts with no client audience and are not available for new purchases. `amountCents` is an integer in ISO minor units (USD 12500 = $125.00, JPY 100 = ¥100, KWD 1234 = KWD 1.234). A complete offer must cost at least one major currency unit (JPY 1, USD 100, or KWD 1000 minor units); partial updates accept at least 1 and validate against the resulting currency. Stripe purchases require a connected account and a currency and amount supported by Stripe. Requires the workspace client-management capability. This is a soft archive/delete where the route preserves historical references or item values as described by the resource lifecycle. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_manage_services"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/services/{serviceId}/purchase":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_services_serviceId_purchase","summary":"Prepare a purchase invoice for a portal service","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"serviceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Creates or reuses the service purchase invoice for the account and returns it as `{ invoice }`. The endpoint prepares the purchase; it does not charge the client.","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"number":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"},"issuedAt":{"type":["string","null"]},"dueAt":{"type":["string","null"]},"memo":{"type":["string","null"]},"billTo":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"items":{"oneOf":[{"type":"array","items":{"type":"object","additionalProperties":true}},{"type":"null"}]},"subtotal":{"type":["number","null"]},"taxName":{"type":["string","null"]},"taxRate":{"type":["number","null"]},"taxAmount":{"type":["number","null"]},"paidAt":{"type":["string","null"]},"paymentRef":{"type":["string","null"]},"billingType":{"type":"string"},"recurringInterval":{"type":["string","null"]},"recurringActive":{"type":"boolean"},"nextIssueAt":{"type":["string","null"]},"parentInvoiceId":{"type":["string","null"]},"stripeSubscriptionId":{"type":["string","null"]},"stripeCustomerId":{"type":["string","null"]},"serviceId":{"type":["string","null"]},"subscriptionStatus":{"type":["string","null"]},"cancelAtPeriodEnd":{"type":"boolean"},"currentPeriodEnd":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","workspaceId","number","amount","currency","status","issuedAt","dueAt","memo","billTo","items","subtotal","taxName","taxRate","taxAmount","paidAt","paymentRef","billingType","recurringInterval","recurringActive","nextIssueAt","parentInvoiceId","stripeSubscriptionId","stripeCustomerId","serviceId","subscriptionStatus","cancelAtPeriodEnd","currentPeriodEnd","createdAt","updatedAt"],"additionalProperties":false}},"required":["invoice"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"invoice":{"id":"11111111-1111-4111-8111-111111111111","accountId":"33333333-3333-4333-8333-333333333333","workspaceId":"22222222-2222-4222-8222-222222222222","number":"INV-042","amount":125,"currency":"usd","status":"sent","issuedAt":"2026-10-14T12:00:00.000Z","dueAt":"2026-10-28T12:00:00.000Z","memo":"October support","billTo":["Strategy support"],"items":[{"n":"Monthly support","q":1,"u":125}],"subtotal":125,"taxName":null,"taxRate":null,"taxAmount":null,"paidAt":null,"paymentRef":null,"billingType":"one_time","recurringInterval":null,"recurringActive":true,"nextIssueAt":null,"parentInvoiceId":null,"stripeSubscriptionId":null,"stripeCustomerId":null,"serviceId":null,"subscriptionStatus":null,"cancelAtPeriodEnd":false,"currentPeriodEnd":null,"createdAt":"2026-10-14T12:00:00.000Z","updatedAt":"2026-10-14T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_services_PurchasePortalServicePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"purchaseKey":"00000000-0000-4000-8000-000000000001"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Prepare a purchase invoice for a portal service. Purchase preparation creates invoice/delivery records but does not charge the client or start a subscription. Reuse the purchase key for retries when provided. Requires the workspace client-management capability. This prepares a purchase; one-time purchases do not accept subscription billing mode, and recurring purchases can choose automatic payments or manual invoice scheduling. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["PurchasePortalServicePayload"],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_invoices","can_manage_invoices"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/service-purchases":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_service_purchases","summary":"List service purchases","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","required":false,"description":"Zero-based pagination offset; must be a non-negative integer.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Returns up to 20 top-level service purchases in descending creation order, with the mapped invoice, fulfillment time, delivered milestones, and a `hasMore` flag.","content":{"application/json":{"schema":{"type":"object","properties":{"purchases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"number":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"},"issuedAt":{"type":["string","null"]},"dueAt":{"type":["string","null"]},"memo":{"type":["string","null"]},"billTo":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"items":{"oneOf":[{"type":"array","items":{"type":"object","additionalProperties":true}},{"type":"null"}]},"subtotal":{"type":["number","null"]},"taxName":{"type":["string","null"]},"taxRate":{"type":["number","null"]},"taxAmount":{"type":["number","null"]},"paidAt":{"type":["string","null"]},"paymentRef":{"type":["string","null"]},"billingType":{"type":"string"},"recurringInterval":{"type":["string","null"]},"recurringActive":{"type":"boolean"},"nextIssueAt":{"type":["string","null"]},"parentInvoiceId":{"type":["string","null"]},"stripeSubscriptionId":{"type":["string","null"]},"stripeCustomerId":{"type":["string","null"]},"serviceId":{"type":["string","null"]},"subscriptionStatus":{"type":["string","null"]},"cancelAtPeriodEnd":{"type":"boolean"},"currentPeriodEnd":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","workspaceId","number","amount","currency","status","issuedAt","dueAt","memo","billTo","items","subtotal","taxName","taxRate","taxAmount","paidAt","paymentRef","billingType","recurringInterval","recurringActive","nextIssueAt","parentInvoiceId","stripeSubscriptionId","stripeCustomerId","serviceId","subscriptionStatus","cancelAtPeriodEnd","currentPeriodEnd","createdAt","updatedAt"],"additionalProperties":false},"fulfilledAt":{"type":["string","null"]},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string"},"acceptedAt":{"type":["string","null"]}},"required":["id","title","status","acceptedAt"],"additionalProperties":false}}},"required":["id","invoice","fulfilledAt","milestones"],"additionalProperties":false}},"hasMore":{"type":"boolean"}},"required":["purchases","hasMore"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"purchases":[{"id":"11111111-1111-4111-8111-111111111111","invoice":{"id":"11111111-1111-4111-8111-111111111111","accountId":"33333333-3333-4333-8333-333333333333","workspaceId":"22222222-2222-4222-8222-222222222222","number":"INV-042","amount":125,"currency":"usd","status":"sent","issuedAt":"2026-10-14T12:00:00.000Z","dueAt":"2026-10-28T12:00:00.000Z","memo":"October support","billTo":["Strategy support"],"items":[{"n":"Monthly support","q":1,"u":125}],"subtotal":125,"taxName":null,"taxRate":null,"taxAmount":null,"paidAt":null,"paymentRef":null,"billingType":"one_time","recurringInterval":null,"recurringActive":true,"nextIssueAt":null,"parentInvoiceId":null,"stripeSubscriptionId":null,"stripeCustomerId":null,"serviceId":null,"subscriptionStatus":null,"cancelAtPeriodEnd":false,"currentPeriodEnd":null,"createdAt":"2026-10-14T12:00:00.000Z","updatedAt":"2026-10-14T12:00:00.000Z"},"fulfilledAt":null,"milestones":[{"id":"22222222-2222-4222-8222-222222222222","title":"Kickoff","status":"todo","acceptedAt":null}]}],"hasMore":false}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List service purchases. Purchase preparation creates invoice/delivery records but does not charge the client or start a subscription. Reuse the purchase key for retries when provided. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/service-purchases/{invoiceId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_service_purchases_invoiceId","summary":"Get one service purchase","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get one service purchase; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"purchase":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"purchase":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get one service purchase. Purchase preparation creates invoice/delivery records but does not charge the client or start a subscription. Reuse the purchase key for retries when provided. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","purchase"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/service-purchases/{invoiceId}/fulfill":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_service_purchases_invoiceId_fulfill","summary":"Retry delivery of a paid service purchase","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the fulfillment result from the idempotent service. `fulfilled` indicates whether this call created delivery milestones; `milestoneIds` lists the resulting records.","content":{"application/json":{"schema":{"type":"object","properties":{"fulfilled":{"type":"boolean"},"milestoneIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["fulfilled","milestoneIds"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"fulfilled":true,"milestoneIds":["22222222-2222-4222-8222-222222222222"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Retry delivery of a paid service purchase. Purchase preparation creates invoice/delivery records but does not charge the client or start a subscription. Reuse the purchase key for retries when provided. Requires the workspace client-management capability. Fulfillment is safe to retry for an already-paid purchase and never marks an unpaid invoice paid. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_invoices","can_manage_invoices"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/invoices/{invoiceId}/subscription":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_invoices_invoiceId_subscription","summary":"Get invoice subscription details","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the current subscription or manual-renewal state for the invoice.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"cancelAtPeriodEnd":{"type":"boolean"},"currentPeriodEnd":{"type":["string","null"]}},"required":["status","cancelAtPeriodEnd","currentPeriodEnd"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"status":"active","cancelAtPeriodEnd":false,"currentPeriodEnd":"2026-11-14T12:00:00.000Z"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get invoice subscription details. Returns subscription state tied to this account’s invoices or payment records. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/responses":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_responses","summary":"List onboarding responses","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","required":false,"description":"Zero-based pagination offset; must be a non-negative integer.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Returns paginated onboarding response summaries for the account. `hasMore` indicates whether another page exists; use the `offset` query parameter to continue.","content":{"application/json":{"schema":{"type":"object","properties":{"responses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"flowName":{"type":"string"},"status":{"type":"string"},"startedAt":{"type":["string","null"]},"submittedAt":{"type":["string","null"]}},"required":["id","flowName","status","startedAt","submittedAt"],"additionalProperties":false}},"hasMore":{"type":"boolean"}},"required":["responses","hasMore"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"responses":[{"id":"11111111-1111-4111-8111-111111111111","flowName":"New client onboarding","status":"completed","startedAt":"2026-10-14T12:00:00.000Z","submittedAt":"2026-10-14T12:00:00.000Z"}],"hasMore":false}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List onboarding responses. Returns onboarding responses linked to this client account; offset is a non-negative pagination offset. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/responses/{responseId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_responses_responseId","summary":"Get one onboarding response","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"responseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns one account-scoped onboarding response summary and the ordered, client-visible step answers. Sensitive password, hidden, token, secret, and storage values are omitted. E-signature steps can include `hasFinalizedArtifact`.","content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"flowName":{"type":"string"},"status":{"type":"string"},"startedAt":{"type":["string","null"]},"submittedAt":{"type":["string","null"]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"completedAt":{"type":["string","null"]},"answers":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},"hasFinalizedArtifact":{"type":"boolean"}},"required":["id","title","type","status","completedAt","answers"],"additionalProperties":true}}},"required":["id","flowName","status","startedAt","submittedAt","steps"],"additionalProperties":false}},"required":["response"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"response":{"id":"11111111-1111-4111-8111-111111111111","flowName":"New client onboarding","status":"completed","startedAt":"2026-10-14T12:00:00.000Z","submittedAt":"2026-10-14T12:00:00.000Z","steps":[{"id":"11111111-1111-4111-8111-111111111111","title":"Business details","type":"questionnaire","status":"completed","completedAt":"2026-10-14T12:00:00.000Z","answers":[{"label":"Company name","value":"Acme Studio"}]}]}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get one onboarding response. Returns onboarding responses linked to this client account; offset is a non-negative pagination offset. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/subscriptions":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_subscriptions","summary":"List subscriptions","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list subscriptions; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/PortalSubscription"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"subscriptions":[{"id":"sub_example","invoiceId":"00000000-0000-4000-8000-000000000701","status":"active","interval":"month","nextPaymentAt":"2026-02-15T12:00:00.000Z","createdAt":"2026-01-15T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List subscriptions. Returns subscription state tied to this account’s invoices or payment records. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","subscriptions"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/subscriptions/{paymentId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_subscriptions_paymentId","summary":"Get one subscription payment record","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"paymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get one subscription payment record; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"subscription":{"$ref":"#/components/schemas/PortalSubscription"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"subscription":{"id":"sub_example","invoiceId":"00000000-0000-4000-8000-000000000701","status":"active","interval":"month","nextPaymentAt":"2026-02-15T12:00:00.000Z","createdAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get one subscription payment record. Returns subscription state tied to this account’s invoices or payment records. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","subscription"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/access-subjects":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_access_subjects","summary":"List valid file access targets","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"query","required":false,"description":"Restrict access subjects to this client account UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the selectable account and person subjects for portal file and folder access, with the supported access modes.","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"company_name":{"type":"string"},"slug":{"type":["string","null"]},"status":{"type":"string"}},"required":["id","company_name","slug","status"],"additionalProperties":false}},"people":{"type":"array","items":{"type":"object","properties":{"person_id":{"type":"string","format":"uuid"},"portal_member_id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid"},"role":{"type":["string","null"]},"name":{"type":"string"},"email":{"type":["string","null"]}},"required":["person_id","portal_member_id","account_id","role","name","email"],"additionalProperties":false}},"accessContract":{"type":"object","additionalProperties":true}},"required":["accounts","people","accessContract"],"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"accounts":[{"id":"33333333-3333-4333-8333-333333333333","company_name":"Acme Studio","slug":"acme-studio","status":"active"}],"people":[{"person_id":"11111111-1111-4111-8111-111111111111","portal_member_id":"22222222-2222-4222-8222-222222222222","account_id":"33333333-3333-4333-8333-333333333333","role":"client","name":"Jordan Lee","email":"jordan@example.test"}],"accessContract":{"all":{"mode":"all"},"teamOnly":{"mode":"team"},"specific":{"mode":"specific","accountIds":"Select IDs from accounts","personIds":"Select person_id values from people"}}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List valid file access targets. Returns only valid account/person identifiers that can be assigned to file or folder access. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts","summary":"List client accounts","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list client accounts; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/PortalAccount"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"accounts":[{"id":"00000000-0000-4000-8000-000000000101","workspaceId":"00000000-0000-4000-8000-000000000001","primaryPersonId":null,"companyName":"Acme Studio","slug":"acme-studio","status":"onboarding","branding":null,"avatarUrl":null,"customFields":{},"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List client accounts. Accounts are scoped to the authenticated workspace. Client references and custom fields are validated in that workspace. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["accounts"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts","summary":"Create client account","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create client account; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/PortalAccount"},"member":{"$ref":"#/components/schemas/PortalMember"},"invited":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"account":{"id":"00000000-0000-4000-8000-000000000101","workspaceId":"00000000-0000-4000-8000-000000000001","primaryPersonId":null,"companyName":"Acme Studio","slug":"acme-studio","status":"onboarding","branding":null,"avatarUrl":null,"customFields":{},"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"},"member":{"id":"00000000-0000-4000-8000-000000000801","personId":"00000000-0000-4000-8000-000000000802","email":"client@example.test","firstName":"Alex","lastName":"Rivera","name":"Alex Rivera","companyName":"Acme Studio","role":"Primary contact","status":"active","createdAt":"2026-01-15T12:00:00.000Z"},"invited":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/client_portal_CreatePortalAccountPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"companyName":"Acme Studio"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create client account. Accounts are scoped to the authenticated workspace. Client references and custom fields are validated in that workspace. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalAccountPayload"],"x-observed-response-keys":["account","error"],"x-required-capabilities":["can_create_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/activity":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_activity","summary":"List account activity events","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"audience","in":"query","required":false,"description":"Select which representation to return: `agency` includes agency-only fields; `client` returns client-visible projection. Default is agency unless handler documents otherwise.","schema":{"type":"string","enum":["agency","client"]}},{"name":"limit","in":"query","required":false,"description":"Maximum number of events to return. Defaults to 100 and is capped at 500 for this operation.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"targetId","in":"query","required":false,"description":"Filter activity to this resource UUID. Supply together with targetType. For paginated activity, this must identify the task.","schema":{"type":"string","format":"uuid"}},{"name":"targetType","in":"query","required":false,"description":"Filter activity to this resource type. Supply together with targetId. Paginated history currently supports task targets.","schema":{"type":"string","enum":["file","task","file_group","milestone","onboarding"]}},{"name":"paginate","in":"query","required":false,"description":"Pass the string `1` to opt into cursor pagination. Requires targetType=task and targetId. Without it, the existing `{ events }` response is preserved.","schema":{"type":"string","enum":["1"]}},{"name":"before","in":"query","required":false,"description":"Timestamp from the previous page cursor. Supply together with beforeId and paginate=1.","schema":{"type":"string","format":"date-time"}},{"name":"beforeId","in":"query","required":false,"description":"Event UUID from the previous page cursor. Supply together with before and paginate=1.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns reverse-chronological activity. Without paginate=1, the response remains { events }. For task history, paginate=1 with targetType=task and targetId returns { events, hasMore, cursor }; pass cursor.before and cursor.beforeId together to continue. Client audience pages omit internal events and tasks the client cannot currently see. Task pages are scoped to the authorized workspace and account before pagination.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"targetType":{"type":"string"},"targetId":{"type":"string","format":"uuid"},"action":{"type":"string"},"icon":{"type":"string"},"tone":{"type":"string"},"body":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"actorType":{"type":"string"},"actorName":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["id","targetType","targetId","action","createdAt"],"additionalProperties":true}},"hasMore":{"type":"boolean","description":"Present in paginated task responses; true when another page is available."},"cursor":{"description":"Present in paginated task responses; null at the end of history.","oneOf":[{"type":"object","properties":{"before":{"type":"string","format":"date-time"},"beforeId":{"type":"string","format":"uuid"}},"required":["before","beforeId"],"additionalProperties":false},{"type":"null"}]}},"required":["events"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"events":[{"id":"11111111-1111-4111-8111-111111111111","targetType":"task","targetId":"11111111-1111-4111-8111-111111111111","action":"created","icon":"bx-check-square","tone":"info","body":"Kickoff milestone","createdAt":"2026-10-14T12:00:00.000Z","actorType":"agency","actorName":"Alex Morgan","items":[{"kind":"activity_meta","target":"“Prepare kickoff”","audience":"all"}]}]}},"taskPage":{"summary":"Synthetic paginated task activity response","value":{"events":[{"id":"22222222-2222-4222-8222-222222222222","targetType":"task","targetId":"33333333-3333-4333-8333-333333333333","action":"completed","icon":"bx-check-circle","tone":"success","body":null,"createdAt":"2026-10-14T11:45:00.000Z","actorType":"client","actorName":"Jordan Lee","items":[{"kind":"activity_meta","target":"“Prepare kickoff”","audience":"all"}]}],"hasMore":true,"cursor":{"before":"2026-10-14T11:45:00.000Z","beforeId":"22222222-2222-4222-8222-222222222222"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Account not found, or a task is not visible to the client audience. For audience=client task pages, hidden, deleted, and nonexistent tasks return the same task_not_found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List activity for one portal account. Default behavior and response remain { events }. For task activity, explicitly opt in with paginate=1, targetType=task, and targetId; pages return { events, hasMore, cursor } with a stable timestamp/event UUID cursor. targetType and targetId must be supplied together. Client audience pages omit internal events and tasks the client cannot currently see. All page reads are scoped to the authorized workspace and account before pagination. Requires can_view_clients.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/comments":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_comments","summary":"List comments","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"audience","in":"query","required":false,"description":"Select which representation to return: `agency` includes agency-only fields; `client` returns client-visible projection. Default is agency unless handler documents otherwise.","schema":{"type":"string","enum":["agency","client"]}},{"name":"targetId","in":"query","required":false,"description":"Filter activity/comments to this resource UUID.","schema":{"type":"string","format":"uuid"}},{"name":"targetType","in":"query","required":false,"description":"Filter activity/comments to the named resource type.","schema":{"type":"string","enum":["file","task","file_group","milestone","onboarding"]}},{"name":"viewerPersonId","in":"query","required":false,"description":"Optional client person UUID used when resolving viewer-specific comment visibility.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the visible comments for the requested target and next available annotation pin numbers grouped by file version.","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"authorAvatar":{"type":["string","null"]},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"targetType":{"type":"string"},"targetId":{"type":"string","format":"uuid"},"authorType":{"type":"string"},"authorId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"authorName":{"oneOf":[{"type":"string"},{"type":"null"}]},"parentId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"body":{"type":"string"},"internal":{"type":"boolean"},"resolvedAt":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"resolvedByType":{"oneOf":[{"type":"string"},{"type":"null"}]},"resolvedById":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"resolvedByName":{"oneOf":[{"type":"string"},{"type":"null"}]},"annotation":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"fileVersionNumber":{"oneOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","accountId","targetType","targetId","authorType","authorId","authorName","parentId","body","internal","resolvedAt","resolvedByType","resolvedById","resolvedByName","annotation","fileVersionNumber","createdAt"],"additionalProperties":true}},"nextPinNumbers":{"type":"object","additionalProperties":{"type":"integer"}}},"required":["comments","nextPinNumbers"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comments":[{"id":"11111111-1111-4111-8111-111111111111","authorAvatar":null,"accountId":"33333333-3333-4333-8333-333333333333","targetType":"file","targetId":"11111111-1111-4111-8111-111111111111","authorType":"agency","authorId":"11111111-1111-4111-8111-111111111111","authorName":"Alex Morgan","parentId":null,"body":"Please review this section.","internal":false,"resolvedAt":null,"resolvedByType":null,"resolvedById":null,"resolvedByName":null,"annotation":null,"fileVersionNumber":null,"createdAt":"2026-10-14T12:00:00.000Z"}],"nextPinNumbers":{"1":3}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List comments. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalCommentPayload"],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_comments","summary":"Create comment","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create comment; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/PortalComment"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comment":{"id":"00000000-0000-4000-8000-000000001101","targetType":"file","targetId":"00000000-0000-4000-8000-000000000501","body":"Please review page two.","internal":false,"parentId":null,"resolved":false,"author":{"name":"Alex Rivera"},"annotation":null,"fileVersionNumber":1,"createdAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_misc_CreatePortalCommentPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"targetType":"file","targetId":"00000000-0000-4000-8000-000000000001","body":"The first draft is ready for review."}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create comment. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalCommentPayload"],"x-observed-response-keys":["comment","error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_comments","summary":"Resolve or import comments for the resource","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for resolve or import comments for the resource; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/PortalComment"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comment":{"id":"00000000-0000-4000-8000-000000001101","targetType":"file","targetId":"00000000-0000-4000-8000-000000000501","body":"Please review page two.","internal":false,"parentId":null,"resolved":false,"author":{"name":"Alex Rivera"},"annotation":null,"fileVersionNumber":1,"createdAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_misc_ResolvePortalCommentPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"targetType":"file","targetId":"00000000-0000-4000-8000-000000000001","commentId":"00000000-0000-4000-8000-000000000001","resolved":true}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Resolve or import comments for the resource. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["ResolvePortalCommentPayload"],"x-observed-response-keys":["comment","error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/config":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_config","summary":"Get client portal configuration","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get client portal configuration; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":["object","null"],"additionalProperties":true,"properties":{"updatedAt":{"type":["string","null"],"format":"date-time"}}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"config":{"updatedAt":"2026-10-19T01:00:00.123456Z"}}},"absent":{"summary":"No saved singleton","value":{"config":null}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get client portal configuration. Reads or writes the selected account’s portal configuration. A client-specific home override can affect whether workspace defaults continue to flow through. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["config"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"put":{"operationId":"put_v2_workspaces_workspaceId_portal_accounts_accountId_config","summary":"Save portal configuration settings","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for save portal configuration settings; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","additionalProperties":true,"properties":{"updatedAt":{"type":["string","null"],"format":"date-time"}}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"config":{"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_misc_PortalConfigPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Save portal configuration settings. Reads or writes the selected account’s portal configuration. A client-specific home override can affect whether workspace defaults continue to flow through. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["PortalConfigPayload"],"x-observed-response-keys":["config","error"],"x-required-capabilities":["can_create_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/engagement":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_engagement","summary":"Get client engagement summary","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns account activity counts for the preceding 100 days. `days` contains one date/count record per calendar day; `total` is their sum and `streak` is the current consecutive active-day count.","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer"}},"required":["date","count"],"additionalProperties":false}},"total":{"type":"integer"},"streak":{"type":"integer"}},"required":["days","total","streak"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"days":[{"date":"2026-10-14","count":2}],"total":2,"streak":1}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get client engagement summary. Returns engagement and completion signals for this client account. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/file-groups":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_file_groups","summary":"List file groups","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"audience","in":"query","required":false,"description":"Select which representation to return: `agency` includes agency-only fields; `client` returns client-visible projection. Default is agency unless handler documents otherwise.","schema":{"type":"string","enum":["agency","client"]}},{"name":"scopeLibrary","in":"query","required":false,"description":"Pass `client` to scope library resources to this account; otherwise the handler uses workspace library scope.","schema":{"type":"string","enum":["client"]}}],"responses":{"200":{"description":"Returns file groups visible to the agency for the account. Workspace library groups may also be included.","content":{"application/json":{"schema":{"type":"object","properties":{"fileGroups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"purpose":{"oneOf":[{"type":"string"},{"type":"null"}]},"access":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"position":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","workspaceId","name","purpose","access","position","createdAt","updatedAt"],"additionalProperties":false}}},"required":["fileGroups"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"fileGroups":[{"id":"11111111-1111-4111-8111-111111111111","accountId":"33333333-3333-4333-8333-333333333333","workspaceId":"22222222-2222-4222-8222-222222222222","name":"Contracts","purpose":"contract","access":{"mode":"all"},"position":0,"createdAt":"2026-10-14T12:00:00.000Z","updatedAt":"2026-10-14T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List file groups. File groups are workspace or account folders. Access assignments are validated against the current workspace and applicable account. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_file_groups","summary":"Create file group","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create file group; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"fileGroup":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"fileGroup":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_files_CreatePortalFileGroupPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"name":"Example resource"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create file group. File groups are workspace or account folders. Access assignments are validated against the current workspace and applicable account. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalFileGroupPayload"],"x-observed-response-keys":["error","fileGroup"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/file-groups/{groupId}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_file_groups_groupId","summary":"Update file group","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update file group; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"fileGroup":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"fileGroup":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Update file group. File groups are workspace or account folders. Access assignments are validated against the current workspace and applicable account. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","fileGroup"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"purpose":{"type":"string","enum":["upload","contract","deliverable","resource"]},"access":{"$ref":"#/components/schemas/PortalAccess"},"position":{"type":"number"}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"name":"Shared assets","access":{"mode":"all"}}}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_file_groups_groupId","summary":"Delete or archive file group","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive file group; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive file group. File groups are workspace or account folders. Access assignments are validated against the current workspace and applicable account. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/attachments":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_attachments","summary":"List client attachments","description":"List attachments and links shared in this client account that the caller may see, including items posted in messages, tasks and milestones. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Attachments visible to the caller.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"x-required-capabilities":["can_view_clients"]}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/files":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_files","summary":"List files","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"audience","in":"query","required":false,"description":"Select which representation to return: `agency` includes agency-only fields; `client` returns client-visible projection. Default is agency unless handler documents otherwise.","schema":{"type":"string","enum":["agency","client"]}},{"name":"purpose","in":"query","required":false,"description":"Filter files by purpose, such as upload, contract, deliverable, or resource.","schema":{"type":"string","enum":["upload","contract","deliverable","resource"]}},{"name":"scopeLibrary","in":"query","required":false,"description":"Pass `client` to scope library resources to this account; otherwise the handler uses workspace library scope.","schema":{"type":"string","enum":["client"]}}],"responses":{"200":{"description":"Returns the account files and account-visible workspace library files. Managed file delivery URLs are generated for agency access; records use the mapped PortalFile shape.","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"workspaceId":{"type":"string","format":"uuid"},"groupId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"conversationId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"name":{"type":"string"},"purpose":{"type":"string"},"fmt":{"type":"string"},"kind":{"type":"string"},"storagePath":{"type":["string","null"]},"thumbnailPath":{"type":["string","null"]},"thumbnailUrl":{"oneOf":[{"type":"string"},{"type":"null"}]},"storageBackend":{"type":["string","null"]},"externalFileId":{"type":["string","null"]},"storageConnectionId":{"type":["string","null"],"format":"uuid","readOnly":true,"description":"Original workspace storage connection UUID when recorded; independent of the preferred destination for new uploads."},"mimeType":{"type":["string","null"]},"storageStatus":{"type":["string","null"]},"storageError":{"type":["string","null"]},"url":{"type":["string","null"]},"embedFrom":{"type":["string","null"]},"size":{"oneOf":[{"type":"integer"},{"type":"null"}]},"uploadedByType":{"type":["string","null"]},"uploadedBy":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"uploadedByName":{"type":["string","null"]},"description":{"type":["string","null"]},"approval":{"type":["string","null"]},"contractState":{"type":["string","null"]},"lock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"access":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"versions":{"oneOf":[{"type":"array","items":{"type":"object","additionalProperties":true}},{"type":"null"}]},"customFields":{"type":"object","additionalProperties":true},"isLibrary":{"type":"boolean"},"position":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","workspaceId","groupId","conversationId","name","purpose","fmt","kind","storagePath","thumbnailPath","storageBackend","externalFileId","mimeType","storageStatus","storageError","url","embedFrom","size","uploadedByType","uploadedBy","uploadedByName","description","approval","contractState","lock","access","versions","isLibrary","position","createdAt","updatedAt"],"additionalProperties":true}}},"required":["files"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"files":[{"id":"11111111-1111-4111-8111-111111111111","accountId":"33333333-3333-4333-8333-333333333333","workspaceId":"22222222-2222-4222-8222-222222222222","groupId":null,"conversationId":null,"name":"signed-agreement.pdf","purpose":"contract","fmt":"pdf","kind":"pdf","storagePath":null,"thumbnailPath":null,"storageBackend":null,"externalFileId":null,"mimeType":"application/pdf","storageStatus":"ready","storageError":null,"url":"https://files.example.test/signed-agreement.pdf","embedFrom":null,"size":24576,"uploadedByType":"agency","uploadedBy":"11111111-1111-4111-8111-111111111111","uploadedByName":"Alex Morgan","description":"Signed agreement","approval":null,"contractState":"signed","lock":false,"access":{"mode":"all"},"versions":null,"customFields":{},"isLibrary":false,"position":0,"createdAt":"2026-10-14T12:00:00.000Z","updatedAt":"2026-10-14T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List files. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_files","summary":"Create file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/PortalFile"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"file":{"id":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","name":"Brand guide.pdf","groupId":null,"purpose":"deliverable","fmt":"pdf","kind":"pdf","storagePath":"workspace/flow/file.pdf","url":null,"embedFrom":null,"size":102400,"description":null,"approval":"pending","contractState":null,"lock":null,"access":{"mode":"all"},"versions":[],"customFields":{},"isLibrary":false,"position":0}}}}}}},"400":{"description":"Invalid request. Link and embed URLs follow the portal URL rules: spaces are trimmed, a bare domain gets https://, and only public http(s) URLs are accepted. When url is new or changed and the file has no storagePath, the server also checks that the site responds. A malformed URL, an unsupported scheme such as javascript:, data: or file:, a private-network address, or a site that does not respond returns 400 with code invalid_url or url_unreachable, urlCheck {status, retryable, issue?} and fieldErrors.url. Uploaded-file URLs and internal references (upload:, res:, analytics:, same-origin paths) skip the live check. Use GET portal/url-check to check first. Replacing url on an existing link keeps the file id, name, access, group, comments and history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_files_CreatePortalFilePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"name":"Example resource"}}}}}},"description":"Create file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalFilePayload"],"x-observed-response-keys":["error","file"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/files/{fileId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_files_fileId","summary":"Get file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/PortalFile"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"file":{"id":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","name":"Brand guide.pdf","groupId":null,"purpose":"deliverable","fmt":"pdf","kind":"pdf","storagePath":"workspace/flow/file.pdf","url":null,"embedFrom":null,"size":102400,"description":null,"approval":"pending","contractState":null,"lock":null,"access":{"mode":"all"},"versions":[],"customFields":{},"isLibrary":false,"position":0}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","file"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_files_fileId","summary":"Update file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/PortalFile"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"file":{"id":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","name":"Brand guide.pdf","groupId":null,"purpose":"deliverable","fmt":"pdf","kind":"pdf","storagePath":"workspace/flow/file.pdf","url":null,"embedFrom":null,"size":102400,"description":null,"approval":"pending","contractState":null,"lock":null,"access":{"mode":"all"},"versions":[],"customFields":{},"isLibrary":false,"position":0}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource. Link and embed URLs follow the portal URL rules: spaces are trimmed, a bare domain gets https://, and only public http(s) URLs are accepted. When url is new or changed and the file has no storagePath, the server also checks that the site responds. A malformed URL, an unsupported scheme such as javascript:, data: or file:, a private-network address, or a site that does not respond returns 400 with code invalid_url or url_unreachable, urlCheck {status, retryable, issue?} and fieldErrors.url. Uploaded-file URLs and internal references (upload:, res:, analytics:, same-origin paths) skip the live check. Use GET portal/url-check to check first. Replacing url on an existing link keeps the file id, name, access, group, comments and history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response Also returns revision_conflict when the loaded revision is stale.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalError"},{"$ref":"#/components/schemas/EditorRevisionError"}]},"examples":{"revisionConflict":{"value":{"error":"This item changed since it was loaded. Reload it before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_files_UpdatePortalFilePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdatePortalFilePayload"],"x-observed-response-keys":["error","file"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_files_fileId","summary":"Delete or archive file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/home-blocks/types":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_home_blocks_types","summary":"List portal home block types","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response with the endpoint-specific JSON shape observed in the production handler.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true},"examples":{"catalog-summary":{"summary":"Catalog includes supported block types and limits","value":{"types":[{"type":"text","family":"custom","fields":["type","title","body","align","card","placement"]},{"type":"image","family":"custom","fields":["type","src","alt","decorative","caption","href","fit","ratio","rounded","storagePath","placement"]},{"type":"link","family":"custom","fields":["type","href","title","note","layout","preview","placement"]},{"type":"video","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"greeting","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"invoices","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"tasks","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"activity","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"milestones","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"announcement","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"resource","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"schedule","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]}],"limits":{"maxRows":40,"maxCols":2,"titleMax":160,"textMax":6000,"legacyTextMax":4000,"captionMax":240,"altMax":200,"noteMax":400,"urlMax":2048},"placement":{"body":"placement { row, col } optional on create","move":"Indexes address the layout after the block is lifted out"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List portal home block types. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/home-blocks/{blockId}/move":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_home_blocks_blockId_move","summary":"Move home blocks within its account","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"blockId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns the moved block and its final zero-based row and column in the account-specific layout.","content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0}},"required":["row","col"],"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["block","placement","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"block":{"id":"11111111-1111-4111-8111-111111111111","type":"greeting","title":"Welcome"},"placement":{"row":0,"col":0},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Move home blocks within its account. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. The requested row/column are evaluated after lifting the item from its current position. Task moves require a target account in the same workspace. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Use the top-level updatedAt from home-block list/read; account blocks also share the workspace-default config revision. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["row","expectedRevision"],"properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"row":1,"col":0,"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/home-blocks":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_home_blocks","summary":"List home page blocks","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the account home layout as rows and a flattened `blocks` list. An account without an override reads the workspace base layout.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true}}},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"row":{"type":"integer"},"col":{"type":"integer"}},"required":["id","type","row","col"],"additionalProperties":true}},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["rows","blocks","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"rows":[],"blocks":[],"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List home page blocks. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_home_blocks","summary":"Create home page block","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Returns the new account-scoped block and the placement assigned by the server.","content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0}},"required":["row","col"],"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["block","placement","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"block":{"id":"11111111-1111-4111-8111-111111111111","type":"greeting","title":"Welcome"},"placement":{"row":0,"col":0},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Create home page block. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Use the top-level updatedAt from home-block list/read; account blocks also share the workspace-default config revision. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"A supported portal block type. Retired types `chart` and `dashboard` are rejected. The row/column layout supports at most 40 rows and two blocks per row; omit placement to append a new row.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalHomeBlockCreate"},"examples":{"synthetic":{"summary":"Announcement block","value":{"type":"announcement","title":"Office hours","text":"We are available Monday to Friday.","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/home-blocks/{blockId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_home_blocks_blockId","summary":"Get home page block","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"blockId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns the selected account-scoped block and its current placement.","content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0}},"required":["row","col"],"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["block","placement","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"block":{"id":"11111111-1111-4111-8111-111111111111","type":"greeting","title":"Welcome"},"placement":{"row":0,"col":0},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get home page block. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_home_blocks_blockId","summary":"Update home page block","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"blockId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns the updated account-scoped block and its current placement.","content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0}},"required":["row","col"],"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["block","placement","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"block":{"id":"11111111-1111-4111-8111-111111111111","type":"greeting","title":"Welcome back"},"placement":{"row":0,"col":0},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Update home page block. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Use the top-level updatedAt from home-block list/read; account blocks also share the workspace-default config revision. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalHomeBlockPatch"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"title":"Updated heading","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_home_blocks_blockId","summary":"Delete or archive home page block","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"blockId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Confirms deletion of the account-scoped home block and returns its ID.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"id":{"type":"string","format":"uuid"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["ok","id","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true,"id":"11111111-1111-4111-8111-111111111111","updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive home page block. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Use the top-level updatedAt from home-block list/read; account blocks also share the workspace-default config revision. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["expectedRevision"]},"example":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/invoices":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_invoices","summary":"List invoices","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"audience","in":"query","required":false,"description":"Select which representation to return: `agency` includes agency-only fields; `client` returns client-visible projection. Default is agency unless handler documents otherwise.","schema":{"type":"string","enum":["agency","client"]}}],"responses":{"200":{"description":"Returns account invoices mapped to the public invoice shape. Future-dated recurring invoice templates remain hidden until their issue date; optional `audience=client` applies client-visible pricing.","content":{"application/json":{"schema":{"type":"object","properties":{"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"number":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"},"issuedAt":{"type":["string","null"]},"dueAt":{"type":["string","null"]},"memo":{"type":["string","null"]},"billTo":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"items":{"oneOf":[{"type":"array","items":{"type":"object","additionalProperties":true}},{"type":"null"}]},"subtotal":{"type":["number","null"]},"taxName":{"type":["string","null"]},"taxRate":{"type":["number","null"]},"taxAmount":{"type":["number","null"]},"paidAt":{"type":["string","null"]},"paymentRef":{"type":["string","null"]},"billingType":{"type":"string"},"recurringInterval":{"type":["string","null"]},"recurringActive":{"type":"boolean"},"nextIssueAt":{"type":["string","null"]},"parentInvoiceId":{"type":["string","null"]},"stripeSubscriptionId":{"type":["string","null"]},"stripeCustomerId":{"type":["string","null"]},"serviceId":{"type":["string","null"]},"subscriptionStatus":{"type":["string","null"]},"cancelAtPeriodEnd":{"type":"boolean"},"currentPeriodEnd":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"paymentMethods":{"type":["array","null"],"items":{"type":"string","enum":["stripe","external"]},"minItems":1,"maxItems":2,"uniqueItems":true,"description":"Effective allowed payment methods after workspace availability and existing payment attempts are considered."},"externalPaymentUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"Optional external payment URL; HTTP or HTTPS."},"externalPaymentInstructions":{"type":["string","null"],"maxLength":4000},"paymentMethod":{"type":["string","null"],"enum":["ach","bank_transfer","cash","check","other",null]},"paymentRecordedBy":{"type":["string","null"],"format":"uuid"},"paymentRecordedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","accountId","workspaceId","number","amount","currency","status","issuedAt","dueAt","memo","billTo","items","subtotal","taxName","taxRate","taxAmount","paidAt","paymentRef","billingType","recurringInterval","recurringActive","nextIssueAt","parentInvoiceId","stripeSubscriptionId","stripeCustomerId","serviceId","subscriptionStatus","cancelAtPeriodEnd","currentPeriodEnd","createdAt","updatedAt","paymentMethods","externalPaymentUrl","externalPaymentInstructions","paymentMethod","paymentRecordedBy","paymentRecordedAt"],"additionalProperties":false}},"availablePaymentMethods":{"type":"array","items":{"type":"string","enum":["stripe","external"]},"minItems":1,"maxItems":2,"uniqueItems":true,"description":"Allowed payment methods. Defaults to stripe and external when Stripe Connect is enabled, otherwise external only. Subscriptions require stripe. Legacy null values are resolved from the workspace connection and any existing Stripe attempt.","example":["external"]}},"required":["invoices"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"invoices":[{"id":"11111111-1111-4111-8111-111111111111","accountId":"33333333-3333-4333-8333-333333333333","workspaceId":"22222222-2222-4222-8222-222222222222","number":"INV-042","amount":125,"currency":"usd","status":"sent","issuedAt":"2026-10-14T12:00:00.000Z","dueAt":"2026-10-28T12:00:00.000Z","memo":"October support","billTo":["Strategy support"],"items":[{"n":"Monthly support","q":1,"u":125}],"subtotal":125,"taxName":null,"taxRate":null,"taxAmount":null,"paidAt":null,"paymentRef":null,"billingType":"one_time","recurringInterval":null,"recurringActive":true,"nextIssueAt":null,"parentInvoiceId":null,"stripeSubscriptionId":null,"stripeCustomerId":null,"serviceId":null,"subscriptionStatus":null,"cancelAtPeriodEnd":false,"currentPeriodEnd":null,"createdAt":"2026-10-14T12:00:00.000Z","updatedAt":"2026-10-14T12:00:00.000Z","paymentMethods":["stripe","external"],"externalPaymentUrl":null,"externalPaymentInstructions":null,"paymentMethod":null,"paymentRecordedBy":null,"paymentRecordedAt":null}],"availablePaymentMethods":["stripe","external"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List invoices. Invoice `amount` is the tax-inclusive total. Supply tax name and rate together; the rate is agency-provided and is not looked up automatically. Requires the workspace client-view capability. Returns effective payment methods based on stored choices, current Stripe availability, and existing payment attempts. Collection responses also include availablePaymentMethods; item responses include it on invoice.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_invoices","summary":"Create invoice","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create invoice; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"$ref":"#/components/schemas/PortalInvoice"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"invoice":{"id":"00000000-0000-4000-8000-000000000701","accountId":"00000000-0000-4000-8000-000000000101","number":"INV-1001","amount":250000,"subtotal":250000,"taxName":null,"taxRate":0,"currency":"usd","status":"sent","issuedAt":"2026-01-15T12:00:00.000Z","dueAt":"2026-01-30T12:00:00.000Z","memo":"Brand strategy","billTo":"Acme Studio","items":[{"n":"Strategy package","q":1,"u":250000}],"paidAt":null,"paymentRef":null,"billingType":"one_time","recurringInterval":null,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_invoices_CreatePortalInvoicePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"amount":250}}}}}},"description":"Create invoice. Invoice `amount` is the tax-inclusive total. Supply tax name and rate together; the rate is agency-provided and is not looked up automatically. Requires the workspace client-management capability. Request amount is the pre-tax subtotal in major currency units; the stored/returned amount is tax-inclusive and rounded to the currency's supported 0, 2, or 3 decimal places. New invoices cannot start paid (400). Payment methods default to external when Stripe is unavailable; Stripe requires a connected account and a supported currency and representable amount, while external settlement is available for other currencies. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalInvoicePayload"],"x-observed-response-keys":["error","invoice"],"x-required-capabilities":["can_view_invoices","can_manage_invoices"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/invoices/{invoiceId}/pdf":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_invoices_invoiceId_pdf","summary":"Download invoice PDF","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Streams the invoice or receipt PDF. The response is binary PDF data with `Content-Type: application/pdf`; `Content-Disposition` is inline with a generated filename.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Download the invoice or paid receipt PDF with full line items, issuer and recipient details, issue/due dates, saved tax totals, and payment information. The current workspace invoice design controls layout, accent, font, issuer details, notes, and footer, including for existing invoices. Accent and font inherit the saved workspace Client theme unless the invoice design explicitly overrides them. Layouts are classic, minimal, studio, and wave. This endpoint does not change invoice amounts or payment status. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"beta@73582e5d (invoice design preview; not production)"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/invoices/{invoiceId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_invoices_invoiceId","summary":"Get invoice","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get invoice; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"$ref":"#/components/schemas/PortalInvoice"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"invoice":{"id":"00000000-0000-4000-8000-000000000701","accountId":"00000000-0000-4000-8000-000000000101","number":"INV-1001","amount":250,"subtotal":250,"taxName":null,"taxRate":0,"currency":"usd","status":"sent","issuedAt":"2026-01-15T12:00:00.000Z","dueAt":"2026-01-30T12:00:00.000Z","memo":"Brand strategy","billTo":["Acme Studio"],"items":[{"n":"Strategy package","q":1,"u":250}],"paidAt":null,"paymentRef":null,"billingType":"one_time","recurringInterval":null,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","paymentMethods":["stripe","external"],"externalPaymentUrl":null,"externalPaymentInstructions":null,"paymentMethod":null,"paymentRecordedBy":null,"paymentRecordedAt":null}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get invoice. Invoice `amount` is the tax-inclusive total. Supply tax name and rate together; the rate is agency-provided and is not looked up automatically. Requires the workspace client-view capability. Returns effective payment methods based on stored choices, current Stripe availability, and existing payment attempts. Collection responses also include availablePaymentMethods; item responses include it on invoice.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","invoice"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_invoices_invoiceId","summary":"Update invoice","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update invoice; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"$ref":"#/components/schemas/PortalInvoice"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"invoice":{"id":"00000000-0000-4000-8000-000000000701","accountId":"00000000-0000-4000-8000-000000000101","number":"INV-1001","amount":250,"subtotal":250,"taxName":null,"taxRate":0,"currency":"usd","status":"sent","issuedAt":"2026-01-15T12:00:00.000Z","dueAt":"2026-01-30T12:00:00.000Z","memo":"Brand strategy","billTo":["Acme Studio"],"items":[{"n":"Strategy package","q":1,"u":250}],"paidAt":null,"paymentRef":null,"billingType":"one_time","recurringInterval":null,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","paymentMethods":["stripe","external"],"externalPaymentUrl":null,"externalPaymentInstructions":null,"paymentMethod":null,"paymentRecordedBy":null,"paymentRecordedAt":null}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response Also returns revision_conflict when the loaded revision is stale.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalError"},{"$ref":"#/components/schemas/EditorRevisionError"}]},"examples":{"revisionConflict":{"value":{"error":"This item changed since it was loaded. Reload it before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_invoices_UpdatePortalInvoicePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update invoice. Invoice `amount` is the tax-inclusive total. Supply tax name and rate together; the rate is agency-provided and is not looked up automatically. Requires the workspace client-management capability. Generic PATCH cannot settle an unpaid invoice, reopen a paid invoice, or reprice a paid invoice (409); paidAt/paymentRef are not writable here. Record external receipts using POST /payment. Pending checkout claims and existing service/Stripe payment attempts restrict changes to pricing, billing, and payment settings; an existing Stripe subscription must retain Stripe for reconciliation. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdatePortalInvoicePayload"],"x-observed-response-keys":["error","invoice"],"x-required-capabilities":["can_view_invoices","can_manage_invoices"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_invoices_invoiceId","summary":"Delete or archive invoice","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive invoice; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive invoice. Invoice `amount` is the tax-inclusive total. Supply tax name and rate together; the rate is agency-provided and is not looked up automatically. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_view_invoices","can_manage_invoices"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/meet":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_meet","summary":"Start a Google Meet and message the client","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the provider meeting URI and the portal conversation message created for the meeting link.","content":{"application/json":{"schema":{"type":"object","properties":{"meetingUri":{"type":"string"},"message":{"type":"object","additionalProperties":true}},"required":["meetingUri","message"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"meetingUri":"https://meet.example.test/room/abc123","message":{"id":"11111111-1111-4111-8111-111111111111","accountId":"33333333-3333-4333-8333-333333333333","conversationId":"11111111-1111-4111-8111-111111111111","body":"Join the meeting","senderType":"agency","createdAt":"2026-10-14T12:00:00.000Z","attachments":[]}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"reply_context_conflict: reread before deciding whether to send another call notice."},"428":{"description":"reply_context_required: read the conversation before starting the call."},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Start a Google Meet and message the client. Creates a Meet space using the connected workspace Google account, posts the join URL as a client message, and may email the client. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","properties":{"conversationId":{"type":["string","null"],"format":"uuid"},"expectedContextRevision":{"type":"string","format":"uuid"}},"additionalProperties":false,"required":["expectedContextRevision"]},"examples":{"synthetic":{"value":{"expectedContextRevision":"00000000-0000-4000-8000-000000000103"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/members":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_members","summary":"List portal members","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns client portal members with their person identity, profile photo, primary-contact flag, last login time, and whether a password is configured. The language field is the saved system email and invoice PDF language.","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"personId":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"photo":{"type":["string","null"]},"role":{"type":["string","null"]},"companyName":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"lastLoginAt":{"type":["string","null"]},"hasPassword":{"type":"boolean"},"language":{"type":["string","null"],"enum":["fr","es","de","it","ja","ko","zh","zh-TW","no","ru","hi","pt-BR",null],"description":"The saved system email and invoice PDF language. When null, the recipient uses the existing client default and English fallback."}},"required":["id","personId","name","email","photo","role","companyName","isPrimary","lastLoginAt","hasPassword","language"],"additionalProperties":false}}},"required":["members"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"members":[{"id":"11111111-1111-4111-8111-111111111111","personId":"22222222-2222-4222-8222-222222222222","name":"Jordan Lee","email":"jordan@example.test","photo":null,"role":"client","companyName":"Acme Studio","isPrimary":true,"lastLoginAt":null,"hasPassword":false,"language":"hi"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List portal members. Members must belong to the account. Invitation delivery may send email when requested; passwords and photo bytes use separate operations. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_members","summary":"Create portal member","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create portal member; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"$ref":"#/components/schemas/PortalMember"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"member":{"id":"00000000-0000-4000-8000-000000000801","personId":"00000000-0000-4000-8000-000000000802","email":"client@example.test","firstName":"Alex","lastName":"Rivera","name":"Alex Rivera","companyName":"Acme Studio","role":"Primary contact","status":"active","createdAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_members_CreatePortalMemberPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"email":"client@example.test"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create portal member. Members must belong to the account. Invitation delivery may send email when requested; passwords and photo bytes use separate operations. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalMemberPayload"],"x-observed-response-keys":["error","member"],"x-required-capabilities":["can_create_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/members/{memberId}/password":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_members_memberId_password","summary":"Set a portal member password","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for set a portal member password; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Set a portal member password. Members must belong to the account. Invitation delivery may send email when requested; passwords and photo bytes use separate operations. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_create_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["password"],"properties":{"password":{"type":"string","minLength":6}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"password":"synthetic-passphrase"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/members/{memberId}/photo":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_members_memberId_photo","summary":"Upload or remove a member profile photo","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for upload or remove a member profile photo; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"url":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Upload or remove a member profile photo. Members must belong to the account. Invitation delivery may send email when requested; passwords and photo bytes use separate operations. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","url"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/PortalPhotoUploadInput"},"examples":{"synthetic-file":{"summary":"Upload a file part","value":{"file":"<binary file contents>"}}}}}},"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_members_memberId_photo","summary":"Remove a portal member photo","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for remove a portal member photo; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Remove a portal member photo. Members must belong to the account. Invitation delivery may send email when requested; passwords and photo bytes use separate operations. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["ok"],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/members/{memberId}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_members_memberId_language","summary":"Set a portal member’s delivery language","description":"Sets the member’s saved choice for built-in system emails and invoice PDFs. Uses the member ID from the account’s member list and requires can_create_clients on that account within the authorized workspace. User-authored text is not translated. No email, invoice, or webhook is created or sent. This uses the same save as the Client Portal Team settings. Repeating the same assignment does not change the preferred language further.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Optional retry key. Reuse it only for an identical request after an uncertain outcome."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["language"],"properties":{"language":{"type":["string","null"],"enum":["en","fr","es","de","it","ja","ko","zh","zh-TW","no","ru","hi","pt-BR",null],"description":"Locale code to save. en and null both clear the saved preference."}}},"examples":{"hindi":{"summary":"Choose Hindi","value":{"language":"hi"}},"brazilianPortuguese":{"summary":"Choose Brazilian Portuguese","value":{"language":"pt-BR"}},"clear":{"summary":"Clear the saved preference","value":{"language":null}}}}}},"responses":{"200":{"description":"The normalized saved language and number of active matching people updated by the scoped save.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["ok","language","updated"],"properties":{"ok":{"type":"boolean","const":true},"language":{"type":["string","null"],"enum":["fr","es","de","it","ja","ko","zh","zh-TW","no","ru","hi","pt-BR",null],"description":"The saved system email and invoice PDF language. When null, the recipient uses the existing client default and English fallback."},"updated":{"type":"integer","minimum":0,"maximum":1}}},"examples":{"saved":{"summary":"Hindi was saved","value":{"ok":true,"language":"hi","updated":1}},"cleared":{"summary":"Member now uses the fallback","value":{"ok":true,"language":null,"updated":1}}}}}},"400":{"description":"Language is missing or unsupported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal or client-management permission is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"The workspace, account, or member is missing or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The retry key was used with a different payload or its original request is still pending.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"The API key rate limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"The language could not be saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_members_memberId","summary":"Delete or archive portal member","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive portal member; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive portal member. Members must belong to the account. Invitation delivery may send email when requested; passwords and photo bytes use separate operations. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_create_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/messages/attachments":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_messages_attachments","summary":"Upload a message attachment","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Returns metadata for the uploaded message attachment. Download bytes separately through the message attachment GET route.","content":{"application/json":{"schema":{"type":"object","properties":{"attachment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string"},"size":{"type":"integer"},"durationMs":{"oneOf":[{"type":"integer"},{"type":"null"}]},"url":{"type":"string"}},"required":["id","name","type","size","url"],"additionalProperties":true}},"required":["attachment"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"attachment":{"id":"11111111-1111-4111-8111-111111111111","name":"project-brief.pdf","type":"application/pdf","size":24576,"durationMs":null,"url":"/v2/workspaces/22222222-2222-4222-8222-222222222222/portal/accounts/33333333-3333-4333-8333-333333333333/messages/11111111-1111-4111-8111-111111111111/attachments/0"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Upload a message attachment. Saves the file on 360Onboard before attempting a transfer to configured connected storage. A successful transfer returns the provider URL, external file ID and media token; without configured storage or after a failed transfer, returns the retained platform URL and storage path. Existing platform and provider attachments remain readable through their established media routes. Messages and replies remain inside the same account. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/PortalMessageAttachmentUploadInput"},"examples":{"synthetic-file":{"summary":"Upload a file part","value":{"file":"<binary file contents>"}}}}}},"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/messages/{messageId}/attachments/{attachmentIndex}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_messages_messageId_attachments_attachmentIndex","summary":"Get message","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"attachmentIndex","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Streams the requested attachment bytes. The response media type is the attachment MIME type when known and otherwise `application/octet-stream`; range requests are supported by the media delivery handler.","content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get message. Messages and replies remain inside the same account. Mention targets are resolved server-side; list windows use the cursor parameters documented here. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/messages":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_messages","summary":"List messages","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"audience","in":"query","required":false,"description":"Select which representation to return: `agency` includes agency-only fields; `client` returns client-visible projection. Default is agency unless handler documents otherwise.","schema":{"type":"string","enum":["agency","client"]}},{"name":"before","in":"query","required":false,"description":"Return items before this ISO 8601 cursor timestamp.","schema":{"type":"string","format":"date-time"}},{"name":"beforeId","in":"query","required":false,"description":"Tie-break cursor ID paired with `before`.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of records to return. Handler parses this as an integer and applies its documented cap.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"meetingId","in":"query","required":false,"description":"Return the meeting note message and direct replies associated with this meeting UUID.","schema":{"type":"string","format":"uuid"}},{"name":"windowAfter","in":"query","required":false,"description":"Start ISO 8601 timestamp for the requested message window.","schema":{"type":"string","format":"date-time"}},{"name":"windowAfterId","in":"query","required":false,"description":"Tie-break cursor ID paired with `windowAfter`.","schema":{"type":"string","format":"uuid"}},{"name":"windowBefore","in":"query","required":false,"description":"End ISO 8601 timestamp for the requested message window.","schema":{"type":"string","format":"date-time"}},{"name":"windowBeforeId","in":"query","required":false,"description":"Tie-break cursor ID paired with `windowBefore`.","schema":{"type":"string","format":"uuid"}},{"name":"windowScanBefore","in":"query","required":false,"description":"ISO 8601 pagination cursor timestamp for scanning older messages in the window.","schema":{"type":"string","format":"date-time"}},{"name":"windowScanBeforeId","in":"query","required":false,"description":"Tie-break cursor ID paired with `windowScanBefore`.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list messages; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/PortalMessage"}},"nextBefore":{"oneOf":[{"type":"object","required":["createdAt","id"],"properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"}}},{"type":"null"}]},"revisions":{"type":"object","required":["accountRevision","contextRevision"],"properties":{"accountRevision":{"type":["string","null"]},"contextRevision":{"type":"string","format":"uuid"}}},"hasMore":{"type":"boolean"},"complete":{"type":"boolean","description":"Present on loaded-window scans; false requires another page."}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"messages":[{"id":"00000000-0000-4000-8000-000000000901","conversationId":"00000000-0000-4000-8000-000000000902","accountId":"00000000-0000-4000-8000-000000000101","body":"The first draft is ready for review.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}],"revisions":{"accountRevision":"00000000-0000-4000-8000-000000000103","contextRevision":"00000000-0000-4000-8000-000000000103"},"hasMore":false}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List messages. Messages and replies remain inside the same account. Mention targets are resolved server-side; list windows use the cursor parameters documented here. Requires the workspace client-view capability. Beta: messages and revisions are read from the same database snapshot. A full refresh must complete before acknowledging that revision. Paginated loaded-window reads must have matching revision tokens across pages; if a token changes, restart the reconciliation. before/beforeId cannot be combined with window cursors; each timestamp must be paired with its UUID. History pages use the documented limit. Loaded-window reconciliation ignores limit and returns at most 500 messages plus complete/nextBefore; continue until complete and restart if revisions change.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","messages"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_messages","summary":"Create message","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for create message; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/PortalMessage"},"created":{"type":"boolean","description":"False for exact accepted message replay."}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"message":{"id":"00000000-0000-4000-8000-000000000901","conversationId":"00000000-0000-4000-8000-000000000902","accountId":"00000000-0000-4000-8000-000000000101","body":"The first draft is ready for review.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z"},"created":false}}}}}},"201":{"description":"Message created; notifications/webhooks scheduled once.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/PortalMessage"},"created":{"type":"boolean","description":"False for exact accepted message replay."}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"message":{"id":"00000000-0000-4000-8000-000000000901","conversationId":"00000000-0000-4000-8000-000000000902","accountId":"00000000-0000-4000-8000-000000000101","body":"The first draft is ready for review.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z"},"created":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Stale reply context or message ID/idempotency conflict. Read content and reconcile; never blindly retry with a fresh context.","content":{"application/json":{"schema":{"properties":{"error":{"type":["string","object"]},"resource":{"type":"string"},"currentRevision":{"type":["string","null"]}},"type":"object","required":["error"]},"example":{"error":"reply_context_conflict","resource":"conversation.messages","currentRevision":"00000000-0000-4000-8000-000000000103"}}}},"428":{"description":"Missing reply context.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"const":"reply_context_required"}}},"example":{"error":"reply_context_required"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_messages_CreatePortalMessagePayload"},"examples":{"synthetic":{"summary":"Reply prepared from the loaded conversation","value":{"body":"I reviewed your request and will send the draft tomorrow.","kind":"message","expectedContextRevision":"00000000-0000-4000-8000-000000000103","clientMessageId":"00000000-0000-4000-8000-000000000104"}}}}}},"description":"Create message. Messages and replies remain inside the same account. Mention targets are resolved server-side; list windows use the cursor parameters documented here. Requires the workspace client-management capability. Beta: agency replies require expectedContextRevision from the preceding full message read. Freeze that context while composing. Different IDs do not bypass a stale-context conflict. Supply clientMessageId for durable exact-payload retries; replay is authorized before freshness and does not repeat webhooks or notifications. After a conflict, reread and reconsider the reply before using a new ID. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalMessagePayload"],"x-observed-response-keys":["error","message"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/messages/{messageId}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_messages_messageId","summary":"Update message","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update message; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/PortalMessage"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"message":{"id":"00000000-0000-4000-8000-000000000901","conversationId":"00000000-0000-4000-8000-000000000902","accountId":"00000000-0000-4000-8000-000000000101","body":"The first draft is ready for review.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Update message. Messages and replies remain inside the same account. Mention targets are resolved server-side; list windows use the cursor parameters documented here. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","message"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_messages_messageId","summary":"Delete or archive message","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive message; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive message. Messages and replies remain inside the same account. Mention targets are resolved server-side; list windows use the cursor parameters documented here. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["ok"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/meeting-notes":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_meeting_notes","summary":"List meeting notes","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"transcript","in":"query","required":false,"description":"Send false to leave each meeting's transcript out of the list (returned as an empty list). Read one meeting note for its transcript.","schema":{"type":"string","enum":["false"]}}],"responses":{"200":{"description":"Returns meetings linked to the account, unlinked import candidates in the workspace, and active meeting providers.","content":{"application/json":{"schema":{"type":"object","properties":{"meetings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"externalId":{"type":"string"},"title":{"type":"string"},"startedAt":{"type":["string","null"]},"endedAt":{"type":["string","null"]},"summary":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","additionalProperties":true}},"actionItems":{"type":"array","items":{"type":"object","additionalProperties":true}},"transcript":{"description":"Transcript text or transcript segments; empty when no transcript is available.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","additionalProperties":true}},{"type":"null"}]},"providerUrl":{"type":["string","null"]},"recordingUrl":{"type":["string","null"]},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"linkedAt":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","provider","externalId","title"],"additionalProperties":true}},"candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"externalId":{"type":"string"},"title":{"type":"string"},"startedAt":{"type":["string","null"]},"endedAt":{"type":["string","null"]},"summary":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","additionalProperties":true}},"actionItems":{"type":"array","items":{"type":"object","additionalProperties":true}},"transcript":{"description":"Transcript text or transcript segments; empty when no transcript is available.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","additionalProperties":true}},{"type":"null"}]},"providerUrl":{"type":["string","null"]},"recordingUrl":{"type":["string","null"]},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"linkedAt":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","provider","externalId","title"],"additionalProperties":true}},"connectedProviders":{"type":"array","items":{"type":"string"}}},"required":["meetings","candidates","connectedProviders"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"meetings":[{"id":"11111111-1111-4111-8111-111111111111","provider":"zoom","externalId":"meeting-123","title":"Kickoff call","startedAt":"2026-10-14T12:00:00.000Z","endedAt":null,"durationSeconds":null,"organizerEmail":"alex@example.test","participantEmails":["jordan@example.test"],"participants":[{"name":"Jordan Lee","email":"jordan@example.test"}],"summary":"Discussed onboarding timeline.","actionItems":[{"text":"Share brand assets"}],"transcript":[],"providerUrl":"https://meet.example.test/123","recordingUrl":null,"sourceCreatedAt":"2026-10-14T12:00:00.000Z","matchMethod":"email","matchedEmails":["jordan@example.test"],"visibleToClient":true,"conversationId":null,"linkedAt":"2026-10-14T12:00:00.000Z"}],"candidates":[],"connectedProviders":["zoom"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List meeting notes. Imported notes come from connected meeting providers. Sharing in chat is enabled by default; set `shareInChat:false` to keep an imported note agency-only. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_meeting_notes","summary":"Create meeting note","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create meeting note; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"meeting":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"meeting":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Create meeting note. Imported notes come from connected meeting providers. Sharing in chat is enabled by default; set `shareInChat:false` to keep an imported note agency-only. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","meeting"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["meetingId"],"properties":{"meetingId":{"type":"string","format":"uuid"},"shareInChat":{"type":"boolean","default":true},"conversationId":{"type":["string","null"],"format":"uuid"}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"meetingId":"00000000-0000-4000-8000-000000001601","shareInChat":false}}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/milestones/publish":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_milestones_publish","summary":"Publish all staged milestones for a client","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for publish all staged milestones for a client; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Publish all staged milestones for a client. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-management capability. Publishing is the explicit boundary that applies staged milestone changes to the client-visible state. Beta: expectedRevisions must map every currently held milestone ID to the updatedAt from the original list read. The full held set is checked and published atomically; a stale/missing member rejects the whole request. No automatic fresh-token retry. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedRevisions"],"additionalProperties":false,"properties":{"expectedRevisions":{"type":"object","propertyNames":{"format":"uuid"},"additionalProperties":{"type":"string","format":"date-time"}}}},"example":{"expectedRevisions":{"00000000-0000-4000-8000-000000000101":"2026-10-19T01:00:00.123456Z"}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/milestones/{milestoneId}/publish":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_milestones_milestoneId_publish","summary":"Publish one staged client milestone","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"milestoneId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for publish one staged client milestone; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"milestone":{"$ref":"#/components/schemas/PortalMilestone"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"milestone":{"id":"00000000-0000-4000-8000-000000000301","accountId":"00000000-0000-4000-8000-000000000101","templateId":null,"title":"Kickoff","status":"not_started","startApprover":"agency","startWho":null,"finishApprover":"agency","finishWho":null,"startAuto":null,"finishAuto":null,"changesGate":null,"startDate":null,"targetDate":"2026-02-01","acceptedAt":null,"description":null,"cover":null,"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","isDraft":false,"pendingDelete":false,"hasPendingEdit":false,"draft":null}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Publish one staged client milestone. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-management capability. Publishing is the explicit boundary that applies staged milestone changes to the client-visible state. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","milestone"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["expectedRevision"]},"example":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/milestones/{milestoneId}/remind":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_milestones_milestoneId_remind","summary":"Send a client milestone approval reminder","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"milestoneId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for send a client milestone approval reminder; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Send a client milestone approval reminder. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-management capability. Sends only when the milestone is waiting on the client and the relevant reminder email template is enabled; conflicts return 409. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/milestones/{milestoneId}/transition":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_milestones_milestoneId_transition","summary":"Advance a milestone through its approval workflow","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"milestoneId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for advance a milestone through its approval workflow; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"milestone":{"$ref":"#/components/schemas/PortalMilestone"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"milestone":{"id":"00000000-0000-4000-8000-000000000301","accountId":"00000000-0000-4000-8000-000000000101","templateId":null,"title":"Kickoff","status":"not_started","startApprover":"agency","startWho":null,"finishApprover":"agency","finishWho":null,"startAuto":null,"finishAuto":null,"changesGate":null,"startDate":null,"targetDate":"2026-02-01","acceptedAt":null,"description":null,"cover":null,"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","isDraft":false,"pendingDelete":false,"hasPendingEdit":false,"draft":null}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/client_portal_MilestoneTransitionPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"action":"submit_finish"}}}}}},"description":"Advance a milestone through its approval workflow. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-management capability. Supported actions are `start`, `submit_finish`, `approve`, `request_changes`, and `reopen`; transition authorization follows the configured approver. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["MilestoneTransitionPayload"],"x-observed-response-keys":["error","milestone"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/milestones":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_milestones","summary":"List milestones","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"audience","in":"query","required":false,"description":"Select which representation to return: `agency` includes agency-only fields; `client` returns client-visible projection. Default is agency unless handler documents otherwise.","schema":{"type":"string","enum":["agency","client"]}}],"responses":{"200":{"description":"Returns account milestones. The default agency audience can see drafts; `audience=client` omits drafts and staging records.","content":{"application/json":{"schema":{"type":"object","properties":{"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string"},"startApprover":{"type":"string"},"startWho":{"type":"string"},"finishApprover":{"type":"string"},"finishWho":{"type":"string"},"startAuto":{"type":"boolean"},"finishAuto":{"type":"boolean"},"changesGate":{"type":"boolean"},"startDate":{"type":["string","null"]},"targetDate":{"type":["string","null"]},"description":{"type":["string","null"]},"cover":{"type":["string","null"]},"position":{"type":"integer"},"isDraft":{"type":"boolean"},"pendingDelete":{"type":"boolean"},"acceptedAt":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","accountId","title","status"],"additionalProperties":true}}},"required":["milestones"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"milestones":[{"id":"11111111-1111-4111-8111-111111111111","accountId":"33333333-3333-4333-8333-333333333333","title":"Kickoff","status":"todo","startApprover":"agency","startWho":"agency","finishApprover":"client","finishWho":"client","startAuto":false,"finishAuto":false,"changesGate":false,"startDate":null,"targetDate":"2026-10-21","description":"Initial planning","cover":null,"position":0,"isDraft":false,"pendingDelete":false,"acceptedAt":null,"createdAt":"2026-10-14T12:00:00.000Z","updatedAt":"2026-10-14T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List milestones. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_milestones","summary":"Create milestone","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create milestone; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"milestone":{"$ref":"#/components/schemas/PortalMilestone"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"milestone":{"id":"00000000-0000-4000-8000-000000000301","accountId":"00000000-0000-4000-8000-000000000101","templateId":null,"title":"Kickoff","status":"not_started","startApprover":"agency","startWho":null,"finishApprover":"agency","finishWho":null,"startAuto":null,"finishAuto":null,"changesGate":null,"startDate":null,"targetDate":"2026-02-01","acceptedAt":null,"description":null,"cover":null,"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","isDraft":false,"pendingDelete":false,"hasPendingEdit":false,"draft":null}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/client_portal_CreateMilestonePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"title":"Kickoff"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create milestone. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreateMilestonePayload"],"x-observed-response-keys":["error","milestone"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/milestones/{milestoneId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_milestones_milestoneId","summary":"Get milestone","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"milestoneId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get milestone; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"milestone":{"$ref":"#/components/schemas/PortalMilestone"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"milestone":{"id":"00000000-0000-4000-8000-000000000301","accountId":"00000000-0000-4000-8000-000000000101","templateId":null,"title":"Kickoff","status":"not_started","startApprover":"agency","startWho":null,"finishApprover":"agency","finishWho":null,"startAuto":null,"finishAuto":null,"changesGate":null,"startDate":null,"targetDate":"2026-02-01","acceptedAt":null,"description":null,"cover":null,"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","isDraft":false,"pendingDelete":false,"hasPendingEdit":false,"draft":null}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get milestone. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","milestone"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_milestones_milestoneId","summary":"Update milestone","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"milestoneId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update milestone; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"milestone":{"$ref":"#/components/schemas/PortalMilestone"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"milestone":{"id":"00000000-0000-4000-8000-000000000301","accountId":"00000000-0000-4000-8000-000000000101","templateId":null,"title":"Kickoff","status":"not_started","startApprover":"agency","startWho":null,"finishApprover":"agency","finishWho":null,"startAuto":null,"finishAuto":null,"changesGate":null,"startDate":null,"targetDate":"2026-02-01","acceptedAt":null,"description":null,"cover":null,"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","isDraft":false,"pendingDelete":false,"hasPendingEdit":false,"draft":null}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/client_portal_UpdateMilestonePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update milestone. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdateMilestonePayload"],"x-observed-response-keys":["error","milestone"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_milestones_milestoneId","summary":"Delete or archive milestone","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"milestoneId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive milestone; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive milestone. Milestone create/edit/delete changes are staged for agency review. Publish endpoints apply those changes to the client-visible milestone set. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["expectedRevision"]},"example":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/notes":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_notes","summary":"List account notes","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns agency-only notes for the client plus the current agency viewer identity.","content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/PortalNote"},{"type":"object","properties":{"authorAvatar":{"type":["string","null"]}},"required":["authorAvatar"]}]}},"viewer":{"type":"object","properties":{"name":{"type":"string"},"avatar":{"type":["string","null"]}},"required":["name","avatar"],"additionalProperties":false}},"required":["notes","viewer"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"notes":[{"id":"11111111-1111-4111-8111-111111111111","body":"Confirm brand assets before kickoff.","pinned":false,"tag":null,"authorName":"Alex Morgan","authorAvatar":null,"createdAt":"2026-10-14T12:00:00.000Z","updatedAt":"2026-10-14T12:00:00.000Z","authorUserId":"11111111-1111-4111-8111-111111111111"}],"viewer":{"name":"Alex Morgan","avatar":null}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List account notes. Requests are authenticated with the workspace API key and checked against the required workspace capability. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_notes","summary":"Create account note","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create account note; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"$ref":"#/components/schemas/PortalNote"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"note":{"id":"00000000-0000-4000-8000-000000001001","body":"Confirm the kickoff date.","pinned":false,"tag":null,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","authorUserId":null,"authorName":null}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_misc_CreatePortalNotePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"body":"The first draft is ready for review."}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create account note. Requests are authenticated with the workspace API key and checked against the required workspace capability. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalNotePayload"],"x-observed-response-keys":["error","note"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/notes/{noteId}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_notes_noteId","summary":"Update account note","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"noteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update account note; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"note":{"$ref":"#/components/schemas/PortalNote"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"note":{"id":"00000000-0000-4000-8000-000000001001","body":"Confirm the kickoff date.","pinned":false,"tag":null,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","authorUserId":null,"authorName":null}}}}}}},"400":{"description":"Malformed expectedRevision (invalid_revision) or invalid input. Revision errors include resourceType, resourceId, and recovery: read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"note","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"note","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_misc_UpdatePortalNotePayload"},"examples":{"synthetic":{"summary":"Mutation based on the original full read","value":{"body":"Confirm the updated kickoff date.","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update account note. Requests are authenticated with the workspace API key and checked against the required workspace capability. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires JSON expectedRevision from the original full resource read, including for DELETE. Missing returns 428 revision_required; stale, deleted, or unavailable items return 409 revision_conflict; malformed returns 400 invalid_revision. Authorization and workspace/account scope are checked first. Read current content and reconcile before a new mutation; never automatically retry an old intent with a fresh token. Read the full account notes list to obtain note.updatedAt; notes are agency-only.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdatePortalNotePayload"],"x-observed-response-keys":["error","note"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_notes_noteId","summary":"Delete or archive account note","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"noteId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive account note; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Malformed expectedRevision (invalid_revision) or invalid input. Revision errors include resourceType, resourceId, and recovery: read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"note","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"note","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive account note. Requests are authenticated with the workspace API key and checked against the required workspace capability. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires JSON expectedRevision from the original full resource read, including for DELETE. Missing returns 428 revision_required; stale, deleted, or unavailable items return 409 revision_conflict; malformed returns 400 invalid_revision. Authorization and workspace/account scope are checked first. Read current content and reconcile before a new mutation; never automatically retry an old intent with a fresh token. Read the full account notes list to obtain note.updatedAt; notes are agency-only.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Send the original item revision in the JSON body, including for DELETE.","content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original updatedAt from the full item read, preserving fractional precision and timezone offset. Null is invalid for this existing item. Do not use a collection metadata token."}},"required":["expectedRevision"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Mutation based on the original full read","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/tasks":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_tasks","summary":"List tasks","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"audience","in":"query","required":false,"description":"Select which representation to return: `agency` includes agency-only fields; `client` returns client-visible projection. Default is agency unless handler documents otherwise.","schema":{"type":"string","enum":["agency","client"]}},{"name":"includeMilestones","in":"query","required":false,"description":"Pass `true` to include the account milestone list alongside tasks.","schema":{"type":"string","enum":["true","false"]}},{"name":"milestoneId","in":"query","required":false,"description":"Limit tasks to the specified milestone UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list tasks; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/PortalTask"}},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/PortalMilestone"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"tasks":[{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}],"milestones":[{"id":"00000000-0000-4000-8000-000000000301","accountId":"00000000-0000-4000-8000-000000000101","templateId":null,"title":"Kickoff","status":"not_started","startApprover":"agency","startWho":null,"finishApprover":"agency","finishWho":null,"startAuto":null,"finishAuto":null,"changesGate":null,"startDate":null,"targetDate":"2026-02-01","acceptedAt":null,"description":null,"cover":null,"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","isDraft":false,"pendingDelete":false,"hasPendingEdit":false,"draft":null}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List tasks. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_tasks","summary":"Create task","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create task; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/PortalTask"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"task":{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_tasks_CreatePortalTaskPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"title":"Kickoff","repeat":"example"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create task. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalTaskPayload"],"x-observed-response-keys":["error","task"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/tasks/{taskId}/history":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_tasks_taskId_history","summary":"Read a task's flow response and recurring day-by-day history","description":"BETA ONLY. response is the client's flow response for this task (completed or still in progress), or null. series is null unless the task is recurring. For a recurring task it lists one row per scheduled day from the first day through today, newest first, with the day's status, who completed it and when, its comment count (internal included) and, for flow tasks, that day's response. Agency only.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Response and history.","content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"flowId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["completed","in_progress"]},"submittedAt":{"type":["string","null"],"format":"date-time"},"url":{"type":"string","description":"App path of the response on the flow results page."}}},"series":{"type":["object","null"],"properties":{"sourceTaskId":{"type":"string","format":"uuid"},"timeZone":{"type":"string"},"hasFlow":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"taskId":{"type":["string","null"],"format":"uuid"},"status":{"type":"string","enum":["done","done_late","expired","overdue","missed","due_today","scheduled","deleted"]},"completedAt":{"type":["string","null"],"format":"date-time"},"completedByName":{"type":["string","null"]},"commentCount":{"type":"integer"},"response":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"flowId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["completed","in_progress"]},"submittedAt":{"type":["string","null"],"format":"date-time"},"url":{"type":"string","description":"App path of the response on the flow results page."}}}}}}}}},"additionalProperties":true}}}},"404":{"description":"Task not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/tasks/{taskId}/move":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_accounts_accountId_tasks_taskId_move","summary":"Move a task to another account","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The moved task and its new loaded revision.","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/PortalTask"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"task":{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000102","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":null,"assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"400":{"description":"invalid_revision: read the task and reconcile before saving.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalError"},{"$ref":"#/components/schemas/EditorRevisionError"}]},"example":{"error":"Read the task before saving.","code":"invalid_revision","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000201","recovery":"read_resource"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"revision_conflict: read the task and reconcile before saving.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalError"},{"$ref":"#/components/schemas/EditorRevisionError"}]},"example":{"error":"Read the task before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000201","recovery":"read_resource"}}}},"428":{"description":"revision_required: read the task and reconcile before saving.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalError"},{"$ref":"#/components/schemas/EditorRevisionError"}]},"example":{"error":"Read the task before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000201","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Beta: atomically move the task, direct subtasks and their comments to a target account in the same workspace. Clears account-bound milestone/dependency references and all assignees. Requires can_create_clients and expectedRevision copied from the original task.updatedAt. Missing returns 428; stale returns 409 without move, archive or webhook effects. Read and reconcile before a new attempt.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","task"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["targetAccountId","expectedRevision"],"properties":{"targetAccountId":{"type":"string","format":"uuid"},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original task.updatedAt from the full read."}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"targetAccountId":"00000000-0000-4000-8000-000000000102","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/tasks/{taskId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId_tasks_taskId","summary":"Get task","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get task; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/PortalTask"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"task":{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get task. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","task"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId_tasks_taskId","summary":"Update task","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update task; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/PortalTask"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"task":{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_tasks_UpdatePortalTaskPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update task. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdatePortalTaskPayload"],"x-observed-response-keys":["error","task"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId_tasks_taskId","summary":"Delete or archive task","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive task; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Malformed expectedRevision (invalid_revision) or invalid input. Revision errors include resourceType, resourceId, and recovery: read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive task. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires JSON expectedRevision from the original full resource read, including for DELETE. Missing returns 428 revision_required; stale, deleted, or unavailable items return 409 revision_conflict; malformed returns 400 invalid_revision. Authorization and workspace/account scope are checked first. Read current content and reconcile before a new mutation; never automatically retry an old intent with a fresh token. Soft-deletes only the selected task, preserving the existing direct-subtask behavior. Revision conflict occurs before flow-assignment archival, comment cleanup, activity and webhooks.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Send the original item revision in the JSON body, including for DELETE.","content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original updatedAt from the full item read, preserving fractional precision and timezone offset. Null is invalid for this existing item. Do not use a collection metadata token."}},"required":["expectedRevision"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Mutation based on the original full read","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_accounts_accountId","summary":"Get client account","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get client account; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/PortalAccount"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"account":{"id":"00000000-0000-4000-8000-000000000101","workspaceId":"00000000-0000-4000-8000-000000000001","primaryPersonId":null,"companyName":"Acme Studio","slug":"acme-studio","status":"onboarding","branding":null,"avatarUrl":null,"customFields":{},"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get client account. Accounts are scoped to the authenticated workspace. Client references and custom fields are validated in that workspace. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["account"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_accounts_accountId","summary":"Update client account","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update client account; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/PortalAccount"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"account":{"id":"00000000-0000-4000-8000-000000000101","workspaceId":"00000000-0000-4000-8000-000000000001","primaryPersonId":null,"companyName":"Acme Studio","slug":"acme-studio","status":"onboarding","branding":null,"avatarUrl":null,"customFields":{},"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/client_portal_UpdatePortalAccountPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update client account. Accounts are scoped to the authenticated workspace. Client references and custom fields are validated in that workspace. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdatePortalAccountPayload"],"x-observed-response-keys":["account","error"],"x-required-capabilities":["can_create_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_accounts_accountId","summary":"Delete or archive client account","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive client account; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive client account. Accounts are scoped to the authenticated workspace. Client references and custom fields are validated in that workspace. Required capability: can_delete_clients. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["ok"],"x-required-capabilities":["can_delete_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/artifacts/{responseId}/{stepId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_artifacts_responseId_stepId","summary":"Download a completed response artifact","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"responseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Streams the finalized onboarding contract artifact for the specified response step. The response uses the stored artifact MIME type and is binary.","content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Download a completed response artifact. Streams the requested completed signed contract after workspace and response access checks, including valid evidence reused from an earlier submission. An authorized download also attempts to retain an older external PDF on 360Onboard, checking the recorded SHA-256 when available and updating its original artifact reference only after success. The agency copy is never deleted. A failed platform copy does not prevent serving successfully validated original PDF bytes, and later access can retry. Automatic retention uses public downloads for legacy or hashless migrated links; private provider retrieval requires a server-recorded SHA-256 and matching configured provider. Inaccessible historical links stay unchanged, and PDF or hash validation failures are never served as contract media. A disconnected or unavailable original provider can still cause a storage-unavailable error. New signed contracts use their retained platform copy. Platform media reads validate the original response's owner/flow contract path before downloading; source-upload PDF size limits do not impose a new size limit on finalized platform or hash-verified provider PDFs. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/config":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_config","summary":"Get workspace portal configuration","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get workspace portal configuration; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":["object","null"],"additionalProperties":true,"properties":{"updatedAt":{"type":["string","null"],"format":"date-time"}}},"milestoneLabels":{"type":"object","required":["singular","plural"],"properties":{"singular":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^\\u0000-\\u001f\\u007f]+$"},"plural":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^\\u0000-\\u001f\\u007f]+$"}},"additionalProperties":false,"description":"Workspace-authored milestone terminology, defaulting to Milestone/Milestones when unset or invalid."}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"config":{"updatedAt":"2026-10-19T01:00:00.123456Z"},"milestoneLabels":{"singular":"Milestone","plural":"Milestones"}}},"absent":{"summary":"No saved singleton","value":{"config":null,"milestoneLabels":{"singular":"Milestone","plural":"Milestones"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get workspace portal configuration. Reads or writes the selected account’s portal configuration. A client-specific home override can affect whether workspace defaults continue to flow through. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["config"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"put":{"operationId":"put_v2_workspaces_workspaceId_portal_config","summary":"Save portal configuration settings","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for save portal configuration settings; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","additionalProperties":true,"properties":{"updatedAt":{"type":["string","null"],"format":"date-time"}}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"config":{"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_misc_PortalConfigPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Save portal configuration settings. Reads or writes the selected account’s portal configuration. A client-specific home override can affect whether workspace defaults continue to flow through. Requires workspace settings-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["PortalConfigPayload"],"x-observed-response-keys":["config","error"],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/conversations":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_conversations","summary":"List conversations","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list conversations; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"conversations":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"conversations":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List conversations. Conversations belong to the workspace client portal. Message pagination uses cursor windows; use returned cursors to fetch adjacent history. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["conversations"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_conversations","summary":"Create conversation","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Existing identical message replay.","content":{"application/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"revisions":{"type":["object","null"],"description":"An exact accepted replay can return null. Read the conversation again for current revisions before composing another reply.","required":["contentRevision","receiptRevision","contextRevision"],"properties":{"contentRevision":{"type":"string","format":"uuid"},"receiptRevision":{"type":"string","format":"uuid"},"contextRevision":{"type":"string","format":"uuid"}}},"created":{"type":"boolean"},"message":{"$ref":"#/components/schemas/PortalMessage"}},"additionalProperties":false,"required":["conversationId","accountId","message","created","revisions"]},"example":{"conversationId":"00000000-0000-4000-8000-000000000105","accountId":"00000000-0000-4000-8000-000000000101","message":{"id":"00000000-0000-4000-8000-000000000104","conversationId":"00000000-0000-4000-8000-000000000105","accountId":"00000000-0000-4000-8000-000000000101","body":"Welcome to the project.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z"},"created":false,"revisions":null}}}},"201":{"description":"Conversation and first message created; notifications/webhooks scheduled once.","content":{"application/json":{"schema":{"type":"object","required":["conversationId","accountId","message","created","revisions"],"properties":{"conversationId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"message":{"$ref":"#/components/schemas/PortalMessage"},"created":{"type":"boolean"},"revisions":{"type":"object","required":["contentRevision","receiptRevision","contextRevision"],"properties":{"contentRevision":{"type":"string","format":"uuid"},"receiptRevision":{"type":"string","format":"uuid"},"contextRevision":{"type":"string","format":"uuid"}}}},"additionalProperties":false},"example":{"conversationId":"00000000-0000-4000-8000-000000000105","accountId":"00000000-0000-4000-8000-000000000101","message":{"id":"00000000-0000-4000-8000-000000000104","conversationId":"00000000-0000-4000-8000-000000000105","accountId":"00000000-0000-4000-8000-000000000101","body":"Welcome to the project.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z"},"created":true,"revisions":{"contentRevision":"00000000-0000-4000-8000-000000000103","receiptRevision":"00000000-0000-4000-8000-000000000103","contextRevision":"00000000-0000-4000-8000-000000000103"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_messages_CreatePortalConversationPayload"},"examples":{"synthetic":{"value":{"participantIds":["00000000-0000-4000-8000-000000000101"],"message":{"body":"Welcome to the project.","kind":"message","clientMessageId":"00000000-0000-4000-8000-000000000104"}}}}}}},"description":"Create conversation. Conversations belong to the workspace client portal. Message pagination uses cursor windows; use returned cursors to fetch adjacent history. Requires the workspace client-management capability. Beta: a genuinely new conversation has no prior reply context. Supply message.clientMessageId and preserve the exact participants, title and message on unknown-outcome retries. Existing-thread replies must use the message endpoint and its context precondition. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalConversationPayload"],"x-observed-response-keys":["conversationId","error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/conversations/{conversationId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_conversations_conversationId","summary":"List teammates who can be added to a conversation","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Teammates who can see this client and are not yet named in the conversation; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","required":["teammates"],"properties":{"teammates":{"type":"array","items":{"type":"object","required":["userId","name","email"],"properties":{"userId":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"additionalProperties":false}}},"additionalProperties":false},"example":{"teammates":[{"userId":"00000000-0000-4000-8000-000000000003","name":"Maya Chen","email":"maya@example.com"}]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Conversation not found, or the caller cannot see it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Lists the agency teammates who can see this conversation's client and could be added to it by name. Teammates already named in the conversation are left out. Returns 404 when the conversation does not exist in the workspace or the caller cannot see it. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-required-capabilities":["can_view_clients"]},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_conversations_conversationId","summary":"Add people to a conversation or change who can see it","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"participantIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":25,"default":[],"description":"Client people to add by name. They must belong to this conversation's client company."},"sharedWithCompany":{"type":"boolean","description":"Older switch: true lets everyone else at the client company read and reply, without notifications. Ignored when access.client is sent."},"access":{"$ref":"#/components/schemas/PortalConversationAccess","description":"Change who else can see the conversation. Groups left out keep their current settings."},"staffUserIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":25,"description":"Agency teammates to name in the conversation. Each must be able to see this client."}},"additionalProperties":false,"description":"Send at least one person to add or one access change.","example":{"access":{"client":{"on":true,"canReply":true,"notify":false}}}}}}},"responses":{"200":{"description":"The people added and the conversation's access after the change; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","required":["addedParticipantIds","addedStaffUserIds","sharedWithCompany","access"],"properties":{"addedParticipantIds":{"type":"array","items":{"type":"string","format":"uuid"}},"addedStaffUserIds":{"type":"array","items":{"type":"string","format":"uuid"}},"sharedWithCompany":{"type":"boolean"},"access":{"$ref":"#/components/schemas/PortalConversationAccess"}},"additionalProperties":false},"example":{"addedParticipantIds":[],"addedStaffUserIds":[],"sharedWithCompany":true,"access":{"team":{"on":true,"canReply":true,"notify":true},"client":{"on":true,"canReply":true,"notify":false}}}}}},"400":{"description":"Invalid payload, more than 25 named people, a person from another company, a teammate who cannot see this client, or an access change on the main conversation (always visible to everyone)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"The caller can read this conversation but cannot reply, so cannot change who is in it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Conversation not found, or the caller cannot see it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Adds client people or agency teammates to a conversation by name, and/or changes who else can see it: the agency team (teammates with access to this client) and the rest of the client company. Only callers who can reply in the conversation can change it. The main conversation is always visible to everyone, so its access cannot change. A conversation holds up to 25 named people. When the team's access is narrowed, the caller is named in the conversation so it always keeps a teammate who can answer. No message is sent. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-required-capabilities":["can_view_clients"]}},"/v2/workspaces/{workspaceId}/portal/conversations/{conversationId}/messages":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_conversations_conversationId_messages","summary":"List messages","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"before","in":"query","required":false,"description":"Return items before this ISO 8601 cursor timestamp.","schema":{"type":"string","format":"date-time"}},{"name":"beforeId","in":"query","required":false,"description":"Tie-break cursor ID paired with `before`.","schema":{"type":"string","format":"uuid"}},{"name":"windowAfter","in":"query","required":false,"description":"Start ISO 8601 timestamp for the requested message window.","schema":{"type":"string","format":"date-time"}},{"name":"windowAfterId","in":"query","required":false,"description":"Tie-break cursor ID paired with `windowAfter`.","schema":{"type":"string","format":"uuid"}},{"name":"windowBefore","in":"query","required":false,"description":"End ISO 8601 timestamp for the requested message window.","schema":{"type":"string","format":"date-time"}},{"name":"windowBeforeId","in":"query","required":false,"description":"Tie-break cursor ID paired with `windowBefore`.","schema":{"type":"string","format":"uuid"}},{"name":"windowScanBefore","in":"query","required":false,"description":"ISO 8601 pagination cursor timestamp for scanning older messages in the window.","schema":{"type":"string","format":"date-time"}},{"name":"windowScanBeforeId","in":"query","required":false,"description":"Tie-break cursor ID paired with `windowScanBefore`.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":100}}],"responses":{"200":{"description":"Success response for list messages; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/PortalMessage"}},"nextBefore":{"oneOf":[{"type":"object","required":["createdAt","id"],"properties":{"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"}}},{"type":"null"}]},"revisions":{"type":"object","required":["contentRevision","receiptRevision","contextRevision"],"properties":{"contentRevision":{"type":"string","format":"uuid"},"receiptRevision":{"type":"string","format":"uuid"},"contextRevision":{"type":"string","format":"uuid"}}},"hasMore":{"type":"boolean"},"complete":{"type":"boolean","description":"Present on loaded-window scans; false requires another page."}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"messages":[{"id":"00000000-0000-4000-8000-000000000901","conversationId":"00000000-0000-4000-8000-000000000902","accountId":"00000000-0000-4000-8000-000000000101","body":"The first draft is ready for review.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}],"revisions":{"contentRevision":"00000000-0000-4000-8000-000000000103","receiptRevision":"00000000-0000-4000-8000-000000000103","contextRevision":"00000000-0000-4000-8000-000000000103"},"hasMore":false}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List messages. Messages and replies remain inside the same account. Mention targets are resolved server-side; list windows use the cursor parameters documented here. Beta: messages and revisions are read from the same database snapshot. A full refresh must complete before acknowledging that revision. Paginated loaded-window reads must have matching revision tokens across pages; if a token changes, restart the reconciliation. before/beforeId cannot be combined with window cursors; each timestamp must be paired with its UUID. History pages use the documented limit. Loaded-window reconciliation ignores limit and returns at most 500 messages plus complete/nextBefore; continue until complete and restart if revisions change.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","messages"],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_conversations_conversationId_messages","summary":"Create message","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for create message; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/PortalMessage"},"created":{"type":"boolean","description":"False for exact accepted message replay."}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"message":{"id":"00000000-0000-4000-8000-000000000901","conversationId":"00000000-0000-4000-8000-000000000902","accountId":"00000000-0000-4000-8000-000000000101","body":"The first draft is ready for review.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z"},"created":false}}}}}},"201":{"description":"Message created; notifications/webhooks scheduled once.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/PortalMessage"},"created":{"type":"boolean","description":"False for exact accepted message replay."}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"message":{"id":"00000000-0000-4000-8000-000000000901","conversationId":"00000000-0000-4000-8000-000000000902","accountId":"00000000-0000-4000-8000-000000000101","body":"The first draft is ready for review.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z"},"created":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Stale reply context or message ID/idempotency conflict. Read content and reconcile; never blindly retry with a fresh context.","content":{"application/json":{"schema":{"properties":{"error":{"type":["string","object"]},"resource":{"type":"string"},"currentRevision":{"type":["string","null"]}},"type":"object","required":["error"]},"example":{"error":"reply_context_conflict","resource":"conversation.messages","currentRevision":"00000000-0000-4000-8000-000000000103"}}}},"428":{"description":"Missing reply context.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"const":"reply_context_required"}}},"example":{"error":"reply_context_required"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_messages_CreatePortalMessagePayload"},"examples":{"synthetic":{"summary":"Reply prepared from the loaded conversation","value":{"body":"I reviewed your request and will send the draft tomorrow.","kind":"message","expectedContextRevision":"00000000-0000-4000-8000-000000000103","clientMessageId":"00000000-0000-4000-8000-000000000104"}}}}}},"description":"Create message. Messages and replies remain inside the same account. Mention targets are resolved server-side; list windows use the cursor parameters documented here. Beta: agency replies require expectedContextRevision from the preceding full message read. Freeze that context while composing. Different IDs do not bypass a stale-context conflict. Supply clientMessageId for durable exact-payload retries; replay is authorized before freshness and does not repeat webhooks or notifications. After a conflict, reread and reconsider the reply before using a new ID. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalMessagePayload"],"x-observed-response-keys":["error","message"],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/custom-fields":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_custom_fields","summary":"List custom field definitions","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"itemType","in":"query","required":false,"description":"Filter custom-field definitions by `task`, `file`, or `client`.","schema":{"type":"string","enum":["task","file","client"]}}],"responses":{"200":{"description":"Success response for list custom field definitions; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"fields":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List custom field definitions. Definitions are scoped by item type. Field type and item type become immutable after creation; choice options are validated and values are supplied through item customFields. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CustomFieldItemTypeSchema"],"x-observed-response-keys":["error","fields"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_custom_fields","summary":"Create custom field definition","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create custom field definition; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"field":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"503":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/custom_fields_CreateCustomFieldDefinitionPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"itemType":"task","label":"In progress","fieldType":"text"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create custom field definition. Definitions are scoped by item type. Field type and item type become immutable after creation; choice options are validated and values are supplied through item customFields. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreateCustomFieldDefinitionPayload"],"x-observed-response-keys":["error","field"],"x-required-capabilities":["can_manage_custom_fields"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/custom-fields/{fieldId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_custom_fields_fieldId","summary":"Get custom field definition","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fieldId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get custom field definition; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"field":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get custom field definition. Definitions are scoped by item type. Field type and item type become immutable after creation; choice options are validated and values are supplied through item customFields. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","field"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_custom_fields_fieldId","summary":"Update custom field definition","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fieldId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update custom field definition; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"field":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/custom_fields_UpdateCustomFieldDefinitionPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update custom field definition. Definitions are scoped by item type. Field type and item type become immutable after creation; choice options are validated and values are supplied through item customFields. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdateCustomFieldDefinitionPayload"],"x-observed-response-keys":["error","field"],"x-required-capabilities":["can_manage_custom_fields"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_custom_fields_fieldId","summary":"Delete or archive custom field definition","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fieldId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive custom field definition; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive custom field definition. Definitions are scoped by item type. Field type and item type become immutable after creation; choice options are validated and values are supplied through item customFields. Requires the workspace client-management capability. This is a soft archive/delete where the route preserves historical references or item values as described by the resource lifecycle. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_manage_custom_fields"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/file-groups":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_file_groups","summary":"List file groups","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list file groups; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"fileGroups":{"$ref":"#/components/schemas/PortalFileGroup"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"fileGroups":{"id":"00000000-0000-4000-8000-000000000601","accountId":"00000000-0000-4000-8000-000000000101","name":"Shared files","purpose":"resource","access":{"mode":"all"},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List file groups. File groups are workspace or account folders. Access assignments are validated against the current workspace and applicable account. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["fileGroups"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_file_groups","summary":"Create file group","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create file group; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"fileGroup":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"fileGroup":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_files_CreatePortalFileGroupPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"name":"Example resource"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create file group. File groups are workspace or account folders. Access assignments are validated against the current workspace and applicable account. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalFileGroupPayload"],"x-observed-response-keys":["error","fileGroup"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/file-groups/{groupId}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_file_groups_groupId","summary":"Update file group","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update file group; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"fileGroup":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"fileGroup":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Update file group. File groups are workspace or account folders. Access assignments are validated against the current workspace and applicable account. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","fileGroup"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"purpose":{"type":"string","enum":["upload","contract","deliverable","resource"]},"access":{"$ref":"#/components/schemas/PortalAccess"},"position":{"type":"number"}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"name":"Shared assets","access":{"mode":"all"}}}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_file_groups_groupId","summary":"Delete or archive file group","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive file group; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive file group. File groups are workspace or account folders. Access assignments are validated against the current workspace and applicable account. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/files/{fileId}/annotations":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_files_fileId_annotations","summary":"List files","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list files; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"annotations":{"type":"array","items":{"$ref":"#/components/schemas/PortalAnnotation"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"annotations":[{"id":"00000000-0000-4000-8000-000000001301","fileId":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","body":"Update this heading.","resolved":false,"parentId":null,"x":48.2,"y":21.6,"pageUrl":null,"createdAt":"2026-01-15T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List files. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["annotations"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_files_fileId_annotations","summary":"Create file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"annotation":{"$ref":"#/components/schemas/PortalAnnotation"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"annotation":{"id":"00000000-0000-4000-8000-000000001301","fileId":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","body":"Update this heading.","resolved":false,"parentId":null,"x":48.2,"y":21.6,"pageUrl":null,"createdAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Create file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["annotation","error"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string","minLength":1},"accountId":{"type":["string","null"],"format":"uuid"},"parentId":{"type":["string","null"],"format":"uuid"},"x":{"type":"number","minimum":0,"maximum":100},"y":{"type":"number","minimum":0,"maximum":100},"pageUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"body":"Please review this section.","x":48.2,"y":21.6}}}}}}}},"/v2/workspaces/{workspaceId}/portal/files/{fileId}/annotations/{annotationId}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_files_fileId_annotations_annotationId","summary":"Update file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"annotationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"annotation":{"$ref":"#/components/schemas/PortalAnnotation"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"annotation":{"id":"00000000-0000-4000-8000-000000001301","fileId":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","body":"Update this heading.","resolved":false,"parentId":null,"x":48.2,"y":21.6,"pageUrl":null,"createdAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Update file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["annotation","error"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1},"resolved":{"type":"boolean"}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"resolved":true}}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_files_fileId_annotations_annotationId","summary":"Delete or archive file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"annotationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/files/{fileId}/comments":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_files_fileId_comments","summary":"List comments","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns comments visible to the agency on this workspace file and next annotation pin numbers keyed by file version.","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"authorAvatar":{"type":["string","null"]},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"targetType":{"type":"string"},"targetId":{"type":"string","format":"uuid"},"authorType":{"type":"string"},"authorId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"authorName":{"oneOf":[{"type":"string"},{"type":"null"}]},"parentId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"body":{"type":"string"},"internal":{"type":"boolean"},"resolvedAt":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"resolvedByType":{"oneOf":[{"type":"string"},{"type":"null"}]},"resolvedById":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"resolvedByName":{"oneOf":[{"type":"string"},{"type":"null"}]},"annotation":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"fileVersionNumber":{"oneOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","accountId","targetType","targetId","authorType","authorId","authorName","parentId","body","internal","resolvedAt","resolvedByType","resolvedById","resolvedByName","annotation","fileVersionNumber","createdAt"],"additionalProperties":true}},"nextPinNumbers":{"type":"object","additionalProperties":{"type":"integer"}}},"required":["comments","nextPinNumbers"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comments":[{"id":"11111111-1111-4111-8111-111111111111","authorAvatar":null,"accountId":"33333333-3333-4333-8333-333333333333","targetType":"file","targetId":"11111111-1111-4111-8111-111111111111","authorType":"agency","authorId":"11111111-1111-4111-8111-111111111111","authorName":"Alex Morgan","parentId":null,"body":"Please review this section.","internal":false,"resolvedAt":null,"resolvedByType":null,"resolvedById":null,"resolvedByName":null,"annotation":null,"fileVersionNumber":null,"createdAt":"2026-10-14T12:00:00.000Z"}],"nextPinNumbers":{"1":3}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List comments. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_files_fileId_comments","summary":"Create comment","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Returns the updated thread collection after creating the comment, along with next annotation pin numbers.","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"authorAvatar":{"type":["string","null"]},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"targetType":{"type":"string"},"targetId":{"type":"string","format":"uuid"},"authorType":{"type":"string"},"authorId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"authorName":{"oneOf":[{"type":"string"},{"type":"null"}]},"parentId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"body":{"type":"string"},"internal":{"type":"boolean"},"resolvedAt":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"resolvedByType":{"oneOf":[{"type":"string"},{"type":"null"}]},"resolvedById":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"resolvedByName":{"oneOf":[{"type":"string"},{"type":"null"}]},"annotation":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"fileVersionNumber":{"oneOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","accountId","targetType","targetId","authorType","authorId","authorName","parentId","body","internal","resolvedAt","resolvedByType","resolvedById","resolvedByName","annotation","fileVersionNumber","createdAt"],"additionalProperties":true}},"nextPinNumbers":{"type":"object","additionalProperties":{"type":"integer"}}},"required":["comments","nextPinNumbers"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comments":[{"id":"11111111-1111-4111-8111-111111111111","authorAvatar":null,"accountId":"33333333-3333-4333-8333-333333333333","targetType":"file","targetId":"11111111-1111-4111-8111-111111111111","authorType":"agency","authorId":"11111111-1111-4111-8111-111111111111","authorName":"Alex Morgan","parentId":null,"body":"Please review this section.","internal":false,"resolvedAt":null,"resolvedByType":null,"resolvedById":null,"resolvedByName":null,"annotation":null,"fileVersionNumber":null,"createdAt":"2026-10-14T12:00:00.000Z"}],"nextPinNumbers":{"1":3}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalFileCommentInput"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"body":"Please review this paragraph.","internal":false,"fileVersionNumber":1}}}}}},"description":"Create comment. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["hasAnnotationCommentText"],"x-observed-response-keys":["error"],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_files_fileId_comments","summary":"Resolve or import comments for the resource","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the updated thread collection after resolving or reopening a comment thread, with next annotation pin numbers.","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"authorAvatar":{"type":["string","null"]},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"targetType":{"type":"string"},"targetId":{"type":"string","format":"uuid"},"authorType":{"type":"string"},"authorId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"authorName":{"oneOf":[{"type":"string"},{"type":"null"}]},"parentId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"body":{"type":"string"},"internal":{"type":"boolean"},"resolvedAt":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"resolvedByType":{"oneOf":[{"type":"string"},{"type":"null"}]},"resolvedById":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"resolvedByName":{"oneOf":[{"type":"string"},{"type":"null"}]},"annotation":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"fileVersionNumber":{"oneOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","accountId","targetType","targetId","authorType","authorId","authorName","parentId","body","internal","resolvedAt","resolvedByType","resolvedById","resolvedByName","annotation","fileVersionNumber","createdAt"],"additionalProperties":true}},"nextPinNumbers":{"type":"object","additionalProperties":{"type":"integer"}}},"required":["comments","nextPinNumbers"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comments":[{"id":"11111111-1111-4111-8111-111111111111","authorAvatar":null,"accountId":"33333333-3333-4333-8333-333333333333","targetType":"file","targetId":"11111111-1111-4111-8111-111111111111","authorType":"agency","authorId":"11111111-1111-4111-8111-111111111111","authorName":"Alex Morgan","parentId":null,"body":"Please review this section.","internal":false,"resolvedAt":"2026-10-14T12:00:00.000Z","resolvedByType":"agency","resolvedById":"11111111-1111-4111-8111-111111111111","resolvedByName":"Alex Morgan","annotation":null,"fileVersionNumber":null,"createdAt":"2026-10-14T12:00:00.000Z"}],"nextPinNumbers":{"1":3}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Resolve or import comments for the resource. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["commentId","resolved"],"properties":{"commentId":{"type":"string","format":"uuid"},"resolved":{"type":"boolean"}},"additionalProperties":false},{"type":"object","required":["legacyComments"],"properties":{"legacyComments":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["body"],"properties":{"body":{"type":"string","minLength":1,"maxLength":4000},"author":{"type":"string","maxLength":300},"when":{"type":"string","maxLength":200}},"additionalProperties":false}}},"additionalProperties":false}]},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"commentId":"00000000-0000-4000-8000-000000001101","resolved":true}}}}}}}},"/v2/workspaces/{workspaceId}/portal/files":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_files","summary":"List files","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"scope","in":"query","required":false,"description":"Pass `shared-resources` to list shared resource-library files; omit it for the normal workspace portal file list.","schema":{"type":"string","enum":["shared-resources"]}}],"responses":{"200":{"description":"Success response for list files; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/PortalFile"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"files":[{"id":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","name":"Brand guide.pdf","groupId":null,"purpose":"deliverable","fmt":"pdf","kind":"pdf","storagePath":"workspace/flow/file.pdf","url":null,"embedFrom":null,"size":102400,"description":null,"approval":"pending","contractState":null,"lock":null,"access":{"mode":"all"},"versions":[],"customFields":{},"isLibrary":false,"position":0}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List files. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["files"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_files","summary":"Create file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/PortalFile"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"file":{"id":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","name":"Brand guide.pdf","groupId":null,"purpose":"deliverable","fmt":"pdf","kind":"pdf","storagePath":"workspace/flow/file.pdf","url":null,"embedFrom":null,"size":102400,"description":null,"approval":"pending","contractState":null,"lock":null,"access":{"mode":"all"},"versions":[],"customFields":{},"isLibrary":false,"position":0}}}}}}},"400":{"description":"Invalid request. Link and embed URLs follow the portal URL rules: spaces are trimmed, a bare domain gets https://, and only public http(s) URLs are accepted. When url is new or changed and the file has no storagePath, the server also checks that the site responds. A malformed URL, an unsupported scheme such as javascript:, data: or file:, a private-network address, or a site that does not respond returns 400 with code invalid_url or url_unreachable, urlCheck {status, retryable, issue?} and fieldErrors.url. Uploaded-file URLs and internal references (upload:, res:, analytics:, same-origin paths) skip the live check. Use GET portal/url-check to check first. Replacing url on an existing link keeps the file id, name, access, group, comments and history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_files_CreatePortalFilePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"name":"Example resource"}}}}}},"description":"Create file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalFilePayload"],"x-observed-response-keys":["error","file"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/files/{fileId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_files_fileId","summary":"Read workspace library file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current workspace file, including its updatedAt revision.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/PortalFile"}},"required":["file"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic workspace library file","value":{"file":{"id":"00000000-0000-4000-8000-000000000501","name":"Brand guide.pdf","purpose":"resource","fmt":"pdf","kind":"pdf","access":{"mode":"team"},"versions":[],"isLibrary":true,"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Workspace does not grant Client Portal view access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"File is absent, deleted, or outside the selected workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Read the full current workspace library file, including its version history and updatedAt. The lookup requires an active library resource in the selected workspace; account-scoped files must be read through accounts/{accountId}/files/{fileId}. Requires can_view_clients. Missing and cross-workspace IDs both return 404.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-observed-response-keys":["file"],"x-required-capabilities":["can_view_clients"]},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_files_fileId","summary":"Update file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/PortalFile"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"file":{"id":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","name":"Brand guide.pdf","groupId":null,"purpose":"deliverable","fmt":"pdf","kind":"pdf","storagePath":"workspace/flow/file.pdf","url":null,"embedFrom":null,"size":102400,"description":null,"approval":"pending","contractState":null,"lock":null,"access":{"mode":"all"},"versions":[],"customFields":{},"isLibrary":false,"position":0}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource. Link and embed URLs follow the portal URL rules: spaces are trimmed, a bare domain gets https://, and only public http(s) URLs are accepted. When url is new or changed and the file has no storagePath, the server also checks that the site responds. A malformed URL, an unsupported scheme such as javascript:, data: or file:, a private-network address, or a site that does not respond returns 400 with code invalid_url or url_unreachable, urlCheck {status, retryable, issue?} and fieldErrors.url. Uploaded-file URLs and internal references (upload:, res:, analytics:, same-origin paths) skip the live check. Use GET portal/url-check to check first. Replacing url on an existing link keeps the file id, name, access, group, comments and history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response Also returns revision_conflict when the loaded revision is stale.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalError"},{"$ref":"#/components/schemas/EditorRevisionError"}]},"examples":{"revisionConflict":{"value":{"error":"This item changed since it was loaded. Reload it before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_files_UpdatePortalFilePayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdatePortalFilePayload"],"x-observed-response-keys":["error","file"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_files_fileId","summary":"Delete or archive file","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive file; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive file. File metadata is scoped to the workspace and account; upload attribution is server-assigned. External links use `fmt=link` and `kind=link`. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/flows":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_flows","summary":"List flows visible to portal clients","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"assignable","in":"query","required":false,"schema":{"type":"string","enum":["true"]},"description":"When true, return only published V2 client flows that can be assigned to portal tasks."},{"name":"sellable","in":"query","required":false,"schema":{"type":"string","enum":["true"]},"description":"When true, return V2 client flows, published and draft, that can be linked to a service as onboardingFlowId."}],"responses":{"200":{"description":"Success response for list flows visible to portal clients; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"flows":{"type":"array","items":{"type":"object","required":["id","name","published"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","description":"Flow name, or Untitled flow."},"published":{"type":"boolean","description":"False while the flow is a draft. Only published flows have a usable public link."}},"additionalProperties":false}}},"required":["flows"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"flows":[{"id":"00000000-0000-4000-8000-000000000601","name":"Website care signup","published":true}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List flows visible to portal clients. Returns flows available for client portal links in the current workspace. Required capability: can_view_flows.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["flows"],"x-required-capabilities":["can_view_flows"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/home-blocks/types":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_home_blocks_types","summary":"List portal home block types","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response with the endpoint-specific JSON shape observed in the production handler.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true},"examples":{"catalog-summary":{"summary":"Catalog includes supported block types and limits","value":{"types":[{"type":"text","family":"custom","fields":["type","title","body","align","card","placement"]},{"type":"image","family":"custom","fields":["type","src","alt","decorative","caption","href","fit","ratio","rounded","storagePath","placement"]},{"type":"link","family":"custom","fields":["type","href","title","note","layout","preview","placement"]},{"type":"video","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"greeting","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"invoices","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"tasks","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"activity","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"milestones","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"announcement","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"resource","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]},{"type":"schedule","family":"legacy","fields":["type","title","text","variant","align","url","resourceId","overlayTitle","pos","size","eyebrowHidden","placement"]}],"limits":{"maxRows":40,"maxCols":2,"titleMax":160,"textMax":6000,"legacyTextMax":4000,"captionMax":240,"altMax":200,"noteMax":400,"urlMax":2048},"placement":{"body":"placement { row, col } optional on create","move":"Indexes address the layout after the block is lifted out"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List portal home block types. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires can_view_clients; credentials without this permission receive HTTP 403.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/home-blocks/{blockId}/move":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_home_blocks_blockId_move","summary":"Move home blocks within its account","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"blockId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns the moved workspace-default block and its final zero-based row and column.","content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0}},"required":["row","col"],"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["block","placement","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"block":{"id":"11111111-1111-4111-8111-111111111111","type":"greeting","title":"Welcome"},"placement":{"row":0,"col":0},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Move home blocks within its account. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. The requested row/column are evaluated after lifting the item from its current position. Task moves require a target account in the same workspace. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Use the top-level updatedAt from home-block list/read; account blocks also share the workspace-default config revision. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires can_manage_settings; credentials without this permission receive HTTP 403.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["row","expectedRevision"],"properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"row":1,"col":0,"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/home-blocks":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_home_blocks","summary":"List home page blocks","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the workspace-default home layout as row arrays and a flattened list with placement coordinates.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true}}},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"row":{"type":"integer"},"col":{"type":"integer"}},"required":["id","type","row","col"],"additionalProperties":true}},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["rows","blocks","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"rows":[],"blocks":[],"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List home page blocks. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires can_view_clients; credentials without this permission receive HTTP 403.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_home_blocks","summary":"Create home page block","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Returns the new workspace-default block and assigned placement.","content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0}},"required":["row","col"],"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["block","placement","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"block":{"id":"11111111-1111-4111-8111-111111111111","type":"greeting","title":"Welcome"},"placement":{"row":0,"col":0},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Create home page block. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Use the top-level updatedAt from home-block list/read; account blocks also share the workspace-default config revision. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires can_manage_settings; credentials without this permission receive HTTP 403.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"A supported portal block type. Retired types `chart` and `dashboard` are rejected. The row/column layout supports at most 40 rows and two blocks per row; omit placement to append a new row.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalHomeBlockCreate"},"examples":{"synthetic":{"summary":"Announcement block","value":{"type":"announcement","title":"Office hours","text":"We are available Monday to Friday.","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/home-blocks/{blockId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_home_blocks_blockId","summary":"Get home page block","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"blockId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns the selected workspace-default block and its current placement.","content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0}},"required":["row","col"],"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["block","placement","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"block":{"id":"11111111-1111-4111-8111-111111111111","type":"greeting","title":"Welcome"},"placement":{"row":0,"col":0},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get home page block. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires can_view_clients; credentials without this permission receive HTTP 403.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_home_blocks_blockId","summary":"Update home page block","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"blockId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Returns the updated workspace-default block and its current placement.","content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0}},"required":["row","col"],"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["block","placement","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"block":{"id":"11111111-1111-4111-8111-111111111111","type":"greeting","title":"Welcome back"},"placement":{"row":0,"col":0},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Update home page block. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Use the top-level updatedAt from home-block list/read; account blocks also share the workspace-default config revision. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires can_manage_settings; credentials without this permission receive HTTP 403.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalHomeBlockPatch"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"title":"Updated heading","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_home_blocks_blockId","summary":"Delete or archive home page block","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"blockId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Confirms deletion of the workspace-default block and returns its ID.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"id":{"type":"string","format":"uuid"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Workspace-default config revision shared by all home-block writes."}},"required":["ok","id","updatedAt"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true,"id":"11111111-1111-4111-8111-111111111111","updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive home page block. This endpoint edits either the workspace-default home page or one account-specific override. The first account-scoped edit forks the account’s configuration; clear it through the account config endpoint with `home: null` to resume inheriting the workspace home. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Use the top-level updatedAt from home-block list/read; account blocks also share the workspace-default config revision. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires can_manage_settings; credentials without this permission receive HTTP 403.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["expectedRevision"]},"example":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}},"/v2/workspaces/{workspaceId}/portal/home-templates":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_home_templates","summary":"List home page templates","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list home page templates; example values are synthetic. Each returned home template, milestone template and playbook includes updatedAt for conditional saves.","content":{"application/json":{"schema":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid"},"templates":{"type":"array","items":{"$ref":"#/components/schemas/PortalHomeTemplate"}}},"additionalProperties":false,"required":["workspaceId","templates"]},"examples":{"synthetic":{"value":{"workspaceId":"00000000-0000-4000-8000-000000000001","templates":[{"id":"00000000-0000-4000-8000-000000000401","name":"Client welcome","rows":[],"updatedAt":"2026-10-19T01:00:00.123456Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List home page templates. Templates are reusable workspace defaults and are restricted to settings managers. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["workspaceId"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_home_templates","summary":"Create home page template","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create home page template; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/PortalHomeTemplate"}},"additionalProperties":false,"required":["template"]},"examples":{"synthetic":{"value":{"template":{"rows":[],"id":"00000000-0000-4000-8000-000000000401","updatedAt":"2026-10-19T01:00:00.123456Z","name":"Client welcome"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Create home page template. Templates are reusable workspace defaults and are restricted to settings managers. Requires workspace settings-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","template"],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["name","rows"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"rows":{},"milestoneTpl":{"type":["string","null"],"minLength":1,"maxLength":300}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"name":"Standard onboarding","rows":[]}}}}}}}},"/v2/workspaces/{workspaceId}/portal/home-templates/{templateId}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_home_templates_templateId","summary":"Update home page template","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update home page template; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/PortalHomeTemplate"}},"additionalProperties":false,"required":["template"]},"examples":{"synthetic":{"value":{"template":{"rows":[],"id":"00000000-0000-4000-8000-000000000401","updatedAt":"2026-10-19T01:00:00.123456Z","name":"Client welcome"}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Update home page template. Templates are reusable workspace defaults and are restricted to settings managers. Requires workspace settings-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","template"],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"rows":{},"milestoneTpl":{"type":["string","null"],"minLength":1,"maxLength":300},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"required":["expectedRevision"]},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"name":"Standard onboarding","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_home_templates_templateId","summary":"Delete or archive home page template","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive home page template; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive home page template. Templates are reusable workspace defaults and are restricted to settings managers. Requires workspace settings-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["expectedRevision"]},"example":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}},"/v2/workspaces/{workspaceId}/portal/ledger":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_ledger","summary":"List client financial ledger entries","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the workspace payment ledger as a per-client-email union of portal invoice and onboarding payments. amountCents is preserved for compatibility as the original rounded-hundredths value for portal invoices (JPY 10.5 -> 1050; KWD 1.234 -> 123) and remains fixed-hundredths for onboarding. The new amount field is the exact major-unit amount for invoices (JPY 10.5; KWD 1.234); onboarding amounts remain stored fixed-hundredths divided by 100. Currency labels are preserved on read even if retired or unknown.","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"source":{"type":"string","enum":["portal_invoice","onboarding"]},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"company":{"type":["string","null"]},"amountCents":{"type":"integer","description":"Compatibility value: original rounded-hundredths for portal invoices; stored fixed-hundredths for onboarding. Interpret with currency."},"currency":{"type":"string","description":"Currency label; historical retired or unknown labels are preserved on read."},"status":{"type":"string","enum":["paid","outstanding"]},"paidAt":{"type":["string","null"]},"date":{"type":["string","null"]},"label":{"type":"string"},"ref":{"type":["string","null"]},"amount":{"type":"number","description":"Exact major-unit amount for portal invoices; onboarding uses stored fixed-hundredths divided by 100."}},"required":["id","source","email","name","company","amountCents","amount","currency","status","paidAt","date","label","ref"],"additionalProperties":false}}},"required":["entries"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"entries":[{"id":"11111111-1111-4111-8111-111111111111","source":"portal_invoice","email":"jordan@example.test","name":"Jordan Lee","company":"Acme Studio","amountCents":1050,"currency":"jpy","status":"paid","paidAt":"2026-10-14T12:00:00.000Z","date":"2026-10-14T12:00:00.000Z","label":"INV-042","ref":"INV-042","amount":10.5},{"id":"22222222-2222-4222-8222-222222222222","source":"portal_invoice","email":"kwd@example.test","name":"Morgan Price","company":"Example Studio","amountCents":123,"currency":"kwd","status":"outstanding","paidAt":null,"date":"2026-10-15T12:00:00.000Z","label":"INV-043","ref":"INV-043","amount":1.234},{"id":"33333333-3333-4333-8333-333333333333","source":"portal_invoice","email":"legacy@example.test","name":"Legacy Client","company":null,"amountCents":450,"currency":"xyz","status":"outstanding","paidAt":null,"date":"2026-10-16T12:00:00.000Z","label":"LEGACY-1","ref":"LEGACY-1","amount":4.5}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Returns the workspace payment ledger as a per-client-email union of portal invoice and onboarding payments. amountCents is preserved for compatibility as the original rounded-hundredths value for portal invoices (JPY 10.5 -> 1050; KWD 1.234 -> 123) and remains fixed-hundredths for onboarding. The new amount field is the exact major-unit amount for invoices (JPY 10.5; KWD 1.234); onboarding amounts remain stored fixed-hundredths divided by 100. Currency labels are preserved on read even if retired or unknown.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/link-preview":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_link_preview","summary":"Preview an external link","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"url","in":"query","required":false,"description":"External URL to fetch a safe preview for.","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns link preview metadata for the validated HTTP or HTTPS URL. If metadata cannot be fetched, `title`, `image`, and `description` are null and `favicon` uses the host fallback.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"},"title":{"type":["string","null"]},"image":{"type":["string","null"]},"description":{"type":["string","null"]},"favicon":{"type":["string","null"]}},"required":["domain","title","image","description","favicon"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"domain":"example.test","title":"Services","image":null,"description":null,"favicon":"https://www.google.com/s2/favicons?domain=example.test&sz=64"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Preview an external link. Fetches a safe external-link preview; it does not create a portal resource. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/meeting-notes/discover":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_meeting_notes_discover","summary":"Discover meetings from connected providers","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the providers connected to the workspace, aggregate discovered and auto-linked meeting counts, and one result per provider. A provider result may include `skipped` or `error`.","content":{"application/json":{"schema":{"type":"object","properties":{"connectedProviders":{"type":"array","items":{"type":"string"}},"discovered":{"type":"integer"},"linked":{"type":"integer"},"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"discovered":{"type":"integer"},"linked":{"type":"integer"},"skipped":{"type":"boolean"},"error":{"type":"string"}},"required":["provider","discovered","linked"],"additionalProperties":true}}},"required":["connectedProviders","discovered","linked","providers"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"connectedProviders":["zoom"],"discovered":2,"linked":1,"providers":[{"provider":"zoom","discovered":2,"linked":1}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Discover meetings from connected providers. Imported notes come from connected meeting providers. Sharing in chat is enabled by default; set `shareInChat:false` to keep an imported note agency-only. Requires the workspace client-view capability. Discovery may contact connected provider APIs and refresh the workspace meeting catalog; set `force:true` to bypass discovery caching. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","default":false}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"force":false}}}}}}}},"/v2/workspaces/{workspaceId}/portal/meeting-notes/{meetingId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_meeting_notes_meetingId","summary":"Get meeting note","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"meetingId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the full imported meeting note and the linked client account ID.","content":{"application/json":{"schema":{"type":"object","properties":{"meeting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"externalId":{"type":"string"},"title":{"type":"string"},"startedAt":{"type":["string","null"]},"endedAt":{"type":["string","null"]},"summary":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","additionalProperties":true}},"actionItems":{"type":"array","items":{"type":"object","additionalProperties":true}},"transcript":{"description":"Transcript text or transcript segments; empty when no transcript is available.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","additionalProperties":true}},{"type":"null"}]},"providerUrl":{"type":["string","null"]},"recordingUrl":{"type":["string","null"]},"accountId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"linkedAt":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","provider","externalId","title"],"additionalProperties":true},"accountId":{"type":"string","format":"uuid"}},"required":["meeting","accountId"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"meeting":{"id":"11111111-1111-4111-8111-111111111111","provider":"zoom","externalId":"meeting-123","title":"Kickoff call","startedAt":"2026-10-14T12:00:00.000Z","endedAt":null,"durationSeconds":null,"organizerEmail":"alex@example.test","participantEmails":["jordan@example.test"],"participants":[{"name":"Jordan Lee","email":"jordan@example.test"}],"summary":"Discussed onboarding timeline.","actionItems":[{"text":"Share brand assets"}],"transcript":[],"providerUrl":"https://meet.example.test/123","recordingUrl":null,"sourceCreatedAt":"2026-10-14T12:00:00.000Z","matchMethod":"email","matchedEmails":["jordan@example.test"],"visibleToClient":true,"conversationId":null,"linkedAt":"2026-10-14T12:00:00.000Z"},"accountId":"33333333-3333-4333-8333-333333333333"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get meeting note. Imported notes come from connected meeting providers. Sharing in chat is enabled by default; set `shareInChat:false` to keep an imported note agency-only. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/milestone-library/copy":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_milestone_library_copy","summary":"Copy milestone templates to a client account","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Returns the number of milestone records and task records copied from the selected library templates to the destination account.","content":{"application/json":{"schema":{"type":"object","properties":{"milestoneCount":{"type":"integer"},"taskCount":{"type":"integer"}},"required":["milestoneCount","taskCount"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"milestoneCount":2,"taskCount":4}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_milestone_library_CopyMilestoneTemplatesPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"accountId":"00000000-0000-4000-8000-000000000101","templateIds":["00000000-0000-4000-8000-000000001701"]}}}}}},"description":"Copy milestone templates to a client account. Templates and playbooks are reusable workspace assets. Copying creates client-account milestones; it does not publish unrelated staged edits. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CopyMilestoneTemplatesPayload"],"x-observed-response-keys":["error"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/milestone-library":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_milestone_library","summary":"List milestone templates and playbooks","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list milestone templates and playbooks; example values are synthetic. Each returned home template, milestone template and playbook includes updatedAt for conditional saves.","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/PortalMilestoneTemplate"}},"playbooks":{"type":"array","items":{"$ref":"#/components/schemas/PortalPlaybook"}}},"additionalProperties":false,"required":["templates","playbooks"]},"examples":{"synthetic":{"value":{"templates":[{"id":"00000000-0000-4000-8000-000000000402","updatedAt":"2026-10-19T01:00:00.123456Z","title":"Kickoff","startApprover":"none","finishApprover":"agency","tasks":[],"files":[]}],"playbooks":[{"id":"00000000-0000-4000-8000-000000000403","updatedAt":"2026-10-19T01:00:00.123456Z","name":"New client","templateIds":["00000000-0000-4000-8000-000000000402","00000000-0000-4000-8000-000000000404"]}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List milestone templates and playbooks. Templates and playbooks are reusable workspace assets. Copying creates client-account milestones; it does not publish unrelated staged edits. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["templates"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_milestone_library","summary":"Create milestone template or playbook","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create milestone template or playbook; example values are synthetic.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["template"],"properties":{"template":{"$ref":"#/components/schemas/PortalMilestoneTemplate"}},"additionalProperties":false},{"type":"object","required":["playbook"],"properties":{"playbook":{"$ref":"#/components/schemas/PortalPlaybook"}},"additionalProperties":false}]},"examples":{"template":{"value":{"template":{"id":"00000000-0000-4000-8000-000000000402","updatedAt":"2026-10-19T01:00:00.123456Z","title":"Kickoff","startApprover":"none","finishApprover":"agency","tasks":[],"files":[]}}},"playbook":{"value":{"playbook":{"id":"00000000-0000-4000-8000-000000000403","updatedAt":"2026-10-19T01:00:00.123456Z","name":"New client","templateIds":["00000000-0000-4000-8000-000000000402","00000000-0000-4000-8000-000000000404"]}}}}}}},"400":{"description":"Invalid request or a milestone template that is no longer active in the authorized workspace. The playbook is not saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"Select `kind=template` with a `template` object, or `kind=playbook` with a `playbook` object. Playbooks need at least two distinct template IDs from this workspace.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["kind","template"],"properties":{"kind":{"type":"string","const":"template"},"template":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload"}},"additionalProperties":false},{"type":"object","required":["kind","playbook"],"properties":{"kind":{"type":"string","const":"playbook"},"playbook":{"$ref":"#/components/schemas/portal_milestone_library_CreatePortalPlaybookPayload"}},"additionalProperties":false}]},"examples":{"template":{"summary":"Create a milestone template","value":{"kind":"template","template":{"title":"Kickoff","startApprover":"none","finishApprover":"agency","tasks":[]}}},"playbook":{"summary":"Create a playbook","value":{"kind":"playbook","playbook":{"name":"Standard kickoff","templateIds":["00000000-0000-4000-8000-000000001701","00000000-0000-4000-8000-000000001702"]}}}}}}},"description":"Create milestone template or playbook. Templates and playbooks are reusable workspace assets. Copying creates client-account milestones; it does not publish unrelated staged edits. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Playbook saves recheck active template availability within the same transaction as the write. A template deleted after the initial read returns 400 without saving; read the library again and reconcile the selection.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalPlaybookPayload","MilestoneTemplatePayload"],"x-observed-response-keys":["error","playbook","template"],"x-required-capabilities":["can_manage_milestone_library"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/milestone-library/{kind}/{id}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_milestone_library_kind_id","summary":"Update milestone template or playbook","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update milestone template or playbook; example values are synthetic.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["template"],"properties":{"template":{"$ref":"#/components/schemas/PortalMilestoneTemplate"}},"additionalProperties":false},{"type":"object","required":["playbook"],"properties":{"playbook":{"$ref":"#/components/schemas/PortalPlaybook"}},"additionalProperties":false}]},"examples":{"template":{"value":{"template":{"id":"00000000-0000-4000-8000-000000000402","updatedAt":"2026-10-19T01:00:00.123456Z","title":"Kickoff","startApprover":"none","finishApprover":"agency","tasks":[],"files":[]}}},"playbook":{"value":{"playbook":{"id":"00000000-0000-4000-8000-000000000403","updatedAt":"2026-10-19T01:00:00.123456Z","name":"New client","templateIds":["00000000-0000-4000-8000-000000000402","00000000-0000-4000-8000-000000000404"]}}}}}}},"400":{"description":"Invalid request or a milestone template that is no longer active in the authorized workspace. The playbook is not saved. A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"playbook","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"playbook","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"description":"For `{kind}=templates`, send editable milestone template fields. For `{kind}=playbooks`, send name, description, and/or at least two distinct workspace templateIds.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PortalMilestoneTemplateUpdate"},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"templateIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":2,"maxItems":100},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"required":["expectedRevision"]}]},"examples":{"template":{"summary":"Update a template","value":{"title":"Updated kickoff","startApprover":"none","finishApprover":"agency","tasks":[],"expectedRevision":"2026-10-19T01:00:00.123456Z"}},"playbook":{"summary":"Update a playbook","value":{"templateIds":["00000000-0000-4000-8000-000000001701","00000000-0000-4000-8000-000000001702"],"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}},"description":"Update milestone template or playbook. Templates and playbooks are reusable workspace assets. Copying creates client-account milestones; it does not publish unrelated staged edits. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Playbook saves recheck active template availability within the same transaction as the write. A template deleted after the initial read returns 400 without saving; read the library again and reconcile the selection.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalPlaybookPayload","MilestoneTemplatePayload"],"x-observed-response-keys":["error","playbook","template"],"x-required-capabilities":["can_manage_milestone_library"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_milestone_library_kind_id","summary":"Delete or archive milestone template or playbook","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive milestone template or playbook; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Malformed expectedRevision (invalid_revision) or invalid input. Revision errors include resourceType, resourceId, and recovery: read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"milestone_template","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"milestone_template","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive milestone template or playbook. Templates and playbooks are reusable workspace assets. Copying creates client-account milestones; it does not publish unrelated staged edits. Requires the workspace client-management capability. This is a soft archive/delete where the route preserves historical references or item values as described by the resource lifecycle. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires JSON expectedRevision from the original full resource read, including for DELETE. Missing returns 428 revision_required; stale, deleted, or unavailable items return 409 revision_conflict; malformed returns 400 invalid_revision. Authorization and workspace/account scope are checked first. Read current content and reconcile before a new mutation; never automatically retry an old intent with a fresh token. For kind=templates, removal of references from current active workspace playbooks and soft-deletion of playbooks left empty occur in the same transaction. Stale deletion or cleanup failure changes neither resource. For kind=playbooks, only the selected playbook is soft-deleted.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_manage_milestone_library"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Send the original item revision in the JSON body, including for DELETE.","content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original updatedAt from the full item read, preserving fractional precision and timezone offset. Null is invalid for this existing item. Do not use a collection metadata token."}},"required":["expectedRevision"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Mutation based on the original full read","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/profile":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_profile","summary":"List agency portal profile","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the portal-facing agency profile, active workspace members, the current viewing user ID, and workspace ID.","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"name":{"type":"string"},"avatarUrl":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"wideLogoUrl":{"type":["string","null"],"description":"Optional wide logo (the full logo with the brand name). Login pages, emails and invoices use it when set and fall back to logoUrl. Null when no wide logo is set. Read-only here; set it with the profile settings."},"tagline":{"type":"string"},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"photo":{"oneOf":[{"type":"string"},{"type":"null"}]},"bio":{"oneOf":[{"type":"string"},{"type":"null"}]},"invitationId":{"oneOf":[{"type":"string"},{"type":"null"}]},"membershipId":{"oneOf":[{"type":"string"},{"type":"null"}]},"userId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["id","name","title"],"additionalProperties":true}},"memberMeta":{"type":"object","additionalProperties":{"type":"object","additionalProperties":true}},"settings":{"type":"object","additionalProperties":true},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["name","avatarUrl","logoUrl","tagline","people"],"additionalProperties":true},"members":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"avatarUrl":{"type":["string","null"]},"active":{"type":"boolean"}},"required":["membershipId","userId","name","email"],"additionalProperties":true}},"viewerUserId":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"}},"required":["profile","members","viewerUserId","workspaceId"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"profile":{"name":"Example Studio","avatarUrl":null,"logoUrl":"https://cdn.example.test/logo.png","wideLogoUrl":null,"tagline":"Thoughtful onboarding for growing teams.","people":[],"memberMeta":{},"settings":{"helpEmail":"help@example.test","helpPhone":"","brandColors":{"primary":"#172B50","secondary":"#0F172A"},"invoiceBilling":{"companyName":"Example Studio","address":""}},"updatedAt":"2026-10-19T01:00:00.123456Z"},"members":[{"membershipId":"11111111-1111-4111-8111-111111111111","userId":"11111111-1111-4111-8111-111111111111","name":"Alex Morgan","email":"alex@example.test","role":"owner","avatarUrl":null,"active":true}],"viewerUserId":"11111111-1111-4111-8111-111111111111","workspaceId":"22222222-2222-4222-8222-222222222222"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List agency portal profile. Reads or updates the agency profile shown in the client portal. Only supplied profile fields are changed. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"put":{"operationId":"put_v2_workspaces_workspaceId_portal_profile","summary":"Save agency portal profile settings","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the updated portal-facing agency profile after applying the supplied patch.","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"name":{"type":"string"},"avatarUrl":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"wideLogoUrl":{"type":["string","null"],"description":"Optional wide logo (the full logo with the brand name). Login pages, emails and invoices use it when set and fall back to logoUrl. Null when no wide logo is set. Read-only here; set it with the profile settings."},"tagline":{"type":"string"},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"photo":{"oneOf":[{"type":"string"},{"type":"null"}]},"bio":{"oneOf":[{"type":"string"},{"type":"null"}]},"invitationId":{"oneOf":[{"type":"string"},{"type":"null"}]},"membershipId":{"oneOf":[{"type":"string"},{"type":"null"}]},"userId":{"oneOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["id","name","title"],"additionalProperties":true}},"memberMeta":{"type":"object","additionalProperties":{"type":"object","additionalProperties":true}},"settings":{"type":"object","additionalProperties":true},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["name","avatarUrl","logoUrl","tagline","people"],"additionalProperties":true}},"required":["profile"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"profile":{"name":"Example Studio","avatarUrl":null,"logoUrl":"https://cdn.example.test/logo.png","wideLogoUrl":null,"tagline":"Thoughtful onboarding for growing teams.","people":[],"memberMeta":{},"settings":{"helpEmail":"help@example.test","helpPhone":"","brandColors":{"primary":"#172B50","secondary":"#0F172A"},"invoiceBilling":{"companyName":"Example Studio","address":""}},"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Save agency portal profile settings. Reads or updates the agency profile shown in the client portal. Only supplied profile fields are changed. Requires workspace settings-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error"],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","properties":{"tagline":{"type":"string"},"people":{"type":"array","items":{"type":"object","additionalProperties":true}},"memberMeta":{"type":"object","additionalProperties":true},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"required":["expectedRevision"]},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"tagline":"A small studio helping ambitious teams.","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/calendar":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_calendar","summary":"List calendar items","description":"Return meetings, task start/due dates and milestone start/target dates that overlap [from, to). Tasks with a start and a due date span every day between them. Teammates limited to specific clients only receive those clients' items plus meetings they organize or attend. Cancelled meetings are left out unless includeCancelled=true. Read-only.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"description":"Range start, ISO 8601 with offset."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"description":"Range end (exclusive). At most 400 days after from."},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Only this client account."},{"name":"types","in":"query","required":false,"schema":{"type":"string","example":"meeting,task"},"description":"Comma list of meeting, task and milestone. Defaults to all three."},{"name":"memberId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Meetings this member organizes or attends and tasks assigned to them. Milestones are left out."},{"name":"includeCancelled","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Calendar items in the range; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}}},"meetings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":["string","null"],"format":"uuid"},"accountName":{"type":["string","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"timeZone":{"type":"string","description":"IANA time zone the meeting was scheduled in."},"locationType":{"type":"string","enum":["video","phone","in_person","custom"]},"location":{"type":["string","null"]},"joinUrl":{"type":["string","null"],"format":"uri"},"internalNotes":{"type":["string","null"],"description":"Agency-only. Never returned to clients."},"organizerUserId":{"type":["string","null"],"format":"uuid"},"organizerName":{"type":["string","null"]},"attendees":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","userId","name"],"properties":{"type":{"const":"team"},"userId":{"type":"string","format":"uuid"},"name":{"type":"string"}}},{"type":"object","required":["type","personId","name"],"properties":{"type":{"const":"client"},"personId":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":["string","null"]}}},{"type":"object","required":["type","email"],"properties":{"type":{"const":"external"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]}}}]}},"status":{"type":"string","enum":["scheduled","cancelled"]},"cancelledAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":true}},"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":["string","null"],"format":"uuid"},"accountName":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string"},"dueAt":{"type":["string","null"],"format":"date-time"},"startAt":{"type":["string","null"],"format":"date-time"},"assigneeType":{"type":["string","null"]},"assigneeId":{"type":["string","null"]},"assigneeName":{"type":["string","null"]},"parentId":{"type":["string","null"],"format":"uuid"},"milestoneId":{"type":["string","null"],"format":"uuid"}}}},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"accountName":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string"},"startDate":{"type":["string","null"],"format":"date-time"},"targetDate":{"type":["string","null"],"format":"date-time"},"isDraft":{"type":"boolean"}}}}}},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"range":{"from":"2026-11-01T07:00:00.000Z","to":"2026-12-13T08:00:00.000Z"},"meetings":[{"id":"c4d5e6f7-0a1b-4c2d-9e3f-4a5b6c7d8e9f","accountId":"7d3c1a52-4b8e-4f0a-9c61-2e5f8a9b0c11","accountName":"Brightline Physical Therapy","title":"Website kickoff call","description":"Walk through the sitemap, launch date and content owners.","startsAt":"2026-11-10T17:00:00.000Z","endsAt":"2026-11-10T17:30:00.000Z","timeZone":"America/Los_Angeles","locationType":"video","location":null,"joinUrl":"https://meet.google.com/abc-defg-hij","internalNotes":"Bring the care-plan upsell.","organizerUserId":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","organizerName":"Marcus Bell","attendees":[{"type":"team","userId":"5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f","name":"Maya Ortiz"},{"type":"client","personId":"9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d","name":"Rachel Kim","email":"rachel@brightlinept.com"}],"status":"scheduled","cancelledAt":null,"createdBy":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","createdAt":"2026-11-07T18:20:00.000Z","updatedAt":"2026-11-07T18:20:00.000Z"}],"tasks":[{"id":"6c7d8e9f-0a1b-4c2d-8e3f-4a5b6c7d8e9f","accountId":"7d3c1a52-4b8e-4f0a-9c61-2e5f8a9b0c11","accountName":"Brightline Physical Therapy","title":"Send brand photos","status":"todo","dueAt":"2026-11-12T08:00:00.000Z","startAt":null,"assigneeType":"client","assigneeId":"9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d","assigneeName":"Rachel Kim","parentId":null,"milestoneId":null}],"milestones":[{"id":"8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b","accountId":"7d3c1a52-4b8e-4f0a-9c61-2e5f8a9b0c11","accountName":"Brightline Physical Therapy","title":"Website launch","status":"in_progress","startDate":"2026-11-02T08:00:00.000Z","targetDate":"2026-11-30T08:00:00.000Z","isDraft":false}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable or the key lacks the required permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"accountId is not a client you can see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"x-production-request-schemas":[],"x-observed-response-keys":["range","meetings","tasks","milestones"],"x-required-capabilities":["can_view_clients"]}},"/v2/workspaces/{workspaceId}/portal/calendar/booking/settings":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_calendar_booking_settings","summary":"Read client booking settings","description":"How clients book meetings from Messages in this workspace.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Read client booking settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"apiKey":[]}]},"put":{"operationId":"put_v2_workspaces_workspaceId_portal_calendar_booking_settings","summary":"Update client booking settings","description":"Owner or admin only. Requires expectedRevision from the last read. When 360Onboard can't offer its own open times (enabled is false, no event type is visible to clients, or a host still needs to connect Google Calendar or save hours), clients book on the agency's saved calendar links instead: Clients see every saved link except those in hiddenBookingLinkIds. Then Book a meeting in the client portal and the client sidebar's Calendar page open the shown link inside the portal; with two or more, the client picks one first. The response's bookingLinks are the links clients fall back to, and bookingLink is the first of them. The other fields control booking open times inside 360Onboard (GET selfBookingOpen: true).","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Update client booking settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"Not the owner or an admin"},"409":{"description":"Settings changed since the last read"}},"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["enabled","availabilityMode","useConversationPeople","requiresApproval","durationMinutes","minNoticeHours","maxDaysAhead","expectedRevision"],"properties":{"enabled":{"type":"boolean"},"availabilityMode":{"type":"string","enum":["team_pool","owner","admins","all_members"]},"useConversationPeople":{"type":"boolean"},"requiresApproval":{"type":"boolean"},"durationMinutes":{"type":"integer","enum":[15,30,45,60]},"minNoticeHours":{"type":"integer","minimum":0,"maximum":336},"maxDaysAhead":{"type":"integer","minimum":1,"maximum":365},"bufferBeforeMinutes":{"type":"integer","minimum":0,"maximum":240,"description":"Free time kept before each busy event or meeting, so a booking can't start right after one. Left out keeps the current value."},"bufferAfterMinutes":{"type":"integer","minimum":0,"maximum":240,"description":"Free time kept after each busy event or meeting, so a booking can't end right before one. Left out keeps the current value."},"mainBookingLinkId":{"type":["string","null"],"minLength":1,"maxLength":200,"description":"The saved calendar link (profile settings.calendarLinks id) clients open first when they book on external pages. Null uses the first shown link. Left out keeps it."},"blockAllDayEvents":{"type":"boolean","description":"False: all-day busy events on connected calendars (bill reminders, holidays) don't block booking times; timed events still do. Default true. Left out keeps it."},"reminderRules":{"type":"object","additionalProperties":false,"required":["attendees","hosts"],"description":"Reminders before each meeting with a client. attendees: clients and their guests get a reminder in their thread and a Meeting reminder email with the calendar file. hosts: the organizer and teammates on the meeting get an email. Default: attendees 1440 and 60 minutes before, hosts none. Left out keeps them.","properties":{"attendees":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["minutes"],"properties":{"minutes":{"type":"integer","minimum":5,"maximum":20160,"description":"How long before the meeting starts."},"templateId":{"type":["string","null"],"format":"uuid","description":"This reminder's own email: the id of a custom email template in this workspace (create one with POST /email-templates). Omit or null to send the shared Meeting reminder or Host meeting reminder email. If the template is later deleted, the shared email is sent."}}}},"hosts":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["minutes"],"properties":{"minutes":{"type":"integer","minimum":5,"maximum":20160,"description":"How long before the meeting starts."},"templateId":{"type":["string","null"],"format":"uuid","description":"This reminder's own email: the id of a custom email template in this workspace (create one with POST /email-templates). Omit or null to send the shared Meeting reminder or Host meeting reminder email. If the template is later deleted, the shared email is sent."}}}}}},"inviteTeamMembers":{"type":"boolean","description":"False: teammates on a meeting aren't added as guests on the Google Calendar invite. The organizer always has it. Default true. Left out keeps it."},"clientCalendarEnabled":{"type":"boolean","description":"False: clients can't connect their own Google Calendar when booking to hide times they're busy. Google's consent screen names 360Onboard as the app asking for access. Default true. Left out keeps it."},"hiddenBookingLinkIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":200},"description":"Ids of saved calendar links (profile settings.calendarLinks, the same links onboarding flows use) that clients don't see. [] shows them all; left out keeps the list. Each must be a saved link's id."},"expectedRevision":{"type":["string","null"],"format":"uuid"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/calendar/booking/event-types":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_calendar_booking_event_types","summary":"List event types","description":"The kinds of meeting this workspace offers.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success"}}},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_calendar_booking_event_types","summary":"Create an event type","description":"Owner or admin only.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"description":{"type":["string","null"],"maxLength":500},"durationMinutes":{"type":"integer","minimum":5,"maximum":480},"visibleToClients":{"type":"boolean","description":"False keeps this event type agency-only."},"rules":{"type":["object","null"],"additionalProperties":false,"description":"Booking rules this event type uses instead of the workspace booking settings. Null: all workspace rules apply. Left out: stays as it is. Inside, a null or left-out value uses the workspace value. Sending rules replaces all four, so include every value you want to keep.","properties":{"minNoticeHours":{"type":["integer","null"],"minimum":0,"maximum":336},"maxDaysAhead":{"type":["integer","null"],"minimum":1,"maximum":365},"bufferBeforeMinutes":{"type":["integer","null"],"minimum":0,"maximum":240},"bufferAfterMinutes":{"type":["integer","null"],"minimum":0,"maximum":240}}},"reminderRules":{"type":["object","null"],"additionalProperties":false,"required":["attendees","hosts"],"description":"Reminders this event type sends instead of the workspace ones. Null: the workspace reminders apply. Left out: stays as it is. attendees: clients and their guests get a reminder in their thread and a Meeting reminder email with the calendar file. hosts: the organizer and teammates on the meeting get an email.","properties":{"attendees":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["minutes"],"properties":{"minutes":{"type":"integer","minimum":5,"maximum":20160,"description":"How long before the meeting starts."},"templateId":{"type":["string","null"],"format":"uuid","description":"This reminder's own email: the id of a custom email template in this workspace (create one with POST /email-templates). Omit or null to send the shared Meeting reminder or Host meeting reminder email. If the template is later deleted, the shared email is sent."}}}},"hosts":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["minutes"],"properties":{"minutes":{"type":"integer","minimum":5,"maximum":20160,"description":"How long before the meeting starts."},"templateId":{"type":["string","null"],"format":"uuid","description":"This reminder's own email: the id of a custom email template in this workspace (create one with POST /email-templates). Omit or null to send the shared Meeting reminder or Host meeting reminder email. If the template is later deleted, the shared email is sent."}}}}}},"availability":{"type":["object","null"],"description":"Hours that replace people's normal hours for this event type. Null uses normal hours.","properties":{"timeZone":{"type":"string"},"weeklyHours":{"type":"object"}},"required":["timeZone","weeklyHours"]}},"required":["name","durationMinutes","availability"]}}}},"responses":{"201":{"description":"Created"}}}},"/v2/workspaces/{workspaceId}/portal/calendar/booking/event-types/{eventTypeId}":{"put":{"operationId":"put_v2_workspaces_workspaceId_portal_calendar_booking_event_types_eventTypeId","summary":"Update an event type","description":"Owner or admin only. Requires expectedRevision from the last read.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"eventTypeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"description":{"type":["string","null"],"maxLength":500},"durationMinutes":{"type":"integer","minimum":5,"maximum":480},"visibleToClients":{"type":"boolean","description":"False keeps this event type agency-only."},"rules":{"type":["object","null"],"additionalProperties":false,"description":"Booking rules this event type uses instead of the workspace booking settings. Null: all workspace rules apply. Left out: stays as it is. Inside, a null or left-out value uses the workspace value. Sending rules replaces all four, so include every value you want to keep.","properties":{"minNoticeHours":{"type":["integer","null"],"minimum":0,"maximum":336},"maxDaysAhead":{"type":["integer","null"],"minimum":1,"maximum":365},"bufferBeforeMinutes":{"type":["integer","null"],"minimum":0,"maximum":240},"bufferAfterMinutes":{"type":["integer","null"],"minimum":0,"maximum":240}}},"reminderRules":{"type":["object","null"],"additionalProperties":false,"required":["attendees","hosts"],"description":"Reminders this event type sends instead of the workspace ones. Null: the workspace reminders apply. Left out: stays as it is. attendees: clients and their guests get a reminder in their thread and a Meeting reminder email with the calendar file. hosts: the organizer and teammates on the meeting get an email.","properties":{"attendees":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["minutes"],"properties":{"minutes":{"type":"integer","minimum":5,"maximum":20160,"description":"How long before the meeting starts."},"templateId":{"type":["string","null"],"format":"uuid","description":"This reminder's own email: the id of a custom email template in this workspace (create one with POST /email-templates). Omit or null to send the shared Meeting reminder or Host meeting reminder email. If the template is later deleted, the shared email is sent."}}}},"hosts":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["minutes"],"properties":{"minutes":{"type":"integer","minimum":5,"maximum":20160,"description":"How long before the meeting starts."},"templateId":{"type":["string","null"],"format":"uuid","description":"This reminder's own email: the id of a custom email template in this workspace (create one with POST /email-templates). Omit or null to send the shared Meeting reminder or Host meeting reminder email. If the template is later deleted, the shared email is sent."}}}}}},"availability":{"type":["object","null"],"description":"Hours that replace people's normal hours for this event type. Null uses normal hours.","properties":{"timeZone":{"type":"string"},"weeklyHours":{"type":"object"}},"required":["timeZone","weeklyHours"]},"expectedRevision":{"type":"string","format":"uuid"}},"required":["name","durationMinutes","availability","expectedRevision"]}}}},"responses":{"200":{"description":"Success"}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_calendar_booking_event_types_eventTypeId","summary":"Delete an event type","description":"Owner or admin only. Requests already sent keep their time and length.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"eventTypeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success"}}}},"/v2/workspaces/{workspaceId}/portal/calendar/booking/event-types/{eventTypeId}/my-hours":{"put":{"operationId":"put_v2_workspaces_workspaceId_portal_calendar_booking_event_types_eventTypeId_my_hours","summary":"Set my hours for an event type","description":"The caller's own hours for this event type. They come before the event type's hours. Null goes back to normal hours.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"eventTypeId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"availability":{"type":["object","null"],"properties":{"timeZone":{"type":"string"},"weeklyHours":{"type":"object"}},"required":["timeZone","weeklyHours"]}},"required":["availability"]}}}},"responses":{"200":{"description":"Success"}}}},"/v2/workspaces/{workspaceId}/portal/calendar/booking/slots":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_calendar_booking_slots","summary":"List open meeting times","description":"Open times under the workspace booking setting. With no from and to it only reports whether booking is on. The range can be at most 45 days.","tags":["Client Portal"],"parameters":[{"name":"eventTypeId","in":"query","required":false,"description":"Which event type to list times for. Defaults to the workspace's first one.","schema":{"type":"string","format":"uuid"}},{"name":"requestId","in":"query","required":false,"description":"Limit results to the times this meeting request can move to.","schema":{"type":"string","format":"uuid"}},{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"conversationId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"timeZone","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"List open meeting times","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"apiKey":[]}]}},"/v2/workspaces/{workspaceId}/portal/calendar/booking/requests":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_calendar_booking_requests","summary":"List meeting requests in a thread","description":"Up to 200 requests, newest first.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"conversationId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"List meeting requests in a thread","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"apiKey":[]}]},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_calendar_booking_requests","summary":"Schedule a meeting with a client","description":"If every invited client chose to accept meetings automatically, it books right away and the request has meetingId. Otherwise it posts Accept, Suggest time and Decline in the thread and books when they accept.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"conversationId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Schedule a meeting with a client","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"The meeting has no client attendee or is for another client"},"409":{"description":"The time has passed or another request is waiting at that time"}},"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["meeting"],"properties":{"meeting":{"type":"object","additionalProperties":true,"description":"The same fields as POST calendar/meetings, with a client attendee."},"manual":{"type":"boolean","description":"A time typed in rather than chosen from open times. Always waits for the other side."},"rangeEndsAt":{"type":["string","null"],"format":"date-time","description":"Offers a window. The person answering picks the exact time inside it."},"conversationId":{"type":["string","null"],"format":"uuid"},"expectedContextRevision":{"type":["string","null"],"format":"uuid"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/calendar/booking/requests/{requestId}":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_calendar_booking_requests_requestId","summary":"Answer a meeting request","description":"Accept, decline or suggest another time. Accepting creates the meeting. The reply is posted in the thread when expectedContextRevision is current; posted reports whether it was.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"requestId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"conversationId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Answer a meeting request","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"Already answered, not your turn, or the time is no longer free"}},"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"type":"string","enum":["accept","decline","suggest"]},"startsAt":{"type":"string","format":"date-time","description":"Required for suggest, and for accept when the request is a range."},"manual":{"type":"boolean","description":"A time typed in rather than chosen from open times. Always waits for the other side."},"rangeEndsAt":{"type":["string","null"],"format":"date-time","description":"Offers a window. The person answering picks the exact time inside it."},"expectedContextRevision":{"type":["string","null"],"format":"uuid"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/calendar/settings":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_calendar_settings","summary":"Read my calendar settings","description":"The signed-in team member's available hours, time zone and hidden item types.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"timeZone","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Read my calendar settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}},"security":[{"apiKey":[]}]},"put":{"operationId":"put_v2_workspaces_workspaceId_portal_calendar_settings","summary":"Update my calendar settings","description":"Save available hours and which item types show. Requires expectedRevision from the last read.","tags":["Client Portal"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Read my calendar settings","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"Settings changed since the last read"}},"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["timeZone","weeklyHours","hiddenTypes","expectedRevision"],"properties":{"timeZone":{"type":"string"},"weeklyHours":{"type":"object","additionalProperties":true},"hiddenTypes":{"type":"array","items":{"type":"string","enum":["meeting","task","subtask","milestone"]}},"expectedRevision":{"type":["string","null"],"format":"uuid"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/calendar/meetings":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_calendar_meetings","summary":"Schedule a meeting","description":"Create a meeting on the native calendar. Team attendees must be workspace members; client attendees must be portal contacts on accountId; names and emails are filled in from those records. Invited client contacts see the meeting, without internalNotes, in their portal calendar. Overlapping meetings for the organizer or team attendees are returned in conflicts and never block the save. No email invitation is sent and nothing is written to Google Calendar.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Meeting scheduled; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"meeting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":["string","null"],"format":"uuid"},"accountName":{"type":["string","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"timeZone":{"type":"string","description":"IANA time zone the meeting was scheduled in."},"locationType":{"type":"string","enum":["video","phone","in_person","custom"]},"location":{"type":["string","null"]},"joinUrl":{"type":["string","null"],"format":"uri"},"internalNotes":{"type":["string","null"],"description":"Agency-only. Never returned to clients."},"organizerUserId":{"type":["string","null"],"format":"uuid"},"organizerName":{"type":["string","null"]},"attendees":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","userId","name"],"properties":{"type":{"const":"team"},"userId":{"type":"string","format":"uuid"},"name":{"type":"string"}}},{"type":"object","required":["type","personId","name"],"properties":{"type":{"const":"client"},"personId":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":["string","null"]}}},{"type":"object","required":["type","email"],"properties":{"type":{"const":"external"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]}}}]}},"status":{"type":"string","enum":["scheduled","cancelled"]},"cancelledAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":true},"conflicts":{"type":"array","items":{"type":"object","properties":{"meetingId":{"type":["string","null"],"format":"uuid","description":"Null when the overlapping meeting belongs to a client you cannot see; its title is then Busy."},"title":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"userIds":{"type":"array","items":{"type":"string","format":"uuid"}},"names":{"type":"array","items":{"type":"string"}}}}}}},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"meeting":{"id":"c4d5e6f7-0a1b-4c2d-9e3f-4a5b6c7d8e9f","accountId":"7d3c1a52-4b8e-4f0a-9c61-2e5f8a9b0c11","accountName":"Brightline Physical Therapy","title":"Website kickoff call","description":"Walk through the sitemap, launch date and content owners.","startsAt":"2026-11-10T17:00:00.000Z","endsAt":"2026-11-10T17:30:00.000Z","timeZone":"America/Los_Angeles","locationType":"video","location":null,"joinUrl":"https://meet.google.com/abc-defg-hij","internalNotes":"Bring the care-plan upsell.","organizerUserId":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","organizerName":"Marcus Bell","attendees":[{"type":"team","userId":"5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f","name":"Maya Ortiz"},{"type":"client","personId":"9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d","name":"Rachel Kim","email":"rachel@brightlinept.com"}],"status":"scheduled","cancelledAt":null,"createdBy":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","createdAt":"2026-11-07T18:20:00.000Z","updatedAt":"2026-11-07T18:20:00.000Z"},"conflicts":[{"meetingId":"0e1f2a3b-4c5d-4e6f-8a7b-9c0d1e2f3a4b","title":"Northline Studio check-in","startsAt":"2026-11-10T17:15:00.000Z","endsAt":"2026-11-10T17:45:00.000Z","userIds":["5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f"],"names":["Maya Ortiz"]}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable or the key lacks the required permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Client account not found in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"x-production-request-schemas":["CreateCalendarMeetingPayload"],"x-observed-response-keys":["meeting","conflicts"],"x-required-capabilities":["can_create_clients"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","startsAt","endsAt"],"properties":{"title":{"type":"string","minLength":1,"maxLength":200},"accountId":{"type":["string","null"],"format":"uuid","description":"Client account. Null or omitted for an internal meeting."},"description":{"type":["string","null"],"maxLength":8000,"description":"Agenda. Invited clients can read it."},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time","description":"Must be after startsAt."},"timeZone":{"type":"string","default":"UTC","description":"IANA time zone, for example America/New_York."},"locationType":{"type":"string","enum":["video","phone","in_person","custom"],"default":"video"},"location":{"type":["string","null"],"maxLength":500},"joinUrl":{"type":["string","null"],"format":"uri","maxLength":2000,"description":"http or https link."},"internalNotes":{"type":["string","null"],"maxLength":8000,"description":"Agency-only notes."},"organizerUserId":{"type":["string","null"],"format":"uuid","description":"Workspace member. Defaults to the API key's user."},"attendees":{"type":"array","maxItems":100,"items":{"oneOf":[{"type":"object","required":["type","userId"],"properties":{"type":{"const":"team"},"userId":{"type":"string","format":"uuid","description":"Workspace member user id."}},"additionalProperties":false},{"type":"object","required":["type","personId"],"properties":{"type":{"const":"client"},"personId":{"type":"string","format":"uuid","description":"Portal contact on accountId."}},"additionalProperties":false},{"type":"object","required":["type","email"],"properties":{"type":{"const":"external"},"email":{"type":"string","format":"email"},"name":{"type":"string","maxLength":120}},"additionalProperties":false}]},"default":[]}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"title":"Website kickoff call","accountId":"7d3c1a52-4b8e-4f0a-9c61-2e5f8a9b0c11","startsAt":"2026-11-10T09:00:00-08:00","endsAt":"2026-11-10T09:30:00-08:00","timeZone":"America/Los_Angeles","locationType":"video","joinUrl":"https://meet.google.com/abc-defg-hij","attendees":[{"type":"team","userId":"5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f"},{"type":"client","personId":"9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d"}],"internalNotes":"Bring the care-plan upsell."}}}}}}}},"/v2/workspaces/{workspaceId}/portal/calendar/meetings/{meetingId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_calendar_meetings_meetingId","summary":"Get a meeting","description":"Read one meeting, including internal notes. Meetings in other workspaces or for clients you cannot see return 404.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"meetingId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Calendar meeting id."}],"responses":{"200":{"description":"The meeting; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"meeting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":["string","null"],"format":"uuid"},"accountName":{"type":["string","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"timeZone":{"type":"string","description":"IANA time zone the meeting was scheduled in."},"locationType":{"type":"string","enum":["video","phone","in_person","custom"]},"location":{"type":["string","null"]},"joinUrl":{"type":["string","null"],"format":"uri"},"internalNotes":{"type":["string","null"],"description":"Agency-only. Never returned to clients."},"organizerUserId":{"type":["string","null"],"format":"uuid"},"organizerName":{"type":["string","null"]},"attendees":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","userId","name"],"properties":{"type":{"const":"team"},"userId":{"type":"string","format":"uuid"},"name":{"type":"string"}}},{"type":"object","required":["type","personId","name"],"properties":{"type":{"const":"client"},"personId":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":["string","null"]}}},{"type":"object","required":["type","email"],"properties":{"type":{"const":"external"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]}}}]}},"status":{"type":"string","enum":["scheduled","cancelled"]},"cancelledAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":true}}},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"meeting":{"id":"c4d5e6f7-0a1b-4c2d-9e3f-4a5b6c7d8e9f","accountId":"7d3c1a52-4b8e-4f0a-9c61-2e5f8a9b0c11","accountName":"Brightline Physical Therapy","title":"Website kickoff call","description":"Walk through the sitemap, launch date and content owners.","startsAt":"2026-11-10T17:00:00.000Z","endsAt":"2026-11-10T17:30:00.000Z","timeZone":"America/Los_Angeles","locationType":"video","location":null,"joinUrl":"https://meet.google.com/abc-defg-hij","internalNotes":"Bring the care-plan upsell.","organizerUserId":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","organizerName":"Marcus Bell","attendees":[{"type":"team","userId":"5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f","name":"Maya Ortiz"},{"type":"client","personId":"9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d","name":"Rachel Kim","email":"rachel@brightlinept.com"}],"status":"scheduled","cancelledAt":null,"createdBy":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","createdAt":"2026-11-07T18:20:00.000Z","updatedAt":"2026-11-07T18:20:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable or the key lacks the required permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Meeting not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"x-production-request-schemas":[],"x-observed-response-keys":["meeting"],"x-required-capabilities":["can_view_clients"]},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_calendar_meetings_meetingId","summary":"Edit or reschedule a meeting","description":"Change any meeting field. Times are validated together with the stored ones, so the meeting must still end after it starts. Changing accountId drops client attendees from the old client unless attendees is sent. A cancelled meeting returns 409 until you send status scheduled to restore it. Returns overlap warnings like create.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"meetingId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Calendar meeting id."}],"responses":{"200":{"description":"Meeting updated; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"meeting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":["string","null"],"format":"uuid"},"accountName":{"type":["string","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"timeZone":{"type":"string","description":"IANA time zone the meeting was scheduled in."},"locationType":{"type":"string","enum":["video","phone","in_person","custom"]},"location":{"type":["string","null"]},"joinUrl":{"type":["string","null"],"format":"uri"},"internalNotes":{"type":["string","null"],"description":"Agency-only. Never returned to clients."},"organizerUserId":{"type":["string","null"],"format":"uuid"},"organizerName":{"type":["string","null"]},"attendees":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","userId","name"],"properties":{"type":{"const":"team"},"userId":{"type":"string","format":"uuid"},"name":{"type":"string"}}},{"type":"object","required":["type","personId","name"],"properties":{"type":{"const":"client"},"personId":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":["string","null"]}}},{"type":"object","required":["type","email"],"properties":{"type":{"const":"external"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]}}}]}},"status":{"type":"string","enum":["scheduled","cancelled"]},"cancelledAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":true},"conflicts":{"type":"array","items":{"type":"object","properties":{"meetingId":{"type":["string","null"],"format":"uuid","description":"Null when the overlapping meeting belongs to a client you cannot see; its title is then Busy."},"title":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"userIds":{"type":"array","items":{"type":"string","format":"uuid"}},"names":{"type":"array","items":{"type":"string"}}}}}}},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"meeting":{"id":"c4d5e6f7-0a1b-4c2d-9e3f-4a5b6c7d8e9f","accountId":"7d3c1a52-4b8e-4f0a-9c61-2e5f8a9b0c11","accountName":"Brightline Physical Therapy","title":"Website kickoff call","description":"Walk through the sitemap, launch date and content owners.","startsAt":"2026-11-11T18:00:00.000Z","endsAt":"2026-11-11T18:30:00.000Z","timeZone":"America/Los_Angeles","locationType":"video","location":null,"joinUrl":"https://meet.google.com/abc-defg-hij","internalNotes":"Bring the care-plan upsell.","organizerUserId":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","organizerName":"Marcus Bell","attendees":[{"type":"team","userId":"5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f","name":"Maya Ortiz"},{"type":"client","personId":"9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d","name":"Rachel Kim","email":"rachel@brightlinept.com"}],"status":"scheduled","cancelledAt":null,"createdBy":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","createdAt":"2026-11-07T18:20:00.000Z","updatedAt":"2026-11-07T18:20:00.000Z"},"conflicts":[{"meetingId":"0e1f2a3b-4c5d-4e6f-8a7b-9c0d1e2f3a4b","title":"Northline Studio check-in","startsAt":"2026-11-10T17:15:00.000Z","endsAt":"2026-11-10T17:45:00.000Z","userIds":["5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f"],"names":["Maya Ortiz"]}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable or the key lacks the required permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Meeting not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The meeting is cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"x-production-request-schemas":["UpdateCalendarMeetingPayload"],"x-observed-response-keys":["meeting","conflicts"],"x-required-capabilities":["can_create_clients"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"properties":{"title":{"type":"string","minLength":1,"maxLength":200},"accountId":{"type":["string","null"],"format":"uuid","description":"Client account. Null or omitted for an internal meeting."},"description":{"type":["string","null"],"maxLength":8000,"description":"Agenda. Invited clients can read it."},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time","description":"Must be after startsAt."},"timeZone":{"type":"string","default":"UTC","description":"IANA time zone, for example America/New_York."},"locationType":{"type":"string","enum":["video","phone","in_person","custom"],"default":"video"},"location":{"type":["string","null"],"maxLength":500},"joinUrl":{"type":["string","null"],"format":"uri","maxLength":2000,"description":"http or https link."},"internalNotes":{"type":["string","null"],"maxLength":8000,"description":"Agency-only notes."},"organizerUserId":{"type":["string","null"],"format":"uuid","description":"Workspace member. Defaults to the API key's user."},"attendees":{"type":"array","maxItems":100,"items":{"oneOf":[{"type":"object","required":["type","userId"],"properties":{"type":{"const":"team"},"userId":{"type":"string","format":"uuid","description":"Workspace member user id."}},"additionalProperties":false},{"type":"object","required":["type","personId"],"properties":{"type":{"const":"client"},"personId":{"type":"string","format":"uuid","description":"Portal contact on accountId."}},"additionalProperties":false},{"type":"object","required":["type","email"],"properties":{"type":{"const":"external"},"email":{"type":"string","format":"email"},"name":{"type":"string","maxLength":120}},"additionalProperties":false}]},"default":[]},"status":{"type":"string","enum":["scheduled"],"description":"Restore a cancelled meeting."}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"startsAt":"2026-11-11T10:00:00-08:00","endsAt":"2026-11-11T10:30:00-08:00"}}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_calendar_meetings_meetingId","summary":"Cancel a meeting","description":"Mark the meeting cancelled. The record stays on the calendar as cancelled and can be restored with PATCH {status: scheduled}. Cancelling an already cancelled meeting succeeds without changes. Attendees are not notified.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"meetingId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Calendar meeting id."}],"responses":{"200":{"description":"Meeting cancelled; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"meeting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":["string","null"],"format":"uuid"},"accountName":{"type":["string","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"timeZone":{"type":"string","description":"IANA time zone the meeting was scheduled in."},"locationType":{"type":"string","enum":["video","phone","in_person","custom"]},"location":{"type":["string","null"]},"joinUrl":{"type":["string","null"],"format":"uri"},"internalNotes":{"type":["string","null"],"description":"Agency-only. Never returned to clients."},"organizerUserId":{"type":["string","null"],"format":"uuid"},"organizerName":{"type":["string","null"]},"attendees":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","userId","name"],"properties":{"type":{"const":"team"},"userId":{"type":"string","format":"uuid"},"name":{"type":"string"}}},{"type":"object","required":["type","personId","name"],"properties":{"type":{"const":"client"},"personId":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":["string","null"]}}},{"type":"object","required":["type","email"],"properties":{"type":{"const":"external"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]}}}]}},"status":{"type":"string","enum":["scheduled","cancelled"]},"cancelledAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":true},"cancelled":{"type":"boolean"}}},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"meeting":{"id":"c4d5e6f7-0a1b-4c2d-9e3f-4a5b6c7d8e9f","accountId":"7d3c1a52-4b8e-4f0a-9c61-2e5f8a9b0c11","accountName":"Brightline Physical Therapy","title":"Website kickoff call","description":"Walk through the sitemap, launch date and content owners.","startsAt":"2026-11-10T17:00:00.000Z","endsAt":"2026-11-10T17:30:00.000Z","timeZone":"America/Los_Angeles","locationType":"video","location":null,"joinUrl":"https://meet.google.com/abc-defg-hij","internalNotes":"Bring the care-plan upsell.","organizerUserId":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","organizerName":"Marcus Bell","attendees":[{"type":"team","userId":"5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f","name":"Maya Ortiz"},{"type":"client","personId":"9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d","name":"Rachel Kim","email":"rachel@brightlinept.com"}],"status":"cancelled","cancelledAt":"2026-11-08T16:00:00.000Z","createdBy":"2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","createdAt":"2026-11-07T18:20:00.000Z","updatedAt":"2026-11-08T16:00:00.000Z"},"cancelled":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable or the key lacks the required permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Meeting not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"x-production-request-schemas":[],"x-observed-response-keys":["meeting","cancelled"],"x-required-capabilities":["can_create_clients"]}},"/v2/workspaces/{workspaceId}/portal/calendar/conflicts":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_calendar_conflicts","summary":"Check meeting conflicts","description":"List scheduled meetings in [startsAt, endsAt) that involve any of userIds as organizer or team attendee. Saves nothing. Meetings for clients you cannot see are returned as Busy without their id.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Overlapping meetings; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"conflicts":{"type":"array","items":{"type":"object","properties":{"meetingId":{"type":["string","null"],"format":"uuid","description":"Null when the overlapping meeting belongs to a client you cannot see; its title is then Busy."},"title":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"userIds":{"type":"array","items":{"type":"string","format":"uuid"}},"names":{"type":"array","items":{"type":"string"}}}}}}},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"conflicts":[{"meetingId":"0e1f2a3b-4c5d-4e6f-8a7b-9c0d1e2f3a4b","title":"Northline Studio check-in","startsAt":"2026-11-10T17:15:00.000Z","endsAt":"2026-11-10T17:45:00.000Z","userIds":["5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f"],"names":["Maya Ortiz"]}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable or the key lacks the required permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"x-production-request-schemas":["CalendarConflictPayload"],"x-observed-response-keys":["conflicts"],"x-required-capabilities":["can_view_clients"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["startsAt","endsAt","userIds"],"properties":{"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"userIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid"}},"excludeMeetingId":{"type":["string","null"],"format":"uuid"}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"startsAt":"2026-11-10T17:00:00.000Z","endsAt":"2026-11-10T17:30:00.000Z","userIds":["2f6a9d13-8c4b-4e7a-b5d0-1c2e3f4a5b6c","5b8e2c41-7a3d-4c9e-8f12-6d0a1b2c3e4f"]}}}}}}}},"/v2/workspaces/{workspaceId}/portal/calendar/meet-link":{"post":{"operationId":"post_v2_workspaces_workspaceId_portal_calendar_meet_link","summary":"Create a Google Meet link","description":"Create a Google Meet room with the workspace's existing Video Call (Google Meet) connection and return its link to use as a meeting's joinUrl. It does not create a Google Calendar event or save a meeting. Returns 400 google_not_connected when Video Call is not connected.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Meet link created; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"joinUrl":{"type":"string","format":"uri"}}},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"joinUrl":"https://meet.google.com/abc-defg-hij"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable or the key lacks the required permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"502":{"description":"Google Meet could not create the room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"x-production-request-schemas":[],"x-observed-response-keys":["joinUrl"],"x-required-capabilities":["can_create_clients"]}},"/v2/workspaces/{workspaceId}/portal/broadcasts":{"get":{"operationId":"list_portal_broadcasts","summary":"List portal broadcasts","description":"Returns newest-created-first announcements, including drafts, scheduled, live and ended records, with unique-recipient counts. Use the nextOffset returned by the previous page. Requires Client Portal and both can_view_clients and can_manage_settings with unrestricted workspace client access.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","description":"Workspace authorized for the API key and its owner.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","description":"Number of records to skip.","required":false,"schema":{"type":"integer","minimum":0,"maximum":1000000,"default":0}},{"name":"limit","in":"query","description":"Maximum records in a page.","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":40}}],"responses":{"200":{"description":"Broadcasts in this workspace.","content":{"application/json":{"schema":{"type":"object","required":["broadcasts","nextOffset"],"properties":{"broadcasts":{"type":"array","items":{"$ref":"#/components/schemas/PortalBroadcast"}},"nextOffset":{"type":["integer","null"],"minimum":0}},"additionalProperties":false},"example":{"broadcasts":[{"placement":"top","title":"Holiday hours","message":"Hi {first_name}, we’ll be back January 2.","audience":{"kind":"specific","accountIds":["fbade424-04ba-4d88-9cb2-c8b802916d84"]},"startsAt":"2026-12-24T09:00:00-08:00","endsAt":"2027-01-02T09:00:00-08:00","actions":[{"label":"See our calendar","destination":{"kind":"portal","section":"calendar"}}],"tone":"normal","image":null,"dismissible":true,"posterFrequency":"once","id":"2516a53c-15c9-4d24-9ba0-16e0f502ab32","state":"draft","status":"draft","createdAt":"2026-11-26T18:00:00.000Z","updatedAt":"2026-11-26T18:00:00.000Z","counts":{"seen":0,"dismissed":0,"clicked":0}}],"nextOffset":null}}}},"400":{"description":"Invalid IDs, inputs, audience, pagination, date order, or revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal unavailable to this key, missing workspace settings or client-view permission, or access limited to specific clients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Workspace or broadcast not available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded. Check Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Broadcast storage or API context unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}},"post":{"operationId":"create_portal_broadcast","summary":"Create a portal broadcast","description":"Creates a private draft by default. action=publish explicitly makes it visible when startsAt arrives or immediately if omitted. This never sends email, messages, or webhooks. Duplicate a broadcast by creating a new draft with its content and new dates. Requires Client Portal and both can_view_clients and can_manage_settings with unrestricted workspace client access.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","description":"Workspace authorized for the API key and its owner.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","description":"Optional key for identical requests by the same actor within the 24-hour replay window.","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["broadcast"],"properties":{"action":{"type":"string","enum":["save","publish"],"default":"save"},"broadcast":{"$ref":"#/components/schemas/PortalBroadcastInput"}},"additionalProperties":false},"example":{"action":"save","broadcast":{"placement":"top","title":"Holiday hours","message":"Hi {first_name}, we’ll be back January 2.","audience":{"kind":"specific","accountIds":["fbade424-04ba-4d88-9cb2-c8b802916d84"]},"startsAt":"2026-12-24T09:00:00-08:00","endsAt":"2027-01-02T09:00:00-08:00","actions":[{"label":"See our calendar","destination":{"kind":"portal","section":"calendar"}}]}}}}},"responses":{"201":{"description":"Created broadcast.","content":{"application/json":{"schema":{"type":"object","required":["broadcast"],"properties":{"broadcast":{"$ref":"#/components/schemas/PortalBroadcast"}},"additionalProperties":false},"example":{"broadcast":{"placement":"top","title":"Holiday hours","message":"Hi {first_name}, we’ll be back January 2.","audience":{"kind":"specific","accountIds":["fbade424-04ba-4d88-9cb2-c8b802916d84"]},"startsAt":"2026-12-24T09:00:00-08:00","endsAt":"2027-01-02T09:00:00-08:00","actions":[{"label":"See our calendar","destination":{"kind":"portal","section":"calendar"}}],"tone":"normal","image":null,"dismissible":true,"posterFrequency":"once","id":"2516a53c-15c9-4d24-9ba0-16e0f502ab32","state":"draft","status":"draft","createdAt":"2026-11-26T18:00:00.000Z","updatedAt":"2026-11-26T18:00:00.000Z","counts":{"seen":0,"dismissed":0,"clicked":0}}}}}},"400":{"description":"Invalid IDs, inputs, audience, pagination, date order, or revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal unavailable to this key, missing workspace settings or client-view permission, or access limited to specific clients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Workspace or broadcast not available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Revision or idempotency conflict, or invalid lifecycle transition. Read the current broadcast before acting again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded. Check Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Broadcast storage or API context unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/broadcasts/audience":{"post":{"operationId":"preview_portal_broadcast_audience","summary":"Count the eligible client accounts","description":"Validates the audience against the workspace, then returns the number of current matching client accounts. This does not save, publish, or send a broadcast. It is not a count of personal logins. Requires Client Portal and both can_view_clients and can_manage_settings with unrestricted workspace client access.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","description":"Workspace authorized for the API key and its owner.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["audience"],"properties":{"audience":{"$ref":"#/components/schemas/PortalBroadcastAudience"}},"additionalProperties":false},"example":{"audience":{"kind":"specific","accountIds":["fbade424-04ba-4d88-9cb2-c8b802916d84"]}}}}},"responses":{"200":{"description":"Eligible client account count.","content":{"application/json":{"schema":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","minimum":0}},"additionalProperties":false},"example":{"count":1}}}},"400":{"description":"Invalid IDs, inputs, audience, pagination, date order, or revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal unavailable to this key, missing workspace settings or client-view permission, or access limited to specific clients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Workspace or broadcast not available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded. Check Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Broadcast storage or API context unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/broadcasts/{broadcastId}":{"get":{"operationId":"get_portal_broadcast","summary":"Read a portal broadcast","description":"Returns full saved content, current status, counts and the exact updatedAt needed for later mutations. Requires Client Portal and both can_view_clients and can_manage_settings with unrestricted workspace client access.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","description":"Workspace authorized for the API key and its owner.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"broadcastId","in":"path","description":"ID returned by the list or create response.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Saved broadcast.","content":{"application/json":{"schema":{"type":"object","required":["broadcast"],"properties":{"broadcast":{"$ref":"#/components/schemas/PortalBroadcast"}},"additionalProperties":false},"example":{"broadcast":{"placement":"top","title":"Holiday hours","message":"Hi {first_name}, we’ll be back January 2.","audience":{"kind":"specific","accountIds":["fbade424-04ba-4d88-9cb2-c8b802916d84"]},"startsAt":"2026-12-24T09:00:00-08:00","endsAt":"2027-01-02T09:00:00-08:00","actions":[{"label":"See our calendar","destination":{"kind":"portal","section":"calendar"}}],"tone":"normal","image":null,"dismissible":true,"posterFrequency":"once","id":"2516a53c-15c9-4d24-9ba0-16e0f502ab32","state":"draft","status":"draft","createdAt":"2026-11-26T18:00:00.000Z","updatedAt":"2026-11-26T18:00:00.000Z","counts":{"seen":0,"dismissed":0,"clicked":0}}}}}},"400":{"description":"Invalid IDs, inputs, audience, pagination, date order, or revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal unavailable to this key, missing workspace settings or client-view permission, or access limited to specific clients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Workspace or broadcast not available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded. Check Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Broadcast storage or API context unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}},"patch":{"operationId":"update_portal_broadcast","summary":"Save, publish, or end a portal broadcast","description":"save replaces a draft. publish replaces and publishes a draft or updates an already published notice. end stops a live or scheduled notice without deleting it. An ended notice cannot be restarted, but its content can be copied to a new draft. Edits retain the original notice’s person-level seen and dismissed state. All actions check the exact updatedAt read before editing. No email, chat, or webhook is sent. Requires Client Portal and both can_view_clients and can_manage_settings with unrestricted workspace client access.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","description":"Workspace authorized for the API key and its owner.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"broadcastId","in":"path","description":"ID returned by the list or create response.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","description":"Optional key for identical requests by the same actor within the 24-hour replay window.","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["action","broadcast","expectedRevision"],"properties":{"action":{"type":"string","enum":["save","publish"]},"broadcast":{"$ref":"#/components/schemas/PortalBroadcastInput"},"expectedRevision":{"type":"string","format":"date-time"}},"additionalProperties":false},{"type":"object","required":["action","expectedRevision"],"properties":{"action":{"type":"string","const":"end"},"expectedRevision":{"type":"string","format":"date-time"}},"additionalProperties":false}]},"example":{"action":"publish","broadcast":{"placement":"top","title":"Holiday hours","message":"Hi {first_name}, we’ll be back January 2.","audience":{"kind":"specific","accountIds":["fbade424-04ba-4d88-9cb2-c8b802916d84"]},"startsAt":"2026-12-24T09:00:00-08:00","endsAt":"2027-01-02T09:00:00-08:00","actions":[{"label":"See our calendar","destination":{"kind":"portal","section":"calendar"}}]},"expectedRevision":"2026-11-26T18:00:00.000Z"}}}},"responses":{"200":{"description":"Updated broadcast.","content":{"application/json":{"schema":{"type":"object","required":["broadcast"],"properties":{"broadcast":{"$ref":"#/components/schemas/PortalBroadcast"}},"additionalProperties":false},"example":{"broadcast":{"placement":"top","title":"Holiday hours","message":"Hi {first_name}, we’ll be back January 2.","audience":{"kind":"specific","accountIds":["fbade424-04ba-4d88-9cb2-c8b802916d84"]},"startsAt":"2026-12-24T09:00:00-08:00","endsAt":"2027-01-02T09:00:00-08:00","actions":[{"label":"See our calendar","destination":{"kind":"portal","section":"calendar"}}],"tone":"normal","image":null,"dismissible":true,"posterFrequency":"once","id":"2516a53c-15c9-4d24-9ba0-16e0f502ab32","state":"published","status":"scheduled","createdAt":"2026-11-26T18:00:00.000Z","updatedAt":"2026-11-26T18:05:00.000Z","counts":{"seen":0,"dismissed":0,"clicked":0}}}}}},"400":{"description":"Invalid IDs, inputs, audience, pagination, date order, or revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal unavailable to this key, missing workspace settings or client-view permission, or access limited to specific clients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Workspace or broadcast not available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Revision or idempotency conflict, or invalid lifecycle transition. Read the current broadcast before acting again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"428":{"description":"The original updatedAt is required as expectedRevision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"}}}},"429":{"description":"Rate limit exceeded. Check Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Broadcast storage or API context unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}},"delete":{"operationId":"delete_portal_broadcast","summary":"Delete a draft or ended broadcast","description":"Permanently removes this notice and its engagement counts. Live or scheduled notices must be ended first. The JSON body uses the exact updatedAt from the original read. Requires Client Portal and both can_view_clients and can_manage_settings with unrestricted workspace client access.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","description":"Workspace authorized for the API key and its owner.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"broadcastId","in":"path","description":"ID returned by the list or create response.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","description":"Optional key for identical requests by the same actor within the 24-hour replay window.","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedRevision"],"properties":{"expectedRevision":{"type":"string","format":"date-time"}},"additionalProperties":false},"example":{"expectedRevision":"2026-11-26T18:00:00.000Z"}}}},"responses":{"200":{"description":"The broadcast was deleted.","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","const":true}},"additionalProperties":false},"example":{"deleted":true}}}},"400":{"description":"Invalid IDs, inputs, audience, pagination, date order, or revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal unavailable to this key, missing workspace settings or client-view permission, or access limited to specific clients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Workspace or broadcast not available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Revision or idempotency conflict, or invalid lifecycle transition. Read the current broadcast before acting again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"428":{"description":"The original updatedAt is required as expectedRevision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"}}}},"429":{"description":"Rate limit exceeded. Check Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Broadcast storage or API context unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/scheduled-sends":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_scheduled_sends","summary":"List scheduled sends","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"targetKey","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success response for list scheduled sends; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["message","comment"]},"url":{"type":"string"},"path":{"type":"string"},"targetKey":{"type":"string"},"text":{"type":"string"},"internal":{"type":"boolean"},"attachmentCount":{"type":"integer"},"sendAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","sending","sent","failed","cancelled"]},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"sentAt":{"type":["string","null"]},"undoSend":{"type":"boolean","description":"True for a message held for 30 seconds so it can be undone (created with undoSend)."}},"additionalProperties":true}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"scheduled":[{"id":"8f0c2b1e-6a51-4c55-9d7e-1a2b3c4d5e6f","kind":"message","url":"/api/v2/portal/accounts/1b2c3d4e-0000-4000-8000-000000000001/messages","path":"accounts/1b2c3d4e-0000-4000-8000-000000000001/messages","targetKey":"accounts/1b2c3d4e-0000-4000-8000-000000000001/messages||","text":"Morning, the draft is ready for review.","internal":false,"attachmentCount":0,"sendAt":"2026-11-07T14:00:00.000Z","status":"scheduled","error":null,"createdAt":"2026-11-06T04:12:00.000Z","sentAt":null}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List your own scheduled, sending and failed messages and comments. Optional targetKey narrows to one composer. Scheduled items live apart from messages and comments, so recipients see nothing until sendAt. At sendAt the original send runs as the scheduling user, with that route's normal permission checks, notifications and webhooks; if it can no longer be sent the item is marked failed with an error.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["scheduled"],"x-required-capabilities":["can_view_clients"]},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_scheduled_sends","summary":"Schedule a message or comment","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for schedule a message or comment; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["message","comment"]},"url":{"type":"string"},"path":{"type":"string"},"targetKey":{"type":"string"},"text":{"type":"string"},"internal":{"type":"boolean"},"attachmentCount":{"type":"integer"},"sendAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","sending","sent","failed","cancelled"]},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"sentAt":{"type":["string","null"]},"undoSend":{"type":"boolean","description":"True for a message held for 30 seconds so it can be undone (created with undoSend)."}},"additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"scheduled":{"id":"8f0c2b1e-6a51-4c55-9d7e-1a2b3c4d5e6f","kind":"message","url":"/api/v2/portal/accounts/1b2c3d4e-0000-4000-8000-000000000001/messages","path":"accounts/1b2c3d4e-0000-4000-8000-000000000001/messages","targetKey":"accounts/1b2c3d4e-0000-4000-8000-000000000001/messages||","text":"Morning, the draft is ready for review.","internal":false,"attachmentCount":0,"sendAt":"2026-11-07T14:00:00.000Z","status":"scheduled","error":null,"createdAt":"2026-11-06T04:12:00.000Z","sentAt":null}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"503":{"description":"Scheduled send is not available in this environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Schedule a send for later. path is accounts/{accountId}/messages, conversations/{conversationId}/messages, accounts/{accountId}/comments, tasks/{taskId}/comments, files/{fileId}/comments or file-groups/{groupId}/comments. body is exactly what that route accepts now; expectedContextRevision is not needed because the conversation as it is at send time is used. sendAt must be in the future and at most a year ahead. Scheduled items live apart from messages and comments, so recipients see nothing until sendAt. At sendAt the original send runs as the scheduling user, with that route's normal permission checks, notifications and webhooks; if it can no longer be sent the item is marked failed with an error. With undoSend true, an agency message is held for 30 seconds instead (see undoSend).","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["scheduled"],"x-required-capabilities":["can_view_clients"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path","body","sendAt"],"properties":{"path":{"type":"string"},"body":{"type":"object","additionalProperties":true},"sendAt":{"type":"string","format":"date-time"},"undoSend":{"type":"boolean","description":"Hold an agency message for 30 seconds so it can be undone, like Undo send in the app. The server sets the send time to 30 seconds from now and ignores sendAt (still required; any valid time). Only for message paths (conversations/{conversationId}/messages or accounts/{accountId}/messages). Unlike a later scheduled send, body must include expectedContextRevision from the latest full message read, as a direct agency reply does; a stale or missing revision returns 409 reply_context_conflict. Cancel with DELETE scheduled-sends/{id} before it goes out."}},"additionalProperties":false}}}}}},"/v2/workspaces/{workspaceId}/portal/scheduled-sends/{scheduledId}":{"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_scheduled_sends_scheduledId","summary":"Edit or reschedule a scheduled send","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"scheduledId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for edit or reschedule a scheduled send; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["message","comment"]},"url":{"type":"string"},"path":{"type":"string"},"targetKey":{"type":"string"},"text":{"type":"string"},"internal":{"type":"boolean"},"attachmentCount":{"type":"integer"},"sendAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","sending","sent","failed","cancelled"]},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"sentAt":{"type":["string","null"]}},"additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"scheduled":{"id":"8f0c2b1e-6a51-4c55-9d7e-1a2b3c4d5e6f","kind":"message","url":"/api/v2/portal/accounts/1b2c3d4e-0000-4000-8000-000000000001/messages","path":"accounts/1b2c3d4e-0000-4000-8000-000000000001/messages","targetKey":"accounts/1b2c3d4e-0000-4000-8000-000000000001/messages||","text":"Morning, the draft is ready for review.","internal":false,"attachmentCount":0,"sendAt":"2026-11-07T14:00:00.000Z","status":"scheduled","error":null,"createdAt":"2026-11-06T04:12:00.000Z","sentAt":null}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The item is being sent right now or was already sent or cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Change the text and/or send time of your scheduled item before it is sent. Saving a failed item schedules it again. Scheduled items live apart from messages and comments, so recipients see nothing until sendAt. At sendAt the original send runs as the scheduling user, with that route's normal permission checks, notifications and webhooks; if it can no longer be sent the item is marked failed with an error.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["scheduled"],"x-required-capabilities":["can_view_clients"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"sendAt":{"type":"string","format":"date-time"}},"additionalProperties":false}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_scheduled_sends_scheduledId","summary":"Cancel a scheduled send","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"scheduledId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for cancel a scheduled send; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"cancelled":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The item is being sent right now or was already sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Cancel your scheduled item before it is sent. Returns 409 if it is already being sent. Scheduled items live apart from messages and comments, so recipients see nothing until sendAt. At sendAt the original send runs as the scheduling user, with that route's normal permission checks, notifications and webhooks; if it can no longer be sent the item is marked failed with an error.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["cancelled"],"x-required-capabilities":["can_view_clients"]}},"/v2/workspaces/{workspaceId}/portal/saved-replies":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_saved_replies","summary":"List saved replies","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list saved replies; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"replies":{"type":"array","items":{"type":"object","additionalProperties":true}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"replies":[]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List saved replies. Saved replies are workspace-scoped snippets for portal conversations. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["replies"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_saved_replies","summary":"Create saved reply","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create saved reply; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"object","additionalProperties":true}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"reply":{}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Create saved reply. Saved replies are workspace-scoped snippets for portal conversations. Requires workspace settings-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","reply"],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["title","body"],"properties":{"title":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"title":"Kickoff follow-up","body":"Thanks for meeting today."}}}}}}}},"/v2/workspaces/{workspaceId}/portal/saved-replies/{id}":{"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_saved_replies_id","summary":"Delete or archive saved reply","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive saved reply; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive saved reply. Saved replies are workspace-scoped snippets for portal conversations. Requires workspace settings-management capability. This is a soft archive/delete where the route preserves historical references or item values as described by the resource lifecycle. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_manage_settings"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/url-check":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_url_check","summary":"Check a portal link before saving it","description":"Validates, normalizes and preflights a user-entered URL with the same rules the file create and update routes enforce. Leading and trailing spaces are removed, a bare domain such as example.com/page gets https://, and only public http(s) destinations are accepted. The check sends a HEAD request and falls back to GET when a site rejects HEAD, follows up to five redirects, and re-validates every hop's DNS answer against private and loopback ranges. Nothing is saved. Requires Client Portal access and can_view_clients.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"url","in":"query","required":true,"description":"The address to check.","schema":{"type":"string","maxLength":2048}},{"name":"embed","in":"query","required":false,"description":"Pass 1 to also report whether the site allows framing.","schema":{"type":"string","enum":["1","true"]}}],"responses":{"200":{"description":"The check ran. Inspect status and ok; a reachable site that refuses framing returns ok true with embeddable false.","content":{"application/json":{"schema":{"type":"object","required":["status","ok","url","finalUrl","embeddable","retryable","message"],"properties":{"status":{"type":"string","enum":["ok","invalid","blocked","unreachable","not_found","timeout"],"description":"ok: reachable. invalid: malformed, unsupported scheme (javascript:, data:, file:), credentials in the URL, or no domain. blocked: resolves to a private, loopback, link-local or other non-public address, including after redirects. unreachable: DNS or connection failure. not_found: the site answered 404 or 410. timeout: no response within the time limit."},"ok":{"type":"boolean"},"url":{"type":["string","null"],"description":"The trimmed, normalized URL (a bare domain gets https://). Null when invalid."},"finalUrl":{"type":["string","null"],"description":"The public URL reached after following safe redirects."},"embeddable":{"type":["boolean","null"],"description":"Whether the site allows framing (no X-Frame-Options DENY or SAMEORIGIN and no restrictive CSP frame-ancestors). Null unless embed was requested."},"retryable":{"type":"boolean","description":"True for temporary failures such as timeouts and connection errors."},"message":{"type":"string","description":"Plain-language explanation suitable to show beside the field."},"issue":{"type":"string","enum":["empty","too_long","unsupported_scheme","malformed","missing_domain","credentials"],"description":"Present when status is invalid."}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"status":"ok","ok":true,"url":"https://harborlight-design.com/brand","finalUrl":"https://www.harborlight-design.com/brand","embeddable":false,"retryable":false,"message":"This website doesn't allow other sites to embed it. You can still add it as a link that opens in a new tab."}}}}}},"400":{"description":"The URL is invalid. The body uses the same check shape with status invalid and an issue code.","content":{"application/json":{"schema":{"type":"object","required":["status","ok","url","finalUrl","embeddable","retryable","message"],"properties":{"status":{"type":"string","enum":["ok","invalid","blocked","unreachable","not_found","timeout"],"description":"ok: reachable. invalid: malformed, unsupported scheme (javascript:, data:, file:), credentials in the URL, or no domain. blocked: resolves to a private, loopback, link-local or other non-public address, including after redirects. unreachable: DNS or connection failure. not_found: the site answered 404 or 410. timeout: no response within the time limit."},"ok":{"type":"boolean"},"url":{"type":["string","null"],"description":"The trimmed, normalized URL (a bare domain gets https://). Null when invalid."},"finalUrl":{"type":["string","null"],"description":"The public URL reached after following safe redirects."},"embeddable":{"type":["boolean","null"],"description":"Whether the site allows framing (no X-Frame-Options DENY or SAMEORIGIN and no restrictive CSP frame-ancestors). Null unless embed was requested."},"retryable":{"type":"boolean","description":"True for temporary failures such as timeouts and connection errors."},"message":{"type":"string","description":"Plain-language explanation suitable to show beside the field."},"issue":{"type":"string","enum":["empty","too_long","unsupported_scheme","malformed","missing_domain","credentials"],"description":"Present when status is invalid."}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"status":"invalid","ok":false,"url":null,"finalUrl":null,"embeddable":null,"retryable":false,"message":"Only http and https links are allowed, not javascript: links.","issue":"unsupported_scheme"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/summary":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_summary","summary":"Get the portal dashboard summary","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"includeOwn","in":"query","required":false,"description":"Pass `true` to include the current actor’s activity in the summary.","schema":{"type":"string","enum":["true","false"]}},{"name":"range","in":"query","required":false,"description":"Summary period: `30d` (default), `90d`, `year`, or `all`. Unknown values fall back to `30d`.","schema":{"type":"string","enum":["30d","90d","year","all"],"default":"30d"}}],"responses":{"200":{"description":"Returns workspace rollups for the Home page. Client, task and health counts remain workspace-wide. Invoice and revenue amounts are grouped by currency without FX conversion; the primary currency is USD when it appears among open-invoice or paid-invoice revenue-window currency groups, otherwise the alphabetically first reported currency, or USD when there are no reported groups. Draft invoices and paid invoices outside the revenue window do not determine it. Top-level outstanding, monthlyRevenue, revenueSeries, metrics.revenue and metrics.invoices refer only to the primary currency. currencyTotals provides separate figures for each currency; within its invoice metrics, `count` is an invoice count while `overdue`, `upcoming`, and `undated` are monetary amounts that can be fractional. Historical or unknown currency labels remain readable. The `range` query selects 30d, 90d, year, or all time.","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","description":"Primary summary currency: USD when present among open-invoice or paid-invoice revenue-window currency groups; otherwise the alphabetically first reported currency, or USD when there are no reported groups. Draft invoices and paid invoices outside the revenue window do not determine it."},"currencyTotals":{"type":"array","description":"Per-currency invoice and revenue totals; values are never added across currencies or converted.","items":{"type":"object","properties":{"currency":{"type":"string"},"outstanding":{"type":"number"},"monthlyRevenue":{"type":"number"},"revenueSeries":{"type":"array","items":{"type":"number"}},"revenue":{"type":"object","properties":{"current":{"type":"number"},"previous":{"oneOf":[{"type":"number"},{"type":"null"}]},"series":{"type":"array","items":{"type":"number"}}},"required":["current","previous","series"],"additionalProperties":false},"invoices":{"type":"object","properties":{"count":{"type":"integer"},"overdue":{"type":"number"},"upcoming":{"type":"number"},"undated":{"type":"number"}},"required":["count","overdue","upcoming","undated"],"additionalProperties":false}},"required":["currency","outstanding","monthlyRevenue","revenueSeries","revenue","invoices"],"additionalProperties":false}},"activeClients":{"type":"integer"},"totalClients":{"type":"integer"},"outstanding":{"type":"number"},"monthlyRevenue":{"type":"number"},"revenueSeries":{"type":"array","items":{"type":"number"}},"metrics":{"type":"object","properties":{"period":{"type":"object","properties":{"range":{"type":"string","enum":["30d","90d","year","all"]},"label":{"type":"string"},"comparisonLabel":{"type":["string","null"]},"start":{"type":"integer"},"end":{"type":"integer"},"previousStart":{"oneOf":[{"type":"integer"},{"type":"null"}]},"previousEnd":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["range","label","comparisonLabel","start","end","previousStart","previousEnd"],"additionalProperties":false},"revenue":{"type":"object","properties":{"current":{"type":"number"},"previous":{"oneOf":[{"type":"number"},{"type":"null"}]},"series":{"type":"array","items":{"type":"number"}}},"required":["current","previous","series"],"additionalProperties":false},"clients":{"type":"object","properties":{"current":{"type":"number"},"previous":{"oneOf":[{"type":"number"},{"type":"null"}]},"series":{"type":"array","items":{"type":"number"}}},"required":["current","previous","series"],"additionalProperties":false},"invoices":{"type":"object","properties":{"count":{"type":"integer"},"overdue":{"type":"number"},"upcoming":{"type":"number"},"undated":{"type":"number"}},"required":["count","overdue","upcoming","undated"],"additionalProperties":false},"tasks":{"type":"object","properties":{"overdue":{"type":"integer"},"upcoming":{"type":"integer"},"later":{"type":"integer"},"undated":{"type":"integer"}},"required":["overdue","upcoming","later","undated"],"additionalProperties":false}},"required":["period","revenue","clients","invoices","tasks"],"additionalProperties":false},"tasksDue":{"type":"integer"},"atRisk":{"type":"integer"},"health":{"type":"string"},"healthStatus":{"type":"string","enum":["healthy","just_started","needs_attention","at_risk","unavailable"]},"healthDetail":{"type":"string"},"healthCounts":{"type":"object","properties":{"healthy":{"type":"integer"},"justStarted":{"type":"integer"},"needsAttention":{"type":"integer"},"atRisk":{"type":"integer"},"unavailable":{"type":"integer"}},"required":["healthy","justStarted","needsAttention","atRisk","unavailable"],"additionalProperties":false},"healthClients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["healthy","just_started","needs_attention","at_risk","unavailable"]}},"required":["id","name","status"],"additionalProperties":false}},"upcomingTasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"due_at":{"type":["string","null"]},"client":{"type":["string","null"]}},"required":["id","title","due_at","client"],"additionalProperties":false}},"recentActivity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"targetType":{"type":"string"},"targetId":{"type":"string","format":"uuid"},"action":{"type":"string"},"icon":{"type":"string"},"tone":{"type":"string"},"body":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"actorType":{"type":"string"},"actorName":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["id","targetType","targetId","action","createdAt"],"additionalProperties":true}}},"required":["currency","currencyTotals","activeClients","totalClients","outstanding","monthlyRevenue","revenueSeries","metrics","tasksDue","atRisk","health","healthStatus","healthDetail","healthCounts","healthClients","upcomingTasks","recentActivity"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"currency":"usd","currencyTotals":[{"currency":"usd","outstanding":161.5,"monthlyRevenue":1250,"revenueSeries":[800,950,1100,1000,1250,1250],"revenue":{"current":1250,"previous":1000,"series":[800,950,1100,1000,1250,1250]},"invoices":{"count":3,"overdue":100.5,"upcoming":50.25,"undated":10.75}}],"activeClients":8,"totalClients":12,"outstanding":161.5,"monthlyRevenue":1250,"revenueSeries":[800,950,1100,1000,1250,1250],"metrics":{"period":{"range":"30d","label":"Last 30 days","comparisonLabel":"vs previous 30 days","start":1791331200000,"end":1793923200000,"previousStart":1788739200000,"previousEnd":1791331200000},"revenue":{"current":1250,"previous":1000,"series":[800,950,1100,1000,1250,1250]},"clients":{"current":2,"previous":1,"series":[1,1,2,1,2,2]},"invoices":{"count":3,"overdue":100.5,"upcoming":50.25,"undated":10.75},"tasks":{"overdue":1,"upcoming":4,"later":2,"undated":0}},"tasksDue":5,"atRisk":1,"health":"Needs attention","healthStatus":"needs_attention","healthDetail":"1 client needs attention","healthCounts":{"healthy":6,"justStarted":2,"needsAttention":1,"atRisk":1,"unavailable":2},"healthClients":[{"id":"33333333-3333-4333-8333-333333333333","name":"Acme Studio","status":"healthy"}],"upcomingTasks":[{"id":"11111111-1111-4111-8111-111111111111","title":"Prepare kickoff","due_at":"2026-10-21T12:00:00.000Z","client":"Acme Studio"}],"recentActivity":[{"id":"11111111-1111-4111-8111-111111111111","targetType":"task","targetId":"11111111-1111-4111-8111-111111111111","action":"created","icon":"bx-check-square","tone":"info","body":"Kickoff milestone","createdAt":"2026-10-14T12:00:00.000Z","actorType":"agency","actorName":"Alex Morgan","items":[]}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get the portal dashboard summary. Returns workspace-level portal dashboard aggregates. Optional includeOwn and range filters alter which activity is included. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/task-options":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_task_options","summary":"List custom task options","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"field","in":"query","required":false,"description":"Filter options by `status` or `priority`.","schema":{"type":"string","enum":["status","priority"]}}],"responses":{"200":{"description":"Success response for list custom task options; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"options":{"type":"array","items":{"$ref":"#/components/schemas/PortalTaskOption"}}},"required":["options"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Task option with its exact revision","value":{"options":[{"id":"00000000-0000-4000-8000-000000001201","field":"status","label":"Blocked","baseValue":"in_progress","color":"amber","position":0,"updatedAt":"2026-10-19T01:00:00.123456Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List custom task options. Custom task options preserve a built-in base status or priority. Changing an option label does not change the underlying workflow state. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["PortalTaskOptionFieldSchema"],"x-observed-response-keys":["error","options"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_task_options","summary":"Create custom task option","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create custom task option; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"option":{"$ref":"#/components/schemas/PortalTaskOption"}},"required":["option"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Task option with its exact revision","value":{"option":{"id":"00000000-0000-4000-8000-000000001201","field":"status","label":"Blocked","baseValue":"in_progress","color":"amber","position":0,"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"503":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_task_options_CreatePortalTaskOptionPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"field":"status","label":"In progress","baseValue":"todo","color":"slate"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create custom task option. Custom task options preserve a built-in base status or priority. Changing an option label does not change the underlying workflow state. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalTaskOptionPayload"],"x-observed-response-keys":["error","option"],"x-required-capabilities":["can_manage_task_options"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/task-options/{optionId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_task_options_optionId","summary":"Get custom task option","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"optionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get custom task option; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"option":{"$ref":"#/components/schemas/PortalTaskOption"}},"required":["option"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Task option with its exact revision","value":{"option":{"id":"00000000-0000-4000-8000-000000001201","field":"status","label":"Blocked","baseValue":"in_progress","color":"amber","position":0,"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get custom task option. Custom task options preserve a built-in base status or priority. Changing an option label does not change the underlying workflow state. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","option"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_task_options_optionId","summary":"Update custom task option","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"optionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update custom task option; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"option":{"$ref":"#/components/schemas/PortalTaskOption"}},"required":["option"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Task option with its exact revision","value":{"option":{"id":"00000000-0000-4000-8000-000000001201","field":"status","label":"Blocked","baseValue":"in_progress","color":"amber","position":0,"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"400":{"description":"Malformed expectedRevision (invalid_revision) or invalid input. Revision errors include resourceType, resourceId, and recovery: read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The original revision is stale or the requested active option label already exists for this field.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/EditorRevisionError"},{"$ref":"#/components/schemas/PortalError"}]},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task_option","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task_option","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_task_options_UpdatePortalTaskOptionPayload"},"examples":{"synthetic":{"summary":"Mutation based on the original full read","value":{"label":"Awaiting review","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Update custom task option. Custom task options preserve a built-in base status or priority. Changing an option label does not change the underlying workflow state. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires JSON expectedRevision from the original full resource read, including for DELETE. Missing returns 428 revision_required; stale, deleted, or unavailable items return 409 revision_conflict; malformed returns 400 invalid_revision. Authorization and workspace/account scope are checked first. Read current content and reconcile before a new mutation; never automatically retry an old intent with a fresh token. Read task-options or the individual option to obtain option.updatedAt. Deletion preserves tasks' canonical base status/priority.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["UpdatePortalTaskOptionPayload"],"x-observed-response-keys":["error","option"],"x-required-capabilities":["can_manage_task_options"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_task_options_optionId","summary":"Delete or archive custom task option","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"optionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive custom task option; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"option":{"$ref":"#/components/schemas/PortalTaskOption"}},"required":["ok","option"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Task option with its exact revision","value":{"ok":true,"option":{"id":"00000000-0000-4000-8000-000000001201","field":"status","label":"Blocked","baseValue":"in_progress","color":"amber","position":0,"updatedAt":"2026-10-19T01:00:00.123456Z"}}}}}}},"400":{"description":"Malformed expectedRevision (invalid_revision) or invalid input. Revision errors include resourceType, resourceId, and recovery: read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task_option","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task_option","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive custom task option. Custom task options preserve a built-in base status or priority. Changing an option label does not change the underlying workflow state. Requires the workspace client-management capability. This is a soft archive/delete where the route preserves historical references or item values as described by the resource lifecycle. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires JSON expectedRevision from the original full resource read, including for DELETE. Missing returns 428 revision_required; stale, deleted, or unavailable items return 409 revision_conflict; malformed returns 400 invalid_revision. Authorization and workspace/account scope are checked first. Read current content and reconcile before a new mutation; never automatically retry an old intent with a fresh token. Read task-options or the individual option to obtain option.updatedAt. Deletion preserves tasks' canonical base status/priority.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_manage_task_options"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Send the original item revision in the JSON body, including for DELETE.","content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original updatedAt from the full item read, preserving fractional precision and timezone offset. Null is invalid for this existing item. Do not use a collection metadata token."}},"required":["expectedRevision"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Mutation based on the original full read","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2/workspaces/{workspaceId}/portal/task-settings":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_task_settings","summary":"Get task settings","tags":["Client Portal"],"security":[{"apiKey":[]}],"description":"Read the workspace's task settings: the order of statuses and priorities (built-in values and custom option ids together), which ones are hidden (archived), whether clients may create tasks in their portal, and whether tasks open in view or edit mode. Workspaces that never saved settings return the defaults with updatedAt null. Requires can_view_clients.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-required-capabilities":["can_view_clients"],"responses":{"200":{"description":"Task settings; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/PortalTaskSettings"}},"required":["settings"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Ideas first, In review hidden","value":{"settings":{"status":{"order":["00000000-0000-4000-8000-000000001301","todo","in_progress","in_review","done"],"hidden":["in_review"]},"priority":{"order":["urgent","high","medium","low","none"],"hidden":[]},"clientsCanCreateTasks":false,"updatedAt":"2026-11-07T18:00:00.123456Z"}}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}},"put":{"operationId":"put_v2_workspaces_workspaceId_portal_task_settings","summary":"Update task settings","tags":["Client Portal"],"security":[{"apiKey":[]}],"description":"Reorder, hide (archive) or restore task statuses and priorities, and change client task creation. Send only the parts you change; status and priority each take the full {order, hidden}. Unknown keys are dropped and missing keys are appended. Hidden values leave the board, list and pickers but stay restorable; tasks keep their data. done and none can't be hidden. Hiding a value that tasks still use returns 409 task_option_in_use with field, key and taskCount; resend with moveTasks mapping that key to a visible key, and those tasks are moved. status and priority need can_manage_task_options; clientsCanCreateTasks needs can_manage_settings. With clientsCanCreateTasks false (the default), clients cannot create tasks from the portal.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-required-capabilities":["can_manage_task_options","can_manage_settings"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_task_settings_UpdateTaskSettingsPayload"},"examples":{"synthetic":{"summary":"Hide In review and move its tasks to In progress","value":{"status":{"order":["00000000-0000-4000-8000-000000001301","todo","in_progress","in_review","done"],"hidden":["in_review"]},"moveTasks":{"status":{"in_review":"in_progress"}},"expectedRevision":"2026-11-07T18:00:00.123456Z"}}}}}},"responses":{"200":{"description":"Saved settings and how many tasks were moved; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/PortalTaskSettings"},"movedTasks":{"type":"integer","minimum":0}},"required":["settings","movedTasks"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Saved","value":{"settings":{"status":{"order":["00000000-0000-4000-8000-000000001301","todo","in_progress","in_review","done"],"hidden":["in_review"]},"priority":{"order":["urgent","high","medium","low","none"],"hidden":[]},"clientsCanCreateTasks":false,"updatedAt":"2026-11-07T18:05:00.123456Z"},"movedTasks":3}}}}}},"400":{"description":"Invalid settings (invalid_task_settings, empty_task_settings, task_option_not_hideable, invalid_move_target) or malformed expectedRevision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Stale revision (revision_conflict), or a value being hidden still has tasks (task_option_in_use with field, key, taskCount).","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/EditorRevisionError"},{"$ref":"#/components/schemas/PortalError"}]},"example":{"error":"3 tasks are still in this status. Choose where to move them before hiding it.","code":"task_option_in_use","field":"status","key":"in_review","taskCount":3}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task_option","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/tasks/{taskId}/comments":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_tasks_taskId_comments","summary":"List comments","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list comments; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/PortalComment"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comments":[{"id":"00000000-0000-4000-8000-000000001101","targetType":"file","targetId":"00000000-0000-4000-8000-000000000501","body":"Please review page two.","internal":false,"parentId":null,"resolved":false,"author":{"name":"Alex Rivera"},"annotation":null,"fileVersionNumber":1,"createdAt":"2026-01-15T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List comments. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["comments"],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_tasks_taskId_comments","summary":"Create comment","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create comment; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/PortalComment"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comments":[{"id":"00000000-0000-4000-8000-000000001101","targetType":"file","targetId":"00000000-0000-4000-8000-000000000501","body":"Please review page two.","internal":false,"parentId":null,"resolved":false,"author":{"name":"Alex Rivera"},"annotation":null,"fileVersionNumber":1,"createdAt":"2026-01-15T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Endpoint-specific error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Create comment. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["comments","error"],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string","minLength":1,"maxLength":4000},"parentId":{"type":["string","null"],"format":"uuid"},"clientRequestId":{"type":"string","format":"uuid"}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"body":"Could you share the latest draft?"}}}}}}},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_tasks_taskId_comments","summary":"Resolve or import comments for the resource","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for resolve or import comments for the resource; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/PortalComment"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"comments":[{"id":"00000000-0000-4000-8000-000000001101","targetType":"file","targetId":"00000000-0000-4000-8000-000000000501","body":"Please review page two.","internal":false,"parentId":null,"resolved":false,"author":{"name":"Alex Rivera"},"annotation":null,"fileVersionNumber":1,"createdAt":"2026-01-15T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Resolve or import comments for the resource. Comment targets and reply parents must belong to the same client account. Server-generated labels and links are canonicalized. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["comments","error"],"x-required-capabilities":[],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","required":["commentId","resolved"],"properties":{"commentId":{"type":"string","format":"uuid"},"resolved":{"type":"boolean"}},"additionalProperties":false},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"commentId":"00000000-0000-4000-8000-000000001101","resolved":true}}}}}}}},"/v2/workspaces/{workspaceId}/portal/tasks":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_tasks","summary":"List tasks","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for list tasks; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/PortalTask"}}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"tasks":[{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"List tasks. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["tasks"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"post":{"operationId":"post_v2_workspaces_workspaceId_portal_tasks","summary":"Create task","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Success response for create task; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/PortalTask"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"task":{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/portal_tasks_CreatePortalTaskPayload"},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"title":"Kickoff","repeat":"example"}}}}},"description":"Send the JSON payload shown in the request schema. The server validates references and enforces account/workspace scope."},"description":"Create task. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":["CreatePortalTaskPayload"],"x-observed-response-keys":["error","task"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"}},"/v2/workspaces/{workspaceId}/portal/tasks/{taskId}":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_tasks_taskId","summary":"Get task","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for get task; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/PortalTask"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"task":{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Get task. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-view capability.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","task"],"x-required-capabilities":["can_view_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f"},"patch":{"operationId":"patch_v2_workspaces_workspaceId_portal_tasks_taskId","summary":"Update task","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for update task; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/PortalTask"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"task":{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}}}}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Update task. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-management capability. Requires expectedRevision from the original full resource read. Missing returns 428 revision_required; stale returns 409 revision_conflict; malformed returns 400 invalid_revision. Read current content, reconcile intent, then issue a new save; never retry old content with a fresh token. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","task"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Request payload validated by the production route.","content":{"application/json":{"schema":{"type":"object","properties":{"milestoneId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Milestone UUID in the same client account."},"parentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Parent task UUID in the same workspace/client account; null clears the relationship."},"title":{"type":"string","minLength":1,"maxLength":300,"x-zod-optional":true,"description":"Human-readable title or label for the resource."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept. A line holding only [file: name] shows that attached file in place; the name must exactly match an attachments[].name on the same task, so send the attachment in the same call. A file attached with addedIn: description leaves the task, and is deleted from Files, once no description or comment line shows it. A YouTube, Vimeo, Loom, Wistia, Figma, Notion, Google Docs or Sheets, Calendly or Cal.com link alone on its own line shows as an embedded card; a [text](url) link stays a link."},"status":{"type":"string","enum":["todo","in_progress","in_review","done"],"x-zod-optional":true,"description":"Workflow status accepted by this resource.","example":"todo"},"statusOptionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Active workspace task status option UUID; its base status is canonicalized by the server."},"priority":{"type":"string","enum":["urgent","high","medium","low","none"],"x-zod-optional":true,"description":"Task priority using the built-in priority values.","example":"urgent"},"priorityOptionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Active workspace task priority option UUID; its base priority is canonicalized by the server."},"assigneeType":{"anyOf":[{"type":"string","enum":["agency","client"]},{"type":"null"}],"x-zod-optional":true,"description":"Whether the task is assigned to an agency or client participant."},"assigneeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Selectable member/person UUID in this workspace and account."},"assigneeName":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Display name; when a selectable assignee is supplied, the server canonicalizes this value."},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Task due timestamp in ISO 8601 form."},"startAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Start timestamp in ISO 8601 format."},"dependsOn":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Optional single predecessor task UUID that this task depends on."},"repeat":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"x-zod-refined":true,"description":"Repeat schedule configuration for recurring task occurrences. Strings starting portal-repeat:v1: create a new task for each occurrence. Each copy is created on its scheduled date, not before. Task reads (agency and client) include recurrenceExpired: true and recurrenceExpiresAt for a client-assigned copy set to missedOccurrencePolicy expire that was not done before its next occurrence; treat it as closed, not open or overdue."},"flowId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Workspace flow UUID assignable to this client account."},"flowSend":{"anyOf":[{"type":"string","enum":["now","date","after"]},{"type":"null"}],"x-zod-optional":true,"description":"When to send the assigned flow: now, on a date, or after its configured trigger."},"flowSendDate":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Scheduled flow send timestamp when flowSend is date."},"flowDone":{"anyOf":[{"type":"string","enum":["review","done"]},{"type":"null"}],"x-zod-optional":true,"description":"Whether a completed flow should move this task to review or done."},"attachments":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable name or display label."},"size":{"type":"number","description":"File size in bytes.","example":1},"url":{"type":"string","format":"uri","x-zod-optional":true,"description":"External URL or file link accepted by this endpoint.","example":"https://example.test/resource"},"portalFileId":{"type":"string","format":"uuid","x-zod-optional":true,"description":"Existing portal file UUID to reference as an attachment.","example":"00000000-0000-4000-8000-000000000001"},"storagePath":{"type":"string","x-zod-optional":true,"description":"Storage object path; upload path attribution is server-controlled where relevant."},"type":{"type":"string","x-zod-optional":true,"description":"Discriminator for the selected payload variant."},"addedIn":{"type":"string","enum":["description","task"],"x-zod-optional":true,"description":"Where the file came from. description: added in the task's description; it leaves the task once no description or comment line shows it, though the call that adds it keeps it. A file uploaded in the app's task window comes back when its line and attachment are sent back right away. task: made for this task. A client file of either kind is deleted from Files, with its comments, once it leaves the task, unless another task still uses it; a workspace library file is only unlinked. Leave it out for a file attached from Files; removing that one only unlinks it."}},"additionalProperties":false,"required":["name","size"]}},{"type":"null"}],"x-zod-optional":true,"description":"Message attachment metadata or references."},"customFields":{"type":"object","additionalProperties":{},"x-zod-refined":true,"x-zod-optional":true,"description":"Custom field values keyed by the definition UUID; values are checked against the definition type/options."},"position":{"type":"integer","x-zod-optional":true,"description":"Display order within its workspace/account list.","example":1},"accountId":{"type":["string","null"],"format":"uuid","description":"Move the task to another account in the same workspace; null clears the account assignment only where supported."},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"example":{},"required":["expectedRevision"]},"examples":{"synthetic":{"summary":"Synthetic request example","value":{"title":"Update kickoff task","accountId":null,"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}},"delete":{"operationId":"delete_v2_workspaces_workspaceId_portal_tasks_taskId","summary":"Delete or archive task","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success response for delete or archive task; example values are synthetic.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"additionalProperties":true},"examples":{"synthetic":{"summary":"Synthetic response example","value":{"ok":true}}}}}},"400":{"description":"Malformed expectedRevision (invalid_revision) or invalid input. Revision errors include resourceType, resourceId, and recovery: read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The resource changed after the content was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_conflict","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"428":{"description":"Required loaded revision is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorRevisionError"},"example":{"error":"Read current content and reconcile before saving.","code":"revision_required","resourceType":"task","resourceId":"00000000-0000-4000-8000-000000000101","recovery":"read_resource"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"description":"Delete or archive task. Task references must be selectable in the same workspace/account. Custom option IDs are checked against active task options and normalized to their base status/priority. Requires the workspace client-management capability. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically. Requires JSON expectedRevision from the original full resource read, including for DELETE. Missing returns 428 revision_required; stale, deleted, or unavailable items return 409 revision_conflict; malformed returns 400 invalid_revision. Authorization and workspace/account scope are checked first. Read current content and reconcile before a new mutation; never automatically retry an old intent with a fresh token. Soft-deletes only the selected task, preserving the existing direct-subtask behavior. Revision conflict occurs before flow-assignment archival, comment cleanup, activity and webhooks.","tags":["Client Portal"],"security":[{"apiKey":[]}],"x-production-request-schemas":[],"x-observed-response-keys":["error","ok"],"x-required-capabilities":["can_work_on_clients"],"x-verified-source":"origin/main@4c9077f4a38d26fbf4f9278bc1326450ccac587f","requestBody":{"required":true,"description":"Send the original item revision in the JSON body, including for DELETE.","content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original updatedAt from the full item read, preserving fractional precision and timezone offset. Null is invalid for this existing item. Do not use a collection metadata token."}},"required":["expectedRevision"],"additionalProperties":false},"examples":{"synthetic":{"summary":"Mutation based on the original full read","value":{"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}}}},"/v2":{"get":{"operationId":"getApiDiscovery","summary":"Get API discovery document","tags":["Workspaces"],"security":[],"responses":{"200":{"description":"API version, resource URLs, authentication model, and webhook subscriptions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiDiscovery"},"examples":{"sample":{"summary":"Synthetic example response","value":{"name":"360Onboard Public API","version":"v2","authentication":"apiKey query parameter","base_url":"https://api.360onboard.com/v2","resources":{"workspaces":"https://api.360onboard.com/v2/workspaces","flows":"https://api.360onboard.com/v2/workspaces/{workspaceId}/flows","clients":"https://api.360onboard.com/v2/workspaces/{workspaceId}/clients","responses":"https://api.360onboard.com/v2/workspaces/{workspaceId}/responses","portal":"https://api.360onboard.com/v2/workspaces/{workspaceId}/portal"},"questionnaire_auto_fill":{"flow_authoring":"read-only through the public API"},"webhook_events":["*","client.completed"]}}}}}}},"description":"Returns the API name and version, base URL, authentication method, discoverable resource URLs, questionnaire auto-fill notes, and available webhook subscriptions. No API key is required for this discovery document."}},"/v2/workspaces/{workspaceId}/agent-support/messages":{"post":{"operationId":"submitAgentSupportMessage","summary":"Submit an agent-support message","tags":["Agent Support"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","format":"uuid"},"description":"May supply the idempotency_key body field."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportMessageInput"},"examples":{"question":{"summary":"Synthetic support question","value":{"idempotency_key":"88888888-8888-4888-8888-888888888888","goal":"Connect a published flow to our CRM","attempted_tool":"portal_workspace_manage","issue":"The integration action returned a validation error.","expected":"The CRM record should be created.","observed":"The action returned invalid_request.","error_code":"invalid_request","request_human_support":true}}}}}},"responses":{"200":{"description":"Completed support response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportResult"},"examples":{"completed":{"summary":"Synthetic completed support response with explicit escalation","value":{"status":"completed","conversation_id":"99999999-9999-4999-8999-999999999999","turn_id":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","turn_status":"completed","answer":"Use the workspace CRM connector and confirm required fields.","outcome":"unconfirmed","gap_id":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","gap_occurrence_count":1,"resolution_confirmed":false,"gap":{"id":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","category":"api","summary":"Inbound CRM mapping is not visible in the API response.","suggested_improvement":"Expose the published mapping in the flow response.","occurrence_count":1,"confirmed_resolution_count":0,"status":"open"},"replayed":false,"human_support":{"report_id":"cccccccc-cccc-4ccc-8ccc-cccccccccccc","status":"accepted","provider_accepted_at":"2026-10-14T17:35:00.000Z"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying the same request or escalation, when present."}}},"202":{"description":"Support request is processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportResult"},"examples":{"processing":{"summary":"Synthetic accepted support request","value":{"status":"processing","conversation_id":"99999999-9999-4999-8999-999999999999","turn_id":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","turn_status":"pending","answer":null,"retry_after_seconds":3,"human_support":{"status":"processing","retry_after_seconds":3}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying the same request or escalation, when present."}}},"400":{"description":"Malformed JSON or invalid support request fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalidJson":{"summary":"Malformed JSON body","value":{"error":{"code":"invalid_json","message":"Request body must be valid JSON."}}},"invalidRequest":{"summary":"Required or optional fields failed validation","value":{"error":{"code":"invalid_request","message":"Provide a UUID idempotency_key, goal, and issue with valid optional support fields."}}}}}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"missingApiKey":{"summary":"API key was not supplied","value":{"error":{"code":"missing_api_key","message":"Provide an apiKey query parameter."}}},"invalidApiKey":{"summary":"API key is invalid","value":{"error":{"code":"invalid_api_key","message":"The API key is invalid."}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"api_access_unavailable","message":"API access is unavailable for this account."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Workspace or resource not found in the authenticated scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"workspace_not_found","message":"Workspace not found."}}},"conversationNotFound":{"summary":"Requested support conversation was not found","value":{"error":{"code":"not_found","message":"Support conversation not found."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"409":{"description":"The idempotency key was already used with different request content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"idempotency_conflict","message":"This idempotency_key was already used with different request content."}}}}},"429":{"description":"Support rate limit exceeded","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/SupportResult"}]},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"rate_limit_exceeded","message":"Rate limit exceeded. Try again in 60 seconds."}}},"supportLimit":{"summary":"Support-message actor limit reached","value":{"status":"rate_limited","conversation_id":"99999999-9999-4999-8999-999999999999","turn_id":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","retry_with_same_idempotency_key":"88888888-8888-4888-8888-888888888888","retry_after_seconds":120}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying the same request or escalation, when present."}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"internal_error","message":"Unexpected server failure."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"503":{"description":"Temporary support failure; retry using the same idempotency key","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/SupportResult"}]},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"support_unavailable","message":"Support storage is temporarily unavailable. Retry with the same idempotency_key."}}},"supportRetryable":{"summary":"Temporary support-service failure","value":{"status":"retryable_failure","conversation_id":"99999999-9999-4999-8999-999999999999","turn_id":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","retry_with_same_idempotency_key":"88888888-8888-4888-8888-888888888888","message":"Support could not complete this reply. Your report is saved; retry with the same idempotency_key."}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}}},"description":"Submits a product-support question or issue for this workspace. Reuse the UUID idempotency key and identical request to retry. request_human_support defaults to false; only true explicitly emails a human support report to 360onboard. The human_support result reports the email attempt; accepted means provider acceptance, not confirmed delivery or reading. Support-message and human-escalation limits are each 12 requests per hour per authenticated owner/API actor, shared across that actor’s workspaces, in addition to the public API limit. Retry-After is returned when a retry delay is known."}},"/v2/workspaces/{workspaceId}/agent-support/conversations/{conversationId}":{"get":{"operationId":"getAgentSupportConversation","summary":"Get an agent-support conversation","tags":["Agent Support"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Agent-support conversation ID."}],"responses":{"200":{"description":"Conversation and turns","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportConversation"},"examples":{"sample":{"summary":"Synthetic example response","value":{"conversation":{"id":"99999999-9999-4999-8999-999999999999","workspace_id":"11111111-1111-4111-8111-111111111111","status":"completed"},"turns":[{"id":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","role":"assistant","content":"Check that the CRM integration is enabled for this workspace."}]}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"API key missing or invalid."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"API key missing or invalid"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Synthetic not_found response","value":{"error":{"code":"not_found","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Unexpected server failure"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"description":"Reads one agent-support conversation and its turns, scoped to the authenticated account and workspace. Returns 404 when not found or outside scope."}},"/v2/workspaces/{workspaceId}/agent-support/gaps":{"get":{"operationId":"listAgentSupportGaps","summary":"List reported product gaps","tags":["Agent Support"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the resource; the API key must be authorized for this workspace."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":30}}],"responses":{"200":{"description":"Reported gaps","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportGaps"},"examples":{"sample":{"summary":"Synthetic example response","value":{"gaps":[{"id":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","title":"CRM integration field mapping","status":"open"}]}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"400":{"description":"Invalid limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"error":{"summary":"Synthetic invalid_limit response","value":{"error":{"code":"invalid_limit","message":"The requested operation could not be completed."}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Maximum requests allowed in the current one-minute window."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests remaining in the current one-minute window."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp when the current rate-limit window resets."}}},"401":{"description":"API key missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"API key missing or invalid."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"API key missing or invalid"}}}}}}},"403":{"description":"Required API feature is not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"feature_unavailable","message":"Required API feature is not available."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Required API feature is not available"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"404":{"description":"Workspace or resource not found in the authenticated scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"workspace_not_found","message":"Workspace or resource not found in the authenticated scope."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Workspace or resource not found in the authenticated scope"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"429":{"description":"Per-key request rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Per-key request rate limit exceeded."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Per-key request rate limit exceeded"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"}}}},"500":{"description":"Unexpected server failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Unexpected server failure."}},"examples":{"error":{"summary":"Machine-readable API error","value":{"error":{"code":"request_failed","message":"Unexpected server failure"}}}}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}}},"description":"Lists reported support product gaps. limit defaults to 30 and must be between 1 and 50."}},"/v2/workspaces/{workspaceId}/portal":{"get":{"operationId":"discoverWorkspacePortalApi","summary":"Discover workspace Client Portal API","description":"Returns the Client Portal route catalog, payload contracts, authentication convention, and idempotency guidance for this workspace. The workspace must have Client Portal access enabled. Use listed routes under the returned base_url; route access remains scoped to this workspace and the API key actor.","security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"description":"Workspace whose Client Portal API catalog is requested.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Portal API discovery document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalDiscovery"},"examples":{"synthetic":{"summary":"Synthetic portal API catalog","value":{"object":"portal_api","workspace_id":"11111111-1111-4111-8111-111111111111","base_url":"https://api.360onboard.com/v2/workspaces/11111111-1111-4111-8111-111111111111/portal","authentication":"apiKey query parameter","idempotency":"Send Idempotency-Key on POST, PATCH, PUT, and DELETE requests.","routes":[{"path":"/accounts","methods":["GET","POST"]},{"path":"/accounts/{accountId}/tasks","methods":["GET","POST"]},{"path":"/accounts/{accountId}/messages","methods":["GET","POST"]}],"payload_contracts":{}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Client Portal is unavailable for this workspace or actor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Workspace is unavailable to this API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"API key rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Portal discovery could not build the workspace portal context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/invoices/{invoiceId}/payment-link":{"post":{"operationId":"createPortalInvoicePaymentLink","summary":"Create a private pay link for an invoice","description":"Requires Client Portal, can_view_invoices and can_manage_invoices. Returns the same private pay link that the invoice email button opens: a page for that one invoice that needs no client portal sign-in. The link is valid for 90 days and can pay that invoice (one-time with Square or Stripe, or start a recurring invoice) and download its PDF, and nothing else; managing an existing subscription still needs portal sign-in. It is a bearer link, so share it only with the client. A draft invoice has no pay link and returns 409; send the invoice first. There is no request body, nothing is emailed, and no payment is made. Each call signs a new link with a fresh expiry; earlier links stay valid until they expire.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Pay link created.","content":{"application/json":{"schema":{"type":"object","required":["url","expiresAt"],"properties":{"url":{"type":"string","format":"uri","description":"Private pay page address. The access token is in the URL fragment."},"expiresAt":{"type":"string","format":"date-time"}}},"example":{"url":"https://portal.example.com/pay#t=...","expiresAt":"2027-02-26T12:00:00.000Z"}}}},"401":{"description":"API key missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal or the required workspace permission is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Invoice or workspace is unavailable to this actor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The invoice is a draft; send it before sharing a pay link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded; respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Unable to create the pay link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/invoices/{invoiceId}/send":{"get":{"operationId":"listPortalInvoiceEmailDeliveries","summary":"Read recent invoice email delivery outcomes","description":"Requires Client Portal and can_view_clients. Returns at most the latest 100 recipient records for this exact workspace/account/invoice, newest first. No cursor or offset is accepted. Includes manual invoice sends and paid confirmations. accepted means the email provider accepted the message, not that it reached the inbox or was read. unknown stops automatic retry to avoid duplicate mail. failed includes exhausted known failures or a paid event with no eligible portal members; skipped includes removed members, disabled templates, or a changed payment status. Invoice email enrollment occurs before payment effects; paid confirmations are queued atomically once per invoice/member for online and recorded external payments. Subscription anchors are excluded; their actual paid cycle invoices receive confirmations. Previously paid invoices are not backfilled.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Recent scoped delivery records. An empty array means this invoice has no recorded email operations.","content":{"application/json":{"schema":{"type":"object","required":["deliveries"],"properties":{"deliveries":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","kind","operation_key","recipient_email","status","attempts","created_at","updated_at","last_error"],"properties":{"id":{"type":"string","format":"uuid"},"kind":{"enum":["portal_invoice_sent","portal_invoice_paid"]},"operation_key":{"type":"string"},"recipient_email":{"type":"string","description":"Normalized recipient. Empty only for a failed paid-receipt intent with no eligible recipient."},"status":{"enum":["queued","running","accepted","unknown","failed","skipped"]},"attempts":{"type":"integer","minimum":0},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"last_error":{"type":["string","null"]}}}}}},"example":{"deliveries":[{"id":"44444444-4444-4444-8444-444444444444","kind":"portal_invoice_sent","operation_key":"invoice-send-20261015-001","recipient_email":"pat@example.test","status":"accepted","attempts":1,"created_at":"2026-10-15T18:00:00Z","updated_at":"2026-10-15T18:00:30Z","last_error":null}]}}}},"400":{"description":"Invalid key or request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"API key missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal or the required workspace permission is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Invoice or workspace is unavailable to this actor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded; respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Unable to enqueue or read delivery records. Retry a send with the same Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}},"post":{"operationId":"sendPortalInvoice","summary":"Send or resend an existing portal invoice","description":"Requires Client Portal and can_create_clients. Queues one branded editable email per current client portal member, deduplicated by normalized email. billTo is display text and does not select recipients. Atomically changes a draft to sent; preserves other unpaid statuses. Does not create a duplicate invoice or charge a payment. Future-dated invoices, subscription setup anchors, and nonpayable recurring templates are excluded. There is no request body. Idempotency-Key is required, with 1-200 letters, numbers, dot, underscore, colon, or hyphen. Reuse the same key for a retry and use a new key for a deliberate resend. Invoice mail operation deduplication is retained with the invoice beyond the general 24-hour API response cache. Recipients and invoice facts are frozen on the first accepted enqueue; repeated keys do not add newly joined members. A 202 only confirms queueing; use GET on this path to inspect recipient outcomes. The emailed button opens a private pay page for that one invoice with no portal sign-in; see the payment-link endpoint for the same link. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"invoice-send-20261015-001","description":"Stable identity for this send. Keep unchanged on retry; change only for an intentional new send."}],"responses":{"202":{"description":"Invoice email operation persisted and queued. Provider acceptance and inbox delivery are not yet confirmed. A same-key retry returns the existing operation.","content":{"application/json":{"schema":{"type":"object","required":["queued","operationKey","recipientCount","message"],"properties":{"queued":{"const":true},"operationKey":{"type":"string"},"recipientCount":{"type":"integer","minimum":1},"message":{"type":"string"}}},"example":{"queued":true,"operationKey":"invoice-send-20261015-001","recipientCount":1,"message":"Invoice email queued. Acceptance and delivery are not yet confirmed."}}}},"400":{"description":"Invalid key or request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"API key missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal or the required workspace permission is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Invoice or workspace is unavailable to this actor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"No current portal members with email addresses, invoice is not eligible, or the API idempotency reservation is conflicting or still processing. No email is enqueued for a rejected action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded; respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Unable to enqueue or read delivery records. Retry a send with the same Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/invoices/{invoiceId}/payment":{"post":{"operationId":"recordPortalInvoiceExternalPayment","summary":"Record an externally received invoice payment","description":"Requires normal public API authentication/workspace access, Client Portal, and can_create_clients. This is agency confirmation that the full payment arrived externally; it does not query a bank or charge a payment method. It reconciles unsubmitted Stripe attempts, records paid date/method/reference/agency actor, marks the invoice paid, logs activity, and fulfills eligible service delivery. The first enrolled paid transition queues the editable Invoice paid email. A retry by the same actor of an already recorded paid invoice retries activity/fulfillment without changing payment details or queuing another receipt; the retry body must still validate. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Optional public-wrapper idempotency key. Reuse it for a retry to replay the cached non-5xx JSON result; a conflicting request or in-progress reservation returns 409. The receipt endpoint itself also handles an already recorded payment by the same agency actor."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPortalInvoicePaymentPayload"},"example":{"paidAt":"2026-10-15T12:00:00-07:00","paymentMethod":"ach","paymentRef":"TRANSFER-1042"}}}},"responses":{"200":{"description":"External receipt recorded, or an already recorded payment retried by the same agency actor. Logs/eligible service fulfillment may be retried; a receipt email is queued only on the first paid transition.","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"$ref":"#/components/schemas/PortalInvoice"}},"additionalProperties":true},"example":{"invoice":{"id":"00000000-0000-4000-8000-000000000701","accountId":"00000000-0000-4000-8000-000000000101","number":"INV-1042","amount":650,"currency":"usd","status":"paid","paidAt":"2026-10-15T12:00:00-07:00","paymentMethod":"ach","paymentRef":"TRANSFER-1042","paymentRecordedBy":"00000000-0000-4000-8000-000000000001","paymentRecordedAt":"2026-10-15T19:00:00Z","paymentMethods":["external"]}}}}},"400":{"description":"Invalid key or request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"API key missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Client Portal or the required workspace permission is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Invoice or workspace is unavailable to this actor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"Invoice is ineligible (including drafts, another actor’s settled invoice, subscription setup, or a recurring template), checkout is busy/unsafe, an existing Stripe payment needs reconciliation, or the invoice changed during settlement.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"example":{"error":"Invoice changed or was settled by another request. Refresh and try again."}}}},"429":{"description":"Rate limit exceeded; respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"A provider or server error prevented a reliable settlement result. Inspect the invoice before retrying; use the same Idempotency-Key when replaying a request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}}}},"/v2/workspaces/{workspaceId}/portal/invoice-design":{"get":{"operationId":"getPortalInvoiceDesign","summary":"Read invoice design","description":"Read workspace-wide saved overrides, revision, agency invoice logo (the wide logo when one is set, otherwise the square logo) and current Client theme. Null accent/font values inherit dynamically; existing downloads use the current saved design. Requires Client Portal and can_view_clients. No invoice is issued and no payment or email is sent.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Saved workspace design and its revision.","content":{"application/json":{"schema":{"type":"object","required":["design","revision","logoUrl","theme"],"properties":{"design":{"$ref":"#/components/schemas/PortalInvoiceDesign"},"revision":{"type":"integer","minimum":0},"logoUrl":{"type":["string","null"],"description":"Logo shown on invoices and invoice PDFs: the agency's wide logo when one is set, otherwise its square logo. Null when neither is set."},"theme":{"type":"object","required":["accent","font"],"properties":{"accent":{"type":"string"},"font":{"type":"string","enum":["default","editorial","rounded","custom"]},"customFont":{"type":"string"},"customFontUrl":{"type":"string","format":"uri"},"bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Saved workspace page background, or white when unset."}}},"fontWeights":{"$ref":"#/components/schemas/PortalInvoiceFontWeights","description":"Extra weight files saved for the invoice's own custom font."}}},"example":{"design":{"layout":"classic","accentColor":null,"font":null,"showLogo":true,"logoSize":"medium","businessName":"Acme Agency","address":"123 Example Street","email":"billing@example.test","taxId":"","notes":"Payment due within 14 days.","footer":"Thank you for your business.","backgroundColor":null},"revision":4,"logoUrl":null,"theme":{"accent":"#172B50","font":"default"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}}}},"put":{"operationId":"updatePortalInvoiceDesign","summary":"Save invoice design","description":"Replace the complete design using expectedRevision from GET. Updates are compare-and-swap; stale saves return409. Save font:custom plus uploaded customFont/customFontUrl to use an invoice-only font. Set accentColor:null and font:null to restore inherited branding, and backgroundColor:null to restore pure white; omit custom fields to remove the invoice override. Uploading does not itself save the design. Settings apply to invoices and paid receipts, including existing PDFs. Requires Client Portal and can_manage_settings. No invoice is issued and no payment or email is sent. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200},"description":"Optional general API retry key. Reuse with the identical request for a replay within the general 24-hour idempotency window."}],"responses":{"200":{"description":"Saved design with incremented revision.","content":{"application/json":{"schema":{"type":"object","required":["design","revision","logoUrl","theme"],"properties":{"design":{"$ref":"#/components/schemas/PortalInvoiceDesign"},"revision":{"type":"integer","minimum":0},"logoUrl":{"type":["string","null"],"description":"Logo shown on invoices and invoice PDFs: the agency's wide logo when one is set, otherwise its square logo. Null when neither is set."},"theme":{"type":"object","required":["accent","font"],"properties":{"accent":{"type":"string"},"font":{"type":"string","enum":["default","editorial","rounded","custom"]},"customFont":{"type":"string"},"customFontUrl":{"type":"string","format":"uri"},"bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Saved workspace page background, or white when unset."}}},"fontWeights":{"$ref":"#/components/schemas/PortalInvoiceFontWeights","description":"Extra weight files saved for the invoice's own custom font."}}},"example":{"design":{"layout":"classic","accentColor":null,"font":null,"showLogo":true,"logoSize":"medium","businessName":"Acme Agency","address":"123 Example Street","email":"billing@example.test","taxId":"","notes":"Payment due within 14 days.","footer":"Thank you for your business.","backgroundColor":null},"revision":4,"logoUrl":null,"theme":{"accent":"#172B50","font":"default"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"409":{"description":"Revision conflict. Read current settings and reconsider edits; do not automatically overwrite.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}},"example":{"error":"The invoice design changed. Reload before saving."}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["design","expectedRevision"],"properties":{"design":{"$ref":"#/components/schemas/PortalInvoiceDesign"},"expectedRevision":{"type":"integer","minimum":0},"serviceInvoiceLines":{"type":"string","enum":["single","itemized"],"description":"Order form invoices: single (default) shows one line with the service; itemized lists the service, then each priced answer the client picked. Omit to keep the saved choice."},"fontWeights":{"$ref":"#/components/schemas/PortalInvoiceFontWeights","description":"Extra weight files for the custom font. Omit to keep the saved ones; they are cleared when customFontUrl changes."}}},"example":{"design":{"layout":"classic","accentColor":null,"font":null,"showLogo":true,"logoSize":"medium","businessName":"Acme Agency","address":"123 Example Street","email":"billing@example.test","taxId":"","notes":"Payment due within 14 days.","footer":"Thank you for your business.","backgroundColor":null},"expectedRevision":3}}}}}},"/v2/workspaces/{workspaceId}/portal/invoice-design/preview":{"post":{"operationId":"previewPortalInvoiceDesign","summary":"Preview invoice PDF","description":"Render an unsaved design with synthetic sample data. receipt:true renders a paid receipt. Custom font references must belong to this workspace. Missing, unreadable or PDF-incompatible fonts return422 instead of silently substituting a font. Requires Client Portal and can_view_clients. No invoice is issued and no payment or email is sent. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200},"description":"Optional general API retry key. Reuse with the identical request for a replay within the general 24-hour idempotency window."}],"responses":{"200":{"description":"Inline sample PDF. No-store response.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"422":{"description":"The selected custom font is unavailable or unsupported for PDF rendering. Re-upload it or select a built-in font.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}},"example":{"error":"The custom font could not be loaded for this PDF."}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["design"],"properties":{"design":{"$ref":"#/components/schemas/PortalInvoiceDesign"},"receipt":{"type":"boolean","default":false},"sample":{"type":"string","enum":["invoice","order"],"description":"order previews a paid order form receipt instead of the sample invoice."},"serviceInvoiceLines":{"type":"string","enum":["single","itemized"],"description":"With sample order: Order form invoices: single (default) shows one line with the service; itemized lists the service, then each priced answer the client picked."},"fontWeights":{"$ref":"#/components/schemas/PortalInvoiceFontWeights","description":"Extra weight files for the custom font. Omit to use the saved ones while customFontUrl is unchanged."}}},"example":{"design":{"layout":"classic","accentColor":null,"font":null,"showLogo":true,"logoSize":"medium","businessName":"Acme Agency","address":"123 Example Street","email":"billing@example.test","taxId":"","notes":"Payment due within 14 days.","footer":"Thank you for your business.","backgroundColor":null},"receipt":false}}}}}},"/v2/workspaces/{workspaceId}/portal/invoice-design/font":{"post":{"operationId":"uploadPortalInvoiceFont","summary":"Upload an invoice font","description":"Upload one actual TTF, OTF, WOFF or WOFF2 font, 1 byte–5 MiB, as multipart/form-data field file. File extension, size and font parsing are validated before storage. Returns a new immutable workspace-scoped reference and sanitized display name. This stores a public branding asset without changing invoice settings, revisions or Client theme. Use PUT invoice-design to select and save it. Without an Idempotency-Key, each retry creates another asset; reuse the same optional general API key for an identical retry within its 24-hour window. UI and MCP uploads do not automatically retry. Requires Client Portal and can_manage_settings. No invoice is issued and no payment or email is sent. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200},"description":"Optional general API retry key. Reuse with the identical request for a replay within the general 24-hour idempotency window."}],"responses":{"200":{"description":"Uploaded asset; not yet selected or saved.","content":{"application/json":{"schema":{"type":"object","required":["customFont","customFontUrl"],"properties":{"customFont":{"type":"string"},"customFontUrl":{"type":"string","format":"uri"},"customFontVariable":{"type":"boolean","description":"True when the file is a variable font (one file holding every weight), read from the font file itself. Send it back as fontWeights.customFontVariable."}}},"example":{"customFont":"Brand Sans","customFontUrl":"https://project.supabase.co/storage/v1/object/public/360onboard-files/portal/11111111-1111-4111-8111-111111111111/invoice-fonts/22222222-2222-4222-8222-222222222222.ttf","customFontVariable":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}]}}}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"TTF, OTF, WOFF or WOFF2 font up to5242880 bytes."}}}}}}}},"/v2/workspaces/{workspaceId}/portal/analytics/connection":{"get":{"operationId":"getPortalSeoConnection","summary":"Read agency DataForSEO connection","description":"Requires can_manage_settings. Returns connected state, revision and agency refresh defaults; API login/password/ciphertext are never exposed.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"description":"Workspace accessible to the API key and actor","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful scoped operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeoConnection"},"example":{"revision":"33333333-3333-4333-8333-333333333333","connected":true,"rankingsFrequency":"daily","backlinksFrequency":"weekly"}}}},"400":{"description":"Invalid settings, missing provider setup, or unsupported secure credential storage.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace scope, client portal entitlement, or actor permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Client account not found in the authorized workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Revision conflict. Read current settings and reconcile before saving. Unknown write outcomes require read-back; never silently overwrite.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded; honor Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"DataForSEO validation failed; sanitized provider status only, no credentials returned.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Analytics storage or provider unavailable. Do not blindly repeat an uncertain paid provider request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"savePortalSeoConnection","summary":"Save agency DataForSEO connection","description":"Requires can_manage_settings. Full replacement of state/defaults, compare-and-set revision (null creates). Supply API login and API password together to connect or replace credentials; connection verification calls the provider user_data endpoint. Credentials are encrypted per workspace using the configured token encryption secret. connected=false pauses future collection and preserves history. Refresh updates wake scheduling. No rankings/backlink collection occurs within this request. No email or webhook is emitted; no Idempotency-Key required. After unknown write outcome, GET before retrying. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"description":"Workspace accessible to the API key and actor","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional shared portal replay key; retain it for retries of the same request. Revision checks still apply.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeoConnectionWrite"},"example":{"revision":null,"login":"seo@example.test","password":"synthetic-api-password","connected":true,"rankingsFrequency":"daily","backlinksFrequency":"weekly"}}}},"responses":{"200":{"description":"Successful scoped operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeoConnection"},"example":{"revision":"33333333-3333-4333-8333-333333333333","connected":true,"rankingsFrequency":"daily","backlinksFrequency":"weekly"}}}},"400":{"description":"Invalid settings, missing provider setup, or unsupported secure credential storage.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace scope, client portal entitlement, or actor permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Client account not found in the authorized workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Revision conflict. Read current settings and reconcile before saving. Unknown write outcomes require read-back; never silently overwrite.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded; honor Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"DataForSEO validation failed; sanitized provider status only, no credentials returned.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Analytics storage or provider unavailable. Do not blindly repeat an uncertain paid provider request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/analytics":{"get":{"operationId":"getPortalSeoAnalytics","summary":"Read client SEO setup and analytics","description":"Requires can_view_analytics plus client portal access. Reads saved results without paid collection. Returns compact views for 7/30/90 days, current rank/URL, start-of-period delta when a baseline exists, actual daily observations, backlink totals, latest 100 link details, most-linked pages and dated new/lost intervals. Unranked top-100 checks have null rank and count as 101 in averages; unmeasured keywords remain pending. Jobs are limited to 100, prioritizing unknown outcomes before recent work; acknowledging one exposes the next. Stored history covers up to 180 days of the current tracking dataset. No fabricated comparisons, email, webhook or provider call. lastDestinations distinguishes completed empty most-linked-page results from pending collection. Provider billing/access errors are terminal with actionable sanitized guidance; free task reads and explicit rate-limit rejections have at most three attempts with bounded exponential backoff. Ambiguous paid requests are held for review. The collection window includes queue waiting and stops six hours after job creation or at 180 worker attempts, before starting any expired paid request. New paid work requires at least 15 minutes remaining in that window. Known tasks are never automatically resubmitted.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"description":"Workspace accessible to the API key and actor","schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"description":"Portal account owned by this workspace","schema":{"type":"string","format":"uuid"}},{"name":"website","in":"query","description":"A configured domain; omitted or unassigned values select the first configured website.","schema":{"type":"string"}},{"name":"device","in":"query","description":"For both-device tracking, choose desktop (default) or mobile. A single configured device overrides this selection.","schema":{"type":"string","enum":["desktop","mobile"]}},{"name":"setupOnly","in":"query","description":"1 returns only setup and connection status, without history, views or job details.","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"Successful scoped operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeoRead"},"example":{"setup":{"revision":"33333333-3333-4333-8333-333333333333","websites":["example.com"],"keywords":["brand strategy agency"],"location":"United States","language":"English","device":"desktop","rankingsFrequency":null,"backlinksFrequency":null,"enabled":false,"pages":{"positions":true,"backlinks":true}},"connected":false,"snapshots":[],"jobs":[]}}}},"400":{"description":"Invalid settings, missing provider setup, or unsupported secure credential storage.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace scope, client portal entitlement, or actor permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Client account not found in the authorized workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Revision conflict. Read current settings and reconcile before saving. Unknown write outcomes require read-back; never silently overwrite.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded; honor Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"DataForSEO validation failed; sanitized provider status only, no credentials returned.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Analytics storage or provider unavailable. Do not blindly repeat an uncertain paid provider request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"savePortalSeoSetup","summary":"Save client tracking and page configuration","description":"Requires can_manage_settings. Full payload, compare-and-set revision (null creates); unknown fields rejected. Enabled tracking requires a connected agency provider and at least one website. Keywords apply to every assigned site; both devices create separate ranking checks. Nullable refresh values inherit agency defaults. UTC calendar daily/weekly/monthly schedules feed a private queue; page reads do not spend provider balance. Changing domains, keywords, location, language or device starts a new dataset; enabled/page/section/frequency edits preserve history. enabled=false hides client analytics and stops new work. pages controls client navigation/data visibility; sections controls page presentation. Saves do not initiate a synchronous paid check, send email or emit webhook. Optional Idempotency-Key is supported; after unknown outcome GET the current revision before retrying. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"description":"Workspace accessible to the API key and actor","schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"description":"Portal account owned by this workspace","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional shared portal replay key; retain it for retries of the same request. Revision checks still apply.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeoSetupWrite"},"example":{"revision":null,"websites":["example.com"],"keywords":["brand strategy agency"],"location":"United States","language":"English","device":"desktop","rankingsFrequency":null,"backlinksFrequency":null,"enabled":false,"pages":{"positions":true,"backlinks":true}}}}},"responses":{"200":{"description":"Successful scoped operation.","content":{"application/json":{"schema":{"type":"object","properties":{"setup":{"$ref":"#/components/schemas/SeoSetup"}},"required":["setup"],"additionalProperties":false},"example":{"setup":{"revision":"33333333-3333-4333-8333-333333333333","websites":["example.com"],"keywords":["brand strategy agency"],"location":"United States","language":"English","device":"desktop","rankingsFrequency":null,"backlinksFrequency":null,"enabled":false,"pages":{"positions":true,"backlinks":true}}}}}},"400":{"description":"Invalid settings, missing provider setup, or unsupported secure credential storage.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace scope, client portal entitlement, or actor permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Client account not found in the authorized workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Revision conflict. Read current settings and reconcile before saving. Unknown write outcomes require read-back; never silently overwrite.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded; honor Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"DataForSEO validation failed; sanitized provider status only, no credentials returned.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Analytics storage or provider unavailable. Do not blindly repeat an uncertain paid provider request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}}}}},"/v2/workspaces/{workspaceId}/portal/accounts/{accountId}/analytics/jobs/{jobId}/review":{"post":{"operationId":"reviewPortalSeoJob","summary":"Acknowledge an unknown paid request outcome","description":"Requires can_manage_settings and reviewedProviderOutcome=true after the agency reviews the request in DataForSEO. Changes only the matching unknown job in this workspace/client to failed/reviewed, allowing future scheduled checks. Does not immediately repeat or charge a check. Replays are safe: acknowledged=false when no matching unknown job remains. Unknown paid submissions never automatically retry, including after tracking revisions. No email or webhook. Portal Idempotency-Key fingerprints include the authenticated actor. A cached message replay rechecks current permission and message/account/conversation availability. Reusing an older unbound cache entry or another actor's key returns conflict; it is never re-executed automatically.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"description":"Workspace accessible to the API key and actor","schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"description":"Portal account owned by this workspace","schema":{"type":"string","format":"uuid"}},{"name":"jobId","in":"path","required":true,"description":"Unknown analytics job ID from the client read","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional shared portal replay key; retain it for retries of the same request. Revision checks still apply.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reviewedProviderOutcome":{"const":true,"type":"boolean"}},"required":["reviewedProviderOutcome"],"additionalProperties":false},"example":{"reviewedProviderOutcome":true}}}},"responses":{"200":{"description":"Successful scoped operation.","content":{"application/json":{"schema":{"type":"object","properties":{"acknowledged":{"type":"boolean"}},"required":["acknowledged"],"additionalProperties":false},"example":{"acknowledged":true}}}},"400":{"description":"Invalid settings, missing provider setup, or unsupported secure credential storage.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace scope, client portal entitlement, or actor permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Client account not found in the authorized workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Revision conflict. Read current settings and reconcile before saving. Unknown write outcomes require read-back; never silently overwrite.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded; honor Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"DataForSEO validation failed; sanitized provider status only, no credentials returned.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Analytics storage or provider unavailable. Do not blindly repeat an uncertain paid provider request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}}}}},"/v2/workspaces/{workspaceId}/portal/analytics/availability":{"get":{"operationId":"getPortalSeoAvailability","summary":"Read agency analytics availability","description":"Requires can_view_analytics and client portal access. Returns available=true only when this workspace has connected DataForSEO and at least one active, non-deleted client with enabled tracking, a non-empty assigned website list, and an enabled Positions or Backlinks page. Deleted workspaces/clients, disabled tracking, disconnected providers and missing setup return false. This drives agency desktop/mobile navigation and the direct analytics entry point; Integrations and Client SEO pages remain accessible to complete setup. Read only: no provider calls, collection, credential disclosure, email or webhook. Existing saved history is preserved when availability becomes false.","tags":["Client Portal"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"description":"Workspace accessible to the API key and actor","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Workspace-scoped availability.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeoAvailability"},"examples":{"notConfigured":{"value":{"available":false}},"ready":{"value":{"available":true}}}}}},"400":{"description":"Invalid workspace identifier or request parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace scope, client portal entitlement, or actor permission denied.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Workspace not found or unavailable to this actor.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Active workspace changed. Refresh the workspace before reading availability.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded; honor Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Analytics storage unavailable. Retry this read later; it performs no provider requests.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":false}}}}},"x-beta":true}},"/v2/workspaces/{workspaceId}/resources/check-changes":{"post":{"operationId":"checkResourceChanges","summary":"Check authorized resource revisions","description":"Metadata-only, side-effect-free checks using API-key and current actor permissions. Flows and non-portal resources do not need Client Portal entitlement. Portal resources retain entitlement and account/participant scope. At most 50 unique descriptors, 200 entries before coalescing. Compare opaque tokens and fully reread changed content before editing or replying. A matching token never bypasses authorization. This does not wake idle clients. API-key metadata requires can_manage_settings and api_access; webhooks requires can_manage_settings and the webhooks feature. Analytics requires can_view_analytics and Client Portal; analytics.connection requires can_manage_settings and Client Portal. Restricted API keys receive only their visible workspace projection.","security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["resources"],"additionalProperties":false,"properties":{"resources":{"type":"array","maxItems":200,"items":{"$ref":"#/components/schemas/ResourceRevisionDescriptor"},"description":"At most 50 unique (type, accountId, id) identities."}}},"example":{"resources":[{"type":"flow","id":"00000000-0000-4000-8000-000000000102","revision":"2026-10-18T01:00:00Z"},{"type":"tasks","id":"00000000-0000-4000-8000-000000000101","accountId":"00000000-0000-4000-8000-000000000101","revision":null}]}}}},"responses":{"200":{"description":"Authorized tokens and non-disclosing unavailable statuses. Response is no-store.","content":{"application/json":{"schema":{"type":"object","required":["resources"],"additionalProperties":false,"properties":{"resources":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/ResourceRevisionResult"}}}},"example":{"resources":[{"type":"flow","id":"00000000-0000-4000-8000-000000000102","status":"available","revision":"2026-10-19T01:00:00.123456Z"},{"type":"tasks","id":"00000000-0000-4000-8000-000000000101","accountId":"00000000-0000-4000-8000-000000000101","status":"unavailable","revision":null}]}}}},"400":{"description":"Invalid JSON, unregistered type, non-UUID identity, unexpected field or more than 50 unique descriptors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_revision_request","message":"Invalid JSON, unregistered type, non-UUID identity, unexpected field or more than 50 unique descriptors."}}}}},"401":{"description":"Missing/invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"Missing/invalid API key."}}}}},"403":{"description":"API access unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_access_unavailable","message":"API access unavailable."}}}}},"404":{"description":"Workspace unavailable or outside actor/key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"workspace_not_found","message":"Workspace unavailable or outside actor/key scope."}}}}},"429":{"description":"Rate limited; respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Rate limited; respect Retry-After."}}}}},"503":{"description":"Revision service unavailable; retry the read before changing content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"revisions_unavailable","message":"Revision service unavailable; retry the read before changing content."}}}}}}}},"/v2/workspaces/{workspaceId}/portal/milestone-labels":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_milestone_labels","summary":"Read workspace milestone labels","description":"Returns only the workspace milestone labels and exact profile updatedAt. Requires can_view_clients. Unconfigured workspaces default to Milestone/Milestones; an absent profile returns those defaults and updatedAt:null. No writes, notifications, or provider calls.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current workspace labels and profile revision.","content":{"application/json":{"schema":{"type":"object","required":["labels","updatedAt"],"properties":{"labels":{"type":"object","required":["singular","plural"],"properties":{"singular":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^\\u0000-\\u001f\\u007f]+$","description":"Trimmed, single-line label."},"plural":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^\\u0000-\\u001f\\u007f]+$","description":"Trimmed, single-line label."}},"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Exact saved profile revision, preserving fractional precision; null if no profile exists."}},"additionalProperties":false},"examples":{"custom":{"summary":"Workspace custom terminology","value":{"labels":{"singular":"Project","plural":"Projects"},"updatedAt":"2026-10-19T01:00:00.123456Z"}},"default":{"summary":"Unconfigured workspace defaults","value":{"labels":{"singular":"Milestone","plural":"Milestones"},"updatedAt":null}}}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable; requires can_view_clients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The active workspace changed; reload before continuing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"tags":["Client Portal"],"security":[{"apiKey":[]}],"x-required-capabilities":["can_view_clients"],"x-release-channel":"beta"},"put":{"operationId":"put_v2_workspaces_workspaceId_portal_milestone_labels","summary":"Save workspace milestone labels","description":"Requires can_manage_settings. Supply both nonblank, single-line labels (at most 40 characters each before trimming) and expectedRevision copied exactly from the original labels read, including fractional precision. Leading/trailing whitespace is removed. Save Milestone/Milestones explicitly to reset to defaults. The save atomically checks the profile revision and preserves unrelated profile settings. When the original read returned no profile, send expectedRevision:null to create its minimal workspace profile; a concurrent creation returns 409 without overwriting it. Missing revision returns 428, stale revision 409, and invalid labels/revision 400. Does not rename saved content or entities, publish staged milestones, send notifications, or unlock files. On retry, reread and reconcile; do not replace the revision on an old draft.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["labels","expectedRevision"],"properties":{"labels":{"type":"object","required":["singular","plural"],"properties":{"singular":{"type":"string","minLength":1,"maxLength":40,"pattern":"^(?=.*\\S)[^\\u0000-\\u001f\\u007f\\u2028\\u2029]+$","description":"Nonblank, single-line label, at most 40 characters before leading/trailing whitespace is removed."},"plural":{"type":"string","minLength":1,"maxLength":40,"pattern":"^(?=.*\\S)[^\\u0000-\\u001f\\u007f\\u2028\\u2029]+$","description":"Nonblank, single-line label, at most 40 characters before leading/trailing whitespace is removed."}},"additionalProperties":false},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact profile updatedAt returned by the original read, including fractional precision. Use null after an absent-profile read to create the minimal profile; a concurrent first save returns 409."}},"additionalProperties":true},"examples":{"rename":{"summary":"Set custom workspace labels","value":{"labels":{"singular":"Project","plural":"Projects"},"expectedRevision":"2026-10-19T01:00:00.123456Z"}},"reset":{"summary":"Reset to built-in defaults","value":{"labels":{"singular":"Milestone","plural":"Milestones"},"expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}},"responses":{"200":{"description":"Saved labels and exact resulting profile revision.","content":{"application/json":{"schema":{"type":"object","required":["labels","updatedAt"],"properties":{"labels":{"type":"object","required":["singular","plural"],"properties":{"singular":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^\\u0000-\\u001f\\u007f]+$","description":"Trimmed, single-line label."},"plural":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^\\u0000-\\u001f\\u007f]+$","description":"Trimmed, single-line label."}},"additionalProperties":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Exact saved profile revision, preserving fractional precision; null if no profile exists."}},"additionalProperties":false},"example":{"labels":{"singular":"Project","plural":"Projects"},"updatedAt":"2026-10-19T01:00:01.654321Z"}}}},"400":{"description":"Invalid labels or malformed revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable; requires can_manage_settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Workspace not found or outside the API key's allowed scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The profile changed since the supplied revision, or the active workspace changed; reread and reconcile before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"428":{"description":"expectedRevision is required; use the exact updatedAt from the original read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"tags":["Client Portal"],"security":[{"apiKey":[]}],"x-required-capabilities":["can_manage_settings"],"x-release-channel":"beta"}},"/v2/workspaces/{workspaceId}/portal/client-display":{"get":{"operationId":"get_v2_workspaces_workspaceId_portal_client_display","summary":"Read shared client grouping","description":"Returns only the Person/Company client grouping and the profile updatedAt token. Requires can_view_clients. Missing settings default to person; a missing profile returns person and updatedAt:null. No writes, notifications or provider calls.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the shared client grouping and exact profile revision.","content":{"application/json":{"schema":{"type":"object","required":["mode","updatedAt"],"properties":{"mode":{"type":"string","enum":["person","company"]},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Exact profile revision, preserving fractional precision. Null if no profile exists."}},"additionalProperties":false},"example":{"mode":"company","updatedAt":"2026-10-19T01:00:00.123456Z"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"tags":["Client Portal"],"security":[{"apiKey":[]}],"x-required-capabilities":["can_view_clients"],"x-release-channel":"beta"},"put":{"operationId":"put_v2_workspaces_workspaceId_portal_client_display","summary":"Save shared client grouping","description":"Requires can_manage_settings. Set mode to person or company with expectedRevision copied exactly from the original read, including fractional precision. The save atomically checks the profile revision and preserves all unrelated settings. Missing revision is 428, stale revision 409, invalid mode/revision 400, and an absent profile 404. Does not create a profile, emit notifications or call a provider. On a retry, reread and reconcile; never replace the revision on an old draft.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Returns the shared client grouping and exact profile revision.","content":{"application/json":{"schema":{"type":"object","required":["mode","updatedAt"],"properties":{"mode":{"type":"string","enum":["person","company"]},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Exact profile revision, preserving fractional precision. Null if no profile exists."}},"additionalProperties":false},"example":{"mode":"company","updatedAt":"2026-10-19T01:00:00.123456Z"}}}},"400":{"description":"Invalid request A malformed revision returns invalid_revision with resourceType, resourceId and recovery:read_resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"403":{"description":"Capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"409":{"description":"The profile changed since the supplied revision; read current content and reconcile before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"428":{"description":"expectedRevision is required; copy the exact updatedAt from the original client-display read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalError"}}}}},"tags":["Client Portal"],"security":[{"apiKey":[]}],"x-required-capabilities":["can_manage_settings"],"x-release-channel":"beta","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode","expectedRevision"],"properties":{"mode":{"type":"string","enum":["person","company"]},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Original profile updatedAt. Null is accepted only as an absent-profile read token and the save then returns 404."}},"additionalProperties":true},"example":{"mode":"company","expectedRevision":"2026-10-19T01:00:00.123456Z"}}}}}},"/v2/workspaces/{workspaceId}/clients/{clientId}/submissions":{"post":{"operationId":"startFreshClientSubmission","summary":"Start a fresh repeat submission","description":"Create a new blank V2 submission for an existing identified client assignment. Requires an API key with V2 API access, workspace access, and can_create_clients. The source must be active and its published V2 flow must enable allowRepeatSubmissions. Email must match the existing workspace person. A stable request_key returns the same assignment and response on retries without changing stored answers or profile values. The guest opening window ends five minutes after original creation; later retries return opening_url:null and never renew guest access. Creates an empty response and sends no email, invitation, or webhook.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Authorized workspace containing the source assignment."},{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Existing active identified V2 source client assignment."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"request_key":{"type":"string","format":"uuid","description":"Stable UUID for retrying this logical fresh-start action."},"first_name":{"type":"string","maxLength":200},"last_name":{"type":"string","maxLength":200},"email":{"type":"string","format":"email"},"company_name":{"type":"string","maxLength":300,"default":""},"phone":{"type":"string","maxLength":100,"default":""}},"required":["request_key","first_name","last_name","email"],"additionalProperties":false},"example":{"request_key":"11111111-1111-4111-8111-111111111111","first_name":"Jane","last_name":"Smith","email":"jane@example.test","company_name":"Example Studio","phone":"+15555550123"}}}},"responses":{"201":{"description":"Blank repeat assignment created or replayed for this request key. The opening URL contains a short-lived token; deliver it only to the intended client.","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","format":"uuid"},"response_id":{"type":"string","format":"uuid"},"client_link":{"type":"string","format":"uri"},"opening_url":{"type":["string","null"],"format":"uri"}},"required":["client_id","response_id","client_link","opening_url"],"additionalProperties":false},"example":{"client_id":"22222222-2222-4222-8222-222222222222","response_id":"33333333-3333-4333-8333-333333333333","client_link":"https://app.360onboard.com/c/opaque-link","opening_url":"https://app.360onboard.com/c/opaque-link#onboardingHandoff=short_lived_token"}}}},"400":{"description":"Invalid body, request key, or email does not match the existing person.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"email_mismatch","message":"Email must match the existing client contact."}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API actor lacks workspace access or can_create_clients permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"permission_denied","message":"Client creation permission is required."}}}}},"404":{"description":"Source assignment is unavailable in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"client_not_found","message":"Source client assignment is unavailable."}}}}},"409":{"description":"Repeat submissions are disabled or the source cannot be used for a repeat.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"repeat_submissions_unavailable","message":"Repeat submissions are not enabled for this flow."}}}}},"503":{"description":"Repeat assignment setup or response creation is temporarily incomplete. Retry with the same request_key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}],"tags":["Clients"]}},"/v2/workspaces/{workspaceId}/flows/{flowId}/working-design":{"get":{"tags":["Flows"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the flow; effective API-key and actor scopes must allow access."},{"name":"flowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Active V2 flow to read or edit."}],"operationId":"getFlowWorkingDesign","summary":"Get a V2 flow working design","description":"Reads the current authoring copy, including staged changes, editable design copy, recognized choice discovery, and the exact save revision. Returns active V2 flows in the intersection of API-key and actor workspace access. Requires can_view_flows and API access. Unlike GET /flows/{flowId}, which stays published-only, this returns the authoring working copy. No mutation or publication side effect. Hero artwork displays in the Split hero layout in website mode; other layouts retain it without displaying it. Responses preserve uploaded custom fonts, custom family names, background patterns and existing authored text. Do not echo the read design into PATCH: mutation inputs are intentionally stricter.","x-required-capabilities":["can_view_flows"],"responses":{"200":{"description":"Current working design; update saves or stages content and never publishes.","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingDesignGetResponse"},"example":{"data":{"design":{"theme":"editorial","overrides":{"primaryColor":"#123456","displayFont":"Agency Sans","bodyFont":"Agency Sans","customFont":"Agency Sans","customFontUrl":"https://files.example.test/agency.woff2"},"layouts":{"hero":"split","step":"two-column"},"mode":"website","layoutConfig":{},"heroArtwork":{"image":{"url":"https://images.example.test/hero.jpg","source":"url"},"imageAlt":"A mountain landscape"},"welcomeScreen":true,"backgroundPattern":"dots"},"copy":{"heroTitle":"Welcome, {{first_name}}","overviewTitle":"Your onboarding plan"},"updatedAt":"2026-10-26T12:00:00Z","staged":true},"choices":{"themes":[{"id":"modern","name":"Modern"}],"layouts":{"hero":[{"id":"split","name":"Split","compatibleModes":["website"]}]},"modes":["website","slideshow"],"slideshowTransitions":["vertical","horizontal","fade"],"imageSources":["url","unsplash"],"fonts":[{"id":"Inter","name":"Inter","roles":["display","body"]}],"copyFields":["heroTitle","overviewTitle"],"heroArtwork":{"layouts":["split"],"modes":["website"]},"backdrop":{"styles":["photo","glass"],"strengths":["subtle","balanced","bold"],"text":["auto","light","dark"],"cards":["clear","frosted","solid"],"featured":[{"id":"LeG68PrXA6Y","label":"Prism","tone":"light","image":{"url":"https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=2400&q=80&auto=format&fit=crop","source":"unsplash","unsplash":{"photoId":"LeG68PrXA6Y","photographerName":"Codioful (Formerly Gradienta)","photographerUrl":"https://unsplash.com/@gradienta","downloadLocation":"https://api.unsplash.com/photos/LeG68PrXA6Y/download"}}}]}}}}}},"400":{"description":"Invalid design/copy payload; unknown properties, unsupported IDs and media metadata are rejected.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"API key is missing, invalid or unavailable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"The acting user lacks the required flow permission.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Workspace, flow, or V2 working design was not found within effective key and actor scope.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"expected_updated_at is stale; GET the working design and reconcile before retrying.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limit exceeded."},"5XX":{"description":"API service error."}}},"patch":{"tags":["Flows"],"security":[{"apiKey":[]}],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace containing the flow; effective API-key and actor scopes must allow access."},{"name":"flowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Active V2 flow to read or edit."}],"operationId":"updateFlowWorkingDesign","summary":"Update a V2 flow working design","description":"Applies only recognized theme, layout, presentation mode, slideshow transition, supported image metadata, overrides and editable design copy. Requires can_edit_flows, API access, and expected_updated_at from GET. Uses the shared flow-content save service: draft changes save directly; published-flow changes remain staged in pending_changes. Unrelated selected variants and customization properties are preserved. Unknown properties, IDs and media metadata are rejected. Does not publish; use flow publication separately when explicitly intended. A stale revision returns 409; fetch and reconcile before retrying. Hero artwork displays in the Split hero layout in website mode; other layouts retain it without displaying it. New Unsplash selections are tracked after the accepted save. Tracking failure or an unknown network outcome never undoes the save and is reported in unsplashTracking; do not automatically retry an unknown outcome. Set individual override fields to null to remove them and restore theme inheritance; omitted fields remain unchanged. Reset palette clears primaryColor, accentColor, backgroundColor and foregroundColor. Reset type and shape clears displayFont, bodyFont, baseSize, density, radiusScale, customFont and customFontUrl, plus the uploaded font's extra weight files. Uploaded font metadata is clear-only; arbitrary custom font names and URLs cannot be written here. Responses preserve retained authored values and may contain values outside this strict input contract.","x-required-capabilities":["can_edit_flows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_updated_at"],"anyOf":[{"required":["design"]},{"required":["copy"]}],"properties":{"expected_updated_at":{"type":"string","format":"date-time"},"design":{"$ref":"#/components/schemas/WorkingDesignDesign"},"copy":{"$ref":"#/components/schemas/WorkingDesignCopy"}}},"example":{"expected_updated_at":"2026-10-26T11:59:00Z","design":{"theme":"editorial","overrides":{"primaryColor":"#123456","displayFont":null,"bodyFont":null,"baseSize":null,"density":null,"radiusScale":null,"customFont":null,"customFontUrl":null},"layouts":{"hero":"split","step":"two-column"},"mode":"website","layoutConfig":{},"heroArtwork":{"image":{"url":"https://images.example.test/hero.jpg","source":"url"},"imageAlt":"A mountain landscape"}},"copy":{"heroTitle":"Welcome, {{first_name}}","overviewTitle":"Your onboarding plan"}}}}},"responses":{"200":{"description":"Current working design; update saves or stages content and never publishes.","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingDesignResponse"},"example":{"data":{"design":{"theme":"editorial","overrides":{"primaryColor":"#123456"},"layouts":{"hero":"split","step":"two-column"},"mode":"website","layoutConfig":{},"heroArtwork":{"image":{"url":"https://images.example.test/hero.jpg","source":"url"},"imageAlt":"A mountain landscape"},"welcomeScreen":true},"copy":{"heroTitle":"Welcome, {{first_name}}","overviewTitle":"Your onboarding plan"},"updatedAt":"2026-10-26T12:00:00Z","staged":true,"unsplashTracking":"not_needed"}}}}},"400":{"description":"Invalid design/copy payload; unknown properties, unsupported IDs and media metadata are rejected.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"API key is missing, invalid or unavailable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"The acting user lacks the required flow permission.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Workspace, flow, or V2 working design was not found within effective key and actor scope.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"expected_updated_at is stale; GET the working design and reconcile before retrying.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limit exceeded."},"5XX":{"description":"API service error."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"query","name":"apiKey","description":"Generate in Settings → APIs, Webhooks & MCP → API Keys. Send as ?apiKey=... from a trusted server. Access is limited to workspaces selected for the key and available to its owning actor."},"webhookSignature":{"type":"apiKey","in":"header","name":"X-360Onboard-Signature","description":"HMAC-SHA256 header in t=<unix-seconds>,v1=<hex> form. Verify over timestamp + dot + the exact raw request body using the endpoint secret."}},"schemas":{"PortalBroadcastAudience":{"oneOf":[{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","const":"all"}},"additionalProperties":false},{"type":"object","required":["kind","accountIds"],"properties":{"kind":{"type":"string","const":"specific"},"accountIds":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","format":"uuid"}}},"additionalProperties":false},{"type":"object","required":["kind","field","value"],"properties":{"kind":{"type":"string","const":"rule"},"field":{"oneOf":[{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","const":"company"}},"additionalProperties":false},{"type":"object","required":["kind","id"],"properties":{"kind":{"type":"string","const":"custom"},"id":{"type":"string","format":"uuid"}},"additionalProperties":false}]},"value":{"type":"string","minLength":1,"maxLength":2000}},"additionalProperties":false}]},"PortalBroadcastInput":{"type":"object","required":["placement","title","message","audience"],"properties":{"placement":{"type":"string","enum":["top","sidebar","poster"],"description":"Portal-wide top bar, sidebar card, or closable poster dialog. At most one top bar, two sidebar banners, and one poster per visit are displayed."},"title":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n]+$"},"message":{"type":"string","maxLength":2000,"description":"Markdown (bold, italic, strikethrough, headings, lists, quotes and links), up to 600 characters for sidebar and 2,000 for poster. Required for sidebar and poster; a top bar shows only its title, so its message is left out. On sidebar and poster, a line of its own written as ![description](https://...) shows that picture; top bars reject pictures. Personalize the title, message and button labels with variables, filled in for each client who reads it: {{client.first_name}}, {{client.last_name}}, {{client.full_name}}, {{client.email}}, {{client.company_name}}, {{client_field.<client custom field id>}}, and the reader's own day as {{date.today}}, {{date.weekday}}, {{date.month}} or {{date.year}}. Older {first_name} and {company} still work."},"tone":{"type":"string","enum":["normal","important"],"default":"normal"},"align":{"type":"string","enum":["left","center"],"default":"center","description":"Where a top bar puts its title. Other placements ignore it."},"image":{"oneOf":[{"type":"object","required":["url","alt"],"properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"Public HTTP(S) image URL or bare domain."},"alt":{"type":"string","maxLength":200}},"additionalProperties":false},{"type":"null"}],"default":null,"description":"Older single picture shown above the message. Prefer a picture line in message instead. Only sidebar and poster placements support it. Empty alt means decorative."},"actions":{"type":"array","maxItems":2,"items":{"type":"object","required":["label","destination"],"properties":{"label":{"type":"string","minLength":1,"maxLength":120},"destination":{"oneOf":[{"type":"object","required":["kind","url"],"properties":{"kind":{"type":"string","const":"external"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"HTTP(S) address or bare domain. Bare domains normalize to HTTPS."}},"additionalProperties":false},{"type":"object","required":["kind","section"],"properties":{"kind":{"type":"string","const":"portal"},"section":{"type":"string","enum":["overview","messages","tasks","milestones","calendar","files","services","invoices","flows"]}},"additionalProperties":false}]}},"additionalProperties":false},"default":[],"description":"One button for top or sidebar, up to two for poster."},"audience":{"$ref":"#/components/schemas/PortalBroadcastAudience"},"startsAt":{"type":["string","null"],"format":"date-time","default":null,"description":"ISO date-time with offset. null starts immediately on publish."},"endsAt":{"type":["string","null"],"format":"date-time","default":null,"description":"ISO date-time with offset. Must be later than start and, on publish, in the future. null means until manually ended."},"dismissible":{"type":"boolean","default":true,"description":"Must be true for posters."},"posterFrequency":{"type":"string","enum":["once","every_visit"],"default":"once","description":"For posters, once per person or every visit until the broadcast ends (closing it hides it for that visit only). Must be once for top and sidebar."}},"additionalProperties":false,"allOf":[{"if":{"properties":{"placement":{"type":"string","const":"top"}}},"then":{"properties":{"message":{"maxLength":320},"image":{"type":"null"},"actions":{"maxItems":1},"posterFrequency":{"type":"string","const":"once"}}}},{"if":{"properties":{"placement":{"type":"string","const":"sidebar"}}},"then":{"properties":{"message":{"maxLength":600},"actions":{"maxItems":1},"posterFrequency":{"type":"string","const":"once"}}}},{"if":{"properties":{"placement":{"type":"string","const":"poster"}}},"then":{"properties":{"dismissible":{"const":true}}}}]},"PortalBroadcast":{"type":"object","required":["placement","title","message","tone","image","actions","audience","startsAt","endsAt","dismissible","posterFrequency","id","state","status","createdAt","updatedAt","counts"],"properties":{"placement":{"type":"string","enum":["top","sidebar","poster"],"description":"Portal-wide top bar, sidebar card, or closable poster dialog. At most one top bar, two sidebar banners, and one poster per visit are displayed."},"title":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n]+$"},"message":{"type":"string","maxLength":2000,"description":"Markdown (bold, italic, strikethrough, headings, lists, quotes and links), up to 600 characters for sidebar and 2,000 for poster. Required for sidebar and poster; a top bar shows only its title, so its message is left out. On sidebar and poster, a line of its own written as ![description](https://...) shows that picture; top bars reject pictures. Personalize the title, message and button labels with variables, filled in for each client who reads it: {{client.first_name}}, {{client.last_name}}, {{client.full_name}}, {{client.email}}, {{client.company_name}}, {{client_field.<client custom field id>}}, and the reader's own day as {{date.today}}, {{date.weekday}}, {{date.month}} or {{date.year}}. Older {first_name} and {company} still work."},"tone":{"type":"string","enum":["normal","important"],"default":"normal"},"align":{"type":"string","enum":["left","center"],"default":"center","description":"Where a top bar puts its title. Other placements ignore it."},"image":{"oneOf":[{"type":"object","required":["url","alt"],"properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"Public HTTP(S) image URL or bare domain."},"alt":{"type":"string","maxLength":200}},"additionalProperties":false},{"type":"null"}],"default":null,"description":"Older single picture shown above the message. Prefer a picture line in message instead. Only sidebar and poster placements support it. Empty alt means decorative."},"actions":{"type":"array","maxItems":2,"items":{"type":"object","required":["label","destination"],"properties":{"label":{"type":"string","minLength":1,"maxLength":120},"destination":{"oneOf":[{"type":"object","required":["kind","url"],"properties":{"kind":{"type":"string","const":"external"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"HTTP(S) address or bare domain. Bare domains normalize to HTTPS."}},"additionalProperties":false},{"type":"object","required":["kind","section"],"properties":{"kind":{"type":"string","const":"portal"},"section":{"type":"string","enum":["overview","messages","tasks","milestones","calendar","files","services","invoices","flows"]}},"additionalProperties":false}]}},"additionalProperties":false},"default":[],"description":"One button for top or sidebar, up to two for poster."},"audience":{"$ref":"#/components/schemas/PortalBroadcastAudience"},"startsAt":{"type":["string","null"],"format":"date-time","default":null,"description":"ISO date-time with offset. null starts immediately on publish."},"endsAt":{"type":["string","null"],"format":"date-time","default":null,"description":"ISO date-time with offset. Must be later than start and, on publish, in the future. null means until manually ended."},"dismissible":{"type":"boolean","default":true,"description":"Must be true for posters."},"posterFrequency":{"type":"string","enum":["once","every_visit"],"default":"once","description":"For posters, once per person or every visit until the broadcast ends (closing it hides it for that visit only). Must be once for top and sidebar."},"id":{"type":"string","format":"uuid"},"state":{"type":"string","enum":["draft","published","ended"]},"status":{"type":"string","enum":["draft","scheduled","live","ended"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"counts":{"type":"object","required":["seen","dismissed","clicked"],"properties":{"seen":{"type":"integer","minimum":0},"dismissed":{"type":"integer","minimum":0},"clicked":{"type":"integer","minimum":0}},"additionalProperties":false}},"additionalProperties":false},"PortalFileUploadRequest":{"type":"object","required":["fileName","size"],"properties":{"fileName":{"type":"string","minLength":1,"description":"Original filename. Must contain non-whitespace characters; only a safe extension is kept in the generated storage path."},"size":{"type":"number","minimum":0,"maximum":52428800,"description":"File size in bytes, at most 50 MiB."},"mimeType":{"type":"string","description":"Optional file MIME type. Any attachment type is accepted, including PPTX, XLSX, DOCX, CSV and unknown binary types. Use application/octet-stream for unknown types.","default":"application/octet-stream"}},"additionalProperties":true},"PortalFileUploadResponse":{"type":"object","required":["signedUrl","publicUrl","path"],"properties":{"signedUrl":{"type":"string","format":"uri","description":"Temporary upload credential. PUT raw file bytes here with their Content-Type; do not send the 360Onboard API key to this URL."},"publicUrl":{"type":"string","format":"uri","description":"Staged object URL. The object exists only after a successful byte upload. Pass this as url when saving file metadata."},"path":{"type":"string","description":"Server-generated owner-scoped object path. Pass this as storagePath when saving file metadata."}},"additionalProperties":false},"SeoConnectionWrite":{"type":"object","properties":{"revision":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"login":{"type":"string","format":"email","maxLength":254},"password":{"type":"string","minLength":1,"maxLength":512},"connected":{"type":"boolean"},"rankingsFrequency":{"type":"string","enum":["daily","weekly","monthly"]},"backlinksFrequency":{"type":"string","enum":["daily","weekly","monthly"]}},"required":["revision","connected","rankingsFrequency","backlinksFrequency"],"additionalProperties":false},"SeoSetupWrite":{"type":"object","properties":{"revision":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"websites":{"type":"array","items":{"type":"string","maxLength":253},"maxItems":10,"description":"Up to 10 public domains, normalized to lowercase hostnames without www, schemes or paths; duplicates removed. No credentials or ports."},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":100,"description":"Up to 100 distinct nonempty keywords (200 characters each), shared across assigned sites. Literal plus and percent characters are preserved at the provider."},"location":{"type":"string","minLength":1,"maxLength":200},"language":{"type":"string","minLength":1,"maxLength":80},"device":{"type":"string","enum":["desktop","mobile","both"]},"rankingsFrequency":{"anyOf":[{"type":"string","enum":["daily","weekly","monthly"]},{"type":"null"}]},"backlinksFrequency":{"anyOf":[{"type":"string","enum":["daily","weekly","monthly"]},{"type":"null"}]},"enabled":{"type":"boolean"},"pages":{"type":"object","properties":{"positions":{"type":"boolean"},"backlinks":{"type":"boolean"}},"required":["positions","backlinks"],"additionalProperties":false},"sections":{"type":"object","properties":{"positions":{"type":"object","properties":{"metrics":{"type":"boolean"},"trend":{"type":"boolean"},"distribution":{"type":"boolean"},"opportunities":{"type":"boolean"},"keywords":{"type":"boolean"}},"required":["metrics","trend","distribution","opportunities","keywords"],"additionalProperties":false},"backlinks":{"type":"object","properties":{"metrics":{"type":"boolean"},"trend":{"type":"boolean"},"destinations":{"type":"boolean"},"links":{"type":"boolean"}},"required":["metrics","trend","destinations","links"],"additionalProperties":false}},"required":["positions","backlinks"],"additionalProperties":false}},"required":["revision","websites","keywords","location","language","device","rankingsFrequency","backlinksFrequency","enabled","pages"],"additionalProperties":false},"SeoConnection":{"type":"object","properties":{"revision":{"type":["string","null"],"format":"uuid"},"connected":{"type":"boolean"},"rankingsFrequency":{"type":"string","enum":["daily","weekly","monthly"]},"backlinksFrequency":{"type":"string","enum":["daily","weekly","monthly"]}},"required":["revision","connected","rankingsFrequency","backlinksFrequency"],"additionalProperties":false},"SeoSetup":{"type":"object","properties":{"revision":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"websites":{"type":"array","items":{"type":"string","maxLength":253},"maxItems":10,"description":"Up to 10 public domains, normalized to lowercase hostnames without www, schemes or paths; duplicates removed. No credentials or ports."},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":100,"description":"Up to 100 distinct nonempty keywords (200 characters each), shared across assigned sites. Literal plus and percent characters are preserved at the provider."},"location":{"type":"string","minLength":1,"maxLength":200},"language":{"type":"string","minLength":1,"maxLength":80},"device":{"type":"string","enum":["desktop","mobile","both"]},"rankingsFrequency":{"anyOf":[{"type":"string","enum":["daily","weekly","monthly"]},{"type":"null"}]},"backlinksFrequency":{"anyOf":[{"type":"string","enum":["daily","weekly","monthly"]},{"type":"null"}]},"enabled":{"type":"boolean"},"pages":{"type":"object","properties":{"positions":{"type":"boolean"},"backlinks":{"type":"boolean"}},"required":["positions","backlinks"],"additionalProperties":false},"sections":{"type":"object","properties":{"positions":{"type":"object","properties":{"metrics":{"type":"boolean"},"trend":{"type":"boolean"},"distribution":{"type":"boolean"},"opportunities":{"type":"boolean"},"keywords":{"type":"boolean"}},"required":["metrics","trend","distribution","opportunities","keywords"],"additionalProperties":false},"backlinks":{"type":"object","properties":{"metrics":{"type":"boolean"},"trend":{"type":"boolean"},"destinations":{"type":"boolean"},"links":{"type":"boolean"}},"required":["metrics","trend","destinations","links"],"additionalProperties":false}},"required":["positions","backlinks"],"additionalProperties":false},"datasetRevision":{"type":"string","format":"uuid","readOnly":true,"description":"Server dataset identity; omit from writes. Presentation/frequency edits preserve it; tracking target edits create a new dataset."}},"required":["revision","websites","keywords","location","language","device","rankingsFrequency","backlinksFrequency","enabled","pages"],"additionalProperties":false},"SeoRead":{"type":"object","properties":{"setup":{"$ref":"#/components/schemas/SeoSetup"},"connected":{"type":"boolean"},"snapshots":{"type":"array","maxItems":0,"items":{}},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"website":{"type":"string"},"kind":{"type":"string","enum":["rank","summary","links","changes","destinations"]},"keyword":{"type":"string"},"status":{"type":"string","enum":["queued","running","polling","failed","unknown"]},"detail":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","website","kind","keyword","status","detail","created_at"],"additionalProperties":false}},"views":{"type":"object","additionalProperties":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"keyword":{"type":"string"},"position":{"type":["number","null"]},"delta":{"type":["number","null"]},"url":{"type":["string","null"]},"checkedAt":{"type":["string","null"]},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false}}},"required":["keyword","position","delta","url","checkedAt","trend"],"additionalProperties":false}},"measured":{"type":"integer"},"positions":{"type":"object","properties":{"average":{"type":["string","null"]},"top10":{"type":["number","null"]},"improved":{"type":["number","null"]},"declined":{"type":["number","null"]}},"required":["average","top10","improved","declined"],"additionalProperties":false},"backlinks":{"type":"object","properties":{"domains":{"type":["number","null"]},"backlinks":{"type":["number","null"]},"new":{"type":["number","null"]},"lost":{"type":["number","null"]}},"required":["domains","backlinks","new","lost"],"additionalProperties":false},"hasComparison":{"type":"boolean"},"rankTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false}},"previousRankTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false}},"backlinkTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false}},"previousBacklinkTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false}},"links":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"anchor":{"type":"string"},"dofollow":{"type":"boolean"},"firstSeen":{"type":["string","null"]},"lost":{"type":"boolean"}},"required":["source","target","anchor","dofollow","firstSeen","lost"],"additionalProperties":false}},"linksTotal":{"type":"integer"},"destinations":{"type":"array","items":{"type":"object","properties":{"page":{"type":"string"},"title":{"type":"string"},"backlinks":{"type":"integer"}},"required":["page","title","backlinks"],"additionalProperties":false}},"lastDestinations":{"type":["string","null"],"description":"Time of the latest successful most-linked-pages collection; null means no successful response has been saved. An empty destinations array with a timestamp is a completed empty result."},"lastRank":{"type":["string","null"]},"lastBacklinks":{"type":["string","null"]},"changesStart":{"type":["string","null"]},"changesEnd":{"type":["string","null"]},"distribution":{"type":"array","items":{"type":"integer"},"minItems":5,"maxItems":5}},"required":["rows","measured","positions","backlinks","hasComparison","rankTrend","previousRankTrend","backlinkTrend","previousBacklinkTrend","links","linksTotal","destinations","lastDestinations","lastRank","lastBacklinks","changesStart","changesEnd","distribution"],"additionalProperties":false},"description":"Compact computed views keyed website:device:7, website:device:30 and website:device:90. Only selected website/device is returned. Omitted for setupOnly=1 or disabled client analytics."}},"required":["setup","connected","snapshots","jobs"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":true}},"required":["error"],"description":"Public API error response.","additionalProperties":true},"WorkspaceList":{"type":"object","properties":{"object":{"type":"string","const":"list","description":"Envelope discriminator; always list."},"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"},"description":"Workspaces available to the API key owner."}},"required":["object","data"],"additionalProperties":true},"ClientList":{"type":"object","properties":{"object":{"type":"string","const":"list","description":"Envelope discriminator; always list."},"data":{"type":"array","items":{"$ref":"#/components/schemas/Client"},"description":"Client records for the requested page."},"page":{"type":"integer","description":"Current 1-based page number."},"limit":{"type":"integer","description":"Maximum records requested per page."},"total":{"type":"integer","description":"Total matching records across all pages."},"has_more":{"type":"boolean","description":"Whether another page is available."}},"required":["object","data","page","limit","total","has_more"],"additionalProperties":true},"FlowList":{"type":"object","properties":{"object":{"type":"string","const":"list","description":"Envelope discriminator; always list."},"data":{"type":"array","items":{"$ref":"#/components/schemas/Flow"},"description":"Published flows for the workspace."},"page":{"type":"integer","description":"Current 1-based page number."},"limit":{"type":"integer","description":"Maximum records requested per page."},"total":{"type":"integer","description":"Total matching records across all pages."},"has_more":{"type":"boolean","description":"Whether another page is available."}},"required":["object","data","page","limit","total","has_more"],"additionalProperties":true},"ResponseList":{"type":"object","properties":{"object":{"type":"string","const":"list","description":"Envelope discriminator; always list."},"data":{"type":"array","items":{"$ref":"#/components/schemas/Response"},"description":"Responses for the requested page."},"page":{"type":"integer","description":"Current 1-based page number."},"limit":{"type":"integer","description":"Maximum records requested per page."},"total":{"type":"integer","description":"Total matching records across all pages."},"has_more":{"type":"boolean","description":"Whether another page is available."}},"required":["object","data","page","limit","total","has_more"],"additionalProperties":true},"Client":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique client resource identifier."},"object":{"type":"string","const":"client","description":"Resource discriminator; always client."},"person_id":{"type":["string","null"],"format":"uuid","description":"Identifier for the associated person record."},"workspace_id":{"type":"string","format":"uuid","description":"Workspace that owns this onboarding client."},"first_name":{"type":["string","null"],"description":"Client first name; null when not provided."},"last_name":{"type":["string","null"],"description":"Client last name; null when not provided."},"full_name":{"type":["string","null"],"description":"Display name assembled from available name fields."},"email":{"type":["string","null"],"format":"email","description":"Client email address; null when not provided."},"company_name":{"type":["string","null"],"description":"Client company; null when not provided."},"phone":{"type":["string","null"],"description":"Client phone number; null when not provided."},"flow_id":{"type":"string","format":"uuid","description":"Published V2 flow assigned to this client."},"flow_name":{"type":["string","null"],"description":"Name of the assigned flow."},"flow_type":{"type":"string","description":"Flow category."},"schema_version":{"type":"integer","const":2,"description":"Flow schema generation used for onboarding."},"status":{"type":"string","description":"Onboarding status reported for the client."},"url":{"type":["string","null"],"format":"uri-reference","description":"Public onboarding URL; null when no usable public link exists."},"progress":{"$ref":"#/components/schemas/Progress","description":"Latest response progress, or the onboarding state when no response exists."},"notifications_silenced":{"type":"boolean","description":"Whether onboarding notifications are suppressed."},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp in UTC."},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp in UTC."},"api_url":{"type":"string","format":"uri","description":"Canonical API URL for this client."},"flow":{"anyOf":[{"$ref":"#/components/schemas/Flow"},{"type":"null"}],"description":"Flow summary; included on single-client reads and omitted from list results."}},"required":["id","object","workspace_id","flow_id","schema_version","status","progress","api_url"],"description":"A client onboarding with nullable identity data. The `flow` relation is included on single-client reads and creation.","additionalProperties":true},"Flow":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique flow identifier."},"object":{"type":"string","const":"flow","description":"Resource discriminator; always flow."},"workspace_id":{"type":"string","format":"uuid","description":"Workspace that owns this flow."},"name":{"type":"string","description":"Published flow name."},"type":{"type":"string","description":"Flow category."},"status":{"type":"string","enum":["published"],"description":"Only published flows are exposed by this API."},"schema_version":{"type":"integer","const":2,"description":"Published flow schema generation."},"public_url":{"type":["string","null"],"format":"uri","description":"Public onboarding URL; null if this flow has no public URL."},"public_link":{"type":"object","properties":{"enabled":{"type":"boolean"},"id":{"type":["string","null"],"format":"uuid"},"slug":{"type":["string","null"]},"settings":{"type":"object","additionalProperties":true}},"required":["enabled","settings"],"additionalProperties":true,"description":"Public-link configuration exposed by the public serializer."},"portal_description":{"type":["string","null"],"description":"Client portal description; null when unset."},"design":{"type":"object","properties":{"selected_variants":{"type":"object","additionalProperties":true},"customization":{"type":"object","additionalProperties":true,"properties":{"locale":{"type":"string","enum":["en","fr","es","de","it","ja","ko","zh","zh-TW","no","ru","hi","pt-BR"],"default":"en","description":"Built-in client flow language. zh is Simplified Chinese, zh-TW is Traditional Chinese, hi is Hindi, and pt-BR is Brazilian Portuguese. Applies to system registration, continuation, validation, progress, payment, signing and runtime messages. Authored flow content stays unchanged. Saved versioned submissions use their assigned definition's locale. Read-only through the public API; change it in the builder or MCP flow_set_language, then publish to the intended target."},"allowRepeatSubmissions":{"type":"boolean","description":"Whether clients can start separate submissions for supported questionnaire-only flows."},"requireEmailVerificationToResume":{"type":"boolean","default":true,"description":"Whether an emailed verification code is required to resume saved answers. Defaults to true when omitted; disabling this still requires a private signed resume link or a valid verified session."}}}},"additionalProperties":true,"description":"Published design settings, with private integration data omitted."},"step_count":{"type":"integer","description":"Number of steps in the published flow."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/FlowStep"},"description":"Sanitized step definitions; included on a single-flow read and omitted from list results."},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp in UTC."},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp in UTC."},"api_url":{"type":"string","format":"uri","description":"Canonical API URL for this flow."}},"required":["id","object","workspace_id","name","type","status","schema_version","public_url","public_link","design","step_count","created_at","updated_at","api_url"],"description":"Published V2 flow with sensitive integration configuration removed.","additionalProperties":true},"Response":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique response identifier."},"object":{"type":"string","const":"response","description":"Resource discriminator; always response."},"workspace_id":{"type":"string","format":"uuid","description":"Workspace that owns this response."},"schema_version":{"type":"integer","const":2,"description":"Flow schema generation used for the response."},"status":{"type":"string","enum":["in_progress","completed","abandoned"],"description":"Response state: in_progress, completed, or abandoned."},"flow_id":{"type":"string","format":"uuid","description":"Flow associated with this response."},"client_id":{"type":["string","null"],"format":"uuid","description":"Client associated with this response."},"started_at":{"type":["string","null"],"format":"date-time","description":"Time the client began this response."},"completed_at":{"type":["string","null"],"format":"date-time","description":"Completion time; null until completed."},"time_spent_seconds":{"type":["integer","null"],"description":"Elapsed active time in seconds."},"client":{"anyOf":[{"$ref":"#/components/schemas/Client"},{"type":"null"}],"description":"Serialized client associated with this response."},"flow":{"$ref":"#/components/schemas/Flow","description":"Serialized flow associated with the response."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/ResponseStep"},"description":"Typed results for the response's assigned flow definition. Disabled steps without a recorded response or evidence are omitted; recorded answers, receipts, signatures, and restart history are retained. Sensitive ephemeral values are omitted."},"api_url":{"type":"string","format":"uri","description":"Canonical API URL for this response."}},"required":["id","object","workspace_id","schema_version","status","flow_id","client_id","started_at","completed_at","steps","api_url"],"description":"A response snapshot with typed results for its assigned flow definition, including recorded evidence for steps that have since been disabled.","additionalProperties":true},"PortalDiscovery":{"type":"object","properties":{"object":{"type":"string","const":"portal_api"},"workspace_id":{"type":"string","format":"uuid"},"base_url":{"type":"string","format":"uri"},"authentication":{"type":"string","const":"apiKey query parameter"},"idempotency":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"methods":{"type":"array","items":{"type":"string","enum":["GET","POST","PATCH","PUT","DELETE"]}}},"required":["path","methods"]},"description":"Workspace portal route catalog, including each route path and supported HTTP methods."},"payload_contracts":{"type":"object","additionalProperties":true,"description":"Payload contract catalog for portal route operations."}},"required":["object","workspace_id","base_url","authentication","idempotency","routes","payload_contracts"],"additionalProperties":false},"ApiDiscovery":{"type":"object","properties":{"name":{"type":"string","description":"Public API name."},"version":{"type":"string","description":"API version label."},"authentication":{"type":"string","description":"Required apiKey query-parameter authentication."},"base_url":{"type":"string","format":"uri","description":"Public API base URL."},"resources":{"type":"object","additionalProperties":{"type":"string"},"description":"Resource route catalog and usage notes."},"questionnaire_auto_fill":{"type":"object","additionalProperties":{"type":"string"},"description":"Scope statement for questionnaire auto-fill."},"webhook_events":{"type":"array","items":{"type":"string","enum":["*","flow.created","client.created","client.completed","portal.account.created","portal.account.updated","portal.account.deleted","portal.task.created","portal.task.updated","portal.task.completed","portal.task.deleted","portal.message.created","portal.note.created","portal.comment.created","portal.milestone.published","portal.milestone.updated","portal.milestone.completed","portal.milestone.deleted","portal.file.created","portal.file.updated","portal.file.approved","portal.file.deleted","portal.invoice.created","portal.invoice.updated","portal.invoice.paid","portal.invoice.deleted","portal.member.created","portal.member.updated","portal.member.deleted","portal.service.created","portal.service.updated","portal.service.purchased"]},"description":"Concrete event names supported for subscriptions; * is a subscription wildcard."}},"required":["name","version","authentication","base_url","resources","webhook_events"],"additionalProperties":true},"SupportMessageInput":{"type":"object","properties":{"conversation_id":{"type":"string","format":"uuid","description":"Optional existing support conversation UUID."},"idempotency_key":{"type":"string","format":"uuid","description":"UUID required in this body or in the Idempotency-Key header."},"goal":{"type":"string","minLength":1,"maxLength":2400,"description":"What the integrator is trying to accomplish."},"attempted_tool":{"type":"string","maxLength":160,"description":"Tool or operation already attempted, if any."},"issue":{"type":"string","minLength":1,"maxLength":2400,"description":"Problem encountered."},"expected":{"type":"string","maxLength":2400,"description":"Expected behavior, if supplied."},"observed":{"type":"string","maxLength":2400,"description":"Observed behavior, if supplied."},"error_code":{"type":"string","maxLength":120,"description":"Error code received, if any."},"resolution_confirmed":{"type":"boolean","default":false,"description":"Whether a suggested resolution was confirmed."},"request_human_support":{"type":"boolean","default":false,"description":"Email a human escalation report to 360onboard only when explicitly true; false or omitted does not escalate."}},"required":["goal","issue"],"additionalProperties":false},"SupportResult":{"type":"object","description":"Support service result.","properties":{"status":{"type":"string","enum":["processing","completed","rate_limited","retryable_failure"],"description":"Submission outcome: completed, processing, rate_limited, or retryable_failure."},"conversation_id":{"type":"string","format":"uuid","description":"Support conversation identifier."},"turn_id":{"type":"string","format":"uuid","description":"Identifier for this support interaction."},"retry_after_seconds":{"type":"integer","description":"Suggested delay before retry when rate limited."},"human_support":{"type":"object","description":"Present when requested. accepted means the email provider accepted it, not that it was delivered or read.","properties":{"report_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["sending","accepted","failed","unknown","rate_limited","not_recorded","processing"]},"retry_after_seconds":{"type":"integer"},"provider_accepted_at":{"type":["string","null"],"format":"date-time"},"turn_id":{"type":"string","format":"uuid","description":"Turn associated with this escalation, included in conversation-history lookups."}},"required":["status"],"additionalProperties":false},"turn_status":{"type":"string","description":"Underlying support turn status returned by persistence."},"answer":{"type":["string","null"],"description":"Rendered support answer; null while pending or when no answer is available."},"outcome":{"type":["string","null"],"enum":["unconfirmed","resolved","still_blocked",null],"description":"Whether the caller has confirmed a suggested resolution, when available."},"gap_id":{"type":["string","null"],"format":"uuid"},"gap_occurrence_count":{"type":["integer","null"]},"resolution_confirmed":{"type":"boolean"},"claimed":{"type":"boolean"},"replayed":{"type":"boolean"},"retry_with_same_idempotency_key":{"type":"string","format":"uuid"},"message":{"type":"string"},"gap":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"description":"Persisted product-gap metadata when a gap was recorded."}},"additionalProperties":true},"SupportConversation":{"type":"object","properties":{"conversation":{"type":"object","additionalProperties":true,"description":"Conversation metadata."},"turns":{"type":"array","items":{"type":"object","properties":{"human_support":{"oneOf":[{"type":"object","properties":{"turn_id":{"type":"string","format":"uuid"},"report_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["sending","accepted","failed","unknown","rate_limited","not_recorded","processing"]},"retry_after_seconds":{"type":"integer"},"provider_accepted_at":{"type":["string","null"],"format":"date-time"}},"additionalProperties":true},{"type":"null"}]}},"additionalProperties":true},"description":"Conversation messages returned for the support thread."}},"required":["conversation","turns"]},"SupportGaps":{"type":"object","properties":{"gaps":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Known product gaps relevant to the request."}},"required":["gaps"]},"portal_services_PortalServicePayload":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120,"description":"Human-readable title or label for the resource."},"description":{"type":"string","maxLength":5000,"default":"","x-zod-defaulted":true,"description":"Optional longer description shown with the resource."},"features":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":20,"default":[],"x-zod-defaulted":true,"description":"Short list of service features."},"amountCents":{"type":"integer","minimum":1,"maximum":99999999,"description":"Integer amount in ISO minor units. Complete service prices must be at least one major currency unit (JPY 1, USD 100, KWD 1000 minor units); partial updates accept at least 1 and validate against the resulting currency. Online Stripe purchase support depends on connected-account, currency, and amount limits.","example":100},"currency":{"type":"string","enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","ved","ves","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw","zwg"],"description":"ISO currency code accepted by this endpoint.","example":"usd"},"billingType":{"type":"string","enum":["one_time","subscription"],"description":"One-time or recurring billing mode.","example":"one_time"},"recurringInterval":{"anyOf":[{"type":"string","enum":["week","month","year"]},{"type":"null"}],"description":"Interval for recurring billing; null for a one-time offering."},"active":{"type":"boolean","description":"Whether the service is published. False is team-only Draft and clears the client audience.","example":true},"clientAccountIds":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":1000,"x-zod-refined":true},{"type":"null"}],"x-zod-optional":true,"description":"Drafts have no client audience and return null. For active services, null means all clients and a nonempty array selects workspace account UUIDs. Publishing a draft requires an explicit clientAccountIds choice (null for all clients or a nonempty array of workspace account UUIDs); omission returns 400. Unpublishing clears the selection, so choose an audience again before republishing."},"onboardingFlowId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Optional V2 client onboarding flow in this workspace that sells this service through its public Buy Now link; null when unlinked. The flow must be active (not archived) and each flow can sell at most one service. When a client pays that flow's payment step, the service purchase is recorded as paid on the client's portal account, adding the client to the portal without an invite if needed, with the amount and provider reference actually charged, and the service delivery runs once per payment."},"delivery":{"oneOf":[{"type":"object","properties":{"type":{"const":"none","type":"string","description":"Discriminator for the selected payload variant."}},"additionalProperties":false,"required":["type"]},{"type":"object","properties":{"type":{"const":"template","type":"string","description":"Discriminator for the selected payload variant."},"templateId":{"type":"string","format":"uuid","description":"Workspace milestone template UUID.","example":"00000000-0000-4000-8000-000000000001"}},"additionalProperties":false,"required":["type","templateId"]},{"type":"object","properties":{"type":{"const":"playbook","type":"string","description":"Discriminator for the selected payload variant."},"playbookId":{"type":"string","format":"uuid","description":"Playbook UUID in this workspace.","example":"00000000-0000-4000-8000-000000000001"}},"additionalProperties":false,"required":["type","playbookId"]}],"discriminator":{"propertyName":"type"},"default":{"type":"none"},"x-zod-defaulted":true,"description":"Post-payment delivery action; sources must be available in this workspace."}},"additionalProperties":false,"required":["title","amountCents","currency","billingType","recurringInterval","active"],"x-zod-refined":true,"example":{"title":"Brand strategy","amountCents":25000,"currency":"usd","billingType":"one_time","recurringInterval":null,"active":false,"delivery":{"type":"none"}},"allOf":[{"$ref":"#/components/schemas/PortalServiceCurrencyMinimum"},{"if":{"properties":{"active":{"const":false}},"required":["active"]},"then":{"properties":{"clientAccountIds":{"type":"null"}}}}]},"portal_services_PortalServicePatch":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120,"x-zod-optional":true,"description":"Human-readable title or label for the resource."},"description":{"type":"string","maxLength":5000,"default":"","x-zod-defaulted":true,"x-zod-optional":true,"description":"Optional longer description shown with the resource."},"features":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":20,"default":[],"x-zod-defaulted":true,"x-zod-optional":true,"description":"Short list of service features."},"amountCents":{"type":"integer","minimum":1,"maximum":99999999,"x-zod-optional":true,"description":"Integer amount in ISO minor units. Complete service prices must be at least one major currency unit (JPY 1, USD 100, KWD 1000 minor units); partial updates accept at least 1 and validate against the resulting currency. Online Stripe purchase support depends on connected-account, currency, and amount limits.","example":100},"currency":{"type":"string","enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","ved","ves","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw","zwg"],"x-zod-optional":true,"description":"ISO currency code accepted by this endpoint.","example":"usd"},"billingType":{"type":"string","enum":["one_time","subscription"],"x-zod-optional":true,"description":"One-time or recurring billing mode.","example":"one_time"},"recurringInterval":{"anyOf":[{"type":"string","enum":["week","month","year"]},{"type":"null"}],"x-zod-optional":true,"description":"Interval for recurring billing; null for a one-time offering."},"active":{"type":"boolean","x-zod-optional":true,"description":"Whether the service is published. False is team-only Draft and clears the client audience.","example":true},"clientAccountIds":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":1000,"x-zod-refined":true},{"type":"null"}],"x-zod-optional":true,"description":"Drafts have no client audience and return null. For active services, null means all clients and a nonempty array selects workspace account UUIDs. Publishing a draft requires an explicit clientAccountIds choice (null for all clients or a nonempty array of workspace account UUIDs); omission returns 400. Unpublishing clears the selection, so choose an audience again before republishing."},"onboardingFlowId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Optional V2 client onboarding flow in this workspace that sells this service through its public Buy Now link; null when unlinked. The flow must be active (not archived) and each flow can sell at most one service. When a client pays that flow's payment step, the service purchase is recorded as paid on the client's portal account, adding the client to the portal without an invite if needed, with the amount and provider reference actually charged, and the service delivery runs once per payment."},"delivery":{"oneOf":[{"type":"object","properties":{"type":{"const":"none","type":"string","description":"Discriminator for the selected payload variant."}},"additionalProperties":false,"required":["type"]},{"type":"object","properties":{"type":{"const":"template","type":"string","description":"Discriminator for the selected payload variant."},"templateId":{"type":"string","format":"uuid","description":"Workspace milestone template UUID.","example":"00000000-0000-4000-8000-000000000001"}},"additionalProperties":false,"required":["type","templateId"]},{"type":"object","properties":{"type":{"const":"playbook","type":"string","description":"Discriminator for the selected payload variant."},"playbookId":{"type":"string","format":"uuid","description":"Playbook UUID in this workspace.","example":"00000000-0000-4000-8000-000000000001"}},"additionalProperties":false,"required":["type","playbookId"]}],"discriminator":{"propertyName":"type"},"default":{"type":"none"},"x-zod-defaulted":true,"x-zod-optional":true,"description":"Post-payment delivery action; sources must be available in this workspace."},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"required":["expectedRevision"]},"portal_services_PurchasePortalServicePayload":{"type":"object","properties":{"purchaseKey":{"type":"string","format":"uuid","description":"Caller-generated UUID used to safely retry preparation of the same purchase.","example":"00000000-0000-4000-8000-000000000001"},"billingMode":{"type":"string","enum":["subscription","auto_issue"],"x-zod-optional":true,"description":"For eligible recurring services, choose automatic subscription or manual recurring invoices.","example":"subscription"}},"additionalProperties":false,"required":["purchaseKey"],"example":{"purchaseKey":"00000000-0000-4000-8000-000000000001"}},"client_portal_CreatePortalAccountPayload":{"type":"object","properties":{"companyName":{"type":"string","maxLength":200,"description":"Client company or account display name."},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9-]+$","x-zod-optional":true,"description":"Lowercase portal slug containing letters, numbers, and hyphens."},"primaryPersonId":{"type":"string","format":"uuid","x-zod-optional":true,"description":"Existing person UUID to designate as the primary client contact.","example":"00000000-0000-4000-8000-000000000001"},"primaryContact":{"type":"object","properties":{"firstName":{"type":"string","maxLength":120,"x-zod-optional":true,"description":"Member given name."},"lastName":{"type":"string","maxLength":120,"x-zod-optional":true,"description":"Member family name."},"name":{"type":"string","maxLength":240,"x-zod-optional":true,"description":"Human-readable name or display label."},"email":{"type":"string","format":"email","description":"Member email address; used for identity matching and, when requested, invitation delivery.","example":"client@example.test"},"companyName":{"type":"string","maxLength":200,"x-zod-optional":true,"description":"Client company or account display name."},"role":{"type":"string","maxLength":80,"x-zod-optional":true,"description":"Optional portal role label shown for the member."},"sendInvite":{"type":"boolean","x-zod-optional":true,"description":"When true, send the normal portal invitation through the application email flow.","example":true},"resendExisting":{"type":"boolean","x-zod-optional":true,"description":"When true, allow the route to resend an invitation for an existing member when supported.","example":true}},"additionalProperties":false,"required":["email"],"x-zod-optional":true,"description":"Optional portal member to provision as the primary contact."},"status":{"type":"string","enum":["onboarding","active","at_risk"],"x-zod-optional":true,"description":"Workflow status accepted by this resource.","example":"onboarding"},"customFields":{"type":"object","additionalProperties":{},"x-zod-refined":true,"x-zod-optional":true,"description":"Custom field values keyed by the definition UUID; values are checked against the definition type/options."}},"additionalProperties":false,"required":["companyName"],"example":{"companyName":"Acme Studio"}},"client_portal_MilestoneTransitionPayload":{"type":"object","properties":{"action":{"type":"string","enum":["start","submit_finish","approve","request_changes","reopen"],"description":"Milestone workflow action: start, submit_finish, approve, request_changes, or reopen.","example":"start"},"note":{"type":"string","maxLength":2000,"x-zod-optional":true,"description":"Optional note attached to the workflow transition."}},"additionalProperties":false,"required":["action"],"example":{"action":"submit_finish"}},"client_portal_CreateMilestonePayload":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300,"description":"Human-readable title or label for the resource."},"startApprover":{"type":"string","enum":["none","client","agency"],"x-zod-optional":true,"description":"Who must approve or initiate milestone start: none, client, or agency.","example":"none"},"startWho":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Optional person/team assignment for milestone start."},"finishApprover":{"type":"string","enum":["none","client","agency"],"x-zod-optional":true,"description":"Who must approve milestone completion: none, client, or agency.","example":"none"},"finishWho":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Optional person/team assignment for milestone completion."},"startAuto":{"anyOf":[{"type":"object","properties":{"on":{"type":"string","enum":["date","starts","completes"],"description":"Automatic milestone trigger: date, starts, or completes.","example":"date"},"ref":{"type":"string","x-zod-optional":true,"description":"Referenced milestone ID for starts/completes triggers."},"date":{"type":"string","x-zod-optional":true,"description":"Date value used by an automatic trigger."}},"additionalProperties":false,"required":["on"]},{"type":"null"}],"x-zod-optional":true,"description":"Automatic start rule tied to a date or another milestone event."},"finishAuto":{"anyOf":[{"type":"object","properties":{"on":{"type":"string","enum":["date","starts","completes"],"description":"Automatic milestone trigger: date, starts, or completes.","example":"date"},"ref":{"type":"string","x-zod-optional":true,"description":"Referenced milestone ID for starts/completes triggers."},"date":{"type":"string","x-zod-optional":true,"description":"Date value used by an automatic trigger."}},"additionalProperties":false,"required":["on"]},{"type":"null"}],"x-zod-optional":true,"description":"Automatic completion rule tied to a date or another milestone event."},"changesGate":{"anyOf":[{"type":"string","enum":["start","finish"]},{"type":"null"}],"x-zod-optional":true,"description":"Controls whether staged changes wait for the configured approval gate."},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Milestone start date (ISO). Until this moment passes the client cannot see the milestone or its tasks and files; send the start of the day in the agency time zone. Null shows it right away."},"targetDate":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Target completion date in ISO date format."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept."},"cover":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["color","image","video"],"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema.","example":"color"},"color":{"type":"string","x-zod-optional":true,"description":"Supported visual color name for a custom task option."},"pattern":{"type":"string","x-zod-optional":true,"description":"Visual pattern name for the milestone cover."},"image":{"type":"string","x-zod-optional":true,"description":"Image URL or stored cover image reference."},"video":{"type":"string","x-zod-optional":true,"description":"Video URL or stored cover video reference."},"textHidden":{"type":"boolean","x-zod-optional":true,"description":"Whether to hide title text over the cover.","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"x-zod-optional":true,"description":"Visual cover position or focal point.","example":"center"},"font":{"type":"string","x-zod-optional":true,"description":"Cover title font choice."},"size":{"anyOf":[{"type":"number"},{"type":"string"}],"x-zod-optional":true,"description":"File size in bytes."}},"additionalProperties":false,"required":["kind"]},{"type":"null"}],"x-zod-optional":true,"description":"Milestone cover presentation settings."},"position":{"type":"integer","x-zod-optional":true,"description":"Display order within its workspace/account list.","example":1}},"additionalProperties":false,"required":["title"],"example":{"title":"Kickoff"}},"client_portal_UpdateMilestonePayload":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300,"x-zod-optional":true,"description":"Human-readable title or label for the resource."},"startApprover":{"type":"string","enum":["none","client","agency"],"x-zod-optional":true,"description":"Who must approve or initiate milestone start: none, client, or agency.","example":"none"},"startWho":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Optional person/team assignment for milestone start."},"finishApprover":{"type":"string","enum":["none","client","agency"],"x-zod-optional":true,"description":"Who must approve milestone completion: none, client, or agency.","example":"none"},"finishWho":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Optional person/team assignment for milestone completion."},"startAuto":{"anyOf":[{"type":"object","properties":{"on":{"type":"string","enum":["date","starts","completes"],"description":"Automatic milestone trigger: date, starts, or completes.","example":"date"},"ref":{"type":"string","x-zod-optional":true,"description":"Referenced milestone ID for starts/completes triggers."},"date":{"type":"string","x-zod-optional":true,"description":"Date value used by an automatic trigger."}},"additionalProperties":false,"required":["on"]},{"type":"null"}],"x-zod-optional":true,"description":"Automatic start rule tied to a date or another milestone event."},"finishAuto":{"anyOf":[{"type":"object","properties":{"on":{"type":"string","enum":["date","starts","completes"],"description":"Automatic milestone trigger: date, starts, or completes.","example":"date"},"ref":{"type":"string","x-zod-optional":true,"description":"Referenced milestone ID for starts/completes triggers."},"date":{"type":"string","x-zod-optional":true,"description":"Date value used by an automatic trigger."}},"additionalProperties":false,"required":["on"]},{"type":"null"}],"x-zod-optional":true,"description":"Automatic completion rule tied to a date or another milestone event."},"changesGate":{"anyOf":[{"type":"string","enum":["start","finish"]},{"type":"null"}],"x-zod-optional":true,"description":"Controls whether staged changes wait for the configured approval gate."},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Milestone start date (ISO). Until this moment passes the client cannot see the milestone or its tasks and files; send the start of the day in the agency time zone. Null shows it right away."},"targetDate":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Target completion date in ISO date format."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept."},"cover":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["color","image","video"],"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema.","example":"color"},"color":{"type":"string","x-zod-optional":true,"description":"Supported visual color name for a custom task option."},"pattern":{"type":"string","x-zod-optional":true,"description":"Visual pattern name for the milestone cover."},"image":{"type":"string","x-zod-optional":true,"description":"Image URL or stored cover image reference."},"video":{"type":"string","x-zod-optional":true,"description":"Video URL or stored cover video reference."},"textHidden":{"type":"boolean","x-zod-optional":true,"description":"Whether to hide title text over the cover.","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"x-zod-optional":true,"description":"Visual cover position or focal point.","example":"center"},"font":{"type":"string","x-zod-optional":true,"description":"Cover title font choice."},"size":{"anyOf":[{"type":"number"},{"type":"string"}],"x-zod-optional":true,"description":"File size in bytes."}},"additionalProperties":false,"required":["kind"]},{"type":"null"}],"x-zod-optional":true,"description":"Milestone cover presentation settings."},"position":{"type":"integer","x-zod-optional":true,"description":"Display order within its workspace/account list.","example":1},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"example":{},"required":["expectedRevision"]},"client_portal_UpdatePortalAccountPayload":{"type":"object","properties":{"companyName":{"type":"string","maxLength":200,"x-zod-optional":true,"description":"Client company or account display name."},"slug":{"anyOf":[{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9-]+$"},{"type":"null"}],"x-zod-optional":true,"description":"Lowercase portal slug containing letters, numbers, and hyphens."},"primaryPersonId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Existing person UUID to designate as the primary client contact."},"status":{"type":"string","enum":["onboarding","active","at_risk"],"x-zod-optional":true,"description":"Workflow status accepted by this resource.","example":"onboarding"},"avatarUrl":{"anyOf":[{"type":"string","format":"uri","maxLength":2048},{"type":"null"}],"x-zod-optional":true,"description":"Optional URL for the client account avatar."},"customFields":{"type":"object","additionalProperties":{},"x-zod-refined":true,"x-zod-optional":true,"description":"Custom field values keyed by the definition UUID; values are checked against the definition type/options."},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"example":{},"required":["expectedRevision"]},"portal_misc_CreatePortalCommentPayload":{"type":"object","properties":{"targetType":{"type":"string","enum":["file","task","file_group","milestone","onboarding"],"description":"Type of resource the comment or activity filter targets.","example":"file"},"targetId":{"type":"string","format":"uuid","description":"UUID of the resource being commented on or filtered.","example":"00000000-0000-4000-8000-000000000001"},"body":{"type":"string","minLength":1,"maxLength":4000,"description":"Comment or message text."},"internal":{"type":"boolean","x-zod-optional":true,"description":"When true, this comment/note is agency-only.","example":true},"parentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Parent comment UUID in this account comment thread; null starts a top-level thread."},"clientRequestId":{"type":"string","format":"uuid","x-zod-optional":true,"description":"Caller-generated UUID to deduplicate a client comment submission.","example":"00000000-0000-4000-8000-000000000001"},"annotation":{"type":"object","properties":{"surface":{"type":"string","enum":["website","image","pdf","video","audio"],"description":"Annotation surface: website, image, PDF, video, or audio.","example":"website"},"versionNumber":{"type":"integer","minimum":1,"description":"File version number this annotation references.","example":1},"pinNumber":{"type":"integer","minimum":1,"x-zod-optional":true,"description":"Optional pin index within the referenced version.","example":1},"x":{"type":"number","minimum":0,"maximum":100,"x-zod-optional":true,"description":"Horizontal percentage coordinate on the review surface, from 0 to 100.","example":0},"y":{"type":"number","minimum":0,"maximum":100,"x-zod-optional":true,"description":"Vertical percentage coordinate on the review surface, from 0 to 100.","example":0},"pageUrl":{"type":"string","maxLength":4000,"x-zod-optional":true,"description":"Page URL associated with a website annotation."},"pageNumber":{"type":"integer","minimum":1,"x-zod-optional":true,"description":"One-based PDF/document page number.","example":1},"startSeconds":{"type":"number","minimum":0,"x-zod-optional":true,"description":"Media annotation start time in seconds.","example":0},"endSeconds":{"type":"number","minimum":0,"x-zod-optional":true,"description":"Media annotation end time in seconds.","example":0},"drawing":{"type":"string","maxLength":24000,"x-zod-optional":true,"description":"Serialized review drawing/markup data."}},"additionalProperties":false,"required":["surface","versionNumber"],"x-zod-refined":true,"x-zod-optional":true,"description":"Review annotation context, including the surface/version and any spatial or time anchor."},"fileVersionNumber":{"type":"integer","minimum":0,"x-zod-optional":true,"description":"Positive file version number associated with this comment.","example":0}},"additionalProperties":false,"required":["targetType","targetId","body"],"example":{"targetType":"file","targetId":"00000000-0000-4000-8000-000000000001","body":"The first draft is ready for review."}},"portal_misc_ResolvePortalCommentPayload":{"type":"object","properties":{"targetType":{"type":"string","enum":["file","task","file_group","milestone","onboarding"],"description":"Type of resource the comment or activity filter targets.","example":"file"},"targetId":{"type":"string","format":"uuid","description":"UUID of the resource being commented on or filtered.","example":"00000000-0000-4000-8000-000000000001"},"commentId":{"type":"string","format":"uuid","description":"Comment UUID to resolve or update.","example":"00000000-0000-4000-8000-000000000001"},"resolved":{"type":"boolean","description":"Whether the review/comment thread is resolved.","example":true}},"additionalProperties":false,"required":["targetType","targetId","commentId","resolved"],"example":{"targetType":"file","targetId":"00000000-0000-4000-8000-000000000001","commentId":"00000000-0000-4000-8000-000000000001","resolved":true}},"portal_misc_PortalConfigPayload":{"type":"object","properties":{"sidebar":{"anyOf":[{"type":"object","properties":{"sections":{"type":"array","maxItems":30,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","maxLength":40}},"required":["id","label"],"additionalProperties":{}},"description":"Agency-placed sidebar sections. Each section id is positioned in sidebar.order alongside page ids and quick link ids. A section with a label renders as a heading; an empty label renders as a divider. Section ids must be unique. Sections are never clickable and never count as pages."}},"additionalProperties":{}},{"type":"null"}],"x-zod-optional":true,"description":"Portal sidebar navigation configuration: order (page, quick link and section ids), labels, hidden, links, and optional sections. A portal with no saved sidebar shows the default grouping (Overview, Activity, then Project and Billing sections); a saved sidebar without sections renders ungrouped."},"home":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"x-zod-optional":true,"description":"Portal homepage block layout/configuration."},"theme":{"anyOf":[{"type":"object","additionalProperties":{},"x-zod-refined":true},{"type":"null"}],"x-zod-optional":true,"description":"Portal visual theme configuration. Light-mode rendering defaults use Ink Blue #172B50 for primary accents/sidebar, #F7F6F3 for the reference page background, and white cards. Dark-mode defaults retain the existing palette. Explicit saved workspace/client colors override these defaults."},"login":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"x-zod-optional":true,"description":"Portal sign-in configuration."},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"example":{},"required":["expectedRevision"]},"portal_misc_CreatePortalNotePayload":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":8000,"description":"Comment or message text."},"pinned":{"type":"boolean","x-zod-optional":true,"description":"Whether an internal account note should remain pinned.","example":true},"tag":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"x-zod-optional":true,"description":"Optional note category label."}},"additionalProperties":false,"required":["body"],"example":{"body":"The first draft is ready for review."}},"portal_misc_UpdatePortalNotePayload":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":8000,"x-zod-optional":true,"description":"Comment or message text."},"pinned":{"type":"boolean","x-zod-optional":true,"description":"Whether an internal account note should remain pinned.","example":true},"tag":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"x-zod-optional":true,"description":"Optional note category label."},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original updatedAt from the full item read, preserving fractional precision and timezone offset. Null is invalid for this existing item. Do not use a collection metadata token."}},"additionalProperties":false,"example":{"body":"Confirm the updated kickoff date.","expectedRevision":"2026-10-19T01:00:00.123456Z"},"required":["expectedRevision"]},"portal_files_CreatePortalFileGroupPayload":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Human-readable name or display label."},"purpose":{"type":"string","x-zod-optional":true,"description":"File purpose: upload, contract, deliverable, or resource."},"access":{"anyOf":[{"oneOf":[{"type":"object","properties":{"mode":{"const":"all","type":"string","description":"Access mode: all, team, or specific."}},"additionalProperties":false,"required":["mode"]},{"type":"object","properties":{"mode":{"const":"team","type":"string","description":"Access mode: all, team, or specific."}},"additionalProperties":false,"required":["mode"]},{"type":"object","properties":{"mode":{"const":"specific","type":"string","description":"Access mode: all, team, or specific."},"companies":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":500,"x-zod-optional":true,"description":"Company/account labels explicitly included in a specific access list."},"people":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":1000,"x-zod-optional":true,"description":"Person labels explicitly included in a specific access list."},"accountIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":500,"x-zod-optional":true,"description":"Client account UUIDs allowed by this specific access assignment."},"personIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000,"x-zod-optional":true,"description":"Person UUIDs allowed by this specific access assignment."}},"additionalProperties":false,"required":["mode"]}],"discriminator":{"propertyName":"mode"}},{"type":"null"}],"x-zod-optional":true,"description":"Access rule: all clients, workspace team only, or selected account/person IDs."},"position":{"type":"integer","x-zod-optional":true,"description":"Display order within its workspace/account list.","example":1}},"additionalProperties":false,"required":["name"],"example":{"name":"Example resource"}},"portal_files_CreatePortalFilePayload":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300,"description":"Human-readable name or display label."},"groupId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"File group UUID in the same workspace and applicable client account."},"purpose":{"type":"string","enum":["upload","contract","deliverable","resource"],"x-zod-optional":true,"description":"File purpose: upload, contract, deliverable, or resource.","example":"upload"},"fmt":{"anyOf":[{"type":"string","enum":["pdf","img","doc","sheet","zip","video","audio","link"]},{"type":"null"}],"x-zod-optional":true,"description":"File format classification."},"kind":{"anyOf":[{"type":"string","enum":["video","audio","embed","doc","sheet","pdf","image","file","link"]},{"type":"null"}],"x-zod-optional":true,"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema."},"storagePath":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Storage object path; upload path attribution is server-controlled where relevant."},"thumbnailPath":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Storage path for a thumbnail associated with the file."},"mimeType":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"x-zod-optional":true,"description":"MIME type of the uploaded or linked file."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"External URL or file link accepted by this endpoint."},"embedFrom":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Provider/source used to embed the linked content."},"size":{"anyOf":[{"type":"number"},{"type":"null"}],"x-zod-optional":true,"description":"File size in bytes."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept."},"approval":{"anyOf":[{"type":"string","enum":["pending","approved","changes"]},{"type":"null"}],"x-zod-optional":true,"description":"Client review state for a deliverable."},"contractState":{"anyOf":[{"type":"string","enum":["draft","sent","signed"]},{"type":"null"}],"x-zod-optional":true,"description":"Signature workflow state for a contract."},"lock":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"x-zod-optional":true,"description":"When true, lock editing/review actions supported by this file."},"access":{"anyOf":[{"oneOf":[{"type":"object","properties":{"mode":{"const":"all","type":"string","description":"Access mode: all, team, or specific."}},"additionalProperties":false,"required":["mode"]},{"type":"object","properties":{"mode":{"const":"team","type":"string","description":"Access mode: all, team, or specific."}},"additionalProperties":false,"required":["mode"]},{"type":"object","properties":{"mode":{"const":"specific","type":"string","description":"Access mode: all, team, or specific."},"companies":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":500,"x-zod-optional":true,"description":"Company/account labels explicitly included in a specific access list."},"people":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":1000,"x-zod-optional":true,"description":"Person labels explicitly included in a specific access list."},"accountIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":500,"x-zod-optional":true,"description":"Client account UUIDs allowed by this specific access assignment."},"personIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000,"x-zod-optional":true,"description":"Person UUIDs allowed by this specific access assignment."}},"additionalProperties":false,"required":["mode"]}],"discriminator":{"propertyName":"mode"}},{"type":"null"}],"x-zod-optional":true,"description":"Access rule: all clients, workspace team only, or selected account/person IDs."},"versions":{"anyOf":[{"type":"array","items":{}},{"type":"null"}],"x-zod-optional":true,"description":"Version metadata associated with this file."},"customFields":{"type":"object","additionalProperties":{},"x-zod-refined":true,"x-zod-optional":true,"description":"Custom field values keyed by the definition UUID; values are checked against the definition type/options."},"isLibrary":{"type":"boolean","x-zod-optional":true,"description":"Whether the item is managed as a shared library resource.","example":true},"position":{"type":"integer","x-zod-optional":true,"description":"Display order within its workspace/account list.","example":1}},"additionalProperties":false,"required":["name"],"example":{"name":"Example resource"}},"portal_files_UpdatePortalFilePayload":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300,"x-zod-optional":true,"description":"Human-readable name or display label."},"groupId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"File group UUID in the same workspace and applicable client account."},"purpose":{"type":"string","enum":["upload","contract","deliverable","resource"],"x-zod-optional":true,"description":"File purpose: upload, contract, deliverable, or resource.","example":"upload"},"fmt":{"anyOf":[{"type":"string","enum":["pdf","img","doc","sheet","zip","video","audio","link"]},{"type":"null"}],"x-zod-optional":true,"description":"File format classification."},"kind":{"anyOf":[{"type":"string","enum":["video","audio","embed","doc","sheet","pdf","image","file","link"]},{"type":"null"}],"x-zod-optional":true,"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema."},"storagePath":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Storage object path; upload path attribution is server-controlled where relevant."},"thumbnailPath":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Storage path for a thumbnail associated with the file."},"mimeType":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"x-zod-optional":true,"description":"MIME type of the uploaded or linked file."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"External URL or file link accepted by this endpoint."},"embedFrom":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Provider/source used to embed the linked content."},"size":{"anyOf":[{"type":"number"},{"type":"null"}],"x-zod-optional":true,"description":"File size in bytes."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept."},"approval":{"anyOf":[{"type":"string","enum":["pending","approved","changes"]},{"type":"null"}],"x-zod-optional":true,"description":"Client review state for a deliverable."},"contractState":{"anyOf":[{"type":"string","enum":["draft","sent","signed"]},{"type":"null"}],"x-zod-optional":true,"description":"Signature workflow state for a contract."},"lock":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"x-zod-optional":true,"description":"When true, lock editing/review actions supported by this file."},"access":{"anyOf":[{"oneOf":[{"type":"object","properties":{"mode":{"const":"all","type":"string","description":"Access mode: all, team, or specific."}},"additionalProperties":false,"required":["mode"]},{"type":"object","properties":{"mode":{"const":"team","type":"string","description":"Access mode: all, team, or specific."}},"additionalProperties":false,"required":["mode"]},{"type":"object","properties":{"mode":{"const":"specific","type":"string","description":"Access mode: all, team, or specific."},"companies":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":500,"x-zod-optional":true,"description":"Company/account labels explicitly included in a specific access list."},"people":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":1000,"x-zod-optional":true,"description":"Person labels explicitly included in a specific access list."},"accountIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":500,"x-zod-optional":true,"description":"Client account UUIDs allowed by this specific access assignment."},"personIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000,"x-zod-optional":true,"description":"Person UUIDs allowed by this specific access assignment."}},"additionalProperties":false,"required":["mode"]}],"discriminator":{"propertyName":"mode"}},{"type":"null"}],"x-zod-optional":true,"description":"Access rule: all clients, workspace team only, or selected account/person IDs."},"versions":{"anyOf":[{"type":"array","items":{}},{"type":"null"}],"x-zod-optional":true,"description":"Version metadata associated with this file."},"customFields":{"type":"object","additionalProperties":{},"x-zod-refined":true,"x-zod-optional":true,"description":"Custom field values keyed by the definition UUID; values are checked against the definition type/options."},"isLibrary":{"type":"boolean","x-zod-optional":true,"description":"Whether the item is managed as a shared library resource.","example":true},"position":{"type":"integer","x-zod-optional":true,"description":"Display order within its workspace/account list.","example":1},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"example":{},"required":["expectedRevision"]},"portal_invoices_CreatePortalInvoicePayload":{"type":"object","properties":{"number":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Invoice number or display identifier."},"currency":{"type":"string","enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","ved","ves","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw","zwg"],"x-zod-optional":true,"description":"ISO currency code accepted by this endpoint."},"status":{"type":"string","enum":["sent","out","over","draft"],"x-zod-optional":true,"description":"Create accepts draft, sent, out, or over; it cannot create a paid invoice. Updates cannot settle an unpaid invoice, reopen a paid invoice, or reprice a paid invoice. Use the dedicated payment operation to record an external receipt.","example":"sent"},"issuedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Invoice issue timestamp."},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Invoice due timestamp in ISO 8601 form."},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Invoice memo shown to the client."},"billTo":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"x-zod-optional":true,"description":"Billing recipient display text."},"items":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"n":{"type":"string","description":"Invoice line item name."},"q":{"type":"number","description":"Invoice line item quantity.","example":1},"u":{"type":"number","description":"Invoice line item unit amount.","example":1}},"additionalProperties":false,"required":["n","q","u"]}},{"type":"null"}],"x-zod-optional":true,"description":"Invoice line items; each item has a name, quantity, and unit amount."},"taxName":{"anyOf":[{"type":"string","minLength":1,"maxLength":80,"x-zod-refined":true},{"type":"null"}],"x-zod-optional":true,"description":"Display name for the agency-supplied tax; provide this together with taxRate."},"taxRate":{"anyOf":[{"type":"number","minimum":0.0001,"maximum":100},{"type":"null"}],"x-zod-optional":true,"description":"Tax rate percentage; the server computes the tax-inclusive total."},"billingType":{"type":"string","enum":["one_time","auto_issue","subscription"],"x-zod-optional":true,"description":"One-time or recurring billing mode.","example":"one_time"},"recurringInterval":{"anyOf":[{"type":"string","enum":["week","month","year"]},{"type":"null"}],"x-zod-optional":true,"description":"Interval for recurring billing; null for a one-time offering."},"amount":{"type":"number","description":"Pre-tax invoice subtotal in major currency units; the server adds configured tax and rounds the tax-inclusive total to the currency supported precision.","example":1},"paymentMethods":{"type":"array","items":{"type":"string","enum":["stripe","external"]},"minItems":1,"maxItems":2,"uniqueItems":true,"description":"Allowed payment methods. Defaults to stripe and external when Stripe Connect is enabled, otherwise external only. Subscriptions require stripe. Legacy null values are resolved from the workspace connection and any existing Stripe attempt.","example":["external"]},"externalPaymentUrl":{"anyOf":[{"type":"string","format":"uri","maxLength":2048},{"type":"null"}],"description":"Optional external payment URL. Trimmed and normalized; HTTP or HTTPS only, with characters supported by invoice PDFs. Null clears it.","example":"https://payments.example.test/invoice/INV-1042"},"externalPaymentInstructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"description":"Optional trimmed external-payment instructions using characters supported by invoice PDFs. Null clears them.","example":"Send payment by bank transfer and include INV-1042 as the reference."}},"additionalProperties":false,"required":["amount"],"x-zod-refined":true,"example":{"amount":250},"description":" Payment timestamps and references are read-only here. Record an external receipt through the dedicated /payment operation."},"portal_invoices_UpdatePortalInvoicePayload":{"type":"object","properties":{"number":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Invoice number or display identifier."},"currency":{"type":"string","enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","ved","ves","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw","zwg"],"x-zod-optional":true,"description":"ISO currency code accepted by this endpoint."},"status":{"type":"string","enum":["paid","sent","out","over","draft"],"x-zod-optional":true,"description":"Create accepts draft, sent, out, or over; it cannot create a paid invoice. Updates cannot settle an unpaid invoice, reopen a paid invoice, or reprice a paid invoice. Use the dedicated payment operation to record an external receipt.","example":"sent"},"issuedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Invoice issue timestamp."},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Invoice due timestamp in ISO 8601 form."},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Invoice memo shown to the client."},"billTo":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"x-zod-optional":true,"description":"Billing recipient display text."},"items":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"n":{"type":"string","description":"Invoice line item name."},"q":{"type":"number","description":"Invoice line item quantity.","example":1},"u":{"type":"number","description":"Invoice line item unit amount.","example":1}},"additionalProperties":false,"required":["n","q","u"]}},{"type":"null"}],"x-zod-optional":true,"description":"Invoice line items; each item has a name, quantity, and unit amount."},"taxName":{"anyOf":[{"type":"string","minLength":1,"maxLength":80,"x-zod-refined":true},{"type":"null"}],"x-zod-optional":true,"description":"Display name for the agency-supplied tax; provide this together with taxRate."},"taxRate":{"anyOf":[{"type":"number","minimum":0.0001,"maximum":100},{"type":"null"}],"x-zod-optional":true,"description":"Tax rate percentage; the server computes the tax-inclusive total."},"billingType":{"type":"string","enum":["one_time","auto_issue","subscription"],"x-zod-optional":true,"description":"One-time or recurring billing mode.","example":"one_time"},"recurringInterval":{"anyOf":[{"type":"string","enum":["week","month","year"]},{"type":"null"}],"x-zod-optional":true,"description":"Interval for recurring billing; null for a one-time offering."},"amount":{"type":"number","description":"Pre-tax invoice subtotal in major currency units; the server adds configured tax and rounds the tax-inclusive total to the currency supported precision.","x-zod-optional":true,"example":1},"paymentMethods":{"type":"array","items":{"type":"string","enum":["stripe","external"]},"minItems":1,"maxItems":2,"uniqueItems":true,"description":"Allowed payment methods. Defaults to stripe and external when Stripe Connect is enabled, otherwise external only. Subscriptions require stripe. Legacy null values are resolved from the workspace connection and any existing Stripe attempt.","example":["external"]},"externalPaymentUrl":{"anyOf":[{"type":"string","format":"uri","maxLength":2048},{"type":"null"}],"description":"Optional external payment URL. Trimmed and normalized; HTTP or HTTPS only, with characters supported by invoice PDFs. Null clears it.","example":"https://payments.example.test/invoice/INV-1042"},"externalPaymentInstructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"description":"Optional trimmed external-payment instructions using characters supported by invoice PDFs. Null clears them.","example":"Send payment by bank transfer and include INV-1042 as the reference."},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"x-zod-refined":true,"example":{"memo":"Updated scope","expectedRevision":"2026-10-14T12:00:00.000Z"},"description":" Payment timestamps and references are read-only here. Record an external receipt through the dedicated /payment operation.","required":["expectedRevision"]},"portal_members_CreatePortalMemberPayload":{"type":"object","properties":{"firstName":{"type":"string","maxLength":120,"x-zod-optional":true,"description":"Member given name."},"lastName":{"type":"string","maxLength":120,"x-zod-optional":true,"description":"Member family name."},"name":{"type":"string","maxLength":240,"x-zod-optional":true,"description":"Human-readable name or display label."},"email":{"type":"string","format":"email","description":"Member email address; used for identity matching and, when requested, invitation delivery.","example":"client@example.test"},"companyName":{"type":"string","maxLength":200,"x-zod-optional":true,"description":"Client company or account display name."},"role":{"type":"string","maxLength":80,"x-zod-optional":true,"description":"Optional portal role label shown for the member."},"sendInvite":{"type":"boolean","x-zod-optional":true,"description":"When true, send the normal portal invitation through the application email flow.","example":true},"resendExisting":{"type":"boolean","x-zod-optional":true,"description":"When true, allow the route to resend an invitation for an existing member when supported.","example":true}},"additionalProperties":false,"required":["email"],"example":{"email":"client@example.test"}},"portal_messages_CreatePortalMessagePayload":{"type":"object","properties":{"clientMessageId":{"type":"string","format":"uuid","description":"Stable caller-generated message operation ID. Reuse with the exact payload for unknown-outcome retries. Without it, the server generates an ID and message-level retry identity is unavailable."},"body":{"type":"string","default":"","x-zod-defaulted":true,"description":"Comment or message text."},"subject":{"type":["string","null"],"maxLength":300,"x-zod-optional":true,"description":"Optional email subject for an agency message that starts a thread (ignored for notes, thread replies, and client senders). When the workspace has Gmail or Outlook connected, the message is also sent as a new email from that mailbox to the client people in the conversation, who then get no separate new-message notification; replies in its thread continue the email thread. Without a connected mailbox, the subject is saved and shown and the usual notification is sent."},"kind":{"type":"string","enum":["message","note"],"x-zod-optional":true,"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema.","example":"message"},"replyTo":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Parent message UUID in the same client account."},"mentions":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["file","task","invoice","flow","service","milestone","onboarding"],"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema.","example":"file"},"id":{"type":"string","minLength":1,"maxLength":1000,"description":"Unique identifier of the related resource."},"label":{"type":"string","description":"Human-readable custom field or option label."},"icon":{"type":"string","x-zod-optional":true,"description":"Optional icon token for a mention display."},"href":{"type":"string","x-zod-optional":true,"description":"Optional link associated with a resource mention."}},"additionalProperties":false,"required":["kind","id","label"],"x-zod-refined":true},"maxItems":30},{"type":"null"}],"x-zod-optional":true,"x-zod-transform":true,"description":"Resource mentions; target IDs must belong to the same client account and labels are canonicalized server-side."},"attachments":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Human-readable name or display label."},"url":{"type":"string","minLength":1,"description":"External URL or file link accepted by this endpoint."},"size":{"type":"number","minimum":0,"description":"File size in bytes.","example":0},"type":{"type":"string","description":"Discriminator for the selected payload variant."},"storage":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Storage backend or attachment origin identifier."},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"External provider name for an attachment."},"externalFileId":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"File ID assigned by an external storage provider."},"storagePath":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Storage object path; upload path attribution is server-controlled where relevant."},"durationMs":{"anyOf":[{"type":"number","minimum":0,"maximum":86400000},{"type":"null"}],"x-zod-optional":true,"description":"Media duration in milliseconds."},"mediaToken":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Short-lived media access token when the attachment type requires one."},"storageConnectionId":{"type":["string","null"],"format":"uuid","description":"Original workspace storage connection returned by the attachment upload or storage browser. Preserve it with the attachment; never substitute the currently preferred connection.","x-zod-optional":true}},"additionalProperties":false,"required":["name","url","size","type"]}},{"type":"null"}],"x-zod-optional":true,"description":"Message attachment metadata or references."},"expectedContextRevision":{"type":["string","null"],"format":"uuid","description":"Required at runtime for an agency client-visible reply. Use revisions.contextRevision from the full content read before composing, not a metadata token. Internal notes and genuinely new conversations have no prior reply-context requirement."}},"additionalProperties":false,"x-zod-refined":true,"example":{"body":"","mentions":[{"kind":"file","id":"x","label":"In progress"}]}},"PortalConversationGroupAccess":{"type":"object","required":["on"],"properties":{"on":{"type":"boolean","description":"Whether this group can see the conversation."},"canReply":{"type":"boolean","default":false,"description":"Whether this group can reply as well as read."},"notify":{"type":"boolean","default":false,"description":"Whether this group is notified of new messages."}},"additionalProperties":false},"PortalConversationAccess":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/PortalConversationGroupAccess","description":"The agency team: teammates with access to this client."},"client":{"$ref":"#/components/schemas/PortalConversationGroupAccess","description":"Everyone else at the client company."}},"additionalProperties":false,"description":"Who besides the named people can see a conversation."},"portal_messages_CreatePortalConversationPayload":{"type":"object","properties":{"participantIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":25,"description":"Person/member UUIDs to include in this conversation; they must be selectable within the workspace/client context."},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"x-zod-optional":true,"description":"Human-readable title or label for the resource."},"sharedWithCompany":{"type":"boolean","description":"Older switch: true also lets everyone else at the client company read and reply, without notifications."},"access":{"$ref":"#/components/schemas/PortalConversationAccess","description":"Who else can see it. New agency conversations start with both groups off."},"staffUserIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":25,"description":"Other agency teammates to name in the conversation. The sender is always named."},"message":{"$ref":"#/components/schemas/portal_messages_CreatePortalMessagePayload"}},"additionalProperties":false,"required":["participantIds","message"],"example":{"participantIds":["00000000-0000-4000-8000-000000000001"],"message":{"body":"","mentions":[{"kind":"file","id":"x","label":"In progress"}]}}},"portal_tasks_CreatePortalTaskPayload":{"type":"object","properties":{"milestoneId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Milestone UUID in the same client account."},"parentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Parent task UUID in the same workspace/client account; null clears the relationship."},"title":{"type":"string","minLength":1,"maxLength":300,"description":"Human-readable title or label for the resource."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept. A line holding only [file: name] shows that attached file in place; the name must exactly match an attachments[].name on the same task, so send the attachment in the same call. A file attached with addedIn: description leaves the task, and is deleted from Files, once no description or comment line shows it. A YouTube, Vimeo, Loom, Wistia, Figma, Notion, Google Docs or Sheets, Calendly or Cal.com link alone on its own line shows as an embedded card; a [text](url) link stays a link."},"status":{"type":"string","enum":["todo","in_progress","in_review","done"],"x-zod-optional":true,"description":"Workflow status accepted by this resource.","example":"todo"},"statusOptionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Active workspace task status option UUID; its base status is canonicalized by the server."},"priority":{"type":"string","enum":["urgent","high","medium","low","none"],"x-zod-optional":true,"description":"Task priority using the built-in priority values.","example":"urgent"},"priorityOptionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Active workspace task priority option UUID; its base priority is canonicalized by the server."},"assigneeType":{"anyOf":[{"type":"string","enum":["agency","client"]},{"type":"null"}],"x-zod-optional":true,"description":"Whether the task is assigned to an agency or client participant."},"assigneeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Selectable member/person UUID in this workspace and account."},"assigneeName":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Display name; when a selectable assignee is supplied, the server canonicalizes this value."},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Task due timestamp in ISO 8601 form."},"startAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Start timestamp in ISO 8601 format."},"dependsOn":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Optional single predecessor task UUID that this task depends on."},"repeat":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"x-zod-refined":true,"description":"Repeat schedule configuration for recurring task occurrences. Strings starting portal-repeat:v1: create a new task for each occurrence. Each copy is created on its scheduled date, not before. Task reads (agency and client) include recurrenceExpired: true and recurrenceExpiresAt for a client-assigned copy set to missedOccurrencePolicy expire that was not done before its next occurrence; treat it as closed, not open or overdue."},"flowId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Workspace flow UUID assignable to this client account."},"flowSend":{"anyOf":[{"type":"string","enum":["now","date","after"]},{"type":"null"}],"x-zod-optional":true,"description":"When to send the assigned flow: now, on a date, or after its configured trigger."},"flowSendDate":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Scheduled flow send timestamp when flowSend is date."},"flowDone":{"anyOf":[{"type":"string","enum":["review","done"]},{"type":"null"}],"x-zod-optional":true,"description":"Whether a completed flow should move this task to review or done."},"attachments":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable name or display label."},"size":{"type":"number","description":"File size in bytes.","example":1},"url":{"type":"string","format":"uri","x-zod-optional":true,"description":"External URL or file link accepted by this endpoint.","example":"https://example.test/resource"},"portalFileId":{"type":"string","format":"uuid","x-zod-optional":true,"description":"Existing portal file UUID to reference as an attachment.","example":"00000000-0000-4000-8000-000000000001"},"storagePath":{"type":"string","x-zod-optional":true,"description":"Storage object path; upload path attribution is server-controlled where relevant."},"type":{"type":"string","x-zod-optional":true,"description":"Discriminator for the selected payload variant."},"addedIn":{"type":"string","enum":["description","task"],"x-zod-optional":true,"description":"Where the file came from. description: added in the task's description; it leaves the task once no description or comment line shows it, though the call that adds it keeps it. A file uploaded in the app's task window comes back when its line and attachment are sent back right away. task: made for this task. A client file of either kind is deleted from Files, with its comments, once it leaves the task, unless another task still uses it; a workspace library file is only unlinked. Leave it out for a file attached from Files; removing that one only unlinks it."}},"additionalProperties":false,"required":["name","size"]}},{"type":"null"}],"x-zod-optional":true,"description":"Message attachment metadata or references."},"customFields":{"type":"object","additionalProperties":{},"x-zod-refined":true,"x-zod-optional":true,"description":"Custom field values keyed by the definition UUID; values are checked against the definition type/options."},"position":{"type":"integer","x-zod-optional":true,"description":"Display order within its workspace/account list.","example":1}},"additionalProperties":false,"required":["title","repeat"],"example":{"title":"Kickoff","repeat":"example"}},"portal_tasks_UpdatePortalTaskPayload":{"type":"object","properties":{"milestoneId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Milestone UUID in the same client account."},"parentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Parent task UUID in the same workspace/client account; null clears the relationship."},"title":{"type":"string","minLength":1,"maxLength":300,"x-zod-optional":true,"description":"Human-readable title or label for the resource."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept. A line holding only [file: name] shows that attached file in place; the name must exactly match an attachments[].name on the same task, so send the attachment in the same call. A file attached with addedIn: description leaves the task, and is deleted from Files, once no description or comment line shows it. A YouTube, Vimeo, Loom, Wistia, Figma, Notion, Google Docs or Sheets, Calendly or Cal.com link alone on its own line shows as an embedded card; a [text](url) link stays a link."},"status":{"type":"string","enum":["todo","in_progress","in_review","done"],"x-zod-optional":true,"description":"Workflow status accepted by this resource.","example":"todo"},"statusOptionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Active workspace task status option UUID; its base status is canonicalized by the server."},"priority":{"type":"string","enum":["urgent","high","medium","low","none"],"x-zod-optional":true,"description":"Task priority using the built-in priority values.","example":"urgent"},"priorityOptionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Active workspace task priority option UUID; its base priority is canonicalized by the server."},"assigneeType":{"anyOf":[{"type":"string","enum":["agency","client"]},{"type":"null"}],"x-zod-optional":true,"description":"Whether the task is assigned to an agency or client participant."},"assigneeId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Selectable member/person UUID in this workspace and account."},"assigneeName":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Display name; when a selectable assignee is supplied, the server canonicalizes this value."},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Task due timestamp in ISO 8601 form."},"startAt":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Start timestamp in ISO 8601 format."},"dependsOn":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Optional single predecessor task UUID that this task depends on."},"repeat":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"x-zod-refined":true,"description":"Repeat schedule configuration for recurring task occurrences. Strings starting portal-repeat:v1: create a new task for each occurrence. Each copy is created on its scheduled date, not before. Task reads (agency and client) include recurrenceExpired: true and recurrenceExpiresAt for a client-assigned copy set to missedOccurrencePolicy expire that was not done before its next occurrence; treat it as closed, not open or overdue."},"flowId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-zod-optional":true,"description":"Workspace flow UUID assignable to this client account."},"flowSend":{"anyOf":[{"type":"string","enum":["now","date","after"]},{"type":"null"}],"x-zod-optional":true,"description":"When to send the assigned flow: now, on a date, or after its configured trigger."},"flowSendDate":{"anyOf":[{"type":"string"},{"type":"null"}],"x-zod-optional":true,"description":"Scheduled flow send timestamp when flowSend is date."},"flowDone":{"anyOf":[{"type":"string","enum":["review","done"]},{"type":"null"}],"x-zod-optional":true,"description":"Whether a completed flow should move this task to review or done."},"attachments":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable name or display label."},"size":{"type":"number","description":"File size in bytes.","example":1},"url":{"type":"string","format":"uri","x-zod-optional":true,"description":"External URL or file link accepted by this endpoint.","example":"https://example.test/resource"},"portalFileId":{"type":"string","format":"uuid","x-zod-optional":true,"description":"Existing portal file UUID to reference as an attachment.","example":"00000000-0000-4000-8000-000000000001"},"storagePath":{"type":"string","x-zod-optional":true,"description":"Storage object path; upload path attribution is server-controlled where relevant."},"type":{"type":"string","x-zod-optional":true,"description":"Discriminator for the selected payload variant."},"addedIn":{"type":"string","enum":["description","task"],"x-zod-optional":true,"description":"Where the file came from. description: added in the task's description; it leaves the task once no description or comment line shows it, though the call that adds it keeps it. A file uploaded in the app's task window comes back when its line and attachment are sent back right away. task: made for this task. A client file of either kind is deleted from Files, with its comments, once it leaves the task, unless another task still uses it; a workspace library file is only unlinked. Leave it out for a file attached from Files; removing that one only unlinks it."}},"additionalProperties":false,"required":["name","size"]}},{"type":"null"}],"x-zod-optional":true,"description":"Message attachment metadata or references."},"customFields":{"type":"object","additionalProperties":{},"x-zod-refined":true,"x-zod-optional":true,"description":"Custom field values keyed by the definition UUID; values are checked against the definition type/options."},"position":{"type":"integer","x-zod-optional":true,"description":"Display order within its workspace/account list.","example":1},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"example":{},"required":["expectedRevision"]},"custom_fields_CreateCustomFieldDefinitionPayload":{"type":"object","properties":{"itemType":{"type":"string","enum":["task","file","client"],"description":"Entity type this custom field definition applies to: task, file, or client.","example":"task"},"label":{"type":"string","minLength":1,"maxLength":80,"description":"Human-readable custom field or option label."},"fieldType":{"type":"string","enum":["text","number","date","checkbox","tags","select","multi_select"],"description":"Custom field value type.","example":"text"},"options":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":100,"x-zod-refined":true,"x-zod-optional":true,"description":"Allowed labels for select and multi-select fields; labels must be unique."}},"additionalProperties":false,"required":["itemType","label","fieldType"],"x-zod-refined":true,"example":{"itemType":"task","label":"In progress","fieldType":"text"}},"custom_fields_UpdateCustomFieldDefinitionPayload":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80,"x-zod-optional":true,"description":"Human-readable custom field or option label."},"position":{"type":"integer","minimum":0,"maximum":10000,"x-zod-optional":true,"description":"Display order within its workspace/account list.","example":0},"options":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":100,"x-zod-refined":true,"x-zod-optional":true,"description":"Allowed labels for select and multi-select fields; labels must be unique."}},"additionalProperties":false,"x-zod-refined":true,"example":{}},"portal_milestone_library_CopyMilestoneTemplatesPayload":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid","description":"Client account UUID; references must belong to this workspace and applicable account.","example":"00000000-0000-4000-8000-000000000001"},"templateIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100,"description":"Distinct milestone template UUIDs from this workspace; playbooks require at least two."}},"additionalProperties":false,"required":["accountId","templateIds"],"example":{"accountId":"00000000-0000-4000-8000-000000000101","templateIds":["00000000-0000-4000-8000-000000001701"]}},"portal_milestone_library_CreatePortalPlaybookPayload":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Human-readable name or display label."},"description":{"type":"string","maxLength":2000,"x-zod-optional":true,"description":"Optional longer description shown with the resource."},"templateIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":2,"maxItems":100,"description":"Distinct milestone template UUIDs from this workspace; playbooks require at least two."}},"additionalProperties":false,"required":["name","templateIds"]},"portal_milestone_library_MilestoneTemplatePayload":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300,"description":"Human-readable title or label for the resource."},"description":{"type":"string","maxLength":4000,"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept."},"cover":{"type":"object","properties":{"kind":{"type":"string","enum":["color","image","video"],"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema.","example":"color"},"color":{"type":"string","x-zod-optional":true,"description":"Supported visual color name for a custom task option."},"pattern":{"type":"string","x-zod-optional":true,"description":"Visual pattern name for the milestone cover."},"image":{"type":"string","x-zod-optional":true,"description":"Image URL or stored cover image reference."},"video":{"type":"string","x-zod-optional":true,"description":"Video URL or stored cover video reference."},"textHidden":{"type":"boolean","x-zod-optional":true,"description":"Whether to hide title text over the cover.","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"x-zod-optional":true,"description":"Visual cover position or focal point.","example":"center"},"font":{"type":"string","x-zod-optional":true,"description":"Cover title font choice."},"size":{"anyOf":[{"type":"number"},{"type":"string"}],"x-zod-optional":true,"description":"File size in bytes."}},"additionalProperties":false,"required":["kind"],"x-zod-optional":true,"description":"Milestone cover presentation settings."},"startApprover":{"type":"string","enum":["none","client","agency"],"description":"Who must approve or initiate milestone start: none, client, or agency.","example":"none"},"finishApprover":{"type":"string","enum":["none","client","agency"],"description":"Who must approve milestone completion: none, client, or agency.","example":"none"},"startAuto":{"type":"object","properties":{"on":{"type":"string","enum":["date","starts","completes"],"description":"Automatic milestone trigger: date, starts, or completes.","example":"date"},"ref":{"type":"string","x-zod-optional":true,"description":"Referenced milestone ID for starts/completes triggers."},"date":{"type":"string","x-zod-optional":true,"description":"Date value used by an automatic trigger."}},"additionalProperties":false,"required":["on"],"x-zod-optional":true,"description":"Automatic start rule tied to a date or another milestone event."},"finishAuto":{"type":"object","properties":{"on":{"type":"string","enum":["date","starts","completes"],"description":"Automatic milestone trigger: date, starts, or completes.","example":"date"},"ref":{"type":"string","x-zod-optional":true,"description":"Referenced milestone ID for starts/completes triggers."},"date":{"type":"string","x-zod-optional":true,"description":"Date value used by an automatic trigger."}},"additionalProperties":false,"required":["on"],"x-zod-optional":true,"description":"Automatic completion rule tied to a date or another milestone event."},"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"description":"Unique identifier of the related resource."},"title":{"type":"string","minLength":1,"maxLength":300,"description":"Human-readable title or label for the resource."},"description":{"type":"string","maxLength":4000,"x-zod-optional":true,"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept."},"priority":{"type":"string","enum":["urgent","high","medium","low","none"],"description":"Task priority using the built-in priority values.","example":"urgent"},"responsibleTeam":{"type":"string","enum":["agency","client"],"x-zod-optional":true,"description":"Whether the task belongs to the agency or client.","example":"agency"},"dependsOn":{"type":"string","maxLength":200,"x-zod-optional":true,"description":"Optional single predecessor task UUID that this task depends on."},"repeat":{"type":"string","maxLength":120,"x-zod-optional":true,"description":"Repeat schedule configuration for recurring task occurrences. Strings starting portal-repeat:v1: create a new task for each occurrence. Each copy is created on its scheduled date, not before. Task reads (agency and client) include recurrenceExpired: true and recurrenceExpiresAt for a client-assigned copy set to missedOccurrencePolicy expire that was not done before its next occurrence; treat it as closed, not open or overdue."},"subtasks":{"type":"array","items":{"type":"object","description":"recursive schema"},"maxItems":100,"x-zod-optional":true,"description":"Nested task definitions for this template task."},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500,"description":"Human-readable name or display label."},"size":{"anyOf":[{"type":"string","maxLength":80},{"type":"number","minimum":0}],"description":"File size in bytes."}},"additionalProperties":false,"required":["name","size"]},"maxItems":50,"x-zod-optional":true,"description":"Message attachment metadata or references."}},"additionalProperties":false,"required":["id","title","priority"]},"maxItems":250,"description":"Tasks included in this milestone template, each with its own stable identifier and optional dependencies/subtasks."},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500,"description":"Human-readable name or display label."},"size":{"anyOf":[{"type":"string","maxLength":80},{"type":"number","minimum":0}],"description":"File size in bytes."}},"additionalProperties":false,"required":["name","size"]},"maxItems":50,"x-zod-optional":true,"description":"File payloads associated with a group or migration operation."}},"additionalProperties":false,"required":["title","startApprover","finishApprover","tasks"]},"portal_task_options_CreatePortalTaskOptionPayload":{"type":"object","properties":{"field":{"type":"string","enum":["status","priority"],"description":"Whether a task option applies to status or priority.","example":"status"},"label":{"type":"string","minLength":1,"maxLength":80,"description":"Human-readable custom field or option label."},"baseValue":{"anyOf":[{"type":"string","enum":["todo","in_progress","in_review","done"]},{"type":"string","enum":["urgent","high","medium","low","none"]}],"description":"Built-in status or priority represented by this custom option."},"color":{"type":"string","enum":["slate","blue","green","amber","orange","red","violet","pink"],"x-zod-optional":true,"default":"slate","x-zod-defaulted":true,"description":"Supported visual color name for a custom task option.","example":"slate"}},"additionalProperties":false,"required":["field","label","baseValue"],"x-zod-refined":true,"example":{"field":"status","label":"In progress","baseValue":"todo","color":"slate"}},"portal_task_options_UpdatePortalTaskOptionPayload":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80,"x-zod-optional":true,"description":"Human-readable custom field or option label."},"color":{"type":"string","enum":["slate","blue","green","amber","orange","red","violet","pink"],"x-zod-optional":true,"description":"Supported visual color name for a custom task option.","example":"slate"},"position":{"type":"integer","minimum":0,"maximum":10000,"x-zod-optional":true,"description":"Display order within its workspace/account list.","example":0},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original updatedAt from the full item read, preserving fractional precision and timezone offset. Null is invalid for this existing item. Do not use a collection metadata token."}},"additionalProperties":false,"x-zod-refined":true,"example":{"label":"Awaiting review","expectedRevision":"2026-10-19T01:00:00.123456Z"},"required":["expectedRevision"],"anyOf":[{"required":["label"]},{"required":["color"]},{"required":["position"]}]},"portal_task_settings_UpdateTaskSettingsPayload":{"type":"object","properties":{"status":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Every key in display order. A key is a built-in value or a custom option id."},"hidden":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Hidden (archived) keys. done (status) and none (priority) can't be hidden."}},"required":["order","hidden"],"additionalProperties":false},"priority":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Every key in display order. A key is a built-in value or a custom option id."},"hidden":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Hidden (archived) keys. done (status) and none (priority) can't be hidden."}},"required":["order","hidden"],"additionalProperties":false},"clientsCanCreateTasks":{"type":"boolean"},"moveTasks":{"type":"object","properties":{"status":{"type":"object","additionalProperties":{"type":"string"}},"priority":{"type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":false,"description":"For each newly hidden key that tasks still use, the visible key to move those tasks to."},"expectedRevision":{"type":["string","null"],"format":"date-time","description":"settings.updatedAt from the read; null before the first save."}},"required":["expectedRevision"],"additionalProperties":false},"PortalTaskSettings":{"type":"object","properties":{"status":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Every key in display order. A key is a built-in value or a custom option id."},"hidden":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Hidden (archived) keys. done (status) and none (priority) can't be hidden."}},"required":["order","hidden"],"additionalProperties":false},"priority":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Every key in display order. A key is a built-in value or a custom option id."},"hidden":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Hidden (archived) keys. done (status) and none (priority) can't be hidden."}},"required":["order","hidden"],"additionalProperties":false},"clientsCanCreateTasks":{"type":"boolean","default":false},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Revision for the next PUT; null until the first save."}},"required":["status","priority","clientsCanCreateTasks","updatedAt"],"additionalProperties":false},"WebhookEventEnvelope":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique event identifier, stable across delivery retries."},"object":{"type":"string","const":"event","description":"Envelope discriminator; always event."},"api_version":{"type":"string","const":"v2","description":"Public API version that defines this event payload."},"type":{"type":"string","enum":["flow.created","client.created","client.completed","portal.account.created","portal.account.updated","portal.account.deleted","portal.task.created","portal.task.updated","portal.task.completed","portal.task.deleted","portal.message.created","portal.note.created","portal.comment.created","portal.milestone.published","portal.milestone.updated","portal.milestone.completed","portal.milestone.deleted","portal.file.created","portal.file.updated","portal.file.approved","portal.file.deleted","portal.invoice.created","portal.invoice.updated","portal.invoice.paid","portal.invoice.deleted","portal.member.created","portal.member.updated","portal.member.deleted","portal.service.created","portal.service.updated","portal.service.purchased"],"description":"One of the documented concrete event types. Wildcard * is accepted only when subscribing, never as a delivered event type."},"workspace_id":{"type":"string","format":"uuid","description":"Workspace where the event occurred."},"created_at":{"type":"string","format":"date-time","description":"Event creation timestamp in UTC."},"data":{"type":"object","description":"Event-specific immutable snapshot; exact fields depend on type.","additionalProperties":true}},"required":["id","object","api_version","type","workspace_id","created_at","data"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique delivery record identifier."},"object":{"type":"string","const":"webhook_delivery","description":"Resource discriminator; always webhook_delivery."},"endpoint_id":{"type":"string","format":"uuid","description":"Webhook endpoint targeted by this delivery."},"event_id":{"type":"string","format":"uuid","description":"Event associated with this delivery."},"event_type":{"type":["string","null"],"description":"Concrete event type, if retained."},"event_object_id":{"type":["string","null"],"description":"Identifier of the primary event resource, if available."},"status":{"type":"string","enum":["pending","retrying","delivering","succeeded","failed"],"description":"Delivery lifecycle state."},"attempts":{"type":"integer","description":"Number of delivery attempts made so far."},"next_attempt_at":{"type":"string","format":"date-time","description":"Scheduled next attempt; null when no retry is scheduled."},"response_status":{"type":["integer","null"],"description":"HTTP response status from the latest attempt, if any."},"response_body":{"type":["string","null"],"description":"Truncated response body from the latest attempt, if available."},"last_error":{"type":["string","null"],"description":"Latest transport or delivery error, if any."},"delivered_at":{"type":["string","null"],"format":"date-time","description":"Successful delivery time; null unless delivered."},"created_at":{"type":"string","format":"date-time","description":"Delivery record creation timestamp in UTC."},"updated_at":{"type":"string","format":"date-time","description":"Last delivery record update timestamp in UTC."},"payload":{"anyOf":[{"$ref":"#/components/schemas/WebhookEventEnvelope"},{"type":"null"}],"description":"Event snapshot associated with this delivery, if retained."}},"required":["id","object","endpoint_id","event_id","status","attempts","next_attempt_at","payload"],"additionalProperties":true},"WebhookDeliveryList":{"type":"object","properties":{"object":{"type":"string","const":"list","description":"Envelope discriminator; always list."},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"},"description":"Delivery records for the requested page."}},"required":["object","data"],"additionalProperties":true},"PortalPhotoUploadInput":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"],"additionalProperties":true},"PortalMessageAttachmentUploadInput":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"],"additionalProperties":true},"PortalFileCommentInput":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000},"parentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"clientRequestId":{"type":"string","format":"uuid"},"annotation":{"type":"object","additionalProperties":true},"fileVersionNumber":{"type":"integer","minimum":1},"internal":{"type":"boolean","default":true},"accountId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"legacyComments":{"type":"array","items":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000},"author":{"type":"string","maxLength":300},"when":{"type":"string","maxLength":200}},"required":["body"],"additionalProperties":false},"minItems":1,"maxItems":100}},"additionalProperties":false},"PortalError":{"type":"object","properties":{"error":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"code":{"type":"string"},"reason":{"type":"string"},"details":{},"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error"],"additionalProperties":true},"Workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique workspace identifier."},"object":{"type":"string","const":"workspace","description":"Resource discriminator; always workspace."},"name":{"type":"string","description":"Workspace name."},"slug":{"type":"string","description":"Workspace URL slug."},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp in UTC."},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp in UTC."},"api_url":{"type":"string","format":"uri","description":"Canonical API URL."}},"required":["id","object","name","slug","api_url"],"description":"Workspace owned by, or explicitly accessible to, the API key.","additionalProperties":true},"FlowStep":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"flow_step"},"position":{"type":"integer"},"type":{"type":"string","description":"Published V2 step type, such as questionnaire, tutorial, embed, esignature, payment, or schedule."},"title":{"type":"string"},"description":{"type":["string","null"]},"condition":{"type":["object","null"],"additionalProperties":true},"assignment":{"type":["object","null"],"additionalProperties":true},"fields":{"type":"array","items":{"type":"object","additionalProperties":true}},"tutorial":{"type":"object","additionalProperties":true},"embed":{"type":"object","description":"Embed steps only: { url, full_page, continue_label } for the outside page the step shows.","additionalProperties":true},"esignature":{"type":["object","null"],"additionalProperties":true},"schedule":{"type":["object","null"],"additionalProperties":true},"platform_access":{"type":["object","null"],"additionalProperties":true},"payment":{"type":["object","null"],"description":"Payment step configuration. Null when the step has no payment settings.","additionalProperties":true,"properties":{"amount_cents":{"type":"integer","description":"Fixed amount in hundredths of the currency unit. For subscriptions this is the recurring price charged every interval. For `answers` this is the optional base price. May be 0 when `pricing_mode` is `formula`, `service`, or `answers`."},"formula":{"type":["string","null"],"description":"Formula that computes the amount from earlier answers, in major currency units. Used when `pricing_mode` is `formula`."},"pricing_mode":{"type":"string","enum":["fixed","formula","service","answers"],"description":"How the amount is set. `fixed` charges `amount_cents`. `formula` evaluates `formula`. `service` charges the package the client picked from the service that sells this flow. `answers` charges `amount_cents` as a base price plus the prices of the answers the client picked on earlier questions. Steps saved without an explicit mode report `formula` when a formula is set, otherwise `fixed`."},"hide_powered_by":{"type":"boolean","description":"Whether the \"Securely powered by\" provider badge is hidden on the checkout card."},"currency":{"type":"string","description":"ISO 4217 currency code.","example":"usd"},"description":{"type":"string","description":"Description shown to the client on the checkout card."},"payment_type":{"type":"string","enum":["one_time","subscription"]},"interval":{"type":["string","null"],"description":"Billing interval for subscriptions.","enum":["day","week","month","year",null]},"trial_days":{"type":["number","null"],"description":"Free trial length in days before the first recurring charge. Cannot be combined with a setup fee."},"setup_fee_cents":{"type":["integer","null"],"description":"Stripe subscriptions only. One-time fee, in hundredths of the currency unit, charged with the first payment. Null when no setup fee is configured."},"first_recurring_charge":{"type":["string","null"],"description":"Set when a setup fee is configured. `today` charges the setup fee plus the first interval at checkout. `next_period` charges only the setup fee at checkout and the first recurring amount one interval later.","enum":["today","next_period",null]},"show_coupon_input":{"type":"boolean","description":"Whether the client can enter a promotion code. Stripe applies the coupon to the checkout total, including any setup fee, and to later renewals according to the coupon duration."},"allowed_methods":{"type":"array","items":{"type":"string"},"description":"Configured payment providers. The first supported provider is used."}},"example":{"amount_cents":100000,"formula":null,"pricing_mode":"fixed","hide_powered_by":false,"currency":"usd","description":"Monthly retainer","payment_type":"subscription","interval":"month","trial_days":null,"setup_fee_cents":200000,"first_recurring_charge":"next_period","show_coupon_input":true,"allowed_methods":["stripe"]}},"api":{"type":["object","null"],"description":"Published API Request action metadata, not the private endpoint, query values, header values, or body. At runtime this action resolves explicit client identity tokens such as {{client.email}} from the active submission and resolves earlier answer and result tokens separately.","additionalProperties":true},"ai":{"type":["object","null"],"additionalProperties":true},"webhook":{"type":["object","null"],"additionalProperties":true},"email":{"type":["object","null"],"additionalProperties":true}},"required":["id","object","position","type","title"],"description":"Sanitized published step. Private endpoint URLs, headers, secrets, static recipients, and private integration target IDs are omitted.","additionalProperties":true},"Progress":{"type":"object","properties":{"current_step":{"type":["integer","null"],"description":"One-based current step position; null before a response starts."},"current_step_id":{"type":["string","null"],"description":"Current step identifier; null before a response starts."},"first_opened_at":{"type":["string","null"],"format":"date-time","description":"First time the onboarding link was opened, if recorded."},"started_at":{"type":["string","null"],"format":"date-time","description":"Response start time, if started."},"last_activity_at":{"type":["string","null"],"format":"date-time","description":"Most recent recorded response activity, if any."},"submitted_at":{"type":["string","null"],"format":"date-time","description":"Submission time, if completed."},"time_spent_seconds":{"type":["integer","null"],"description":"Accumulated active time in seconds."}},"additionalProperties":true},"FlowStats":{"type":"object","properties":{"object":{"type":"string","const":"flow_stats","description":"Resource discriminator; always flow_stats."},"flow_id":{"type":"string","format":"uuid","description":"Flow summarized by these counts."},"flow_name":{"type":"string","description":"Name of the summarized flow."},"total_clients":{"type":"integer","description":"Number of clients associated with this flow."},"completed":{"type":"integer","description":"Number with completed responses."},"in_progress":{"type":"integer","description":"Number with in-progress responses."},"not_started":{"type":"integer","description":"Clients without an in-progress or completed response."},"completion_rate":{"type":"integer","minimum":0,"maximum":100,"description":"Completed responses as an integer percentage of total clients; zero when there are no clients."}},"required":["object","flow_id","flow_name","total_clients","completed","in_progress","not_started","completion_rate"],"additionalProperties":true},"ClientProgress":{"type":"object","properties":{"object":{"type":"string","const":"client_progress","description":"Resource discriminator; always client_progress."},"client_id":{"type":"string","format":"uuid","description":"Client represented by this progress view."},"flow_id":{"type":"string","format":"uuid","description":"Flow assigned to the client."},"flow_name":{"type":["string","null"],"description":"Assigned flow name."},"status":{"type":"string","enum":["not_started","in_progress","completed","abandoned"],"description":"Latest response state or not_started."},"total_steps":{"type":"integer","description":"Number of steps in the published flow."},"completed_steps":{"type":"integer","description":"Number of completed steps."},"percentage":{"type":"integer","minimum":0,"maximum":100,"description":"Completed step percentage."},"response_id":{"type":["string","null"],"format":"uuid","description":"Latest response UUID, if one exists."},"started_at":{"type":["string","null"],"format":"date-time","description":"Latest response start timestamp, if started."},"completed_at":{"type":["string","null"],"format":"date-time","description":"Latest response completion timestamp, if completed."},"last_activity_at":{"type":["string","null"],"format":"date-time","description":"Latest response activity timestamp, if available."}},"required":["object","client_id","flow_id","status","total_steps","completed_steps","percentage","response_id"],"description":"Progress reflects the latest response. When a response does not yet exist, status falls back to the onboarding state and percentage is zero.","additionalProperties":true},"FileValue":{"type":"object","properties":{"id":{"type":["string","null"],"description":"File record identifier."},"object":{"type":"string","const":"file","description":"Resource discriminator."},"name":{"type":"string","description":"Original file name."},"size_bytes":{"type":["integer","null"],"description":"File size in bytes."},"mime_type":{"type":["string","null"],"description":"Media type reported for the file."},"storage_provider":{"type":["string","null"],"description":"Storage backend identifier."},"external_file_id":{"type":["string","null"],"description":"Provider-side file identifier, if available."},"url":{"type":"string","format":"uri-reference","description":"File access URL, if available."},"uploaded_at":{"type":["string","null"],"format":"date-time","description":"Upload timestamp in UTC."},"storage_connection_id":{"type":["string","null"],"format":"uuid","readOnly":true,"description":"Original workspace storage connection UUID when recorded. New upload preferences do not change this identity. Null for platform storage and legacy files without connection provenance."}},"required":["object","name","url"],"description":"Sanitized file answer. Client uploads stage on 360Onboard first; after a successful configured transfer, URLs point to connected storage. Without configured storage or after an unsuccessful transfer, the retained platform copy remains the source. Existing provider locations remain supported.","additionalProperties":true},"ResponseStep":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"response_step"},"type":{"type":"string","enum":["questionnaire","ephemeral","tutorial","embed","esignature","payment","platform_access","schedule","ai","api","webhook","crm","export","email","sms","client_portal"]},"title":{"type":["string","null"]},"status":{"type":"string"},"completed_at":{"type":["string","null"],"format":"date-time"},"completion_source":{"type":"object","description":"Present only when this step is satisfied by verified completion from an earlier submission. Payment amounts and signatures refer to the original receipt, not a new charge or signing event. Omitted for completion in the current submission.","properties":{"type":{"type":"string","const":"prior_submission","description":"Completion is reused from an earlier submission."},"response_id":{"type":"string","format":"uuid","description":"Original submission that owns the receipt."},"flow_version_id":{"type":"string","format":"uuid","description":"Published flow version assigned to the original submission."},"completed_at":{"type":["string","null"],"format":"date-time","description":"Original completion time, or null when no timestamp was recorded."}},"required":["type","response_id","flow_version_id","completed_at"],"additionalProperties":false,"example":{"type":"prior_submission","response_id":"00000000-0000-4000-8000-000000000101","flow_version_id":"00000000-0000-4000-8000-000000000102","completed_at":"2026-10-01T12:00:00Z"}},"previous_completion":{"type":"object","description":"Historical metadata for a previously reused completion that is no longer valid on a completed restarted submission. Does not authorize reuse. Current receipt and answer details are omitted for this step.","properties":{"status":{"type":"string","const":"revoked","description":"The prior completion no longer satisfies this step."},"response_id":{"type":"string","format":"uuid","description":"Original submission identifier, retained even if unavailable."},"flow_version_id":{"type":"string","format":"uuid","description":"Original assigned flow version identifier."},"completed_at":{"type":["string","null"],"format":"date-time","description":"Original recorded completion time, or null."},"source_available":{"type":"boolean","description":"Whether the original is still available in the same workspace, flow and person scope. Does not independently grant access."}},"required":["status","response_id","flow_version_id","completed_at","source_available"],"additionalProperties":false,"example":{"status":"revoked","response_id":"00000000-0000-4000-8000-000000000101","flow_version_id":"00000000-0000-4000-8000-000000000102","completed_at":"2026-10-01T12:00:00Z","source_available":false}},"fields":{"type":["array","object","null"],"description":"Questionnaire steps return an array of field answers. CRM steps return the resolved sent mapping object (email, firstName, lastName, company, phone and note as nullable strings, and custom as an array of label/value string pairs), or null before an attempt.","properties":{"email":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"company":{"type":["string","null"]},"phone":{"type":["string","null"]},"note":{"type":["string","null"]},"custom":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}}},"items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":["string","null"]},"value":{"anyOf":[{"$ref":"#/components/schemas/FileValue"},{"type":["string","number","boolean","null"]},{"type":"array","items":{}},{"type":"object","additionalProperties":true}]},"other":{"type":"string","description":"Present when the client chose the Other option and typed their own answer. The same text is also included in value."}},"required":["id","label","value"],"additionalProperties":true}},"sensitive":{"type":"boolean","description":"Ephemeral steps are flagged sensitive; their values are excluded."},"values_included":{"type":"boolean","description":"False for ephemeral steps."},"field_ids":{"type":"array","items":{"type":"string"}},"signers":{"type":"array","items":{"type":"object","additionalProperties":true}},"document":{"type":["object","null"],"description":"Signed-contract artifact. New finalized documents use the permanent 360Onboard URL with storage_provider supabase; an optional agency copy does not replace that URL. Historical external locations remain supported until an authorized detail or media read successfully retains the original PDF. Copying preserves signing timestamps, hash and original response ownership, including reused restart evidence.","properties":{"status":{"type":"string","enum":["pending_signers","finalizing","finalized","failed"]},"required_signers":{"type":"integer","minimum":0},"completed_signers":{"type":"integer","minimum":0},"url":{"type":["string","null"],"format":"uri-reference","description":"Primary signed PDF URL, or null before finalization."},"storage_provider":{"type":["string","null"],"description":"Primary backend: supabase for new finalized contracts, or a legacy connected-provider identifier until copying succeeds."},"sha256":{"type":["string","null"],"description":"Recorded SHA-256 of the finalized PDF, if available; copy-back checks this value before adopting the platform reference."},"finalized_at":{"type":["string","null"],"format":"date-time","description":"Original finalization timestamp in UTC; retaining a platform copy does not change it."}},"required":["status","required_signers","completed_signers","url","storage_provider","sha256","finalized_at"],"examples":[{"status":"finalized","required_signers":2,"completed_signers":2,"url":"https://storage.example.com/storage/v1/object/public/360onboard-files/owner/flow/signed-documents/platform/agreement/final.pdf","storage_provider":"supabase","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","finalized_at":"2026-10-16T12:00:00Z"},{"status":"finalized","required_signers":1,"completed_signers":1,"url":"https://drive.google.com/file/d/example-legacy-agreement/view","storage_provider":"google_drive","sha256":null,"finalized_at":"2026-09-01T12:00:00Z"}],"additionalProperties":true},"audit_events":{"type":"array","items":{"type":"object","additionalProperties":true}},"amount_cents":{"type":"integer"},"currency":{"type":"string"},"provider":{"type":["string","null"],"description":"Payment or CRM provider identifier. CRM providers include suitedash, swipeone, ninjapipe, flowlu and automatenexus (AutomateNexus CRM). Null when an action has no provider configured."},"sent":{"type":"boolean","description":"For CRM and export actions, true only when the action completed successfully."},"external_id":{"type":["string","null"],"description":"Provider-side record ID returned by a CRM or export action, or null when unavailable."},"fired_at":{"type":["string","null"],"format":"date-time","description":"Time the action ran, or null before an attempt."},"outputs":{"type":"object","additionalProperties":true},"answers":{"type":"array","items":{"type":"object","additionalProperties":true}},"error":{"type":["string","null"]}},"required":["id","object","type","status"],"description":"Type-specific response step snapshot. Questionnaire fields, signature audit data, payment and platform results are exposed by step type. Ephemeral answer values and integration secrets are never included.","additionalProperties":true},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique webhook endpoint identifier."},"object":{"type":"string","const":"webhook_endpoint","description":"Resource discriminator; always webhook_endpoint."},"api_version":{"type":"string","const":"v2","description":"API version associated with this endpoint."},"workspace_id":{"type":"string","format":"uuid","description":"Workspace that owns this endpoint."},"url":{"type":"string","format":"uri","description":"Receiver URL."},"events":{"type":"array","items":{"type":"string","enum":["*","flow.created","client.created","client.completed","portal.account.created","portal.account.updated","portal.account.deleted","portal.task.created","portal.task.updated","portal.task.completed","portal.task.deleted","portal.message.created","portal.note.created","portal.comment.created","portal.milestone.published","portal.milestone.updated","portal.milestone.completed","portal.milestone.deleted","portal.file.created","portal.file.updated","portal.file.approved","portal.file.deleted","portal.invoice.created","portal.invoice.updated","portal.invoice.paid","portal.invoice.deleted","portal.member.created","portal.member.updated","portal.member.deleted","portal.service.created","portal.service.updated","portal.service.purchased"]},"description":"Subscribed concrete event types or * wildcard."},"active":{"type":"boolean","description":"Whether event delivery is enabled."},"last_triggered_at":{"type":["string","null"],"format":"date-time","description":"Timestamp of the most recent attempted delivery."},"last_error":{"type":["string","null"],"description":"Latest delivery error, if available."},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp in UTC."},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp in UTC."}},"required":["id","object","api_version","workspace_id","url","events","active","created_at","updated_at"],"description":"Webhook endpoint settings. The signing secret is only returned on creation and rotation.","additionalProperties":true},"WebhookEndpointList":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["object","data"],"additionalProperties":true},"CreateClientInput":{"type":"object","properties":{"flow_id":{"type":"string","format":"uuid","description":"ID of a published V2 flow in this workspace."},"email":{"type":"string","format":"email","description":"Client email address."},"first_name":{"type":"string","maxLength":200,"default":"","description":"Client first name, if supplied."},"last_name":{"type":"string","maxLength":200,"default":"","description":"Client last name, if supplied."},"company_name":{"type":"string","maxLength":300,"default":"","description":"Client company, if supplied."},"phone":{"type":"string","maxLength":100,"default":"","description":"Client phone number, if supplied."},"send_invitation":{"type":"boolean","default":true,"description":"Send the onboarding invitation after creation."},"portal_account_id":{"type":"string","format":"uuid","description":"Client (portal account) this flow is for. Must be one of the person's clients; otherwise the request fails with 400 invalid_portal_account. Needed only when the person is in more than one client; without it the flow is not tied to either client."}},"required":["flow_id","email"],"additionalProperties":false,"examples":[{"flow_id":"2f1c98d4-3c56-4e2b-9f1e-168ebd3a4001","email":"jane@example.com","first_name":"Jane","last_name":"Smith","company_name":"Acme Studio","phone":"+1-415-555-0134","send_invitation":true}]},"UpdateClientInput":{"type":"object","properties":{"first_name":{"type":"string","maxLength":200,"description":"Replacement first name, if supplied."},"last_name":{"type":"string","maxLength":200,"description":"Replacement last name, if supplied."},"email":{"type":"string","format":"email","description":"Replacement email address, if supplied."},"company_name":{"type":"string","maxLength":300,"description":"Replacement company name, if supplied."},"phone":{"type":"string","maxLength":100,"description":"Replacement phone number, if supplied."}},"minProperties":1,"additionalProperties":false,"examples":[{"company_name":"Acme Creative","phone":"+1-415-555-0173"}]},"WebhookEndpointCreateInput":{"type":"object","properties":{"url":{"type":"string","format":"uri","pattern":"^https://","description":"Public HTTPS URL using standard port 443, without embedded credentials; DNS must resolve only to public IP addresses."},"events":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["*","flow.created","client.created","client.completed","portal.account.created","portal.account.updated","portal.account.deleted","portal.task.created","portal.task.updated","portal.task.completed","portal.task.deleted","portal.message.created","portal.note.created","portal.comment.created","portal.milestone.published","portal.milestone.updated","portal.milestone.completed","portal.milestone.deleted","portal.file.created","portal.file.updated","portal.file.approved","portal.file.deleted","portal.invoice.created","portal.invoice.updated","portal.invoice.paid","portal.invoice.deleted","portal.member.created","portal.member.updated","portal.member.deleted","portal.service.created","portal.service.updated","portal.service.purchased"],"description":"Use * to subscribe to every supported event."},"description":"Concrete event subscriptions; * subscribes to all supported events."}},"required":["url","events"],"additionalProperties":false,"examples":[{"url":"https://integrations.example.com/360onboard/events","events":["client.completed","portal.invoice.paid"]}]},"WebhookEndpointUpdateInput":{"type":"object","properties":{"url":{"type":"string","format":"uri","pattern":"^https://","description":"Public HTTPS URL using standard port 443, without embedded credentials; DNS must resolve only to public IP addresses."},"events":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["*","flow.created","client.created","client.completed","portal.account.created","portal.account.updated","portal.account.deleted","portal.task.created","portal.task.updated","portal.task.completed","portal.task.deleted","portal.message.created","portal.note.created","portal.comment.created","portal.milestone.published","portal.milestone.updated","portal.milestone.completed","portal.milestone.deleted","portal.file.created","portal.file.updated","portal.file.approved","portal.file.deleted","portal.invoice.created","portal.invoice.updated","portal.invoice.paid","portal.invoice.deleted","portal.member.created","portal.member.updated","portal.member.deleted","portal.service.created","portal.service.updated","portal.service.purchased"],"description":"Use * to subscribe to every supported event."},"description":"Replacement event subscriptions; * subscribes to all supported events."},"active":{"type":"boolean","description":"Set false to pause delivery while retaining the endpoint."}},"minProperties":1,"additionalProperties":false,"examples":[{"active":false}]},"WebhookReplayResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Delivery identifier requested for replay."},"replayed":{"type":"boolean","const":true,"description":"Whether replay was accepted."},"result":{"type":"string","description":"Replay operation result."}},"required":["id","replayed","result"],"additionalProperties":true},"ClientLookupResult":{"type":"object","properties":{"found":{"type":"boolean","description":"Whether a matching client was found."},"client":{"anyOf":[{"$ref":"#/components/schemas/Client"},{"type":"null"}],"description":"Matching client record, or null when not found."}},"required":["found"],"additionalProperties":true},"DataFlowResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flow"}},"required":["data"],"additionalProperties":true},"DataFlowStatsResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlowStats"}},"required":["data"],"additionalProperties":true},"DataClientResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Client"}},"required":["data"],"additionalProperties":true},"DataClientProgressResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ClientProgress"}},"required":["data"],"additionalProperties":true},"DataWebhookEndpointResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["data"],"additionalProperties":true},"WebhookEndpointCreated":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","properties":{"secret":{"type":"string","description":"Returned only on endpoint creation; store securely because it is not shown by list/read/update."}},"required":["secret"],"additionalProperties":true}]},"DataWebhookEndpointCreatedResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointCreated"}},"required":["data"],"additionalProperties":true},"PortalAccount":{"type":"object","description":"Client portal account as returned by the workspace-scoped account routes.","required":["id","workspaceId","companyName","status","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"workspaceId":{"type":"string","format":"uuid","description":"Owning workspace UUID.","example":"00000000-0000-4000-8000-000000000001"},"primaryPersonId":{"type":["string","null"],"format":"uuid","description":"Primary client person UUID, when assigned.","example":"00000000-0000-4000-8000-000000000001"},"companyName":{"type":"string","description":"Client company or account name."},"slug":{"type":["string","null"],"description":"Client portal account slug."},"status":{"type":"string","enum":["onboarding","active","at_risk"],"description":"Current workflow status.","example":"onboarding"},"branding":{"type":["object","null"],"additionalProperties":true},"avatarUrl":{"type":["string","null"],"format":"uri","description":"Optional URL for the client account avatar.","example":"https://example.test/resource"},"customFields":{"type":"object","additionalProperties":true,"description":"Values keyed by custom-field definition UUID."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","readOnly":true,"description":"Loaded revision for conditional editor saves; preserve exact precision."}},"example":{"id":"00000000-0000-4000-8000-000000000101","workspaceId":"00000000-0000-4000-8000-000000000001","primaryPersonId":null,"companyName":"Acme Studio","slug":"acme-studio","status":"onboarding","branding":null,"avatarUrl":null,"customFields":{},"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}},"PortalTask":{"type":"object","description":"Client portal task, with normalized workspace and account references.","required":["id","accountId","title","status","priority","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"accountId":{"type":"string","format":"uuid","description":"Client account UUID.","example":"00000000-0000-4000-8000-000000000001"},"title":{"type":"string","description":"Human-readable title or label for the resource."},"description":{"type":["string","null"],"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept. A line holding only [file: name] shows that attached file in place; the name must exactly match an attachments[].name on the same task, so send the attachment in the same call. A file attached with addedIn: description leaves the task, and is deleted from Files, once no description or comment line shows it. A YouTube, Vimeo, Loom, Wistia, Figma, Notion, Google Docs or Sheets, Calendly or Cal.com link alone on its own line shows as an embedded card; a [text](url) link stays a link."},"status":{"type":"string","enum":["todo","in_progress","in_review","done"],"description":"Current workflow status.","example":"todo"},"priority":{"type":"string","enum":["urgent","high","medium","low","none"],"description":"Task priority using the built-in priority values.","example":"urgent"},"statusOptionId":{"type":["string","null"],"format":"uuid","description":"Active workspace task status option UUID; its base status is canonicalized by the server.","example":"00000000-0000-4000-8000-000000000001"},"priorityOptionId":{"type":["string","null"],"format":"uuid","description":"Active workspace task priority option UUID; its base priority is canonicalized by the server.","example":"00000000-0000-4000-8000-000000000001"},"milestoneId":{"type":["string","null"],"format":"uuid","description":"Milestone UUID in the same client account.","example":"00000000-0000-4000-8000-000000000001"},"parentId":{"type":["string","null"],"format":"uuid","description":"Parent resource UUID; see the schema and operation for its resource type and scope.","example":"00000000-0000-4000-8000-000000000001"},"assigneeType":{"type":["string","null"],"enum":["agency","client",null],"description":"Whether the task is assigned to an agency or client participant.","example":"agency"},"assigneeId":{"type":["string","null"],"format":"uuid","description":"Selectable member/person UUID in this workspace and account.","example":"00000000-0000-4000-8000-000000000001"},"assigneeName":{"type":["string","null"],"description":"Display name; when a selectable assignee is supplied, the server canonicalizes this value."},"dueAt":{"type":["string","null"],"format":"date-time","description":"Due timestamp in ISO 8601 form; field context identifies invoice versus task due date."},"startAt":{"type":["string","null"],"format":"date-time","description":"Start timestamp in ISO 8601 format."},"dependsOn":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Optional single predecessor task UUID that this task depends on."},"repeat":{"type":["object","string","null"],"additionalProperties":true,"description":"Repeat schedule configuration for recurring task occurrences. Strings starting portal-repeat:v1: create a new task for each occurrence. Each copy is created on its scheduled date, not before. Task reads (agency and client) include recurrenceExpired: true and recurrenceExpiresAt for a client-assigned copy set to missedOccurrencePolicy expire that was not done before its next occurrence; treat it as closed, not open or overdue."},"flowId":{"type":["string","null"],"format":"uuid","description":"Workspace flow UUID assignable to this client account.","example":"00000000-0000-4000-8000-000000000001"},"flowSend":{"type":["string","null"],"enum":["now","date","after",null],"description":"When to send the assigned flow: now, on a date, or after its configured trigger.","example":"now"},"flowSendDate":{"type":["string","null"],"format":"date-time","description":"Scheduled flow send timestamp when flowSend is date."},"flowDone":{"type":["string","null"],"enum":["review","done",null],"description":"Whether a completed flow should move this task to review or done.","example":"review"},"attachments":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Message attachment metadata or references."},"customFields":{"type":"object","additionalProperties":true,"description":"Values keyed by custom-field definition UUID."},"position":{"type":"number","description":"Ordering position within the containing list or layout.","example":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","readOnly":true,"description":"Loaded revision for conditional editor saves; preserve exact precision."}},"example":{"id":"00000000-0000-4000-8000-000000000201","accountId":"00000000-0000-4000-8000-000000000101","title":"Provide brand assets","description":"Upload the current logo files.","status":"todo","priority":"medium","statusOptionId":null,"priorityOptionId":null,"milestoneId":null,"parentId":null,"assigneeType":"agency","assigneeId":null,"assigneeName":null,"dueAt":null,"startAt":null,"dependsOn":[],"repeat":null,"flowId":null,"flowSend":null,"flowSendDate":null,"flowDone":null,"attachments":[],"customFields":{},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}},"PortalMilestone":{"type":"object","description":"Milestone assigned to a client account. Agency responses may include staged draft and publish-state fields.","required":["id","accountId","title","status","position","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"accountId":{"type":"string","format":"uuid","description":"Client account UUID.","example":"00000000-0000-4000-8000-000000000001"},"templateId":{"type":["string","null"],"format":"uuid","description":"Workspace milestone template UUID.","example":"00000000-0000-4000-8000-000000000001"},"title":{"type":"string","description":"Human-readable title or label for the resource."},"status":{"type":"string","description":"Current workflow status."},"startApprover":{"type":"string","description":"Actor responsible for starting this milestone."},"startWho":{"type":["string","null"],"description":"Optional person/team assignment for milestone start."},"finishApprover":{"type":"string","description":"Actor responsible for approving milestone completion."},"finishWho":{"type":["string","null"],"description":"Optional person/team assignment for milestone completion."},"startAuto":{"type":["object","null"],"additionalProperties":true,"description":"Automatic start rule tied to a date or another milestone event."},"finishAuto":{"type":["object","null"],"additionalProperties":true,"description":"Automatic completion rule tied to a date or another milestone event."},"changesGate":{"type":["string","null"],"description":"Controls whether staged changes wait for the configured approval gate."},"startDate":{"type":["string","null"],"format":"date","description":"Milestone start date (ISO). Until this moment passes the client cannot see the milestone or its tasks and files; send the start of the day in the agency time zone. Null shows it right away."},"targetDate":{"type":["string","null"],"format":"date","description":"Target date in ISO 8601 date form."},"acceptedAt":{"type":["string","null"],"format":"date-time","description":"Time the client accepted or approved the milestone, when applicable."},"description":{"type":["string","null"],"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept."},"cover":{"type":["object","null"],"additionalProperties":true,"description":"Milestone cover presentation settings."},"position":{"type":"number","description":"Ordering position within the containing list or layout.","example":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","readOnly":true,"description":"Loaded revision for conditional editor saves; preserve exact precision."},"isDraft":{"type":"boolean","description":"True when this milestone creation is staged and not yet client-visible.","example":true},"pendingDelete":{"type":"boolean","description":"True when deletion is staged pending publication.","example":true},"hasPendingEdit":{"type":"boolean","description":"True when edits are staged in the draft object.","example":true},"draft":{"type":["object","null"],"additionalProperties":true,"description":"Staged field values; applied when published."}},"example":{"id":"00000000-0000-4000-8000-000000000301","accountId":"00000000-0000-4000-8000-000000000101","templateId":null,"title":"Kickoff","status":"not_started","startApprover":"agency","startWho":null,"finishApprover":"agency","finishWho":null,"startAuto":null,"finishAuto":null,"changesGate":null,"startDate":null,"targetDate":"2026-02-01","acceptedAt":null,"description":null,"cover":null,"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","isDraft":false,"pendingDelete":false,"hasPendingEdit":false,"draft":null}},"PortalService":{"type":"object","description":"A service offering configured for the client portal.","required":["id","title","amountCents","currency","billingType","active"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"title":{"type":"string","description":"Human-readable title or label for the resource."},"description":{"type":"string","description":"Optional longer description shown with the resource."},"features":{"type":"array","items":{"type":"string"},"description":"Short list of service features."},"amountCents":{"type":"integer","minimum":1,"description":"Integer amount in ISO minor units. Complete service prices must be at least one major currency unit (JPY 1, USD 100, KWD 1000 minor units); partial updates accept at least 1 and validate against the resulting currency. Online Stripe purchase support depends on connected-account, currency, and amount limits.","example":100},"currency":{"type":"string","enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","ved","ves","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw","zwg"],"description":"ISO currency code accepted by this endpoint.","example":"usd"},"billingType":{"type":"string","enum":["one_time","subscription"],"description":"One-time or recurring billing behavior.","example":"one_time"},"recurringInterval":{"type":["string","null"],"enum":["week","month","year",null],"description":"Recurrence interval for subscription billing.","example":"week"},"active":{"type":"boolean","description":"Whether the service is published. False is team-only Draft and clears the client audience.","example":true},"clientAccountIds":{"type":["array","null"],"items":{"type":"string","format":"uuid"},"description":"Drafts have no client audience and return null. For active services, null means all clients and a nonempty array selects workspace account UUIDs. Publishing a draft requires an explicit clientAccountIds choice (null for all clients or a nonempty array of workspace account UUIDs); omission returns 400. Unpublishing clears the selection, so choose an audience again before republishing."},"onboardingFlowId":{"type":["string","null"],"format":"uuid","description":"Optional V2 client onboarding flow in this workspace that sells this service through its public Buy Now link; null when unlinked. The flow must be active (not archived) and each flow can sell at most one service. When a client pays that flow's payment step, the service purchase is recorded as paid on the client's portal account, adding the client to the portal without an invite if needed, with the amount and provider reference actually charged, and the service delivery runs once per payment."},"delivery":{"type":"object","additionalProperties":true,"description":"Post-payment delivery action; sources must be available in this workspace."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","readOnly":true,"description":"Loaded revision for conditional editor saves; preserve exact precision."}},"example":{"id":"00000000-0000-4000-8000-000000000401","title":"Brand strategy","description":"A discovery and positioning package.","features":["Workshop","Strategy brief"],"amountCents":250000,"currency":"usd","billingType":"one_time","recurringInterval":null,"active":true,"clientAccountIds":null,"onboardingFlowId":null,"delivery":{"type":"none"},"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"},"allOf":[{"$ref":"#/components/schemas/PortalServiceCurrencyMinimum"},{"if":{"properties":{"active":{"const":false}},"required":["active"]},"then":{"properties":{"clientAccountIds":{"type":"null"}}}}]},"PortalFile":{"type":"object","description":"Portal file metadata. File binary content is transferred through storage/upload endpoints; this object contains its metadata and access policy.","required":["id","name","purpose","fmt","kind"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"accountId":{"type":["string","null"],"format":"uuid","description":"Client account UUID.","example":"00000000-0000-4000-8000-000000000001"},"name":{"type":"string","description":"Human-readable name or display label."},"groupId":{"type":["string","null"],"format":"uuid","description":"File group UUID in the same workspace and applicable client account.","example":"00000000-0000-4000-8000-000000000001"},"purpose":{"type":"string","enum":["upload","contract","deliverable","resource"],"description":"File purpose: upload, contract, deliverable, or resource.","example":"upload"},"fmt":{"type":"string","enum":["pdf","img","doc","sheet","zip","video","audio","link"],"description":"File format classification.","example":"pdf"},"kind":{"type":"string","enum":["video","audio","embed","doc","sheet","pdf","image","file","link"],"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema.","example":"video"},"storagePath":{"type":["string","null"],"description":"Storage object path; upload path attribution is server-controlled where relevant."},"url":{"type":["string","null"],"format":"uri","description":"External URL or file link accepted by this endpoint.","example":"https://example.test/resource"},"embedFrom":{"type":["string","null"],"description":"Provider/source used to embed the linked content."},"size":{"type":["integer","null"],"minimum":0,"description":"File size in bytes."},"description":{"type":["string","null"],"description":"Markdown: start a line with #, ## or ### for a heading; **bold**, *italic*, ~~strikethrough~~, - and 1. lists, > quotes and [links](https://example.com) show formatted. Plain text shows as written, with each new line kept."},"approval":{"type":["string","null"],"enum":["pending","approved","changes",null],"description":"Client review state for a deliverable.","example":"pending"},"contractState":{"type":["string","null"],"enum":["draft","sent","signed",null],"description":"Signature workflow state for a contract.","example":"draft"},"lock":{"type":["object","null"],"additionalProperties":true,"description":"When true, lock editing/review actions supported by this file."},"access":{"$ref":"#/components/schemas/PortalAccess","description":"Who can access this file or group."},"versions":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Version metadata associated with this file. Cloud-backed versions preserve their own storageConnectionId and externalFileId independently of the current file or preferred upload destination."},"customFields":{"type":"object","additionalProperties":true,"description":"Values keyed by custom-field definition UUID."},"isLibrary":{"type":"boolean","description":"Whether the item is managed as a shared library resource.","example":true},"position":{"type":"number","description":"Ordering position within the containing list or layout.","example":1},"storageConnectionId":{"type":["string","null"],"format":"uuid","readOnly":true,"description":"Original workspace storage connection UUID when recorded. New upload preferences do not change this identity. Null for platform storage and legacy files without connection provenance."},"updatedAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp of the latest file update, including version-history changes. Loaded revision for conditional editor saves; preserve exact precision."}},"example":{"id":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","name":"Brand guide.pdf","groupId":null,"purpose":"deliverable","fmt":"pdf","kind":"pdf","storagePath":"workspace/flow/file.pdf","url":null,"embedFrom":null,"size":102400,"description":null,"approval":"pending","contractState":null,"lock":null,"access":{"mode":"all"},"versions":[],"customFields":{},"isLibrary":false,"position":0}},"PortalAccess":{"oneOf":[{"type":"object","required":["mode"],"properties":{"mode":{"const":"all","type":"string","description":"Access mode: all, team, or specific."}},"additionalProperties":false},{"type":"object","required":["mode"],"properties":{"mode":{"const":"team","type":"string","description":"Access mode: all, team, or specific."}},"additionalProperties":false},{"type":"object","required":["mode"],"properties":{"mode":{"const":"specific","type":"string","description":"Access mode: all, team, or specific."},"accountIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Client account UUIDs allowed by this specific access assignment."},"personIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Person UUIDs allowed by this specific access assignment."}},"additionalProperties":false}],"discriminator":{"propertyName":"mode"},"example":{"mode":"all"}},"PortalFileGroup":{"type":"object","description":"Portal file folder/group metadata.","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"accountId":{"type":["string","null"],"format":"uuid","description":"Client account UUID.","example":"00000000-0000-4000-8000-000000000001"},"name":{"type":"string","description":"Human-readable name or display label."},"purpose":{"type":["string","null"],"description":"File purpose: upload, contract, deliverable, or resource."},"access":{"$ref":"#/components/schemas/PortalAccess","description":"Who can access this file or group."},"position":{"type":"number","description":"Ordering position within the containing list or layout.","example":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"example":{"id":"00000000-0000-4000-8000-000000000601","accountId":"00000000-0000-4000-8000-000000000101","name":"Shared files","purpose":"resource","access":{"mode":"all"},"position":0,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}},"PortalInvoice":{"type":"object","description":"Invoice record returned by the portal API. `amount` is the tax-inclusive total; `subtotal`, `taxName`, and `taxRate` retain the agency-entered tax breakdown when present.","required":["id","amount","currency","status"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"accountId":{"type":"string","format":"uuid","description":"Client account UUID.","example":"00000000-0000-4000-8000-000000000001"},"number":{"type":["string","null"],"description":"Invoice number or display identifier."},"amount":{"type":"number","description":"Final amount due, including tax.","example":1},"subtotal":{"type":["number","null"],"description":"Pre-tax subtotal."},"taxName":{"type":["string","null"],"description":"Display name for the agency-supplied tax; provide this together with taxRate."},"taxRate":{"type":["number","null"],"minimum":0,"maximum":100,"description":"Agency supplied percentage, not auto-calculated."},"currency":{"type":"string","description":"Historical currency labels are preserved on reads, including retired or unknown labels. New writes accept only the current app catalog."},"status":{"type":"string","enum":["paid","sent","out","over","draft"],"description":"Current workflow status.","example":"paid"},"issuedAt":{"type":["string","null"],"format":"date-time","description":"Invoice issue timestamp."},"dueAt":{"type":["string","null"],"format":"date-time","description":"Due timestamp in ISO 8601 form; field context identifies invoice versus task due date."},"memo":{"type":["string","null"],"description":"Invoice memo shown to the client."},"billTo":{"type":["array","null"],"description":"Billing address lines, or null when unset.","items":{"type":"string"}},"items":{"type":"array","items":{"type":"object","properties":{"n":{"type":"string","description":"Invoice line item name."},"q":{"type":"number","description":"Invoice line item quantity.","example":1},"u":{"type":"number","description":"Invoice line item unit amount.","example":1}},"required":["n","q","u"]},"description":"Invoice line items; each item has a name, quantity, and unit amount."},"paidAt":{"type":["string","null"],"format":"date-time","description":"Payment timestamp when marked paid."},"paymentRef":{"type":["string","null"],"description":"External payment reference, if present."},"billingType":{"type":["string","null"],"enum":["one_time","auto_issue","subscription",null],"description":"One-time or recurring billing behavior.","example":"one_time"},"recurringInterval":{"type":["string","null"],"enum":["week","month","year",null],"description":"Recurrence interval for subscription billing.","example":"week"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","readOnly":true,"description":"Loaded revision for conditional editor saves; preserve exact precision."},"paymentMethods":{"anyOf":[{"type":"array","items":{"type":"string","enum":["stripe","external"]},"minItems":1,"maxItems":2,"uniqueItems":true,"description":"Allowed payment methods. Defaults to stripe and external when Stripe Connect is enabled, otherwise external only. Subscriptions require stripe. Legacy null values are resolved from the workspace connection and any existing Stripe attempt.","example":["external"]},{"type":"null"}]},"externalPaymentUrl":{"anyOf":[{"type":"string","format":"uri","maxLength":2048},{"type":"null"}],"description":"Optional external payment URL. Trimmed and normalized; HTTP or HTTPS only, with characters supported by invoice PDFs. Null clears it.","example":"https://payments.example.test/invoice/INV-1042"},"externalPaymentInstructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"description":"Optional trimmed external-payment instructions using characters supported by invoice PDFs. Null clears them.","example":"Send payment by bank transfer and include INV-1042 as the reference."},"paymentMethod":{"type":["string","null"],"description":"Recorded payment method; manual receipts use ach, bank_transfer, cash, check, or other.","enum":["ach","bank_transfer","cash","check","other",null]},"paymentRecordedBy":{"type":["string","null"],"format":"uuid","description":"Agency user who recorded the external receipt."},"payment_link":{"type":["string","null"],"format":"uri","description":"Private pay link for this invoice (no portal sign-in, valid 90 days, bearer link: share only with the client). Null for a draft. Returned by get invoice; POST payment-link returns a fresh link with its expiry."},"paymentRecordedAt":{"type":["string","null"],"format":"date-time","description":"Time the agency recorded the external receipt."},"availablePaymentMethods":{"type":"array","items":{"type":"string","enum":["stripe","external"]},"minItems":1,"maxItems":2,"uniqueItems":true,"description":"Payment methods currently available in the workspace. Returned on the invoice detail response."}},"example":{"id":"00000000-0000-4000-8000-000000000701","accountId":"00000000-0000-4000-8000-000000000101","number":"INV-1001","amount":250,"subtotal":250,"taxName":null,"taxRate":0,"currency":"usd","status":"sent","issuedAt":"2026-01-15T12:00:00.000Z","dueAt":"2026-01-30T12:00:00.000Z","memo":"Brand strategy","billTo":["Acme Studio"],"items":[{"n":"Strategy package","q":1,"u":250}],"paidAt":null,"paymentRef":null,"billingType":"one_time","recurringInterval":null,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","paymentMethods":["stripe","external"],"externalPaymentUrl":null,"externalPaymentInstructions":null,"paymentMethod":null,"paymentRecordedBy":null,"paymentRecordedAt":null,"availablePaymentMethods":["stripe","external"]}},"PortalMember":{"type":"object","description":"Client portal member attached to the account.","required":["id","email"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"personId":{"type":["string","null"],"format":"uuid","example":"00000000-0000-4000-8000-000000000001"},"email":{"type":"string","format":"email","description":"Member email address; used for identity matching and, when requested, invitation delivery.","example":"client@example.test"},"firstName":{"type":["string","null"],"description":"Member given name."},"lastName":{"type":["string","null"],"description":"Member family name."},"name":{"type":["string","null"],"description":"Human-readable name or display label."},"companyName":{"type":["string","null"],"description":"Client company or account name."},"role":{"type":["string","null"],"description":"Optional portal role label shown for the member."},"status":{"type":["string","null"],"description":"Current workflow status."},"createdAt":{"type":"string","format":"date-time"}},"example":{"id":"00000000-0000-4000-8000-000000000801","personId":"00000000-0000-4000-8000-000000000802","email":"client@example.test","firstName":"Alex","lastName":"Rivera","name":"Alex Rivera","companyName":"Acme Studio","role":"Primary contact","status":"active","createdAt":"2026-01-15T12:00:00.000Z"}},"PortalMessage":{"type":"object","description":"Portal conversation message with canonicalized mention metadata and attachment references.","required":["id","body"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"conversationId":{"type":["string","null"],"format":"uuid","example":"00000000-0000-4000-8000-000000000001"},"accountId":{"type":["string","null"],"format":"uuid","description":"Client account UUID.","example":"00000000-0000-4000-8000-000000000001"},"body":{"type":"string","description":"Comment or message text."},"kind":{"type":"string","enum":["message","note"],"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema.","example":"message"},"replyTo":{"type":["string","null"],"format":"uuid","description":"Parent message UUID in the same client account.","example":"00000000-0000-4000-8000-000000000001"},"mentions":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Resource mentions; target IDs must belong to the same client account and labels are canonicalized server-side."},"attachments":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Message attachment metadata or references."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"example":{"id":"00000000-0000-4000-8000-000000000901","conversationId":"00000000-0000-4000-8000-000000000902","accountId":"00000000-0000-4000-8000-000000000101","body":"The first draft is ready for review.","kind":"message","replyTo":null,"mentions":[],"attachments":[],"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z"}},"PortalNote":{"type":"object","description":"Internal client account note.","required":["id","body","pinned","tag","createdAt","updatedAt","authorUserId","authorName"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"body":{"type":"string","description":"Comment or message text."},"pinned":{"type":"boolean","description":"Whether an internal account note should remain pinned.","example":true},"tag":{"type":["string","null"],"description":"Optional note category label."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original editor revision. Preserve this string for note PATCH and DELETE."},"authorUserId":{"type":["string","null"],"format":"uuid","description":"Agency user who authored the note, when available."},"authorName":{"type":["string","null"],"description":"Stored display name of the note author, when available."}},"example":{"id":"00000000-0000-4000-8000-000000001001","body":"Confirm the kickoff date.","pinned":false,"tag":null,"createdAt":"2026-01-15T12:00:00.000Z","updatedAt":"2026-01-15T12:00:00.000Z","authorUserId":null,"authorName":null}},"PortalComment":{"type":"object","description":"Portal comment/review thread entry.","required":["id","body"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"targetType":{"type":"string","description":"Type of resource the comment or activity filter targets."},"targetId":{"type":"string","format":"uuid","description":"UUID of the resource being commented on or filtered.","example":"00000000-0000-4000-8000-000000000001"},"body":{"type":"string","description":"Comment or message text."},"internal":{"type":"boolean","description":"When true, this comment/note is agency-only.","example":true},"parentId":{"type":["string","null"],"format":"uuid","description":"Parent resource UUID; see the schema and operation for its resource type and scope.","example":"00000000-0000-4000-8000-000000000001"},"resolved":{"type":"boolean","description":"Whether the review/comment thread is resolved.","example":true},"author":{"type":"object","additionalProperties":true,"description":"Historical comment author label."},"annotation":{"type":["object","null"],"additionalProperties":true,"description":"Review annotation context, including the surface/version and any spatial or time anchor."},"fileVersionNumber":{"type":["integer","null"],"description":"Positive file version number associated with this comment."},"createdAt":{"type":"string","format":"date-time"}},"example":{"id":"00000000-0000-4000-8000-000000001101","targetType":"file","targetId":"00000000-0000-4000-8000-000000000501","body":"Please review page two.","internal":false,"parentId":null,"resolved":false,"author":{"name":"Alex Rivera"},"annotation":null,"fileVersionNumber":1,"createdAt":"2026-01-15T12:00:00.000Z"}},"PortalTaskOption":{"type":"object","description":"Workspace-defined status or priority option; baseValue preserves the built-in workflow meaning.","required":["id","field","label","baseValue","color","position","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"field":{"type":"string","enum":["status","priority"],"description":"Whether a task option applies to status or priority.","example":"status"},"label":{"type":"string","description":"Human-readable custom field or option label."},"baseValue":{"type":"string","description":"Built-in status or priority represented by this custom option."},"color":{"type":"string","enum":["slate","blue","green","amber","orange","red","violet","pink"],"description":"Supported visual color name for a custom task option.","example":"slate"},"position":{"type":"integer","description":"Ordering position within the containing list or layout.","example":1},"updatedAt":{"type":"string","format":"date-time","maxLength":64,"description":"Exact original editor revision. Preserve this string for option PATCH and DELETE."}},"example":{"id":"00000000-0000-4000-8000-000000001201","field":"status","label":"Blocked","baseValue":"in_progress","color":"amber","position":0,"updatedAt":"2026-10-19T01:00:00.123456Z"}},"PortalAnnotation":{"type":"object","description":"Review annotation anchored to a file version.","required":["id","body"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique resource identifier.","example":"00000000-0000-4000-8000-000000000001"},"fileId":{"type":"string","format":"uuid","example":"00000000-0000-4000-8000-000000000001"},"accountId":{"type":["string","null"],"format":"uuid","description":"Client account UUID.","example":"00000000-0000-4000-8000-000000000001"},"body":{"type":"string","description":"Comment or message text."},"resolved":{"type":"boolean","description":"Whether the review/comment thread is resolved.","example":true},"parentId":{"type":["string","null"],"format":"uuid","description":"Parent resource UUID; see the schema and operation for its resource type and scope.","example":"00000000-0000-4000-8000-000000000001"},"x":{"type":["number","null"],"minimum":0,"maximum":100,"description":"Horizontal percentage coordinate on the review surface, from 0 to 100."},"y":{"type":["number","null"],"minimum":0,"maximum":100,"description":"Vertical percentage coordinate on the review surface, from 0 to 100."},"pageUrl":{"type":["string","null"],"format":"uri","description":"Page URL associated with a website annotation.","example":"https://example.test/resource"},"createdAt":{"type":"string","format":"date-time"}},"example":{"id":"00000000-0000-4000-8000-000000001301","fileId":"00000000-0000-4000-8000-000000000501","accountId":"00000000-0000-4000-8000-000000000101","body":"Update this heading.","resolved":false,"parentId":null,"x":48.2,"y":21.6,"pageUrl":null,"createdAt":"2026-01-15T12:00:00.000Z"}},"PortalSubscription":{"type":"object","description":"Subscription or recurring payment state for an account invoice.","properties":{"id":{"type":"string","description":"Unique resource identifier."},"invoiceId":{"type":"string","format":"uuid","example":"00000000-0000-4000-8000-000000000001"},"status":{"type":"string","description":"Current workflow status."},"interval":{"type":"string"},"nextPaymentAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"example":{"id":"sub_example","invoiceId":"00000000-0000-4000-8000-000000000701","status":"active","interval":"month","nextPaymentAt":"2026-02-15T12:00:00.000Z","createdAt":"2026-01-15T12:00:00.000Z"}},"PortalHomeBlockPlacement":{"type":"object","properties":{"row":{"type":"integer","minimum":0,"maximum":39,"example":0},"col":{"type":"integer","minimum":0,"maximum":1,"example":0}},"additionalProperties":false,"example":{}},"PortalHomeBlockCreate_image":{"type":"object","properties":{"type":{"type":"string","const":"image","description":"Discriminator for the selected payload variant."},"src":{"type":"string","maxLength":2048,"description":"https URL or same-origin path."},"alt":{"type":"string","maxLength":200,"description":"Required for accessibility; may be empty only when decorative is true."},"decorative":{"type":"boolean","example":true},"caption":{"type":"string","maxLength":240},"href":{"type":"string","maxLength":2048,"description":"Optional http(s) click-through URL."},"fit":{"type":"string","enum":["cover","contain"],"example":"cover"},"ratio":{"type":"string","enum":["16:9","4:3","1:1","auto"],"example":"16:9"},"rounded":{"type":"boolean","example":true},"storagePath":{"type":"string","maxLength":2048,"description":"Storage object path; upload path attribution is server-controlled where relevant."},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","src","alt","expectedRevision"],"additionalProperties":false,"description":"Create a image portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"image","src":"https://cdn.example.test/kickoff.png","alt":"The team at the kickoff call","caption":"Kickoff","fit":"cover","ratio":"16:9","rounded":true,"expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_text":{"type":"object","properties":{"type":{"type":"string","const":"text","description":"Discriminator for the selected payload variant."},"body":{"type":"string","maxLength":6000,"description":"Markdown source. Start a line with `#`, `##` or `###` for a heading; there is no separate title field. A YouTube, Vimeo, Loom or Wistia link alone on a line plays in the page. Show an uploaded file with `![name](res:<fileId>)` on its own line, where `<fileId>` is the id of a workspace file created with purpose `resource`. A client who cannot see that file sees the writing without it."},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"card":{"type":"boolean","description":"Show the writing inside a card.","example":false},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","body","expectedRevision"],"additionalProperties":false,"description":"Create a text portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"text","body":"## Start here\n\nHere is what happens **first**.","align":"left","card":true,"expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_link":{"type":"object","properties":{"type":{"type":"string","const":"link","description":"Discriminator for the selected payload variant."},"href":{"type":"string","maxLength":2048,"description":"Required http(s) destination."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"note":{"type":"string","maxLength":400,"description":"Optional note attached to the workflow transition."},"layout":{"type":"string","enum":["row","card"],"example":"row"},"preview":{"type":"object","properties":{"domain":{"type":"string","maxLength":253},"title":{"type":"string","maxLength":200,"description":"Human-readable title or label for the resource."},"description":{"type":"string","maxLength":400,"description":"Optional longer description shown with the resource."},"image":{"type":["string","null"],"description":"Image URL or stored cover image reference."},"favicon":{"type":["string","null"]},"fetchedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","href","expectedRevision"],"additionalProperties":false,"description":"Create a link portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"link","href":"https://example.test/report","title":"Project report","layout":"card","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_video":{"type":"object","properties":{"type":{"type":"string","const":"video","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000,"description":"Heading shown for the titled variant."},"variant":{"type":"string","enum":["titled","full"],"example":"titled"},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a video portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"video","resourceId":"resource-example-1","text":"A message from the team","variant":"titled","align":"left","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_greeting":{"type":"object","properties":{"type":{"type":"string","const":"greeting","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a greeting portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"greeting","title":"Welcome","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_invoices":{"type":"object","properties":{"type":{"type":"string","const":"invoices","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a invoices portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"invoices","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_tasks":{"type":"object","properties":{"type":{"type":"string","const":"tasks","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a tasks portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"tasks","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_activity":{"type":"object","properties":{"type":{"type":"string","const":"activity","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a activity portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"activity","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_milestones":{"type":"object","properties":{"type":{"type":"string","const":"milestones","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a milestones portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"milestones","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_announcement":{"type":"object","properties":{"type":{"type":"string","const":"announcement","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a announcement portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"announcement","title":"Office hours","text":"We are available Monday to Friday.","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_resource":{"type":"object","properties":{"type":{"type":"string","const":"resource","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a resource portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"resource","text":"resource-library-id","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_schedule":{"type":"object","properties":{"type":{"type":"string","const":"schedule","description":"Discriminator for the selected payload variant."},"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"http(s), upload:, or res: reference where supported by the selected legacy block."},"resourceId":{"type":"string","maxLength":128,"description":"Resources library ID; preferred for video blocks."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"Create a schedule portal home block. Block fields are validated by the production catalog; placement is optional on create.","example":{"type":"schedule","expectedRevision":"2026-10-19T01:00:00.123456Z"}},"PortalHomeBlockCreate_analytics":{"type":"object","properties":{"type":{"type":"string","const":"analytics"},"page":{"type":"string","enum":["positions","backlinks"],"description":"Beta analytics page; defaults to positions."},"display":{"type":"string","enum":["numbers","graph"],"description":"Beta summary display; defaults to numbers."},"range":{"type":"string","enum":["7","30","90"],"description":"Beta saved analytics range; defaults to 30."},"metrics":{"type":"array","maxItems":5,"items":{"type":"string","enum":["tracked","average","top10","improved","declined","domains","backlinks","new","lost"]},"description":"Beta analytics metrics. Positions supports tracked/average/top10/improved/declined; Backlinks supports domains/backlinks/new/lost. Default Positions omits tracked for four balanced cells."},"showBorders":{"type":"boolean","description":"Beta Numbers cell borders; defaults to true."},"placement":{"$ref":"#/components/schemas/PortalHomeBlockPlacement"},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"required":["type","expectedRevision"],"additionalProperties":false,"description":"BETA ONLY — not released to the production API. Saved SEO summary or graph; enable an agency DataForSEO connection and configure the target client first. Reads do not collect paid provider data. Workspace and account scopes use the existing home-block services.","example":{"type":"analytics","page":"positions","display":"numbers","metrics":["average","top10","improved","declined"],"showBorders":true,"expectedRevision":"2026-10-19T01:00:00.123456Z"},"x-release-channel":"beta"},"PortalHomeBlockCreate":{"oneOf":[{"$ref":"#/components/schemas/PortalHomeBlockCreate_image"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_text"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_link"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_video"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_greeting"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_invoices"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_tasks"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_activity"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_milestones"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_announcement"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_resource"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_schedule"},{"$ref":"#/components/schemas/PortalHomeBlockCreate_analytics"}],"discriminator":{"propertyName":"type"},"description":"A supported portal block type. Retired types `chart` and `dashboard` are rejected. The row/column layout supports at most 40 rows and two blocks per row; omit placement to append a new row.","example":{"type":"announcement","title":"Office hours","text":"We are available Monday to Friday."}},"PortalHomeBlockPatch":{"type":"object","description":"Supply editable fields for the block's existing type. `id` and `type` are immutable; null clears optional values. Unknown fields are rejected.","properties":{"title":{"type":"string","maxLength":160,"description":"Human-readable title or label for the resource."},"body":{"type":"string","maxLength":6000,"description":"Comment or message text."},"src":{"type":"string","maxLength":2048},"alt":{"type":"string","maxLength":200},"decorative":{"type":"boolean","example":true},"caption":{"type":"string","maxLength":240},"href":{"type":"string","maxLength":2048,"description":"Optional link associated with a resource mention."},"fit":{"type":"string","enum":["cover","contain"],"example":"cover"},"ratio":{"type":"string","enum":["16:9","4:3","1:1","auto"],"example":"16:9"},"rounded":{"type":"boolean","example":true},"storagePath":{"type":"string","maxLength":2048,"description":"Storage object path; upload path attribution is server-controlled where relevant."},"note":{"type":"string","maxLength":400,"description":"Optional note attached to the workflow transition."},"layout":{"type":"string","enum":["row","card"],"example":"row"},"preview":{"type":"object","additionalProperties":true},"resourceId":{"type":"string","maxLength":128},"text":{"type":"string","maxLength":4000},"variant":{"type":"string","maxLength":40},"align":{"type":"string","enum":["left","center","right"],"example":"left"},"url":{"type":"string","maxLength":2048,"description":"External URL or file link accepted by this endpoint."},"overlayTitle":{"type":"boolean","example":true},"pos":{"type":"string","enum":["center","tl","tr","bl","br"],"description":"Visual cover position or focal point.","example":"center"},"size":{"type":"number","minimum":8,"maximum":200,"description":"File size in bytes.","example":8},"eyebrowHidden":{"type":"boolean","example":true},"kind":{"type":"string","enum":["bar","line","donut"],"description":"Resource subtype, message kind, field kind, or block type as constrained by this schema.","example":"bar"},"rows":{"type":"array","maxItems":24,"items":{"type":"object","properties":{"label":{"type":"string","maxLength":60,"description":"Human-readable custom field or option label."},"value":{"type":"number","minimum":-1000000000000,"maximum":1000000000000,"example":-1000000000000}},"required":["label","value"],"additionalProperties":false}},"valuePrefix":{"type":"string","maxLength":8},"valueSuffix":{"type":"string","maxLength":8},"showValues":{"type":"boolean","example":true},"showLegend":{"type":"boolean","example":true},"placement":{"type":"object","properties":{"row":{"type":"integer","minimum":0,"maximum":39,"example":0},"col":{"type":"integer","minimum":0,"maximum":1,"example":0}},"additionalProperties":false,"example":{}},"page":{"type":"string","enum":["positions","backlinks"],"description":"Beta analytics page; defaults to positions."},"display":{"type":"string","enum":["numbers","graph"],"description":"Beta summary display; defaults to numbers."},"range":{"type":"string","enum":["7","30","90"],"description":"Beta saved analytics range; defaults to 30."},"metrics":{"type":"array","maxItems":5,"items":{"type":"string","enum":["tracked","average","top10","improved","declined","domains","backlinks","new","lost"]},"description":"Beta analytics metrics. Positions supports tracked/average/top10/improved/declined; Backlinks supports domains/backlinks/new/lost. Default Positions omits tracked for four balanced cells."},"showBorders":{"type":"boolean","description":"Beta Numbers cell borders; defaults to true."},"expectedRevision":{"type":["string","null"],"format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"example":{},"required":["expectedRevision"]},"InboundTriggerRequest":{"type":"object","required":["client","data"],"additionalProperties":false,"properties":{"client":{"type":"object","required":["email"],"additionalProperties":false,"properties":{"email":{"type":"string","format":"email","maxLength":320,"description":"Client email; normalized to trimmed lowercase for the onboarding record."},"first_name":{"type":"string","maxLength":200,"default":"","description":"Trimmed before max-length validation and storage; defaults to empty string.","x-zod-trimmed":true},"last_name":{"type":"string","maxLength":200,"default":"","description":"Trimmed before max-length validation and storage; defaults to empty string.","x-zod-trimmed":true},"company_name":{"type":"string","maxLength":300,"default":"","description":"Trimmed before max-length validation and storage; defaults to empty string.","x-zod-trimmed":true},"phone":{"type":"string","maxLength":100,"default":"","description":"Trimmed before max-length validation and storage; defaults to empty string.","x-zod-trimmed":true}}},"data":{"type":"object","description":"Event values mapped to editable questionnaire defaults. Maximum serialized request size 256,000 bytes; payload depth 16, 5,000 nodes, arrays of 500 items, strings of 10,000 characters. Rejects property names __proto__, prototype, and constructor.","additionalProperties":true}}},"InboundTriggerClient":{"type":"object","required":["id","flow_id","workspace_id","email","link","invitation_requested","created_at","flow_version_id","flow_version_generation","setup_state"],"properties":{"id":{"type":"string","format":"uuid"},"flow_id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"link":{"type":"string","format":"uri"},"invitation_requested":{"type":"boolean","description":"Trigger setting for sending an initial invitation; not evidence of email delivery."},"created_at":{"type":"string","format":"date-time"},"flow_version_id":{"type":["string","null"],"format":"uuid"},"flow_version_generation":{"type":["integer","null"]},"setup_state":{"type":"string","enum":["complete","processing","unknown"]},"firstName":{"type":"string","description":"May be present on the initial response. A cached replay preserves the original body; durable event replays omit this field."},"lastName":{"type":"string","description":"May be present on the initial response. A cached replay preserves the original body; durable event replays omit this field."},"companyName":{"type":"string","description":"May be present on the initial response. A cached replay preserves the original body; durable event replays omit this field."},"phone":{"type":"string","description":"May be present on the initial response. A cached replay preserves the original body; durable event replays omit this field."}},"additionalProperties":false},"InboundTriggerResponse":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/InboundTriggerClient"}},"additionalProperties":false},"InboundTriggerUnknownResponse":{"type":"object","required":["error","data"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","const":"setup_outcome_unknown"},"message":{"type":"string"}},"additionalProperties":true},"data":{"$ref":"#/components/schemas/InboundTriggerClient"}},"additionalProperties":false},"RecordPortalInvoicePaymentPayload":{"type":"object","required":["paidAt","paymentMethod"],"properties":{"paidAt":{"type":"string","format":"date-time","description":"Date/time payment arrived, including Z or a timezone offset."},"paymentMethod":{"type":"string","enum":["ach","bank_transfer","cash","check","other"],"description":"How the agency received the external payment."},"paymentRef":{"type":["string","null"],"maxLength":500,"description":"Optional reference, trimmed; an empty value is stored as null."}}},"PortalInvoiceFontWeights":{"type":"object","additionalProperties":false,"required":["customFontFaces","customFontVariable"],"description":"Extra weight files for the invoice's own custom font (font:custom). The main customFontUrl file is Regular 400. PDFs draw bold text from the file closest to 700.","properties":{"customFontFaces":{"type":"array","maxItems":8,"description":"One file per weight. Each url is another invoice font upload from this workspace.","items":{"type":"object","additionalProperties":false,"required":["url","weight"],"properties":{"url":{"type":"string","format":"uri","maxLength":2048},"weight":{"type":"integer","enum":[100,200,300,500,600,700,800,900]},"fileName":{"type":"string","maxLength":200}}}},"customFontVariable":{"type":"boolean","description":"True when the main file is a variable font that holds every weight."}}},"PortalInvoiceDesign":{"type":"object","additionalProperties":false,"properties":{"layout":{"type":"string","enum":["classic","minimal","studio","wave"]},"accentColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","default":null,"description":"Null follows the saved workspace Client theme."},"font":{"type":["string","null"],"enum":["default","editorial","rounded","custom",null],"default":null,"description":"Null inherits Client theme. custom requires customFont and customFontUrl from this workspace’s font upload."},"customFont":{"type":"string","minLength":1,"maxLength":160,"description":"Display name returned by font upload. Omit both custom fields to remove the invoice-specific font."},"customFontUrl":{"type":"string","format":"uri","maxLength":2048,"description":"Public font URL returned by this workspace’s invoice-design/font endpoint; other workspaces and external URLs are rejected."},"showLogo":{"type":"boolean"},"logoSize":{"type":"string","enum":["small","medium"]},"businessName":{"type":"string","maxLength":160},"address":{"type":"string","maxLength":1000},"email":{"type":"string","maxLength":320,"description":"Email address, or an empty string."},"taxId":{"type":"string","maxLength":120},"notes":{"type":"string","maxLength":2000},"footer":{"type":"string","maxLength":300},"backgroundColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","default":null,"description":"Invoice and receipt page background in HTML previews and every PDF page. Null or omitted uses pure white independently of the saved workspace Client theme background. Does not change the workspace theme."}},"required":["layout","showLogo","logoSize","businessName","address","email","taxId","notes","footer"],"allOf":[{"if":{"properties":{"font":{"const":"custom"}},"required":["font"]},"then":{"required":["customFont","customFontUrl"]}}]},"SeoAvailability":{"type":"object","properties":{"available":{"type":"boolean","description":"Connected provider plus at least one configured active client with enabled SEO tracking and a visible SEO page."}},"required":["available"],"additionalProperties":false,"example":{"available":false}},"ResourceRevisionResult":{"type":"object","required":["type","id","status","revision"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["flow","flow.list","workflow","conversation.messages","account.messages","conversation.inbox","tasks","milestones","comments","clients","onboardings","results","files","documents","approvals","meeting-notes","invoices","services","subscriptions","ledger","activity","analytics","unread","portal.customization","portal.branding","portal.home-blocks","portal.templates","team","permissions","integrations","domains","billing","settings","workspaces","usage","profile","api-keys","webhooks","analytics.connection"],"description":"Registered resource family. Flow/workflow uses the flow UUID; conversation.messages uses the conversation UUID. Workspace collections use workspaceId; account collections use accountId. Unsupported scope returns unavailable."},"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["available","unavailable"],"description":"Unavailable intentionally does not distinguish missing, deleted, unauthorized or unsupported scope."},"revision":{"type":["string","null"],"description":"Opaque authorized view token; null for unavailable or a valid initial collection state. Clock-derived views also change at minute boundaries."}}},"EditorRevisionError":{"type":"object","required":["error","code","resourceType","resourceId","recovery"],"properties":{"error":{"type":"string"},"code":{"type":"string","enum":["revision_required","revision_conflict","invalid_revision"]},"resourceType":{"type":"string"},"resourceId":{"type":"string"},"recovery":{"const":"read_resource","type":"string"}},"additionalProperties":false},"PortalMilestoneTemplateUpdate":{"type":"object","properties":{"title":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/title"},"description":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/description"},"cover":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/cover"},"startApprover":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/startApprover"},"finishApprover":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/finishApprover"},"startAuto":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/startAuto"},"finishAuto":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/finishAuto"},"tasks":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/tasks"},"files":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/files"},"expectedRevision":{"type":"string","format":"date-time","maxLength":64,"description":"Exact originally loaded updatedAt, preserving fractional precision. Null only when the singleton was absent. Not a collection metadata token."}},"additionalProperties":false,"required":["title","startApprover","finishApprover","tasks","expectedRevision"]},"PortalPlaybook":{"type":"object","required":["id","updatedAt","name","templateIds"],"properties":{"id":{"type":"string","format":"uuid"},"updatedAt":{"type":"string","format":"date-time"},"name":{"type":"string"},"description":{"type":"string"},"templateIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"additionalProperties":false},"PortalMilestoneTemplate":{"type":"object","properties":{"title":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/title"},"description":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/description"},"cover":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/cover"},"startApprover":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/startApprover"},"finishApprover":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/finishApprover"},"startAuto":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/startAuto"},"finishAuto":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/finishAuto"},"tasks":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/tasks"},"files":{"$ref":"#/components/schemas/portal_milestone_library_MilestoneTemplatePayload/properties/files"},"id":{"type":"string","format":"uuid"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":false,"required":["id","updatedAt","title","startApprover","finishApprover","tasks","files"]},"ResourceRevisionDescriptor":{"type":"object","required":["type","id"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["flow","flow.list","workflow","conversation.messages","account.messages","conversation.inbox","tasks","milestones","comments","clients","onboardings","results","files","documents","approvals","meeting-notes","invoices","services","subscriptions","ledger","activity","analytics","unread","portal.customization","portal.branding","portal.home-blocks","portal.templates","team","permissions","integrations","domains","billing","settings","workspaces","usage","profile","api-keys","webhooks","analytics.connection"],"description":"Registered resource family. Flow/workflow uses the flow UUID; conversation.messages uses the conversation UUID. Workspace collections use workspaceId; account collections use accountId. Unsupported scope returns unavailable. api-keys, webhooks and analytics.connection use workspaceId. API-key metadata is bound to the authenticated actor, never a caller-selected actor."},"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid","description":"Optional client-account binding; must be authorized in this workspace."},"revision":{"type":["string","null"],"maxLength":512,"description":"Previously observed metadata token; compare against the returned opaque revision. This is never an editor or reply precondition."}}},"PortalHomeTemplate":{"type":"object","required":["id","name","rows","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"rows":{},"milestoneTpl":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"PortalServiceCurrencyMinimum":{"description":"Currency-conditioned minimum price for a complete portal service offering.","allOf":[{"if":{"properties":{"currency":{"enum":["bif","clp","djf","gnf","isk","jpy","kmf","krw","pyg","rwf","ugx","vnd","vuv","xaf","xof","xpf"]}},"required":["currency"]},"then":{"properties":{"amountCents":{"minimum":1}}}},{"if":{"properties":{"currency":{"enum":["aed","afn","all","amd","aoa","ars","aud","awg","azn","bam","bbd","bdt","bmd","bnd","bob","brl","bsd","btn","bwp","byn","bzd","cad","cdf","chf","cny","cop","crc","cup","cve","czk","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","irr","jmd","kes","kgs","khr","kpw","kyd","kzt","lak","lbp","lkr","lrd","lsl","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","pab","pen","pgk","php","pkr","pln","qar","ron","rsd","rub","sar","sbd","scr","sdg","sek","sgd","shp","sle","sos","srd","ssp","stn","svc","syp","szl","thb","tjs","tmt","top","try","ttd","twd","tzs","uah","usd","uyu","uzs","ved","ves","wst","xcd","xcg","yer","zar","zmw","zwg"]}},"required":["currency"]},"then":{"properties":{"amountCents":{"minimum":100}}}},{"if":{"properties":{"currency":{"enum":["bhd","iqd","jod","kwd","lyd","omr","tnd"]}},"required":["currency"]},"then":{"properties":{"amountCents":{"minimum":1000}}}}]},"WorkingDesignImage":{"oneOf":[{"type":"object","additionalProperties":false,"required":["url","source"],"properties":{"url":{"type":"string","format":"uri"},"source":{"type":"string","const":"url"}}},{"type":"object","additionalProperties":false,"required":["url","source","unsplash"],"properties":{"url":{"type":"string","format":"uri"},"source":{"type":"string","const":"unsplash"},"unsplash":{"type":"object","additionalProperties":false,"required":["photoId","photographerName","photographerUrl","downloadLocation"],"properties":{"photoId":{"type":"string","minLength":1,"maxLength":200},"photographerName":{"type":"string","minLength":1,"maxLength":200},"photographerUrl":{"type":"string","format":"uri"},"downloadLocation":{"type":"string","format":"uri","description":"Unsplash download-tracking URL on api.unsplash.com."}}}}}]},"WorkingDesignDesign":{"type":"object","additionalProperties":false,"properties":{"theme":{"type":"string","enum":["minimal","editorial","modern","corporate","playful","bold","minimal-dark","editorial-dark","modern-dark","corporate-dark","playful-dark","bold-dark","studio","lilac","atelier","journal","graphite","swiss","sage","maison","console","hello","terra","studio-dark","lilac-dark","atelier-dark","journal-dark","graphite-dark","swiss-dark","sage-dark","maison-dark","console-dark","hello-dark","terra-dark","poster","gala","ledger","pebble","dossier","saffron","orchard","lagoon","poster-dark","gala-dark","ledger-dark","pebble-dark","dossier-dark","saffron-dark","orchard-dark","lagoon-dark","glass","glass-dark"]},"mode":{"type":"string","enum":["website","slideshow"]},"slideshow":{"type":"object","additionalProperties":false,"required":["transition"],"properties":{"transition":{"type":"string","enum":["vertical","horizontal","fade"],"description":"How slideshow mode moves between questions and pages: vertical slides up like Typeform, horizontal slides right to left, fade cross-fades. Clients that prefer reduced motion always get a fade."}},"description":"Slideshow presentation settings. Applies when mode is slideshow, where questionnaire steps show one question at a time. Omitted on flows that never set it; the default transition is vertical."},"overrides":{"type":"object","additionalProperties":false,"properties":{"primaryColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"accentColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"backgroundColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"foregroundColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"displayFont":{"type":["string","null"],"enum":["Inter","Fraunces","Space Grotesk","Source Sans 3","Nunito","Archivo Black","Playfair Display","IBM Plex Sans","IBM Plex Mono","Manrope","Plus Jakarta Sans","DM Sans","Geist","Inter Tight","Instrument Sans","Instrument Serif","Newsreader","Cormorant Garamond","Libre Caslon Text","Hanken Grotesk","Schibsted Grotesk","Figtree","Outfit","Sora","Onest","Bricolage Grotesque","Geist Mono","JetBrains Mono","Barlow Condensed","Barlow","Prata","Zilla Slab","Rubik","Courier Prime",null],"description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"bodyFont":{"type":["string","null"],"enum":["Inter","Fraunces","Space Grotesk","Source Sans 3","Nunito","Archivo Black","Playfair Display","IBM Plex Sans","IBM Plex Mono","Manrope","Plus Jakarta Sans","DM Sans","Geist","Inter Tight","Instrument Sans","Instrument Serif","Newsreader","Cormorant Garamond","Libre Caslon Text","Hanken Grotesk","Schibsted Grotesk","Figtree","Outfit","Sora","Onest","Bricolage Grotesque","Geist Mono","JetBrains Mono","Barlow Condensed","Barlow","Prata","Zilla Slab","Rubik","Courier Prime",null],"description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"density":{"type":["string","null"],"enum":["compact","comfortable","dramatic",null],"description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"radiusScale":{"type":["string","null"],"enum":["tight","normal","round",null],"description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"baseSize":{"type":["number","null"],"minimum":0.75,"maximum":1.5,"description":"Set null to remove this override and inherit the theme value. Omit to keep the saved value."},"customFont":{"type":"null","description":"Clear-only uploaded-font metadata. Set null to remove it during a type and shape reset; upload or replace font files through the validated builder upload."},"customFontUrl":{"type":"null","description":"Clear-only uploaded-font metadata. Set null to remove it during a type and shape reset; upload or replace font files through the validated builder upload."},"customFontFaces":{"type":"null","description":"Clear-only list of extra weight files for the uploaded font. Set null to remove them; clearing customFont or customFontUrl also removes them."},"customFontVariable":{"type":"null","description":"Clear-only variable-font flag for the uploaded font. Set null to remove it; clearing customFont or customFontUrl also removes it."}},"description":"Explicit null values delete only the named overrides so the theme value is inherited. Omitted values and unrelated saved overrides are preserved. Font selection writes accept catalog families only; customFont and customFontUrl are clear-only."},"layouts":{"type":"object","additionalProperties":false,"properties":{"hero":{"type":"string","enum":["centered","split","full-bleed","editorial"]},"overview":{"type":"string","enum":["card-grid","timeline","list","accordion"]},"progress":{"type":"string","enum":["dots","bar","numbered"]},"step":{"type":"string","enum":["single-column","two-column","card","immersive"]},"thankyou":{"type":"string","enum":["centered","split","confetti-card","minimal"]},"header":{"type":"string","enum":["minimal","brand","with-help","with-progress"]}}},"layoutConfig":{"type":"object","additionalProperties":false,"properties":{"twoColumn":{"type":"object","additionalProperties":false,"properties":{"image":{"oneOf":[{"$ref":"#/components/schemas/WorkingDesignImage"},{"type":"null"}]}}},"dashboard":{"type":"object","additionalProperties":false,"properties":{"backgroundImage":{"oneOf":[{"$ref":"#/components/schemas/WorkingDesignImage"},{"type":"null"}]}}}}},"backdrop":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"style":{"type":"string","enum":["photo","glass"],"description":"photo keeps the picture sharp under a wash of the theme's page color; glass blurs it and turns cards, inputs and the header see-through."},"image":{"$ref":"#/components/schemas/WorkingDesignImage"},"strength":{"type":"string","enum":["subtle","balanced","bold"],"description":"How much of the photo shows through. Default balanced."},"text":{"type":"string","enum":["auto","light","dark"],"description":"Glass only: text color over the photo. auto (default) follows the photo's brightness."},"cards":{"type":"string","enum":["clear","frosted","solid"],"description":"Glass only: how see-through cards and inputs are. Default clear."}}},{"type":"null"}],"description":"Photo behind the whole flow. Fields merge into the current backdrop, so you can change only strength, style, text or cards; a flow without one needs style and image. null removes it. Changing theme without sending backdrop brings the new theme's own photo (glass, glass-dark, terra, atelier) unless the flow has its own pick, and drops the old theme's untouched photo. The background pattern (dots or grid) follows the theme the same way. choices.themes lists the 15 gallery themes; older theme ids are still accepted. Featured photos are listed in choices.backdrop.featured."},"heroArtwork":{"type":"object","additionalProperties":false,"properties":{"image":{"oneOf":[{"$ref":"#/components/schemas/WorkingDesignImage"},{"type":"null"}]},"imageAlt":{"type":"string","maxLength":500,"description":"Accessible description for hero artwork. Setting image to null removes the image and keeps this value."}},"description":"Optional artwork displayed by the Split hero layout in website mode, persisted in customization.heroImage and customization.heroImageAlt. Other hero layouts retain this value without displaying it. Setting image to null removes only the image and keeps imageAlt and unrelated customization."},"welcomeScreen":{"type":"boolean","description":"Whether clients see the welcome screen before the first step, the same switch as Design, Pages, Show welcome screen in the builder. false sends clients straight to the first step. Stored in customization.welcomeScreenEnabled; omit it to keep the saved setting."}}},"WorkingDesignReadDesign":{"type":"object","additionalProperties":false,"properties":{"theme":{"$ref":"#/components/schemas/WorkingDesignDesign/properties/theme"},"mode":{"$ref":"#/components/schemas/WorkingDesignDesign/properties/mode"},"slideshow":{"$ref":"#/components/schemas/WorkingDesignDesign/properties/slideshow"},"overrides":{"type":"object","additionalProperties":true,"properties":{"primaryColor":{"type":"string"},"accentColor":{"type":"string"},"backgroundColor":{"type":"string"},"foregroundColor":{"type":"string"},"displayFont":{"type":"string"},"bodyFont":{"type":"string"},"density":{"type":"string"},"radiusScale":{"type":"string"},"baseSize":{"type":"number"},"customFont":{"type":"string","description":"Name of the font uploaded through the builder."},"customFontUrl":{"type":"string","description":"Persisted public URL returned by the validated font upload."}},"description":"Saved overrides are retained by the read projection, including uploaded custom-font names, URLs and family selections. Only recognized strict mutation fields may be sent in PATCH."},"layouts":{"$ref":"#/components/schemas/WorkingDesignDesign/properties/layouts"},"layoutConfig":{"$ref":"#/components/schemas/WorkingDesignDesign/properties/layoutConfig"},"backdrop":{"type":"object","additionalProperties":false,"required":["style","image"],"properties":{"style":{"type":"string","enum":["photo","glass"]},"image":{"$ref":"#/components/schemas/WorkingDesignImage"},"strength":{"type":"string","enum":["subtle","balanced","bold"]},"text":{"type":"string","enum":["light","dark"],"description":"Glass only: fixed text color over the photo. Absent means auto."},"cards":{"type":"string","enum":["frosted","solid"],"description":"Glass only: card cover. Absent means clear."}},"description":"Photo behind the whole flow. Absent means the theme's plain page color."},"heroArtwork":{"type":"object","additionalProperties":false,"properties":{"image":{"$ref":"#/components/schemas/WorkingDesignDesign/properties/heroArtwork/properties/image"},"imageAlt":{"type":"string","description":"Retained authored alternative text. New PATCH values are limited to 500 characters."}}},"backgroundPattern":{"type":"string","description":"Retained authored background pattern ID. The typed design mutation does not edit this field."},"welcomeScreen":{"type":"boolean","description":"Whether clients see the welcome screen before the first step. true unless it was turned off."}},"description":"Current working design projection, including retained authored values. This read shape is not a PATCH payload; use WorkingDesignDesign for strict edits and null inheritance resets.","required":["theme","overrides","layouts","mode","heroArtwork","welcomeScreen"]},"WorkingDesignCopy":{"type":"object","additionalProperties":false,"properties":{"heroTitle":{"type":"string","maxLength":2000},"heroSubtitle":{"type":"string","maxLength":2000},"heroButtonText":{"type":"string","maxLength":2000},"heroFloatingCard1Text":{"type":"string","maxLength":2000},"heroFloatingCard2Text":{"type":"string","maxLength":2000},"headerTitle":{"type":"string","maxLength":2000},"headerSubtitle":{"type":"string","maxLength":2000},"headerButtonText":{"type":"string","maxLength":2000},"overviewTitle":{"type":"string","maxLength":2000},"overviewDescription":{"type":"string","maxLength":2000},"helpTitle":{"type":"string","maxLength":2000},"helpDescription":{"type":"string","maxLength":2000},"thankYouTitle":{"type":"string","maxLength":2000},"thankYouDescription":{"type":"string","maxLength":2000}}},"WorkingDesignReadCopy":{"type":"object","additionalProperties":false,"properties":{"heroTitle":{"type":"string"},"heroSubtitle":{"type":"string"},"heroButtonText":{"type":"string"},"heroFloatingCard1Text":{"type":"string"},"heroFloatingCard2Text":{"type":"string"},"headerTitle":{"type":"string"},"headerSubtitle":{"type":"string"},"headerButtonText":{"type":"string"},"overviewTitle":{"type":"string"},"overviewDescription":{"type":"string"},"helpTitle":{"type":"string"},"helpDescription":{"type":"string"},"thankYouTitle":{"type":"string"},"thankYouDescription":{"type":"string"}},"description":"Retained authored design copy. New PATCH values are limited to 2000 characters per field, while reads preserve existing text."},"WorkingDesignChoice":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"compatibleModes":{"type":"array","items":{"type":"string","enum":["website","slideshow"]}}}},"WorkingDesignChoices":{"type":"object","required":["themes","layouts","modes","imageSources","fonts","copyFields","heroArtwork","backdrop"],"properties":{"themes":{"type":"array","items":{"$ref":"#/components/schemas/WorkingDesignChoice"}},"layouts":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/WorkingDesignChoice"}}},"modes":{"type":"array","items":{"type":"string","enum":["website","slideshow"]}},"slideshowTransitions":{"type":"array","items":{"type":"string","enum":["vertical","horizontal","fade"]},"description":"Accepted values for design.slideshow.transition."},"imageSources":{"type":"array","items":{"type":"string","enum":["url","unsplash"]}},"fonts":{"type":"array","items":{"type":"object","required":["id","name","roles"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["display","body","mono"]}}}}},"copyFields":{"type":"array","items":{"type":"string"}},"backdrop":{"type":"object","required":["styles","strengths","featured"],"properties":{"styles":{"type":"array","items":{"type":"string","enum":["photo","glass"]}},"strengths":{"type":"array","items":{"type":"string","enum":["subtle","balanced","bold"]}},"featured":{"type":"array","items":{"type":"object","required":["id","label","tone","image"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"tone":{"type":"string","enum":["light","dark"]},"image":{"$ref":"#/components/schemas/WorkingDesignImage"}}}}},"description":"Backdrop styles, strengths and featured Unsplash photos ready to use as design.backdrop.image."},"heroArtwork":{"type":"object","required":["layouts","modes"],"properties":{"layouts":{"type":"array","items":{"type":"string","enum":["split"]}},"modes":{"type":"array","items":{"type":"string","enum":["website"]}}},"description":"Hero artwork renders only in these layouts and presentation modes."}}},"WorkingDesignData":{"type":"object","required":["design","copy","updatedAt","staged"],"properties":{"design":{"$ref":"#/components/schemas/WorkingDesignReadDesign"},"copy":{"$ref":"#/components/schemas/WorkingDesignReadCopy"},"updatedAt":{"type":"string","format":"date-time"},"staged":{"type":"boolean"},"unsplashTracking":{"type":"string","enum":["not_needed","tracked","failed","unknown"],"description":"Returned by updates. Tracking follows accepted saves, never rolls them back, and unknown network outcomes must not be automatically retried."}}},"WorkingDesignResponse":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkingDesignData"},"choices":{"$ref":"#/components/schemas/WorkingDesignChoices"}}},"WorkingDesignGetResponse":{"type":"object","required":["data","choices"],"properties":{"data":{"$ref":"#/components/schemas/WorkingDesignData"},"choices":{"$ref":"#/components/schemas/WorkingDesignChoices"}}}}},"tags":[{"name":"Workspaces","description":"Account-level workspace discovery."},{"name":"Flows","description":"Read published V2 onboarding flows and their statistics, and start new onboardings from configured inbound events."},{"name":"Clients","description":"Create and manage V2 client onboarding records."},{"name":"Responses","description":"Read submitted V2 onboarding responses."},{"name":"Webhooks","description":"Manage event subscriptions and delivery history."},{"name":"Client Portal","description":"Workspace-scoped client portal operations. See the discovery operation for the live route and payload contract catalog."},{"name":"Agent Support","description":"Agent support endpoints exposed through the public API."}],"externalDocs":{"description":"API and Webhooks guide","url":"https://www.360onboard.com/help/api-documentation"},"x-source-commit":"4c9077f4a38d26fbf4f9278bc1326450ccac587f","x-generated-from":"Production source origin/main, lib/public-api/v2/portal-router.ts, app/api/public/v2/workspaces, and content/help/api-documentation.md","x-request-schema-caveat":["Zod 3.25.76 was installed; no zod-to-json-schema or OpenAPI converter was installed.","Schemas were evaluated from origin/main TypeScript modules using transpileModule and a require allowlist limited to Zod and relative schema modules; invoice tax-name predicate was stubbed solely to execute its refinement definition.","Refinements and transforms cannot be represented as JSON Schema and are marked x-zod-refined/x-zod-transform.","Optional/default wrappers carry x-zod-optional/x-zod-defaulted hints; defaults may be omitted from API acceptance semantics.","Recursive/lazy schemas are emitted inline with recursion marker where encountered; discriminated unions use oneOf and discriminator.","Custom effect logic such as cross-field validation is not enforceable by these JSON schemas and needs prose/error documentation."],"x-documentation-notes":["Generated from production source commit 4c9077f4a38d26fbf4f9278bc1326450ccac587f.","Dynamic nested flow definitions, response-step output values and portal resources retain extension fields where the source model is intentionally extensible; the server response remains authoritative.","The OpenAPI document describes the REST API. MCP uses OAuth and is documented separately."],"webhooks":{"outboundEvent":{"post":{"operationId":"receive360OnboardWebhookEvent","summary":"Receive a 360Onboard event","description":"Webhook receiver contract for events sent by 360Onboard. Verify the HMAC using the raw request body, apply a 300-second timestamp tolerance as receiver guidance, deduplicate by delivery ID, and return any 2xx promptly after accepting the event. The sender retries failed network requests and non-2xx responses up to eight total attempts. This receiver has no apiKey query authentication.","security":[{"webhookSignature":[]}],"parameters":[{"name":"X-360Onboard-Webhook-Id","in":"header","required":true,"description":"Unique delivery identifier; use for deduplication.","schema":{"type":"string"}},{"name":"X-360Onboard-Event","in":"header","required":true,"description":"Concrete event name, such as client.completed.","schema":{"type":"string"}},{"name":"X-360Onboard-Timestamp","in":"header","required":true,"description":"Unix timestamp in seconds used in the signature.","schema":{"type":"string"}},{"name":"X-360Onboard-Signature","in":"header","required":true,"description":"HMAC-SHA256 signature in t=<timestamp>,v1=<hex> form.","schema":{"type":"string"}},{"name":"X-360Onboard-Delivery-Attempt","in":"header","required":true,"description":"One-based delivery attempt number.","schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"description":"Sender identifier: 360Onboard-Webhooks/2.0.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventEnvelope"},"example":{"id":"44444444-4444-4444-8444-444444444444","object":"event","api_version":"v2","type":"client.completed","workspace_id":"11111111-1111-4111-8111-111111111111","created_at":"2026-09-10T12:00:00Z","data":{"client_id":"55555555-5555-4555-8555-555555555555","flow_id":"22222222-2222-4222-8222-222222222222","status":"completed"}}}}},"responses":{"200":{"description":"Receiver accepted the event. Any 2xx response is treated as successful delivery."},"202":{"description":"Receiver accepted the event for asynchronous processing."},"204":{"description":"Receiver accepted the event without a response body."},"400":{"description":"Receiver rejected an invalid event."},"401":{"description":"Signature verification failed."}}}}},"x-portal-contract-coverage":{"portalPaths":86,"portalOperations":150,"syntheticExamples":true,"limitations":["Portal responses include heterogeneous provider/resource subobjects that remain open objects where production sources do not define a stable interface type.","Home block payloads are modeled as the supported production type variants; the live catalog endpoint remains the source for newly added metadata.","Manual route validators are represented with operation-local schemas; no portal JSON request body remains flagged as unmodeled."]}}