{"openapi":"3.1.0","info":{"title":"Glance API V1","version":"1.6.2","description":"The Glance public API.\n\nAuthenticate every request with a `cg_live_` API key (create one under Settings, then API) sent as a Bearer token:\n\n    Authorization: Bearer cg_live_...\n\nRead endpoints accept GET (arguments as query parameters) or POST (arguments as a JSON body). Write endpoints are POST only. Every response is JSON: `{ \"data\": ... }` on success, or `{ \"error\": { \"code\": \"...\", \"message\": \"...\", \"reason\": \"...\" } }` with a 4xx or 5xx status on failure. `code` keeps the value it has always had, so scripts can compare it. `reason`, when present, names the specific failure, for example `SLUG_TAKEN` beside `code` `BAD_REQUEST`. Some errors add detail fields: a plan limit sends `limit` and `current`. A key acts only within its own organization; call `users/me` to find your organization id. Agency staff keys may pass `organizationId` to act on a client organization.\n\nSecrets never come back: password hashes, integration tokens and billing ids are stripped from every answer, and organizations report `clickupConnected`, `everhourConnected`, `googleConnected`, `quickbooksConnected` and `zohoDeskConnected` instead."},"x-api-version":"v1","tags":[{"name":"Users"},{"name":"Organizations"},{"name":"Portals"},{"name":"Invites"},{"name":"Portal Groups"},{"name":"Analytics"},{"name":"Connected Apps"},{"name":"API Keys"},{"name":"ClickUp"},{"name":"Everhour"},{"name":"Brand"},{"name":"Custom Domains"},{"name":"Links"},{"name":"Google Drive"},{"name":"Billing"},{"name":"Portal View"}],"x-tagGroups":[{"name":"Workspace","tags":["Users","Organizations","Invites","Custom Domains"]},{"name":"Portals","tags":["Portals","Portal Groups","Portal View","Analytics"]},{"name":"Integrations","tags":["ClickUp","Everhour","Google Drive"]},{"name":"Account","tags":["API Keys","Billing"]},{"name":"Utilities","tags":["Brand","Links"]},{"name":"Other","tags":["Connected Apps"]}],"servers":[{"url":"https://clientglance.com","description":"Production"},{"url":"http://localhost:3060","description":"Local dev"}],"security":[{"bearerAuth":[]}],"components":{"schemas":{"ErrorEnvelope":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable code, e.g. BAD_REQUEST or NOT_FOUND."},"message":{"type":"string"},"reason":{"type":"string","description":"The specific failure when one is known, e.g. SLUG_TAKEN."}},"additionalProperties":true}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A cg_live_ key created at /settings/api, sent as a Bearer token."}}},"paths":{"/api/v1/users/me":{"get":{"tags":["Users"],"summary":"Who am I","description":"Returns the user behind this key with their organization. Call it first to find your organizationId.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"users_me","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[]}},"/api/v1/users/get":{"get":{"tags":["Users"],"summary":"Get a user","description":"Returns one user by id. The user must belong to your organization.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"users_get","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (users)"}}]}},"/api/v1/users/list":{"get":{"tags":["Users"],"summary":"List members","description":"Lists every member of an organization (organizationId) with their role.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"users_list","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/users/create":{"post":{"tags":["Users"],"summary":"Create a user","description":"Creates a user record by email and optional name, for beta seeding. Agency staff keys only.","x-hints":{"readOnly":false,"destructive":false,"openWorld":false,"staffOnly":true},"operationId":"users_create","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"additionalProperties":false,"required":["email"]}}}}}},"/api/v1/users/removeFromOrganization":{"post":{"tags":["Users"],"summary":"Remove a member","description":"Removes a member (id) from their organization. Owners only.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"users_removeFromOrganization","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (users)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/users/updateProfile":{"post":{"tags":["Users"],"summary":"Update your profile","description":"Changes the display name (name) of the user behind this key.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"users_updateProfile","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"additionalProperties":false,"required":["name"]}}}}}},"/api/v1/users/setRole":{"post":{"tags":["Users"],"summary":"Change a member's role","description":"Sets a member's (id) role to admin or member. Owners and admins only.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"users_setRole","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (users)"},"role":{"type":"string","enum":["admin","member"]}},"additionalProperties":false,"required":["id","role"]}}}}}},"/api/v1/users/transferOwnership":{"post":{"tags":["Users"],"summary":"Transfer ownership","description":"Makes another member (id) the organization owner. You become an admin. Owners only.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"users_transferOwnership","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (users)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/organizations/get":{"get":{"tags":["Organizations"],"summary":"Get an organization","description":"Returns one organization by id: name, slug, plan, branding and which integrations are connected. Secrets are never returned.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"organizations_get","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/organizations/getBySlug":{"get":{"tags":["Organizations"],"summary":"Get an organization by slug","description":"Returns the organization with this slug, if you're a member.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"organizations_getBySlug","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"slug","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/v1/organizations/list":{"get":{"tags":["Organizations"],"summary":"List all organizations","description":"Lists every organization on the platform. Agency staff keys only.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":true},"operationId":"organizations_list","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[]}},"/api/v1/organizations/listMigrationTargets":{"get":{"tags":["Organizations"],"summary":"List portal migration targets","description":"Lists every organization by id, name and slug, for picking where portals/migrateToOrganization moves a portal. Agency staff keys only.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":true},"operationId":"organizations_listMigrationTargets","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[]}},"/api/v1/organizations/provisionForClient":{"post":{"tags":["Organizations"],"summary":"Provision a client organization","description":"Creates an organization for a client owner (name, slug, ownerEmail) with optional branding. Agency staff keys only.","x-hints":{"readOnly":false,"destructive":false,"openWorld":false,"staffOnly":true},"operationId":"organizations_provisionForClient","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brandColor":{"type":"string"},"language":{"type":"string","enum":["en","fr","es"]},"logoUrl":{"type":"string"},"name":{"type":"string"},"ownerEmail":{"type":"string"},"ownerName":{"type":"string"},"slug":{"type":"string"}},"additionalProperties":false,"required":["name","ownerEmail","slug"]}}}}}},"/api/v1/organizations/clearClickUpToken":{"post":{"tags":["Organizations"],"summary":"Disconnect ClickUp","description":"Removes the stored ClickUp token from an organization (id). Portals stop syncing until ClickUp is connected again.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"organizations_clearClickUpToken","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/organizations/clearEverhourConnection":{"post":{"tags":["Organizations"],"summary":"Disconnect Everhour","description":"Removes the stored Everhour key from an organization (id).","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"organizations_clearEverhourConnection","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portals/get":{"get":{"tags":["Portals"],"summary":"Get a portal","description":"Returns one portal by id with its effective dashboard config.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_get","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}}]}},"/api/v1/portals/getBySlug":{"get":{"tags":["Portals"],"summary":"Get a portal by slug","description":"Returns the portal with this slug, if it belongs to your organization.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_getBySlug","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"slug","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/v1/portals/list":{"get":{"tags":["Portals"],"summary":"List portals","description":"Lists every portal in an organization (organizationId), active or not.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_list","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/portals/listActive":{"get":{"tags":["Portals"],"summary":"List active portals","description":"Lists the active portals in an organization (organizationId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_listActive","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/portals/listDashboard":{"get":{"tags":["Portals"],"summary":"List portals for the dashboard","description":"Lists an organization's portals (organizationId) in the light shape the agency dashboard shows.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_listDashboard","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/portals/getWithOrganization":{"get":{"tags":["Portals"],"summary":"Get a portal with its organization","description":"Returns a portal (id) together with the organization that owns it.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_getWithOrganization","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}}]}},"/api/v1/portals/count":{"get":{"tags":["Portals"],"summary":"Count portals","description":"Returns how many portals an organization (organizationId) has, for checking against the plan limit.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_count","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/portals/setFeatures":{"post":{"tags":["Portals"],"summary":"Set portal features","description":"Turns portal features on or off (id): chat, client docs, time tracking and its source, package budget, and indicators.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"portals_setFeatures","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chatEnabled":{"type":"boolean"},"chatViewId":{"type":"string"},"clientDocId":{"type":"string"},"clientDocsEnabled":{"type":"boolean"},"disableIndicators":{"type":"array","items":{"type":"string"}},"enableIndicators":{"type":"array","items":{"type":"string"}},"everhourProjectIds":{"type":"array","items":{"type":"string"}},"id":{"type":"string","description":"Convex document id (portals)"},"packageBudgetCapAmount":{"type":"number"},"packageBudgetCapUnit":{"type":"string","enum":["hours","tasks"]},"packageBudgetEnabled":{"type":"boolean"},"packageBudgetType":{"type":"string","enum":["monthly_unlimited","monthly_capped","consumable"]},"timeSource":{"type":"string","enum":["clickup","everhour"]},"timeTrackingEnabled":{"type":"boolean"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portals/setProfitability":{"post":{"tags":["Portals"],"summary":"Set portal profitability","description":"Stores the agency-only margin inputs for a portal (id). Pass no profitability to clear them.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"portals_setProfitability","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (portals)"},"profitability":{"type":"object","properties":{"currency":{"type":"string"},"deal_field_id":{"type":"string"},"deal_field_name":{"type":"string"},"default_rate":{"type":"number"},"rate_field_id":{"type":"string"},"rate_field_name":{"type":"string"}},"additionalProperties":false,"required":["deal_field_id","deal_field_name"]}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/invites/list":{"get":{"tags":["Invites"],"summary":"List invites","description":"Lists the pending invites for an organization (organizationId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"invites_list","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/invites/setRole":{"post":{"tags":["Invites"],"summary":"Change an invite's role","description":"Changes the role (admin or member) a pending invite (id) will join with.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"invites_setRole","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (invites)"},"role":{"type":"string","enum":["admin","member"]}},"additionalProperties":false,"required":["id","role"]}}}}}},"/api/v1/invites/accept":{"post":{"tags":["Invites"],"summary":"Accept an invite","description":"Accepts an invite (id) addressed to you and joins its organization.","x-hints":{"readOnly":false,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"invites_accept","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (invites)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/invites/cancel":{"post":{"tags":["Invites"],"summary":"Cancel an invite","description":"Cancels a pending invite (id). Its link stops working.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"invites_cancel","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (invites)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portal-groups/list":{"get":{"tags":["Portal Groups"],"summary":"List portal groups","description":"Lists the portal groups (shared config templates) in an organization.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portal_groups_list","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/portal-groups/get":{"get":{"tags":["Portal Groups"],"summary":"Get a portal group","description":"Returns one portal group (id) with its config.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portal_groups_get","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portalGroups)"}}]}},"/api/v1/portal-groups/listMembers":{"get":{"tags":["Portal Groups"],"summary":"List group portals","description":"Lists the portals linked to a group (groupId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portal_groups_listMembers","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"groupId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portalGroups)"}}]}},"/api/v1/portal-groups/update":{"post":{"tags":["Portal Groups"],"summary":"Update a portal group","description":"Renames a group (id) or replaces its config. Every portal in the group gets the new settings and keeps its own branding, theme and client fields.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"portal_groups_update","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","properties":{"branding":{"type":"object","properties":{"font_family":{"type":"string"},"hide_powered_by":{"type":"boolean"},"logo_url":{"type":"string"},"primary_color":{"type":"string"},"thumbnail":{"type":"string","enum":["auto","custom"]}},"additionalProperties":false,"required":["font_family","primary_color","thumbnail"]},"dashboardOptions":{"type":"object","properties":{"bookmarks":{"type":"object","properties":{"enabled":{"type":"boolean"},"links":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"image":{"type":"string"},"label":{"type":"string"},"url":{"type":"string"}},"additionalProperties":false,"required":["id","label","url"]}},"title":{"type":"string"}},"additionalProperties":false,"required":["enabled","links"]},"chat":{"type":"object","properties":{"clickup_chat_view_id":{"type":"string"},"enabled":{"type":"boolean"},"placement":{"type":"string","enum":["floating","docked"]}},"additionalProperties":false,"required":["enabled"]},"client_docs":{"type":"object","properties":{"clickup_doc_id":{"type":"string"},"enabled":{"type":"boolean"}},"additionalProperties":false,"required":["enabled"]},"client_visible_details":{"type":"object","properties":{"custom_fields":{"type":"array","items":{"type":"object","properties":{"clickup_field_id":{"type":"string"},"field_name":{"type":"string"}},"additionalProperties":false,"required":["clickup_field_id","field_name"]}},"show_custom_fields":{"type":"boolean"},"show_description":{"type":"boolean"}},"additionalProperties":false},"count_subtasks":{"type":"boolean"},"deliverables":{"type":"object","properties":{"count_checklists":{"type":"boolean"},"custom_item_ids":{"type":"array","items":{"type":"number"}},"enabled":{"type":"boolean"},"identification_method":{"type":"string"},"progress_window":{"type":"string","enum":["all","week","month","quarter","year"]},"show_battery":{"type":"boolean"},"show_countdown":{"type":"boolean"},"show_traffic_light":{"type":"boolean"},"visible_statuses":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["enabled"]},"files":{"type":"object","properties":{"allow_client_upload":{"type":"boolean"},"enabled":{"type":"boolean"},"title":{"type":"string"}},"additionalProperties":false,"required":["enabled"]},"financial_metrics":{"type":"object","properties":{"enabled":{"type":"boolean"},"metrics":{"type":"array","items":{"type":"object","properties":{"aggregation":{"type":"string","enum":["sum","average"]},"clickup_field_id":{"type":"string"},"currency":{"type":"string"},"field_name":{"type":"string"},"field_type":{"type":"string","enum":["currency","number","formula"]},"id":{"type":"string"},"label":{"type":"string"},"precision":{"type":"number"},"status_names":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["aggregation","clickup_field_id","field_name","field_type","id","label"]}}},"additionalProperties":false,"required":["enabled","metrics"]},"free_text":{"type":"object","properties":{"content":{"type":"string"},"enabled":{"type":"boolean"},"title":{"type":"string"}},"additionalProperties":false,"required":["enabled"]},"invoice_status":{"type":"object","properties":{"enabled":{"type":"boolean"},"quickbooks_customer_id":{"type":"string"}},"additionalProperties":false,"required":["enabled"]},"layout":{"type":"object","properties":{"card_order":{"type":"array","items":{"type":"string"}},"hidden_metrics":{"type":"array","items":{"type":"string","enum":["progress","time","financial","active_tasks"]}}},"additionalProperties":false,"required":["card_order"]},"package_budget":{"type":"object","properties":{"cap_amount":{"type":"number"},"cap_unit":{"type":"string","enum":["hours","tasks"]},"enabled":{"type":"boolean"},"expiry_date":{"type":"string"},"past_packages":{"type":"array","items":{"type":"object","properties":{"expiry_date":{"type":"string"},"id":{"type":"string"},"size_hours":{"type":"number"},"start_date":{"type":"string"}},"additionalProperties":false,"required":["expiry_date","id","size_hours","start_date"]}},"period":{"type":"string","enum":["week","month","quarter","year"]},"show_overflow":{"type":"boolean"},"start_date":{"type":"string"},"type":{"type":"string","enum":["monthly_unlimited","monthly_capped","consumable"]}},"additionalProperties":false,"required":["enabled","type"]},"project_status":{"type":"object","properties":{"enabled":{"type":"boolean"},"include_subtasks":{"type":"boolean"}},"additionalProperties":false,"required":["enabled"]},"project_tracking":{"type":"object","properties":{"enabled":{"type":"boolean"},"include_subtasks":{"type":"boolean"},"show_default_fields":{"type":"boolean"},"show_time_fields":{"type":"boolean"},"status_breakdown_filter":{"type":"object","properties":{"custom_item_ids":{"type":"array","items":{"type":"number"}},"date_filters":{"type":"array","items":{"type":"object","properties":{"days":{"type":"number"},"field":{"type":"string","enum":["created","updated","due","start"]},"from":{"type":"number"},"op":{"type":"string","enum":["before","after","between","last_n_days"]},"to":{"type":"number"}},"additionalProperties":false,"required":["field","op"]}},"field_filters":{"type":"array","items":{"type":"object","properties":{"clickup_field_id":{"type":"string"},"field_name":{"type":"string"},"op":{"type":"string","enum":["any_of","none_of","is_set","is_empty"]},"values":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["clickup_field_id","field_name","op"]}},"item_level":{"type":"string","enum":["all","parents","subtasks"]},"status_names":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false,"required":["enabled"]},"requests":{"type":"object","properties":{"allow_items":{"type":"boolean"},"allow_new":{"type":"boolean"},"client_notification_email":{"type":"string"},"enabled":{"type":"boolean"},"hide_comment_mentions":{"type":"boolean"},"needs_client_status_names":{"type":"array","items":{"type":"string"}},"notify_client_on_action":{"type":"boolean"},"show_comments":{"type":"boolean"},"show_completed":{"type":"boolean"},"tag_requests":{"type":"boolean"},"visible_filter":{"type":"object","properties":{"custom_item_ids":{"type":"array","items":{"type":"number"}},"date_filters":{"type":"array","items":{"type":"object","properties":{"days":{"type":"number"},"field":{"type":"string","enum":["created","updated","due","start"]},"from":{"type":"number"},"op":{"type":"string","enum":["before","after","between","last_n_days"]},"to":{"type":"number"}},"additionalProperties":false,"required":["field","op"]}},"field_filters":{"type":"array","items":{"type":"object","properties":{"clickup_field_id":{"type":"string"},"field_name":{"type":"string"},"op":{"type":"string","enum":["any_of","none_of","is_set","is_empty"]},"values":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["clickup_field_id","field_name","op"]}},"item_level":{"type":"string","enum":["all","parents","subtasks"]},"status_names":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false,"required":["enabled"]},"scheduled_reports":{"type":"object","properties":{"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["weekly","monthly"]},"recipient_emails":{"type":"array","items":{"type":"string"}},"sections":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["enabled","frequency","sections"]},"task_review":{"type":"object","properties":{"client_notification_email":{"type":"string"},"client_review_status_names":{"type":"array","items":{"type":"string"}},"custom_item_ids":{"type":"array","items":{"type":"number"}},"enabled":{"type":"boolean"},"hide_comment_mentions":{"type":"boolean"},"item_level":{"type":"string","enum":["all","parents","subtasks"]},"notify_frequency":{"type":"string","enum":["off","every_change","daily","weekly"]},"show_comments":{"type":"boolean"}},"additionalProperties":false,"required":["enabled"]},"time_tracking":{"type":"object","properties":{"anonymize_users":{"type":"boolean"},"clickup_space_id":{"type":"string"},"custom_item_ids":{"type":"array","items":{"type":"number"}},"enabled":{"type":"boolean"},"everhour_project_ids":{"type":"array","items":{"type":"string"}},"group_by":{"type":"string","enum":["none","status","custom_field"]},"group_by_field_id":{"type":"string"},"group_by_field_name":{"type":"string"},"include_subtasks":{"type":"boolean"},"include_tasks":{"type":"boolean"},"show_top_tasks":{"type":"boolean"},"show_user_timesheet":{"type":"boolean"},"source":{"type":"string","enum":["clickup","everhour"]}},"additionalProperties":false,"required":["custom_item_ids","enabled","include_subtasks","include_tasks"]}},"additionalProperties":false,"required":["chat","client_docs","deliverables","project_tracking","task_review","time_tracking"]},"language":{"type":"string","enum":["en","fr","es"]},"portalIndicators":{"type":"array","items":{"type":"string"}},"themeId":{"type":"string"}},"additionalProperties":false,"required":["branding","portalIndicators","themeId"]},"id":{"type":"string","description":"Convex document id (portalGroups)"},"name":{"type":"string"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portal-groups/remove":{"post":{"tags":["Portal Groups"],"summary":"Delete a portal group","description":"Deletes a portal group (id). Its portals become Custom and keep what they show today.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"portal_groups_remove","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (portalGroups)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portal-groups/linkPortal":{"post":{"tags":["Portal Groups"],"summary":"Link a portal to a group","description":"Moves a portal (portalId) into a group (groupId), replacing its shared settings with the group's. A null groupId makes it Custom.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"portal_groups_linkPortal","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupId":{"anyOf":[{"type":"string","description":"Convex document id (portalGroups)"},{"type":"null"}]},"portalId":{"type":"string","description":"Convex document id (portals)"}},"additionalProperties":false,"required":["groupId","portalId"]}}}}}},"/api/v1/analytics/trend":{"get":{"tags":["Analytics"],"summary":"Get the visit trend","description":"Returns daily client visits and unlocks across an organization's portals (organizationId) since sinceMs (at most 400 days back), plus per-portal totals.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"analytics_trend","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}},{"name":"sinceMs","in":"query","required":true,"schema":{"type":"number"}}]}},"/api/v1/analytics/visitCounts":{"get":{"tags":["Analytics"],"summary":"Get cached visit counts","description":"Returns the cached 30-day visit count per portal for an organization (organizationId), with stale true once it's over an hour old. Null before the first refresh.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"analytics_visitCounts","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/analytics/refreshVisitCounts":{"post":{"tags":["Analytics"],"summary":"Refresh visit counts","description":"Recounts the 30-day visits per portal for an organization (organizationId) and stores them, like the dashboard does when the cache is stale. A count under an hour old comes back unchanged.","x-hints":{"readOnly":false,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"analytics_refreshVisitCounts","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["organizationId"]}}}}}},"/api/v1/connected-apps/list":{"get":{"tags":["Connected Apps"],"summary":"List connected AI apps","description":"Lists the AI apps (Claude, ChatGPT and others) you connected over OAuth, one row per connection with its family id, name, organization and since.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"connected_apps_list","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[]}},"/api/v1/connected-apps/revoke":{"post":{"tags":["Connected Apps"],"summary":"Disconnect an AI app","description":"Disconnects one AI app connection (family) you own. Its tokens stop working right away. An unknown family does nothing.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"connected_apps_revoke","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"family":{"type":"string"}},"additionalProperties":false,"required":["family"]}}}}}},"/api/v1/api-keys/list":{"get":{"tags":["API Keys"],"summary":"List API keys","description":"Lists an organization's API keys (organizationId) by name and prefix. The secret is never returned.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"api_keys_list","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/api-keys/revoke":{"post":{"tags":["API Keys"],"summary":"Revoke an API key","description":"Revokes an API key (id). Calls made with it fail from then on.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"api_keys_revoke","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (apiKeys)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/integrations/clickup/workspaces":{"get":{"tags":["ClickUp"],"summary":"List ClickUp workspaces","description":"Lists the ClickUp workspaces the organization's connected token can see.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_workspaces","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/spaces":{"get":{"tags":["ClickUp"],"summary":"List ClickUp spaces","description":"Lists the spaces in a ClickUp workspace (workspaceId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_spaces","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/space-hierarchy":{"get":{"tags":["ClickUp"],"summary":"Get a ClickUp space hierarchy","description":"Returns the folders and folderless lists in a ClickUp space (spaceId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_space_hierarchy","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"spaceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/folder-lists":{"get":{"tags":["ClickUp"],"summary":"List lists in a ClickUp folder","description":"Returns the id and name of every list in a folder (folderId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_folder_lists","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"folderId","in":"query","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/statuses":{"get":{"tags":["ClickUp"],"summary":"List ClickUp statuses","description":"Returns the statuses of a ClickUp list or folder (locationId, locationType list or folder). A folder uses its first list's workflow.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_statuses","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"locationId","in":"query","required":true,"schema":{"type":"string"}},{"name":"locationType","in":"query","required":false,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/custom-fields":{"get":{"tags":["ClickUp"],"summary":"List ClickUp custom fields","description":"Returns the custom fields at a list or folder (locationId). scope task_review returns review fields; otherwise the money fields used for budgets.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_custom_fields","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"locationId","in":"query","required":true,"schema":{"type":"string"}},{"name":"locationType","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/custom-items":{"get":{"tags":["ClickUp"],"summary":"List ClickUp task types","description":"Returns the custom task types (workspaceId) that tasks at a list or folder actually use.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_custom_items","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"locationId","in":"query","required":false,"schema":{"type":"string"}},{"name":"locationType","in":"query","required":false,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/docs":{"get":{"tags":["ClickUp"],"summary":"List ClickUp docs","description":"Returns up to 50 live docs in a ClickUp workspace (workspaceId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_docs","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/list-docs":{"get":{"tags":["ClickUp"],"summary":"List docs on a ClickUp list","description":"Returns up to 50 readable docs attached to a list (workspaceId, listId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_list_docs","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"listId","in":"query","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/chat-channels":{"get":{"tags":["ClickUp"],"summary":"List ClickUp chat channels","description":"Returns the chat channels in a ClickUp workspace (workspaceId).","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_chat_channels","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/chat-channel-at-location":{"get":{"tags":["ClickUp"],"summary":"Find the chat channel on a location","description":"Returns the ClickUp chat channel attached to a list or folder (workspaceId, locationId, locationType), or null.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_chat_channel_at_location","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"locationId","in":"query","required":true,"schema":{"type":"string"}},{"name":"locationType","in":"query","required":false,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/capabilities":{"get":{"tags":["ClickUp"],"summary":"Check ClickUp capabilities","description":"Probes what the connected ClickUp plan allows in a workspace (workspaceId). Today it reports whether time tracking is available.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_capabilities","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"workspaceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/everhour/projects":{"get":{"tags":["Everhour"],"summary":"List Everhour projects","description":"Lists the organization's open Everhour projects. Archived projects are hidden.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_everhour_projects","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/everhour/team-users":{"get":{"tags":["Everhour"],"summary":"List Everhour team members","description":"Lists the Everhour team's members with names, emails and avatars.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_everhour_team_users","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/brand/extract":{"post":{"tags":["Brand"],"summary":"Extract a brand","description":"Reads a website (url) and returns its name, main color and logo. The logo is uploaded to storage and returned as logoUrl; any field can be null.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"brand_extract","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"additionalProperties":false,"required":["url"]}}}}}},"/api/v1/api-keys/create":{"post":{"tags":["API Keys"],"summary":"Create an API key","description":"Mints a new API key (name, up to 60 characters) for the organization. Returns the plaintext key once; only its hash is stored. Owners only.","x-hints":{"readOnly":false,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"api_keys_create","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["name"]}}}}}},"/api/v1/invites/send":{"post":{"tags":["Invites"],"summary":"Invite teammates","description":"Invites each address in emails to the organization as role admin or member (member by default) and emails each one a sign-in link that's good for 7 days. Returns how many invites went out.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"invites_send","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string"}},"role":{"type":"string","enum":["admin","member"]},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["emails"]}}}}}},"/api/v1/invites/resend":{"post":{"tags":["Invites"],"summary":"Resend an invite","description":"Gives a pending invite (id) a new link and a fresh 7-day expiry, and emails it to the invitee again. The old link stops working. Answers 404 when the invite was cancelled or already accepted.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":false},"operationId":"invites_resend","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (invites)"},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/organizations/update":{"post":{"tags":["Organizations"],"summary":"Update an organization","description":"Changes the organization's name (100 characters max), brandColor (#rrggbb), language, logoUrl (http or https, null clears it) or, for agency staff, allowedClickupWorkspaceIds and clickupConnectionSource (agency sends every member to connect their own ClickUp on their next login, and that connect clears it). Owners only. Tokens and billing go through their own endpoints.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"organizations_update","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"brandColor":{"type":"string"},"language":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"allowedClickupWorkspaceIds":{"type":"array","items":{"type":"string"}},"clickupConnectionSource":{"type":"string","enum":["agency"]},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/organizations/checkSubdomain":{"get":{"tags":["Organizations"],"summary":"Check a subdomain","description":"Checks whether a subdomain (the organization slug in acme.clientglance.app) has a valid format, isn't reserved and isn't taken. Returns available, plus error when it can't be used.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"organizations_checkSubdomain","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"subdomain","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/v1/brand/uploadLogo":{"post":{"tags":["Brand"],"summary":"Upload a logo","description":"Uploads a logo from a public url, or from base64 bytes with a contentType, converts a raster image to AVIF at 1000px max (2 MB max, an SVG is stored as is) and saves it as the organization logo. Pass target none to only store it and get its URL back. Returns url and size details.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"brand_uploadLogo","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"base64":{"type":"string"},"contentType":{"type":"string"},"target":{"type":"string","enum":["organization","none"]},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/custom-domains/set":{"post":{"tags":["Custom Domains"],"summary":"Add a custom domain","description":"Points a domain you own (domain, e.g. clients.youragency.com) at the organization's portals by creating a Cloudflare hostname. Returns its status and the DNS records to add. Agency plan, one domain per organization.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"custom_domains_set","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["domain"]}}}}}},"/api/v1/custom-domains/refresh":{"post":{"tags":["Custom Domains"],"summary":"Recheck a custom domain","description":"Asks Cloudflare for the custom domain's current status and stores it. Returns status, the DNS records still needed and any error.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"custom_domains_refresh","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/custom-domains/remove":{"post":{"tags":["Custom Domains"],"summary":"Remove a custom domain","description":"Deletes the organization's custom domain and its Cloudflare hostname. Portals go back to the clientglance.app address.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":false},"operationId":"custom_domains_remove","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/portals/create":{"post":{"tags":["Portals"],"summary":"Create a portal","description":"Creates a client portal on a ClickUp list or folder, like the setup wizard: checks the plan's portal limit and features, the slug, and review email setup, then registers the review webhook, creates the ClickUp chat channel when chat is on, and warms the cache. Takes name, slug, clickupListName, portalIndicators and branding, plus optional password, trackingScope (list or folder), clickupWorkspaceId, clickupListId or clickupFolderId, themeId, language, dashboardOptions and groupId. Returns the new portal id.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portals_create","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"password":{"type":"string"},"trackingScope":{"type":"string","enum":["list","folder"]},"clickupWorkspaceId":{"type":"string"},"clickupListId":{"type":"string"},"clickupFolderId":{"type":"string"},"clickupListName":{"type":"string"},"portalIndicators":{"type":"array","items":{"type":"string"}},"branding":{"type":"object"},"themeId":{"type":"string"},"language":{"type":"string"},"dashboardOptions":{"type":"object"},"groupId":{"type":"string","description":"Convex document id (portalGroups)"},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["name","slug","clickupListName","portalIndicators","branding"]}}}}}},"/api/v1/portals/update":{"post":{"tags":["Portals"],"summary":"Update a portal","description":"Updates a portal (id) like its settings page: name, slug, branding, language, indicators, dashboardOptions, isActive, the request form's list (requestsListId, requestsListName), the sites allowed to frame it (embedAllowedHosts: up to 10 https origins like https://*.zohopublic.eu, [] clears), the tasks its client sees (taskFilter: {kind: \"tags\", tags} or {kind: \"custom_field\", clickup_field_id, field_name, values} with dropdown or labels option names or ids; a task matching any one shows; null clears and shows every task), or removePassword. Re-syncs the review webhook when dashboardOptions change and warms the cache. Set a password with portals/set-password.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":false},"operationId":"portals_update","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (portals)"},"name":{"type":"string"},"slug":{"type":"string"},"removePassword":{"type":"boolean"},"portalIndicators":{"type":"array","items":{"type":"string"}},"branding":{"type":"object"},"language":{"type":"string"},"dashboardOptions":{"type":"object"},"taskFilter":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"tags"},"tags":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["kind","tags"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom_field"},"clickup_field_id":{"type":"string"},"field_name":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["kind","clickup_field_id","field_name","values"]},{"type":"null"}]},"isActive":{"type":"boolean"},"requestsListId":{"type":"string"},"requestsListName":{"type":"string"},"embedAllowedHosts":{"type":"array","items":{"type":"string"}}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portals/remove":{"post":{"tags":["Portals"],"summary":"Delete a portal","description":"Deletes a portal (id) and its cached data after unregistering its ClickUp review webhook. The client link stops working right away. Owners and admins only.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":false},"operationId":"portals_remove","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (portals)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portals/set-password":{"post":{"tags":["Portals"],"summary":"Set a portal password","description":"Sets the password clients type to open a portal (portalId). Omit password to have a strong one generated. Returns the plaintext password once.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"portals_set_password","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"password":{"type":"string"}},"additionalProperties":false,"required":["portalId"]}}}}}},"/api/v1/portals/revealPassword":{"get":{"tags":["Portals"],"summary":"Reveal a portal password","description":"Returns a portal's (id) current password in plain text, or null when it has none stored or predates saved copies. Members of the portal's organization and agency staff only.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_revealPassword","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}}]}},"/api/v1/portals/resyncWebhook":{"post":{"tags":["Portals"],"summary":"Re-register the review webhook","description":"Registers a portal's (id) ClickUp review webhook again when it's missing or failing, without changing any setting. Owners and admins only. Returns the webhook id, or null when review email is off.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portals_resyncWebhook","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (portals)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portals/migrateToOrganization":{"post":{"tags":["Portals"],"summary":"Move a portal to a client organization","description":"Moves a portal (id) from your own organization to a client one (targetOrganizationId), once that org's ClickUp can read the portal's list or folder. Agency staff keys only.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":true},"operationId":"portals_migrateToOrganization","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (portals)"},"targetOrganizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["id","targetOrganizationId"]}}}}}},"/api/v1/portals/createDriveFolder":{"post":{"tags":["Portals"],"summary":"Create a portal's Drive folder","description":"Creates a Google Drive folder for a portal (portalId) with the organization's template subfolders and links it to the portal. Needs Google Drive connected. Returns folderUrl.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portals_createDriveFolder","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["portalId"]}}}}}},"/api/v1/portals/previewDigest":{"get":{"tags":["Portals"],"summary":"Preview the digest email","description":"Renders a sample digest email from draft settings (name, org, color, logo, language, frequency weekly or monthly, sections) using sample data. Returns the email html. Nothing is sent.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_previewDigest","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"org","in":"query","required":false,"schema":{"type":"string"}},{"name":"color","in":"query","required":false,"schema":{"type":"string"}},{"name":"logo","in":"query","required":false,"schema":{"type":"string"}},{"name":"language","in":"query","required":false,"schema":{"type":"string"}},{"name":"frequency","in":"query","required":false,"schema":{"type":"string","enum":["weekly","monthly"]}},{"name":"sections","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/portals/digest":{"get":{"tags":["Portals"],"summary":"Get a portal's AI digest","description":"Returns the cached AI summary a portal (id) shows its client: headline, summary, status, highlights and needsAttention, with generatedAt. enabled is false when the plan or settings turn it off.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_digest","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}}]}},"/api/v1/portals/regenerateDigest":{"post":{"tags":["Portals"],"summary":"Regenerate a portal's AI digest","description":"Writes a fresh AI summary for a portal (id) from its live data and stores it. A summary that's still fresh comes back unchanged with throttled true, so repeat calls cost nothing.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":false},"operationId":"portals_regenerateDigest","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (portals)"}},"additionalProperties":false,"required":["id"]}}}}}},"/api/v1/portals/openLink":{"post":{"tags":["Portals"],"summary":"Get a portal's sign-in link","description":"Returns a portal's (id, or its slug) public url, plus openUrl, a sign-in link that skips the password: it works once, within 60 seconds, and signs the browser in for 7 days, like Open portal on the dashboard. Mint it at the click and redirect straight to it; clientRef is your own id for the person (up to 200 characters), recorded with the sign-in. Members of the portal's organization and agency staff only.","x-hints":{"readOnly":false,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portals_openLink","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Convex document id (portals)"},"slug":{"type":"string"},"clientRef":{"type":"string"}},"additionalProperties":false}}}}}},"/api/v1/links/unfurl":{"post":{"tags":["Links"],"summary":"Unfurl a link","description":"Fetches a web page (url) and returns its title and preview image for a bookmark tile. The image is copied into storage; either field can be null.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"links_unfurl","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"additionalProperties":false,"required":["url"]}}}}}},"/api/v1/portal-groups/create":{"post":{"tags":["Portal Groups"],"summary":"Create a portal group","description":"Creates a portal group (name) from a config, or from a portal's current config (portalId). With linkPortal true that portal joins the group. Returns the group id.","x-hints":{"readOnly":false,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"portal_groups_create","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"config":{"type":"object"},"portalId":{"type":"string","description":"Convex document id (portals)"},"linkPortal":{"type":"boolean"},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["name"]}}}}}},"/api/v1/integrations/clickup/set-token":{"post":{"tags":["ClickUp"],"summary":"Connect ClickUp with a personal token","description":"Connects ClickUp with a personal token (token, starts with pk_) instead of browser OAuth. Checks it with ClickUp, stores it encrypted, then syncs the workspace members and flags portals the token can't reach. Returns the ClickUp user it belongs to.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_set_token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["token"]}}}}}},"/api/v1/integrations/clickup/verify":{"get":{"tags":["ClickUp"],"summary":"Check the ClickUp connection","description":"Checks that the stored ClickUp token still works. Returns connected with how many workspaces it reaches, or connected false with the reason.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"integrations_clickup_verify","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/clickup/authorize-url":{"get":{"tags":["ClickUp"],"summary":"Get the ClickUp OAuth link","description":"Returns the ClickUp consent URL that connects ClickUp by OAuth. The API can't finish OAuth itself: a person opens the URL in a browser while signed in to Glance as an owner or admin of the organization (or agency staff), and approves. Unless agency staff opens it, the token lands on the signed-in person's own organization. integrations/clickup/set-token needs no browser.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"integrations_clickup_authorize_url","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/everhour/set-key":{"post":{"tags":["Everhour"],"summary":"Connect Everhour","description":"Checks an Everhour team API key (apiKey) with Everhour, then stores it encrypted on the organization. Returns the team name.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":false},"operationId":"integrations_everhour_set_key","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/integrations/google/authorize-url":{"get":{"tags":["Google Drive"],"summary":"Get the Google Drive OAuth link","description":"Returns the Google consent URL that connects Google Drive for portal folders. The API can't finish OAuth itself: a person opens the URL in a browser while signed in to Glance as an owner or admin of the organization (or agency staff), and approves.","x-hints":{"readOnly":true,"destructive":false,"openWorld":false,"staffOnly":false},"operationId":"integrations_google_authorize_url","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/integrations/google/disconnect":{"post":{"tags":["Google Drive"],"summary":"Disconnect Google Drive","description":"Removes the stored Google tokens from the organization. Existing portal folder links stay; new portals stop getting Drive folders until it's connected again.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"integrations_google_disconnect","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/integrations/google/template":{"post":{"tags":["Google Drive"],"summary":"Set the Drive folder template","description":"Replaces the subfolder names (template, a list) created inside each new client folder. Blank names are dropped. Returns the saved list.","x-hints":{"readOnly":false,"destructive":true,"openWorld":false,"staffOnly":false},"operationId":"integrations_google_template","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"template":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false,"required":["template"]}}}}}},"/api/v1/integrations/google/destination":{"post":{"tags":["Google Drive"],"summary":"Set the Drive destination folder","description":"Sets the Drive folder (folderId) new client folders go in, after checking the connected Google account can open it. Omit folderId to go back to My Drive. Returns folderId and folderName.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":false},"operationId":"integrations_google_destination","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"folderId":{"type":"string"},"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/billing/portal-session":{"post":{"tags":["Billing"],"summary":"Open the Stripe billing portal","description":"Creates a Stripe customer portal session for the organization and returns its url, where a person changes plan, card or invoices. Fails when the organization has no Stripe customer yet.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"billing_portal_session","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/billing/reactivate":{"post":{"tags":["Billing"],"summary":"Reactivate a subscription","description":"Starts a Stripe Checkout on the organization's existing customer and returns its url. If Stripe already has a live subscription, it's written onto the organization instead and alreadyActive comes back true, so nobody pays twice.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"billing_reactivate","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/billing/checkout-link":{"get":{"tags":["Billing"],"summary":"Get a checkout link","description":"Returns the Stripe Payment Link url for a first subscription (plan starter, pro or agency; interval monthly or yearly, monthly by default), tagged with the organization and the launch discount. Organizations that already have a Stripe customer get a 409; use billing/portal-session or billing/reactivate.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"billing_checkout_link","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"plan","in":"query","required":true,"schema":{"type":"string","enum":["starter","pro","agency"]}},{"name":"interval","in":"query","required":false,"schema":{"type":"string","enum":["monthly","yearly"]}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","description":"Convex document id (organizations)"}}]}},"/api/v1/billing/start-trial":{"post":{"tags":["Billing"],"summary":"Start a Pro trial","description":"Starts a 14-day Pro trial in Stripe, billed to the organization owner's email, and sets the plan to pro. Fails when a subscription is already active or trialing. Agency staff keys only.","x-hints":{"readOnly":false,"destructive":true,"openWorld":true,"staffOnly":true},"operationId":"billing_start_trial","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Convex document id (organizations)"}},"additionalProperties":false}}}}}},"/api/v1/portal-view/dashboard":{"get":{"tags":["Portal View"],"summary":"View a portal dashboard","description":"Returns the dashboard a client sees for a portal (portalId): tasks, indicators, time and the enabled cards. period picks the window (e.g. 30d) and member narrows time to one ClickUp user id.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_dashboard","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}},{"name":"period","in":"query","required":false,"schema":{"type":"string"}},{"name":"member","in":"query","required":false,"schema":{"type":"number"}}]}},"/api/v1/portal-view/time":{"get":{"tags":["Portal View"],"summary":"View a portal's time","description":"Returns only the time tracking slice of a portal (portalId) for a period and optional member, the same numbers the client's time card shows.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_time","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}},{"name":"period","in":"query","required":false,"schema":{"type":"string"}},{"name":"member","in":"query","required":false,"schema":{"type":"number"}}]}},"/api/v1/portal-view/report":{"get":{"tags":["Portal View"],"summary":"Get a portal time report","description":"Returns the time report for a portal (portalId) over the last 7 or 30 days (period 7d or 30d, default 30d): totals, weekly breakdown and tasks. format pdf also returns the branded PDF as pdfBase64. Time tracking must be on.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_report","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["7d","30d"]}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["json","pdf"]}}]}},"/api/v1/portal-view/profitability":{"get":{"tags":["Portal View"],"summary":"View portal profitability","description":"Returns the agency-only margin numbers for an internal portal (portalId) that has a profitability setup. Any other portal answers 404.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_profitability","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}}]}},"/api/v1/portal-view/task":{"get":{"tags":["Portal View"],"summary":"View a portal task","description":"Returns one task (taskId) with its attachments and the comments the client can see, if the task is in the portal's (portalId) scope. A task outside it answers 404.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_task","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}},{"name":"taskId","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/v1/portal-view/files":{"get":{"tags":["Portal View"],"summary":"List portal files","description":"Lists the files in a portal's (portalId) Google Drive folder and whether clients may upload. The Files card must be on with a folder linked.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_files","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}}]}},"/api/v1/portal-view/comments/list":{"get":{"tags":["Portal View"],"summary":"List task comments","description":"Lists the client-visible comments on a task (taskId) in a portal's (portalId) scope.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_comments_list","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}},{"name":"taskId","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/v1/portal-view/comments/post":{"post":{"tags":["Portal View"],"summary":"Comment on a task","description":"Adds a comment (content, optional attachments) to a task (taskId) in a portal's (portalId) scope. It posts to ClickUp with the organization's connected ClickUp account, prefixed with the portal name, so it reads as coming from the client portal.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_comments_post","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"taskId":{"type":"string"},"content":{"type":"string"},"attachments":{"type":"array","items":{"type":"object"}}},"additionalProperties":false,"required":["portalId","taskId"]}}}}}},"/api/v1/portal-view/comments/replies":{"get":{"tags":["Portal View"],"summary":"List comment replies","description":"Lists the client-visible replies under a comment (commentId) on a task (taskId) in a portal's (portalId) scope.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_comments_replies","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}},{"name":"taskId","in":"query","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/v1/portal-view/comments/reply":{"post":{"tags":["Portal View"],"summary":"Reply to a comment","description":"Replies (content, optional attachments) under a comment (commentId) on a task (taskId) in a portal's (portalId) scope. It posts to ClickUp with the organization's connected ClickUp account, prefixed with the portal name, so it reads as coming from the client portal.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_comments_reply","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"taskId":{"type":"string"},"commentId":{"type":"string"},"content":{"type":"string"},"attachments":{"type":"array","items":{"type":"object"}}},"additionalProperties":false,"required":["portalId","taskId","commentId"]}}}}}},"/api/v1/portal-view/tasks/treated":{"post":{"tags":["Portal View"],"summary":"Mark a review task treated","description":"Marks a review task (taskId) in a portal (portalId) as treated, which hides it from the client's inbox. Nothing changes in ClickUp.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_tasks_treated","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"taskId":{"type":"string"}},"additionalProperties":false,"required":["portalId","taskId"]}}}}}},"/api/v1/portal-view/tasks/untreated":{"post":{"tags":["Portal View"],"summary":"Reopen a treated task","description":"Puts a treated review task (taskId) back in a portal's (portalId) client inbox.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_tasks_untreated","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"taskId":{"type":"string"}},"additionalProperties":false,"required":["portalId","taskId"]}}}}}},"/api/v1/portal-view/requests/submit":{"post":{"tags":["Portal View"],"summary":"Submit a portal request","description":"Creates a ClickUp task from a request (description, optional name, optional items as [{name, notes}] for subtasks) in the portal's (portalId) request list, like the client's request form, and counts toward the portal's 20 requests a day. File attachments aren't supported here. When ClickUp refuses the task (a disconnected token, or no create access on the list), the request is emailed to the portal's team instead and the answer has taskId null and forwarded true.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_requests_submit","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"description":{"type":"string"},"name":{"type":"string"},"items":{"type":"array","items":{"type":"object"}}},"additionalProperties":false,"required":["portalId","description"]}}}}}},"/api/v1/portal-view/assistant":{"post":{"tags":["Portal View"],"summary":"Ask the portal assistant","description":"Asks a portal's (portalId) AI assistant a question, answered from that portal's own data like the client's assistant card. messages holds up to 10 turns ({ role user or assistant, content }) ending on a user question; it returns the answer text. Needs the Pro plan and the assistant indicator, and each answer counts toward the portal's daily cap.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_assistant","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"messages":{"type":"array","items":{"type":"object"}}},"additionalProperties":false,"required":["portalId","messages"]}}}}}},"/api/v1/portal-view/chat/messages":{"get":{"tags":["Portal View"],"summary":"List portal chat messages","description":"Lists the messages in a portal's (portalId) ClickUp chat channel, oldest first, with senders. Pass cursor and limit (default 50) to page.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_chat_messages","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"number"}}]}},"/api/v1/portal-view/chat/post":{"post":{"tags":["Portal View"],"summary":"Post to portal chat","description":"Sends a message (content) to a portal's (portalId) chat channel. It posts to ClickUp with the organization's connected ClickUp account, prefixed with the portal name, so it reads as coming from the client portal.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_chat_post","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"content":{"type":"string"}},"additionalProperties":false,"required":["portalId","content"]}}}}}},"/api/v1/portal-view/chat/replies":{"get":{"tags":["Portal View"],"summary":"List chat replies","description":"Lists the replies in the thread under a message (messageId) in a portal's (portalId) chat channel.","x-hints":{"readOnly":true,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_chat_replies","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"parameters":[{"name":"portalId","in":"query","required":true,"schema":{"type":"string","description":"Convex document id (portals)"}},{"name":"messageId","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/v1/portal-view/chat/reply":{"post":{"tags":["Portal View"],"summary":"Reply in portal chat","description":"Replies (content) in the thread under a message (messageId) in a portal's (portalId) chat channel. It posts to ClickUp with the organization's connected ClickUp account, prefixed with the portal name, so it reads as coming from the client portal.","x-hints":{"readOnly":false,"destructive":false,"openWorld":true,"staffOnly":false},"operationId":"portal_view_chat_reply","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portalId":{"type":"string","description":"Convex document id (portals)"},"messageId":{"type":"string"},"content":{"type":"string"}},"additionalProperties":false,"required":["portalId","messageId","content"]}}}}}}}}