{"openapi":"3.1.0","info":{"title":"Sapt Platform API","version":"1.0.0","description":"API for Sapt platform - project management, authentication, and email services"},"servers":[{"url":"https://api.sapt.ai","description":"Production"},{"url":"http://localhost:8787","description":"Local development"}],"components":{"schemas":{"MeResponse":{"type":"object","properties":{"actorId":{"type":"string"},"actorType":{"type":"string"},"actorName":{"type":"string"},"apiKey":{"type":["object","null"],"properties":{"id":{"type":"string"},"prefix":{"type":"string"},"scope":{"type":["object","null"],"properties":{"platformPermissions":{"type":"array","items":{"type":"string"}},"globalPermissions":{"type":"array","items":{"type":"string"}},"projectPermissions":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["platformPermissions","globalPermissions","projectPermissions"]}},"required":["id","prefix","scope"]}},"required":["actorId","actorType","actorName"]},"CheckPermissionResponse":{"type":"object","properties":{"allowed":{"type":"boolean"}},"required":["allowed"]},"SignContractRequest":{"type":"object","properties":{"signedByName":{"type":"string","minLength":1},"ipAddress":{"type":"string"},"userAgent":{"type":"string"}},"required":["signedByName"]},"CreateProjectResponse":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"plan":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","slug","plan","createdAt"]},"credits":{"type":"object","properties":{"granted":{"type":"number"},"balance":{"type":"number"}},"required":["granted","balance"]}},"required":["project","credits"]},"CreateProjectRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"plan":{"type":"string","enum":["free","pro"]},"parentProjectId":{"type":"string","format":"uuid"},"branding":{"type":"object","properties":{"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"hex":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["name","hex"]}},"fontStyle":{"type":"string","enum":["modern","classic","playful","bold","handwritten"]},"description":{"type":"string","maxLength":2000}}},"urls":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"]}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"billingOwnerProjectId":{"type":"string"}},"required":["name"]},"UpdateProjectRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"plan":{"type":"string","enum":["free","pro"]},"urls":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"]}},"branding":{"type":"object","properties":{"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"hex":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["name","hex"]}},"fontStyle":{"type":"string","enum":["modern","classic","playful","bold","handwritten"]},"description":{"type":"string","maxLength":2000}}}}},"GetProjectBrandingResponse":{"type":"object","properties":{"branding":{"type":"object","properties":{"name":{"type":"string"},"tagline":{"type":["string","null"]},"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"hex":{"type":"string"}},"required":["name","hex"]}},"logoUrl":{"type":["string","null"]},"fontStyle":{"type":["string","null"],"enum":["modern","classic","playful","bold","handwritten",null]}},"required":["name","tagline","colors","logoUrl","fontStyle"]}},"required":["branding"]},"CreateSubProjectRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"branding":{"type":"object","properties":{"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"hex":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["name","hex"]}},"fontStyle":{"type":"string","enum":["modern","classic","playful","bold","handwritten"]},"description":{"type":"string","maxLength":2000}}},"urls":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"]}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"templateId":{"type":"string","format":"uuid"}},"required":["name"]},"ProjectTemplate":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"bundle":{},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","createdAt","updatedAt"]},"SnapshotApplyReport":{"type":"object","properties":{"counts":{"type":"object","properties":{"objectTypes":{"type":"integer"},"objectRelations":{"type":"integer"},"roles":{"type":"integer"},"workflows":{"type":"integer"},"sidebarSections":{"type":"integer"},"perRoleHides":{"type":"integer"}},"required":["objectTypes","objectRelations","roles","workflows","sidebarSections","perRoleHides"]},"appliedCount":{"type":"integer"},"skipped":{"type":"array","items":{"type":"object","properties":{"entity":{"type":"string"},"name":{"type":"string"}},"required":["entity","name"]}},"failures":{"type":"array","items":{"type":"object","properties":{"entity":{"type":"string"},"name":{"type":"string"},"error":{"type":"string"},"code":{"type":"string"}},"required":["entity","name","error"]}},"missingVariables":{"type":"array","items":{"type":"string"}}},"required":["counts","appliedCount","skipped","failures","missingVariables"]},"Comment":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"message":{"type":"string"},"timestamp":{"type":"string"},"createdTime":{"type":"string"},"username":{"type":"string"},"from":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"username":{"type":"string"}},"required":["id"]},"likeCount":{"type":"number"},"isHidden":{"type":"boolean"},"canHide":{"type":"boolean"},"canRemove":{"type":"boolean"},"replies":{"type":"array","items":{}}},"required":["id"]},"InviteTeamMemberRequest":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"projectRoleId":{"type":"string","format":"uuid","description":"UUID of the project role to assign."},"redirectUrl":{"type":"string","format":"uri"}},"required":["projectId","email","projectRoleId"]},"UpdateTeamMemberRolesRequest":{"type":"object","properties":{"roleIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Array of project role IDs to assign to the member"}},"required":["roleIds"]}},"parameters":{},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token obtained from /api/auth/token endpoint. Token is verified using JWKS and must include a valid user identifier."}}},"paths":{"/projects/{projectId}/agents":{"get":{"tags":["Agents"],"summary":"List agents","description":"List all agent definitions for a project","operationId":"listAgents","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"list","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"List of agent definitions","content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"builtIn":{"type":"boolean"},"systemPrompt":{"type":"string"},"memoryFiles":{"type":"array","items":{"type":"string"}},"toolCategories":{"type":"array","items":{"type":"string","enum":["memory","agents","ads","analytics","socials","cms","email","calendar","support","serp","gbp","feedback","agent_schedules","web","onboarding","navigation","interaction"]}},"mcpServers":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string","description":"Unique name within the agent definition, used as tool name prefix"},"url":{"type":"string","format":"uri","description":"MCP server endpoint (Streamable HTTP)"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Static headers, e.g. Authorization"}},"required":["name","url"]}},"access":{"type":"string","enum":["project_member","specific_roles","public"]},"allowedRoles":{"type":["array","null"],"items":{"type":"string"}},"maxSteps":{"type":"integer"},"model":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","builtIn","systemPrompt","memoryFiles","toolCategories","mcpServers","access","allowedRoles","maxSteps","model","metadata","createdAt","updatedAt"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["limit","offset","hasMore"]}},"required":["agents","pagination"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Agents"],"summary":"Create agent","description":"Create a custom agent definition for a project","operationId":"createAgent","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"create","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"systemPrompt":{"type":"string"},"memoryFiles":{"type":"array","items":{"type":"string"}},"toolCategories":{"type":"array","items":{"type":"string","enum":["memory","agents","ads","analytics","socials","cms","email","calendar","support","serp","gbp","feedback","agent_schedules","web","onboarding","navigation","interaction"]}},"mcpServers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Unique name within the agent definition, used as tool name prefix"},"url":{"type":"string","format":"uri","description":"MCP server endpoint (Streamable HTTP)"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Static headers, e.g. Authorization"}},"required":["name","url"]}},"maxSteps":{"type":"integer"},"metadata":{"type":"object","additionalProperties":{}}},"required":["name","systemPrompt","toolCategories"]}}}},"responses":{"201":{"description":"Created agent definition","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"builtIn":{"type":"boolean"},"systemPrompt":{"type":"string"},"memoryFiles":{"type":"array","items":{"type":"string"}},"toolCategories":{"type":"array","items":{"type":"string","enum":["memory","agents","ads","analytics","socials","cms","email","calendar","support","serp","gbp","feedback","agent_schedules","web","onboarding","navigation","interaction"]}},"mcpServers":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string","description":"Unique name within the agent definition, used as tool name prefix"},"url":{"type":"string","format":"uri","description":"MCP server endpoint (Streamable HTTP)"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Static headers, e.g. Authorization"}},"required":["name","url"]}},"access":{"type":"string","enum":["project_member","specific_roles","public"]},"allowedRoles":{"type":["array","null"],"items":{"type":"string"}},"maxSteps":{"type":"integer"},"model":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","builtIn","systemPrompt","memoryFiles","toolCategories","mcpServers","access","allowedRoles","maxSteps","model","metadata","createdAt","updatedAt"]}},"required":["agent"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/agents/{agentId}":{"get":{"tags":["Agents"],"summary":"Get agent","description":"Get a single agent definition by ID","operationId":"getAgent","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"get","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"agentId","in":"path"}],"responses":{"200":{"description":"Agent definition","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"builtIn":{"type":"boolean"},"systemPrompt":{"type":"string"},"memoryFiles":{"type":"array","items":{"type":"string"}},"toolCategories":{"type":"array","items":{"type":"string","enum":["memory","agents","ads","analytics","socials","cms","email","calendar","support","serp","gbp","feedback","agent_schedules","web","onboarding","navigation","interaction"]}},"mcpServers":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string","description":"Unique name within the agent definition, used as tool name prefix"},"url":{"type":"string","format":"uri","description":"MCP server endpoint (Streamable HTTP)"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Static headers, e.g. Authorization"}},"required":["name","url"]}},"access":{"type":"string","enum":["project_member","specific_roles","public"]},"allowedRoles":{"type":["array","null"],"items":{"type":"string"}},"maxSteps":{"type":"integer"},"model":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","builtIn","systemPrompt","memoryFiles","toolCategories","mcpServers","access","allowedRoles","maxSteps","model","metadata","createdAt","updatedAt"]}},"required":["agent"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"put":{"tags":["Agents"],"summary":"Update agent","description":"Update an existing agent definition","operationId":"updateAgent","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"update","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"agentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"systemPrompt":{"type":"string"},"memoryFiles":{"type":"array","items":{"type":"string"}},"toolCategories":{"type":"array","items":{"type":"string","enum":["memory","agents","ads","analytics","socials","cms","email","calendar","support","serp","gbp","feedback","agent_schedules","web","onboarding","navigation","interaction"]}},"mcpServers":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string","description":"Unique name within the agent definition, used as tool name prefix"},"url":{"type":"string","format":"uri","description":"MCP server endpoint (Streamable HTTP)"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Static headers, e.g. Authorization"}},"required":["name","url"]}},"maxSteps":{"type":"integer"},"metadata":{"type":"object","additionalProperties":{}}}}}}},"responses":{"200":{"description":"Updated agent definition","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"builtIn":{"type":"boolean"},"systemPrompt":{"type":"string"},"memoryFiles":{"type":"array","items":{"type":"string"}},"toolCategories":{"type":"array","items":{"type":"string","enum":["memory","agents","ads","analytics","socials","cms","email","calendar","support","serp","gbp","feedback","agent_schedules","web","onboarding","navigation","interaction"]}},"mcpServers":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string","description":"Unique name within the agent definition, used as tool name prefix"},"url":{"type":"string","format":"uri","description":"MCP server endpoint (Streamable HTTP)"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Static headers, e.g. Authorization"}},"required":["name","url"]}},"access":{"type":"string","enum":["project_member","specific_roles","public"]},"allowedRoles":{"type":["array","null"],"items":{"type":"string"}},"maxSteps":{"type":"integer"},"model":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","builtIn","systemPrompt","memoryFiles","toolCategories","mcpServers","access","allowedRoles","maxSteps","model","metadata","createdAt","updatedAt"]}},"required":["agent"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Agents"],"summary":"Delete agent","description":"Delete a custom agent definition. Built-in agents cannot be deleted.","operationId":"deleteAgent","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"delete","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"agentId","in":"path"}],"responses":{"200":{"description":"Agent deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/auth/me":{"get":{"tags":["Auth"],"summary":"Get current identity","description":"Returns the resolved identity for the current credentials, including permissions and API key scope.","operationId":"getMe","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current identity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/auth/check-permission":{"get":{"tags":["Auth"],"summary":"Check whether the current identity has a project permission","description":"Debug endpoint. Resolves the caller identity and returns whether it holds the given project-scoped permission.","operationId":"checkPermission","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["settings:read","settings:write","settings:manage","members:read","members:write","members:manage","roles:read","roles:write","roles:manage","audit_log:read","audit_log:write","audit_log:manage","crm_types:read","crm_types:write","crm_types:manage","crm_objects:read","crm_objects:write","crm_objects:manage","cms_types:read","cms_types:write","cms_types:manage","cms_items:read","cms_items:write","cms_items:manage","meta_planner:read","meta_planner:write","meta_planner:manage","assets:read","assets:write","assets:manage","workflows:read","workflows:write","workflows:manage","integrations:read","integrations:write","integrations:manage","oauth_clients:read","oauth_clients:write","oauth_clients:manage","agents:read","agents:write","agents:manage","web_analytics:read","web_analytics:write","web_analytics:manage","social:read","social:write","social:manage","tenant_email:read","tenant_email:write","tenant_email:manage","meta_ads:read","meta_ads:write","meta_ads:manage","google_ads:read","google_ads:write","google_ads:manage","google_business:read","google_business:write","google_business:manage","contracts:read","contracts:write","contracts:manage","service_accounts:read","service_accounts:write","service_accounts:manage","support_tickets:read","support_tickets:write","support_tickets:manage","billing:read","billing:write","billing:manage","calendar:read","calendar:write","calendar:manage","sub_projects:read","sub_projects:write","sub_projects:manage","project_templates:read","project_templates:write","project_templates:manage"]},"required":true,"name":"permission","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Permission check result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckPermissionResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/cms/config":{"get":{"tags":["CMS"],"summary":"Get CMS config","description":"Get CMS configuration including asset base URL","operationId":"getCmsConfig","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"CMS configuration","content":{"application/json":{"schema":{"type":"object","properties":{"assetBaseUrl":{"type":"string","format":"uri"}},"required":["assetBaseUrl"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/cms/content/{contentTypeSlug}":{"get":{"tags":["CMS"],"summary":"List content items","description":"List content items of a specific content type","operationId":"listContent","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"contentTypeSlug","in":"path"},{"schema":{"type":"string","enum":["draft","scheduled","published","archived"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"List of content items","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"contentTypeSlug":{"type":"string"},"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"content":{"type":"object","additionalProperties":{}},"status":{"type":"string","enum":["draft","scheduled","published","archived"],"default":"draft"},"publishedAt":{"type":["string","null"],"format":"date-time"},"displayOrder":{"type":"integer","default":0},"tags":{"type":"array","items":{"type":"string"},"default":[]},"scheduledAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","contentTypeSlug","slug","name","content","publishedAt","scheduledAt","createdAt","updatedAt"]}},"total":{"type":"number"}},"required":["items","total"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/cms/content/{contentTypeSlug}/{slug}":{"get":{"tags":["CMS"],"summary":"Get content item","description":"Get a single content item by slug","operationId":"getContent","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"contentTypeSlug","in":"path"},{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Content item details","content":{"application/json":{"schema":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"contentTypeSlug":{"type":"string"},"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"content":{"type":"object","additionalProperties":{}},"status":{"type":"string","enum":["draft","scheduled","published","archived"],"default":"draft"},"publishedAt":{"type":["string","null"],"format":"date-time"},"displayOrder":{"type":"integer","default":0},"tags":{"type":"array","items":{"type":"string"},"default":[]},"scheduledAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","contentTypeSlug","slug","name","content","publishedAt","scheduledAt","createdAt","updatedAt"]}},"required":["item"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/assets/upload-urls":{"post":{"tags":["Assets"],"summary":"Request presigned asset upload URLs","description":"REST mirror of the assets.getUploadUrls tRPC procedure (for OAuth/REST clients).","operationId":"createAssetUploadUrls","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feature":{"type":"string","enum":["cms","email","branding","memory"]},"files":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","exclusiveMinimum":0}},"required":["filename","mimeType","sizeBytes"]},"minItems":1,"maxItems":20}},"required":["feature","files"]}}}},"responses":{"201":{"description":"Presigned upload URLs","content":{"application/json":{"schema":{"type":"object","properties":{"uploads":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"uploadUrl":{"type":"string"},"r2Key":{"type":"string"},"filename":{"type":"string"},"storageFilename":{"type":"string"},"mimeType":{"type":"string"},"assetType":{"type":"string","enum":["image","video","document","audio"]}},"required":["itemId","uploadUrl","r2Key","filename","storageFilename","mimeType","assetType"]}}},"required":["uploads"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/assets":{"post":{"tags":["Assets"],"summary":"Record uploaded assets","description":"REST mirror of the assets.recordUploads tRPC procedure.","operationId":"recordAssetUploads","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"uploads":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","format":"uuid"},"filename":{"type":"string"},"feature":{"type":"string","enum":["cms","email","branding","memory"]},"sizeBytes":{"type":"integer","exclusiveMinimum":0},"r2Key":{"type":"string"},"mimeType":{"type":"string"},"assetType":{"type":"string","enum":["image","video","document","audio"]},"metadata":{}},"required":["itemId","filename","feature","sizeBytes"]},"minItems":1}},"required":["uploads"]}}}},"responses":{"201":{"description":"Recorded assets","content":{"application/json":{"schema":{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"feature":{"type":"string","enum":["cms","email","branding","memory"]}},"required":["id","url","filename"]}}},"required":["assets"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/memory-entries":{"get":{"tags":["Memory"],"summary":"List memory entries","description":"List all memory entries for a project. Returns summary data — fetch individual entries to get content.","operationId":"listMemoryEntries","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"list","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"List of memory entries","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"slug":{"type":"string","description":"Path-like identifier using / separator, e.g. brand, competitors/acme"},"title":{"type":"string","description":"Human-readable label, used as section header when injected into prompt"},"description":{"type":"string","description":"Concise summary shown in listings"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","slug","title","description","metadata","createdAt","updatedAt"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["limit","offset","hasMore"]}},"required":["entries","pagination"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Memory"],"summary":"Create memory entry","description":"Create a new memory entry for a project","operationId":"createMemoryEntry","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"create","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}}},"required":["content"]}}}},"responses":{"201":{"description":"Created memory entry","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"slug":{"type":"string","description":"Path-like identifier using / separator, e.g. brand, competitors/acme"},"title":{"type":"string","description":"Human-readable label, used as section header when injected into prompt"},"description":{"type":"string","description":"Concise summary shown in listings"},"content":{"type":"string","description":"Markdown content"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","slug","title","description","content","metadata","createdAt","updatedAt"]}},"required":["entry"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/memory-entries/{slug}":{"get":{"tags":["Memory"],"summary":"Get memory entry","description":"Get a memory entry by slug including full content. Slugs may contain \"/\" for hierarchical paths (e.g., competitors/acme).","operationId":"getMemoryEntry","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"get","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","example":"brand","description":"Memory entry slug (single segment)"},"required":true,"description":"Memory entry slug (single segment)","name":"slug","in":"path"}],"responses":{"200":{"description":"Memory entry with full content","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"slug":{"type":"string","description":"Path-like identifier using / separator, e.g. brand, competitors/acme"},"title":{"type":"string","description":"Human-readable label, used as section header when injected into prompt"},"description":{"type":"string","description":"Concise summary shown in listings"},"content":{"type":"string","description":"Markdown content"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","slug","title","description","content","metadata","createdAt","updatedAt"]}},"required":["entry"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["Memory"],"summary":"Update memory entry","description":"Update an existing memory entry by slug. Only provided fields are updated. Slugs may contain \"/\" for hierarchical paths.","operationId":"updateMemoryEntry","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"update","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","example":"brand","description":"Memory entry slug (single segment)"},"required":true,"description":"Memory entry slug (single segment)","name":"slug","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"metadata":{"type":["object","null"],"additionalProperties":{}}}}}}},"responses":{"200":{"description":"Updated memory entry","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"slug":{"type":"string","description":"Path-like identifier using / separator, e.g. brand, competitors/acme"},"title":{"type":"string","description":"Human-readable label, used as section header when injected into prompt"},"description":{"type":"string","description":"Concise summary shown in listings"},"content":{"type":"string","description":"Markdown content"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","slug","title","description","content","metadata","createdAt","updatedAt"]}},"required":["entry"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Memory"],"summary":"Delete memory entry","description":"Delete a memory entry by slug. Slugs may contain \"/\" for hierarchical paths.","operationId":"deleteMemoryEntry","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"delete","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","example":"brand","description":"Memory entry slug (single segment)"},"required":true,"description":"Memory entry slug (single segment)","name":"slug","in":"path"}],"responses":{"200":{"description":"Memory entry deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/actions/{actionId}/approve":{"post":{"tags":["Actions"],"summary":"Approve pending action","description":"Approve a pending action. The action handler is executed immediately with the approver's identity.","operationId":"approvePendingAction","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"approve","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"actionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","description":"Project the action belongs to","example":"123e4567-e89b-12d3-a456-426614174000"}},"required":["projectId"]}}}},"responses":{"200":{"description":"Approved pending action","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"actionSlug":{"type":"string","description":"Identifies which handler to execute from the action registry"},"actionInput":{"type":"object","additionalProperties":{},"description":"Serialized input for re-execution"},"description":{"type":"string","description":"Human-readable action description"},"source":{"type":["object","null"],"additionalProperties":{},"description":"Opaque context from the creator"},"status":{"type":"string","enum":["pending","executed","failed","rejected","expired"]},"result":{"type":["object","null"],"additionalProperties":{},"description":"Execution result after approval"},"createdBy":{"type":["string","null"],"description":"Actor ID of who/what triggered the action, or null for internal triggers"},"resolvedBy":{"type":["string","null"],"description":"Actor ID of who approved or rejected"},"resolvedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","actionSlug","actionInput","description","source","status","result","createdBy","resolvedBy","resolvedAt","expiresAt","createdAt","updatedAt"]}},"required":["action"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/actions/{actionId}/reject":{"post":{"tags":["Actions"],"summary":"Reject pending action","description":"Reject a pending action. The action will not be executed.","operationId":"rejectPendingAction","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"reject","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"actionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","description":"Project the action belongs to","example":"123e4567-e89b-12d3-a456-426614174000"}},"required":["projectId"]}}}},"responses":{"200":{"description":"Rejected pending action","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"actionSlug":{"type":"string","description":"Identifies which handler to execute from the action registry"},"actionInput":{"type":"object","additionalProperties":{},"description":"Serialized input for re-execution"},"description":{"type":"string","description":"Human-readable action description"},"source":{"type":["object","null"],"additionalProperties":{},"description":"Opaque context from the creator"},"status":{"type":"string","enum":["pending","executed","failed","rejected","expired"]},"result":{"type":["object","null"],"additionalProperties":{},"description":"Execution result after approval"},"createdBy":{"type":["string","null"],"description":"Actor ID of who/what triggered the action, or null for internal triggers"},"resolvedBy":{"type":["string","null"],"description":"Actor ID of who approved or rejected"},"resolvedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","actionSlug","actionInput","description","source","status","result","createdBy","resolvedBy","resolvedAt","expiresAt","createdAt","updatedAt"]}},"required":["action"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/schedules":{"get":{"tags":["Schedules"],"summary":"List schedules","description":"List scheduled executions for a project.","operationId":"listSchedules","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"list","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"List of scheduled executions","content":{"application/json":{"schema":{"type":"object","properties":{"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"executesAsServiceAccountId":{"type":"string"},"scheduledById":{"type":"string"},"scheduledByType":{"type":"string","enum":["user","service_account"]},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","expired"]},"cronExpression":{"type":["string","null"]},"timezone":{"type":"string"},"executionType":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"maxRuns":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","projectId","executesAsServiceAccountId","scheduledById","scheduledByType","name","description","status","cronExpression","timezone","executionType","metadata","nextRunAt","expiresAt","maxRuns","createdAt"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["limit","offset","hasMore"]}},"required":["schedules","pagination"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/schedules/{id}":{"get":{"tags":["Schedules"],"summary":"Get schedule","description":"Get a single scheduled execution by ID.","operationId":"getSchedule","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"get","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scheduled execution","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"executesAsServiceAccountId":{"type":"string"},"scheduledById":{"type":"string"},"scheduledByType":{"type":"string","enum":["user","service_account"]},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","expired"]},"cronExpression":{"type":["string","null"]},"timezone":{"type":"string"},"executionType":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"maxRuns":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","projectId","executesAsServiceAccountId","scheduledById","scheduledByType","name","description","status","cronExpression","timezone","executionType","metadata","nextRunAt","expiresAt","maxRuns","createdAt"]}},"required":["schedule"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["Schedules"],"summary":"Update schedule","description":"Update a scheduled execution. Only provided fields are updated.","operationId":"updateSchedule","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"update","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"cronExpression":{"type":"string"},"timezone":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"expiresAt":{"type":["string","null"],"format":"date-time"},"maxRuns":{"type":"integer"}}}}}},"responses":{"200":{"description":"Updated scheduled execution","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"executesAsServiceAccountId":{"type":"string"},"scheduledById":{"type":"string"},"scheduledByType":{"type":"string","enum":["user","service_account"]},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","expired"]},"cronExpression":{"type":["string","null"]},"timezone":{"type":"string"},"executionType":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"maxRuns":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","projectId","executesAsServiceAccountId","scheduledById","scheduledByType","name","description","status","cronExpression","timezone","executionType","metadata","nextRunAt","expiresAt","maxRuns","createdAt"]}},"required":["schedule"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Schedules"],"summary":"Delete schedule","description":"Delete a scheduled execution and all its run history.","operationId":"deleteSchedule","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"delete","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Schedule deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/schedules/{id}/pause":{"post":{"tags":["Schedules"],"summary":"Pause schedule","description":"Pause an active scheduled execution.","operationId":"pauseSchedule","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"pause","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Paused scheduled execution","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"executesAsServiceAccountId":{"type":"string"},"scheduledById":{"type":"string"},"scheduledByType":{"type":"string","enum":["user","service_account"]},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","expired"]},"cronExpression":{"type":["string","null"]},"timezone":{"type":"string"},"executionType":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"maxRuns":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","projectId","executesAsServiceAccountId","scheduledById","scheduledByType","name","description","status","cronExpression","timezone","executionType","metadata","nextRunAt","expiresAt","maxRuns","createdAt"]}},"required":["schedule"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/schedules/{id}/resume":{"post":{"tags":["Schedules"],"summary":"Resume schedule","description":"Resume a paused scheduled execution.","operationId":"resumeSchedule","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"resume","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Resumed scheduled execution","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"executesAsServiceAccountId":{"type":"string"},"scheduledById":{"type":"string"},"scheduledByType":{"type":"string","enum":["user","service_account"]},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","expired"]},"cronExpression":{"type":["string","null"]},"timezone":{"type":"string"},"executionType":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"maxRuns":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","projectId","executesAsServiceAccountId","scheduledById","scheduledByType","name","description","status","cronExpression","timezone","executionType","metadata","nextRunAt","expiresAt","maxRuns","createdAt"]}},"required":["schedule"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/schedules/{id}/runs":{"get":{"tags":["Schedules"],"summary":"List schedule runs","description":"List run history for a scheduled execution.","operationId":"listScheduleRuns","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"listRuns","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"List of scheduled execution runs","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"executionId":{"type":"string"},"status":{"type":"string","enum":["success","failure"]},"error":{"type":["string","null"]},"output":{"type":["object","null"],"additionalProperties":{}},"startedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"durationMs":{"type":["integer","null"]}},"required":["id","executionId","status","error","output","startedAt","completedAt","durationMs"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["limit","offset","hasMore"]}},"required":["runs","pagination"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/contracts/{id}":{"get":{"tags":["Contracts"],"summary":"Get contract by ID","description":"Retrieve a service contract by its unique ID (public, no auth required)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Contract retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientName":{"type":"string"},"clientBusinessName":{"type":["string","null"]},"clientEmail":{"type":"string"},"clientPhone":{"type":["string","null"]},"packageName":{"type":"string"},"packagePrice":{"type":"number"},"addOns":{"type":["object","null"],"properties":{"brandRedesign":{"type":"boolean"},"paidAds":{"type":"boolean"},"additionalSocial":{"type":"number"},"customAddon":{"type":"object","properties":{"selected":{"type":"boolean"},"description":{"type":"string"},"price":{"type":"number"}},"required":["selected","description","price"]}},"required":["brandRedesign","paidAds","additionalSocial","customAddon"]},"monthlyTotal":{"type":"number"},"oneTimeTotal":{"type":"number"},"firstPayment":{"type":"number"},"status":{"type":"string","enum":["draft","sent","viewed","signed","expired","cancelled"]},"signedAt":{"type":["string","null"]},"signedByName":{"type":["string","null"]},"viewCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","clientName","clientBusinessName","clientEmail","clientPhone","packageName","packagePrice","addOns","monthlyTotal","oneTimeTotal","firstPayment","status","signedAt","signedByName","viewCount","createdAt"]}}}}}}},"/contracts/{id}/sign":{"post":{"tags":["Contracts"],"summary":"Sign a contract","description":"Sign a service contract with an e-signature (public, no auth required)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignContractRequest"}}}},"responses":{"200":{"description":"Contract signed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}}}}},"/emails/contact":{"post":{"tags":["Emails"],"summary":"Submit contact form (unauthenticated)","description":"Public endpoint for contact form submissions. No authentication required. Rate limited by IP address (3/hour, 10/day). Email is sent to configured recipient addresses only.","operationId":"contact","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"John Doe","description":"Sender name (max 100 characters)"},"email":{"type":"string","format":"email","example":"john@example.com","description":"Sender email address (will be used as reply-to)"},"subject":{"type":"string","minLength":1,"maxLength":200,"example":"Question about services","description":"Subject line (max 200 characters)"},"message":{"type":"string","minLength":10,"maxLength":5000,"example":"I would like to learn more about your services...","description":"Message content (10-5000 characters, plain text only)"},"projectId":{"type":"string","example":"proj_abc123","description":"Optional project ID to route email to specific client (if not provided, uses default)"},"recipientEmail":{"type":"string","format":"email","example":"contact@yourcompany.com","description":"Optional recipient email address (must be from allowed domain). If not provided, uses CONTACT_FORM_RECIPIENT_EMAIL env variable."}},"required":["name","email","subject","message"]}}}},"responses":{"200":{"description":"Contact form submitted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/emails/bulk":{"post":{"tags":["Emails"],"summary":"Send bulk email (batch send to multiple recipients)","description":"Queue a bulk email send to multiple recipients. The email will be processed in the background and sent to all recipients with the same content. All sends are tracked individually in the email log.","operationId":"sendBulk","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"}},"required":["email"]},"minItems":1,"maxItems":10000,"example":[{"email":"user1@example.com","name":"John Doe"},{"email":"user2@example.com","name":"Jane Smith"}],"description":"List of recipients (1-10,000)"},"subject":{"type":"string","minLength":1,"maxLength":200,"example":"Important Update","description":"Email subject line"},"html":{"type":"string","minLength":1,"maxLength":500000,"example":"<html><body><h1>Update</h1><p>Important information...</p></body></html>","description":"HTML email content (max 500KB)"},"text":{"type":"string","maxLength":100000,"example":"Update: Important information...","description":"Plain text fallback (optional)"},"name":{"type":"string","maxLength":200,"example":"Monthly Newsletter - November 2024","description":"Optional description/name for this bulk send"},"metadata":{"type":"object","additionalProperties":{},"example":{"campaign":"november-newsletter"},"description":"Additional metadata"}},"required":["recipients","subject","html"]}}}},"responses":{"200":{"description":"Bulk send queued successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"bulkSendId":{"type":"string"},"status":{"type":"string"},"totalRecipients":{"type":"number"}},"required":["success","bulkSendId","status","totalRecipients"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/emails/bulk/{id}":{"get":{"tags":["Emails"],"summary":"Get bulk send status","description":"Check the status and progress of a bulk email send operation.","operationId":"getBulkSendStatus","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Bulk send status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"bulkSend":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"totalRecipients":{"type":"number"},"sentCount":{"type":"number"},"failedCount":{"type":"number"},"queuedAt":{"type":"string"},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]}},"required":["id","status","totalRecipients","sentCount","failedCount","queuedAt","startedAt","completedAt"]}},"required":["success","bulkSend"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/emails/send/send":{"post":{"tags":["Emails"],"summary":"Send email via AWS SES","description":"Send transactional emails with automatic tracking. All emails are tracked in the Sapt admin dashboard with delivery, open, and click tracking.","operationId":"send","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","format":"email","example":"user@example.com","description":"Recipient email address"},"subject":{"type":"string","minLength":1,"maxLength":200,"example":"Welcome to our service","description":"Email subject line (max 200 characters)"},"html":{"type":"string","minLength":1,"maxLength":500000,"example":"<html><body><h1>Hello!</h1><p>Welcome to our service.</p></body></html>","description":"HTML email content (max 500KB)"},"text":{"type":"string","maxLength":100000,"example":"Hello! Welcome to our service.","description":"Plain text fallback (max 100KB, optional)"},"replyTo":{"type":"string","format":"email","example":"support@example.com","description":"Reply-to email address (optional)"},"metadata":{"type":"object","additionalProperties":{},"example":{"inquiryId":123,"type":"contact-inquiry"},"description":"Additional metadata for tracking (optional)"}},"required":["to","subject","html"]}}}},"responses":{"200":{"description":"Email sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"messageId":{"type":"string"}},"required":["success","messageId"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/emails/batch/queue":{"post":{"tags":["Emails"],"summary":"Queue batch email send","description":"Queue a batch email send for asynchronous processing via Cloudflare Queue. Supports template-based emails with parameter substitution. Requires X-App-Key header for authentication.","operationId":"queueBatchEmail","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"user@example.com","description":"Recipient email address"},"params":{"type":"object","additionalProperties":{"type":"string"},"example":{"name":"John Doe","company":"Acme Corp"},"description":"Per-recipient template parameters for personalization (optional)"}},"required":["email"]},"minItems":1,"maxItems":10000,"example":[{"email":"user1@example.com","params":{"name":"Alice","company":"Acme"}},{"email":"user2@example.com","params":{"name":"Bob","company":"Tech Co"}},{"email":"user3@example.com"}],"description":"List of recipients with optional per-recipient template parameters (1-10,000)"},"template":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":200,"example":"Welcome {{name}}!","description":"Email subject (supports {{variable}} syntax with per-recipient params)"},"html":{"type":"string","minLength":1,"maxLength":500000,"example":"<html><body><h1>Hello {{name}}!</h1><p>Welcome to {{company}}</p></body></html>","description":"HTML content (supports {{variable}} syntax with per-recipient params)"},"text":{"type":"string","maxLength":100000,"example":"Hello {{name}}! Welcome to {{company}}","description":"Plain text fallback (optional, supports {{variable}} syntax)"}},"required":["subject","html"],"description":"Email template with variable placeholders for per-recipient substitution"},"trackingId":{"type":"string","minLength":1,"maxLength":100,"example":"campaign_2024_11_newsletter","description":"Custom tracking ID for this batch send"},"emailType":{"type":"string","example":"marketing","description":"Email category for tracking (optional)"},"clientProjectId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","description":"Client project ID for tracking (optional)"},"metadata":{"type":"object","additionalProperties":{},"example":{"campaign":"november-newsletter","source":"api"},"description":"Additional metadata for tracking (optional)"}},"required":["recipients","template","trackingId"]}}}},"responses":{"200":{"description":"Batch email queued successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"trackingId":{"type":"string"},"totalBatches":{"type":"number"},"totalRecipients":{"type":"number"},"message":{"type":"string"}},"required":["success","trackingId","totalBatches","totalRecipients","message"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/invitations":{"post":{"tags":["Invitations"],"summary":"Create invitation","description":"Invite a user to the platform or to a specific project. Platform admins can invite to any role and any project. Project admins can invite to their projects. The role the inviter can assign depends on their own role.","operationId":"create","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"user@example.com"},"platformRole":{"type":"string","enum":["admin","member","contractor","sales_rep"]},"projectId":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000","description":"Optional: Project to invite the user to"},"projectRoleId":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001","description":"ID of the project role to assign"}},"required":["email","platformRole"]}}}},"responses":{"201":{"description":"Invitation created or skipped","content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":["string","null"],"format":"uuid"},"email":{"type":"string","format":"email"},"action":{"type":"string","enum":["invited","skipped"]},"reason":{"type":"string"}},"required":["invitationId","email","action"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects":{"get":{"tags":["Projects"],"summary":"List user projects","description":"Get all projects the authenticated user is an explicit member of. Platform admins see only their own memberships through this endpoint; the customer dashboard surfaces the admin cross-tenant view via its own internal tRPC endpoint, not the public REST API.","operationId":"listProjects","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"list","responses":{"200":{"description":"List of projects","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"type":{"type":"string","enum":["ecommerce","other"]},"parentProjectId":{"type":["string","null"]},"urls":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"]}},"githubRepo":{"type":["string","null"]},"brandMetadata":{"type":["object","null"],"properties":{"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"hex":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["name","hex"]},"default":[]},"fontStyle":{"type":["string","null"],"enum":["modern","classic","playful","bold","handwritten",null],"default":null},"description":{"type":["string","null"],"maxLength":2000,"default":null},"ctaSlideUrls":{"type":"array","items":{"type":"string","format":"uri"},"default":[]}}},"serpSettings":{"type":["object","null"],"properties":{"locations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"integer"},"name":{"type":"string","minLength":1}},"required":["code","name"]},"default":[]},"trackingEnabled":{"type":"boolean","default":false},"trackedDomain":{"type":["string","null"],"default":null},"language":{"type":["object","null"],"properties":{"code":{"type":"string","minLength":2},"name":{"type":"string","minLength":1}},"default":null,"required":["code","name"]}}},"webhookUrl":{"type":["string","null"]},"webhookSecret":{"type":["string","null"]},"onboardingCompleted":{"type":"boolean"},"onboardingConversationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","type","parentProjectId","urls","githubRepo","brandMetadata","serpSettings","webhookUrl","webhookSecret","onboardingCompleted","onboardingConversationId","createdAt"]}}},"required":["projects"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Projects"],"summary":"Create a project","description":"Create a new project with optional initial configuration.","operationId":"createProject","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"create","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"201":{"description":"Project created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/admin/all":{"get":{"tags":["Projects"],"summary":"List all projects (admin)","description":"Cross-tenant listing of every project in the system. Platform-admin only — returns 403 for any other identity. Intended for staff scripts and admin tooling; customer-facing surfaces should use `GET /api/projects`.","operationId":"listAllProjects","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"listAll","responses":{"200":{"description":"List of all projects","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"type":{"type":"string","enum":["ecommerce","other"]},"parentProjectId":{"type":["string","null"]},"urls":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"]}},"githubRepo":{"type":["string","null"]},"brandMetadata":{"type":["object","null"],"properties":{"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"hex":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["name","hex"]},"default":[]},"fontStyle":{"type":["string","null"],"enum":["modern","classic","playful","bold","handwritten",null],"default":null},"description":{"type":["string","null"],"maxLength":2000,"default":null},"ctaSlideUrls":{"type":"array","items":{"type":"string","format":"uri"},"default":[]}}},"serpSettings":{"type":["object","null"],"properties":{"locations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"integer"},"name":{"type":"string","minLength":1}},"required":["code","name"]},"default":[]},"trackingEnabled":{"type":"boolean","default":false},"trackedDomain":{"type":["string","null"],"default":null},"language":{"type":["object","null"],"properties":{"code":{"type":"string","minLength":2},"name":{"type":"string","minLength":1}},"default":null,"required":["code","name"]}}},"webhookUrl":{"type":["string","null"]},"webhookSecret":{"type":["string","null"]},"onboardingCompleted":{"type":"boolean"},"onboardingConversationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","type","parentProjectId","urls","githubRepo","brandMetadata","serpSettings","webhookUrl","webhookSecret","onboardingCompleted","onboardingConversationId","createdAt"]}}},"required":["projects"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}":{"get":{"tags":["Projects"],"summary":"Get project by ID","description":"Get details of a specific project","operationId":"getProject","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"get","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Project details","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"type":{"type":"string","enum":["ecommerce","other"]},"parentProjectId":{"type":["string","null"]},"urls":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"]}},"githubRepo":{"type":["string","null"]},"brandMetadata":{"type":["object","null"],"properties":{"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"hex":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["name","hex"]},"default":[]},"fontStyle":{"type":["string","null"],"enum":["modern","classic","playful","bold","handwritten",null],"default":null},"description":{"type":["string","null"],"maxLength":2000,"default":null},"ctaSlideUrls":{"type":"array","items":{"type":"string","format":"uri"},"default":[]}}},"serpSettings":{"type":["object","null"],"properties":{"locations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"integer"},"name":{"type":"string","minLength":1}},"required":["code","name"]},"default":[]},"trackingEnabled":{"type":"boolean","default":false},"trackedDomain":{"type":["string","null"],"default":null},"language":{"type":["object","null"],"properties":{"code":{"type":"string","minLength":2},"name":{"type":"string","minLength":1}},"default":null,"required":["code","name"]}}},"webhookUrl":{"type":["string","null"]},"webhookSecret":{"type":["string","null"]},"onboardingCompleted":{"type":"boolean"},"onboardingConversationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","type","parentProjectId","urls","githubRepo","brandMetadata","serpSettings","webhookUrl","webhookSecret","onboardingCompleted","onboardingConversationId","createdAt"]}},"required":["project"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["Projects"],"summary":"Update project","description":"Update project details. Requires project write permission.","operationId":"updateProject","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"update","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectRequest"}}}},"responses":{"200":{"description":"Updated project","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"type":{"type":"string","enum":["ecommerce","other"]},"parentProjectId":{"type":["string","null"]},"urls":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"]}},"githubRepo":{"type":["string","null"]},"brandMetadata":{"type":["object","null"],"properties":{"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"hex":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["name","hex"]},"default":[]},"fontStyle":{"type":["string","null"],"enum":["modern","classic","playful","bold","handwritten",null],"default":null},"description":{"type":["string","null"],"maxLength":2000,"default":null},"ctaSlideUrls":{"type":"array","items":{"type":"string","format":"uri"},"default":[]}}},"serpSettings":{"type":["object","null"],"properties":{"locations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"integer"},"name":{"type":"string","minLength":1}},"required":["code","name"]},"default":[]},"trackingEnabled":{"type":"boolean","default":false},"trackedDomain":{"type":["string","null"],"default":null},"language":{"type":["object","null"],"properties":{"code":{"type":"string","minLength":2},"name":{"type":"string","minLength":1}},"default":null,"required":["code","name"]}}},"webhookUrl":{"type":["string","null"]},"webhookSecret":{"type":["string","null"]},"onboardingCompleted":{"type":"boolean"},"onboardingConversationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","type","parentProjectId","urls","githubRepo","brandMetadata","serpSettings","webhookUrl","webhookSecret","onboardingCompleted","onboardingConversationId","createdAt"]}},"required":["project"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Projects"],"summary":"Delete project","description":"Delete a project.","operationId":"deleteProject","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"delete","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Project deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/members":{"get":{"tags":["Projects"],"summary":"Get project members","description":"Get all members of a project","operationId":"getMembers","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"List of project members","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"User ID"},"name":{"type":["string","null"],"description":"User display name"},"email":{"type":"string","format":"email","description":"User email"},"image":{"type":["string","null"],"format":"uri","description":"User profile image"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]},"description":"Project roles assigned to member"},"isOwner":{"type":"boolean","description":"Whether this member is the project owner"},"createdAt":{"type":"string","format":"date-time","description":"When user account was created"}},"required":["userId","name","email","image","roles","isOwner","createdAt"]}}},"required":["members"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/membership":{"get":{"tags":["Projects"],"summary":"Get user membership","description":"Get the authenticated user's membership details for a project","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"User membership details","content":{"application/json":{"schema":{"type":"object","properties":{"membership":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","description":"Project ID"},"userId":{"type":"string","description":"User ID"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]},"description":"Project roles assigned to member"},"isOwner":{"type":"boolean","description":"Is the project owner"}},"required":["projectId","userId","roles","isOwner"]}},"required":["membership"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/me/membership":{"get":{"tags":["Projects"],"summary":"Get caller's project membership","description":"Get the authenticated caller's membership details for a project. Gated by membership — no project permission required. Reachable under OAuth authentication.","operationId":"getMyMembership","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getMyMembership","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Caller membership details","content":{"application/json":{"schema":{"type":"object","properties":{"membership":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","description":"Project ID"},"userId":{"type":"string","description":"User ID"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]},"description":"Project roles assigned to member"},"isOwner":{"type":"boolean","description":"Is the project owner"}},"required":["projectId","userId","roles","isOwner"]}},"required":["membership"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/branding":{"get":{"tags":["Projects"],"summary":"Get project branding","description":"Get the public branding subset for a project — name, tagline, colors, primary logo, and font style. Intended for OAuth clients rendering a customer-facing UI on the project owner's behalf (e.g. a hosted onboarding questionnaire themed in the agency's brand).","operationId":"getProjectBranding","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getBranding","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Project branding","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetProjectBrandingResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/subprojects":{"get":{"tags":["Projects"],"summary":"List sub-projects","description":"List the sub-projects of `projectId`. Returns `[]` when called on a sub-project (single-level hierarchy). Gated by `sub_projects:read` on the parent.","operationId":"listSubProjects","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"listSubProjects","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"List of sub-projects","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"type":{"type":"string","enum":["ecommerce","other"]},"parentProjectId":{"type":["string","null"]},"urls":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"]}},"githubRepo":{"type":["string","null"]},"brandMetadata":{"type":["object","null"],"properties":{"colors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"hex":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["name","hex"]},"default":[]},"fontStyle":{"type":["string","null"],"enum":["modern","classic","playful","bold","handwritten",null],"default":null},"description":{"type":["string","null"],"maxLength":2000,"default":null},"ctaSlideUrls":{"type":"array","items":{"type":"string","format":"uri"},"default":[]}}},"serpSettings":{"type":["object","null"],"properties":{"locations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"integer"},"name":{"type":"string","minLength":1}},"required":["code","name"]},"default":[]},"trackingEnabled":{"type":"boolean","default":false},"trackedDomain":{"type":["string","null"],"default":null},"language":{"type":["object","null"],"properties":{"code":{"type":"string","minLength":2},"name":{"type":"string","minLength":1}},"default":null,"required":["code","name"]}}},"webhookUrl":{"type":["string","null"]},"webhookSecret":{"type":["string","null"]},"onboardingCompleted":{"type":"boolean"},"onboardingConversationId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","type","parentProjectId","urls","githubRepo","brandMetadata","serpSettings","webhookUrl","webhookSecret","onboardingCompleted","onboardingConversationId","createdAt"]}}},"required":["projects"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Projects"],"summary":"Create a sub-project","description":"Create a sub-project under `projectId`. Sugar over `POST /projects` with `parentProjectId` pre-filled — same shape, minus plan/billing fields. The caller must hold `sub_projects:write` on `projectId`.","operationId":"createSubProject","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"createSubProject","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubProjectRequest"}}}},"responses":{"201":{"description":"Sub-project created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/invitations":{"post":{"tags":["Invitations"],"summary":"Create project invitation","description":"Invite a user to a project. By default the invitee is emailed an acceptance link and also sees the invitation in their Sapt dashboard on next sign-in. Pass `sendEmail: false` to suppress that email and receive the `acceptUrl` in the response instead — for callers that deliver the accept link themselves.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"user@example.com"},"projectRoleId":{"type":"string","format":"uuid"},"sendEmail":{"type":"boolean","example":true}},"required":["email","projectRoleId"]}}}},"responses":{"201":{"description":"Invitation created or skipped","content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":["string","null"],"format":"uuid"},"email":{"type":"string","format":"email"},"action":{"type":"string","enum":["invited","skipped"]},"reason":{"type":"string"},"expiresAt":{"type":["string","null"],"format":"date-time"},"acceptUrl":{"type":["string","null"]}},"required":["invitationId","email","action","expiresAt","acceptUrl"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/integrations":{"get":{"tags":["Integrations"],"summary":"List integrations","description":"List every known integration provider and its connection status for this project.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"integrations":{"type":"array","items":{"type":"object","properties":{"providerId":{"type":"string"},"displayName":{"type":"string"},"category":{"type":"string"},"authKind":{"type":"string","enum":["api_key","oauth2"]},"connected":{"type":"boolean"},"multiAccount":{"type":"boolean"},"supportsAccountRefresh":{"type":"boolean"},"webhookConfigured":{"type":"boolean"},"webhookUrl":{"type":"string"},"connectedAccounts":{"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"kind":{"type":"string"},"displayName":{"type":["string","null"]}},"required":["externalId","kind","displayName"]}}},"required":["providerId","displayName","category","authKind","connected","multiAccount","supportsAccountRefresh","webhookConfigured","webhookUrl","connectedAccounts"]}}},"required":["integrations"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Integrations"],"summary":"Connect an API-key integration","description":"Connect an API-key-scheme integration by submitting credentials. OAuth providers reject this call — use POST /connect-sessions instead.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"providerId":{"type":"string"},"credentials":{"type":"object","additionalProperties":{"type":"string"}}},"required":["providerId","credentials"]}}}},"responses":{"201":{"description":"Integration connected","content":{"application/json":{"schema":{"type":"object","properties":{"providerId":{"type":"string"},"webhookUrl":{"type":"string"}},"required":["providerId","webhookUrl"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/integrations/{integrationId}":{"get":{"tags":["Integrations"],"summary":"Get integration","description":"Get a single integration's connection status. `integrationId` is the provider id.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"integrationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"providerId":{"type":"string"},"displayName":{"type":"string"},"category":{"type":"string"},"authKind":{"type":"string","enum":["api_key","oauth2"]},"connected":{"type":"boolean"},"multiAccount":{"type":"boolean"},"supportsAccountRefresh":{"type":"boolean"},"webhookConfigured":{"type":"boolean"},"webhookUrl":{"type":"string"},"connectedAccounts":{"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"kind":{"type":"string"},"displayName":{"type":["string","null"]}},"required":["externalId","kind","displayName"]}}},"required":["providerId","displayName","category","authKind","connected","multiAccount","supportsAccountRefresh","webhookConfigured","webhookUrl","connectedAccounts"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Integrations"],"summary":"Disconnect integration","description":"Disconnect an integration. `integrationId` is the provider id.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"integrationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/connect-sessions":{"post":{"tags":["Integrations"],"summary":"Create an OAuth connect session","description":"Mint a one-time URL that initiates OAuth for an integration provider. The OAuth flow terminates on a Sapt-hosted result page; poll GET /projects/{projectId}/connect-sessions/{token} for completion.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"providerId":{"type":"string"},"clientInvite":{"type":"boolean"}},"required":["providerId"]}}}},"responses":{"201":{"description":"Connect session created","content":{"application/json":{"schema":{"type":"object","properties":{"connectUrl":{"type":"string","format":"uri"},"token":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["connectUrl","token","expiresAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/connect-sessions/{token}":{"get":{"tags":["Integrations"],"summary":"Get connect session status","description":"Poll for the status of an OAuth connect session created for this project.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"providerId":{"type":"string"},"status":{"type":"string","enum":["pending","completed","failed","expired"]},"expiresAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"error":{"type":["string","null"]}},"required":["token","providerId","status","expiresAt","completedAt","error"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/pixels":{"get":{"tags":["Conversions"],"summary":"List Meta pixels","description":"Enumerate every Meta Pixel discoverable through the project’s connected Meta account. Requires Meta connected with ads permissions; returns an empty list otherwise.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"The project id.","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"description":"The project id.","name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"pixels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Meta Pixel id.","example":"1234567890"},"name":{"type":"string","description":"Pixel display name."},"adAccountId":{"type":"string","description":"Ad account the pixel was found under."},"adAccountName":{"type":"string"},"isActive":{"type":"boolean","description":"Whether the pixel is active in Meta."},"lastFiredTime":{"type":["string","null"],"description":"ISO timestamp the pixel last fired, or null."}},"required":["id","name","adAccountId","adAccountName","isActive","lastFiredTime"]}},"adAccountsScanned":{"type":"integer","minimum":0,"description":"How many ad accounts were scanned to build this list."}},"required":["pixels","adAccountsScanned"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/capi-pixel":{"get":{"tags":["Conversions"],"summary":"Get connected CAPI pixel","description":"Return the project’s connected Meta Pixel + Conversions API token source. The access token itself is never returned.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"The project id.","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"description":"The project id.","name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean","description":"Whether a CAPI pixel is connected."},"pixelId":{"type":["string","null"],"description":"The connected Meta Pixel id."},"tokenSource":{"type":["string","null"],"enum":["paste","oauth",null],"description":"`paste` = a pixel-scoped token you supplied; `oauth` = derived from the Meta connection. The token itself is never returned."},"testEventCode":{"type":["string","null"]},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["connected","pixelId","tokenSource","testEventCode","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"put":{"tags":["Conversions"],"summary":"Connect or update the CAPI pixel","description":"Pin a Meta Pixel for server-side Conversions API. Provide `accessToken` for a pixel-scoped token generated in Events Manager, or set `useOauthToken: true` to source the token from the project’s Meta OAuth connection.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"The project id.","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"description":"The project id.","name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pixelId":{"type":"string","minLength":1,"description":"The Meta Pixel id to send events to.","example":"1234567890"},"accessToken":{"type":"string","description":"A pixel-scoped CAPI access token generated in Meta Events Manager. Omit and set `useOauthToken: true` to source the token from the project’s Meta OAuth connection instead."},"testEventCode":{"type":"string","description":"Optional Events Manager test-event code, used to route test events to the Test Events tab.","example":"TEST12345"},"useOauthToken":{"type":"boolean","description":"Set true to source the token from the Meta OAuth connection. Required when `accessToken` is omitted on first connect."}},"required":["pixelId"]}}}},"responses":{"200":{"description":"CAPI pixel connected","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean","description":"Whether a CAPI pixel is connected."},"pixelId":{"type":["string","null"],"description":"The connected Meta Pixel id."},"tokenSource":{"type":["string","null"],"enum":["paste","oauth",null],"description":"`paste` = a pixel-scoped token you supplied; `oauth` = derived from the Meta connection. The token itself is never returned."},"testEventCode":{"type":["string","null"]},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["connected","pixelId","tokenSource","testEventCode","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Conversions"],"summary":"Disconnect the CAPI pixel","description":"Remove the project’s Meta Pixel CAPI credential. Server-side conversions stop being delivered. Idempotent.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"The project id.","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"description":"The project id.","name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/conversions":{"post":{"tags":["Conversions"],"summary":"Send a server-side conversion","description":"Send a conversion to Meta’s Conversions API server-side. Customer data is hashed before delivery. Returns the `eventId` used — send the same id from your browser pixel to dedupe. A CAPI pixel must be connected first.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"The project id.","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"description":"The project id.","name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["Lead","Purchase","CompleteRegistration","AddToCart","InitiateCheckout","PageView","ViewContent","Subscribe","Qualified","Schedule","Contact","Showed","NoShow","Disqualified"],"description":"The Meta standard event name.","example":"Purchase"},"value":{"type":"number","minimum":0,"description":"Monetary value of the conversion.","example":49.99},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code.","example":"USD"},"email":{"type":"string","description":"Customer email — hashed before delivery."},"phone":{"type":"string","description":"Customer phone — hashed before delivery."},"visitorId":{"type":"string","description":"Sapt first-party visitor id (`_sapt_vid`), if you have it."},"personId":{"type":"string","description":"CRM Person id to attribute the conversion to."},"sourceUrl":{"type":"string","description":"The page URL where the conversion occurred."},"eventId":{"type":"string","description":"Send the same id from your browser pixel (`fbq`) so Meta dedupes the browser and server events. Auto-minted and returned if omitted.","example":"your-order-id-123"}},"required":["kind"]}}}},"responses":{"202":{"description":"Conversion accepted","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","description":"The event_id delivered to Meta — reconcile against your browser pixel."}},"required":["eventId"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/capi-pixel/test-event":{"post":{"tags":["Conversions"],"summary":"Send a CAPI test event","description":"Fire a synthetic conversion to verify the pixel + CAPI credential end-to-end. Watch for it in Meta’s Events Manager Test Events tab.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"The project id.","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"description":"The project id.","name":"projectId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"eventName":{"type":"string","enum":["Lead","Purchase","CompleteRegistration","AddToCart","InitiateCheckout","PageView","ViewContent","Subscribe","Qualified","Schedule","Contact","Showed","NoShow","Disqualified"],"description":"Event name to simulate. Defaults to `Lead`."},"testEventCode":{"type":"string","description":"Events Manager test-event code.","example":"TEST12345"}}}}}},"responses":{"202":{"description":"Test event sent","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"},"eventName":{"type":"string","enum":["Lead","Purchase","CompleteRegistration","AddToCart","InitiateCheckout","PageView","ViewContent","Subscribe","Qualified","Schedule","Contact","Showed","NoShow","Disqualified"]}},"required":["eventId","eventName"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/object-types":{"get":{"tags":["CRM"],"summary":"List object types","description":"List the CRM object types defined for this project, including spine-linking metadata such as linksToPerson and identityFields.","operationId":"listObjectTypes","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeHidden","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"objectTypes":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["system","user"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","boolean","object","reference","image","video","document","asset","date","select"]},"required":{"type":"boolean"},"multiple":{"type":"object","properties":{"minItems":{"type":"integer","minimum":0},"maxItems":{"type":"integer","minimum":0},"uniqueItems":{"type":"boolean"}}},"options":{"type":"object","additionalProperties":{}}},"required":["type","options"]}},"required":["schema"]}},"statuses":{"type":["array","null"],"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"isInitial":{"type":"boolean"},"isTerminal":{"type":"boolean"},"capiStage":{"type":"string","enum":["lead","qualified","scheduled","purchased"]}},"required":["key","label"]}},"isPublicIngestable":{"type":"boolean"},"isHiddenFromUi":{"type":"boolean"},"linksToPerson":{"type":"boolean","description":"When true, writes for this type auto-attach or create a Person spine record and store its id as personRefId."},"linksToCompany":{"type":"boolean","description":"Reserved company attribution flag. Use Person spine and declared CRM relations as the stable public model unless company spine support is explicitly documented."},"identityFields":{"type":["array","null"],"items":{"type":"string"},"description":"For the person type, fields used to match the Person spine. For other types, fields used for same-type upsert/dedupe behavior."},"rejectUnknownFields":{"type":"boolean"},"relations":{"type":"object","additionalProperties":{"type":"object","properties":{"relationId":{"type":"string"},"label":{"type":"string"},"targetTypeSlug":{"type":"string"},"multiple":{"type":"boolean"}},"required":["relationId","label","targetTypeSlug","multiple"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["slug","name","description","kind","icon","color","schema","statuses","isPublicIngestable","isHiddenFromUi","linksToPerson","linksToCompany","identityFields","rejectUnknownFields","relations","createdAt","updatedAt"]}}},"required":["objectTypes"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["CRM"],"summary":"Create object type","description":"Create a new CRM object type in this project. Set linksToPerson for types that capture human identity or engagement so records attach to the Person spine.","operationId":"createObjectType","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z][a-z0-9_]*$"},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500},"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","boolean","object","reference","image","video","document","asset","date","select"]},"required":{"type":"boolean"},"multiple":{"type":"object","properties":{"minItems":{"type":"integer","minimum":0},"maxItems":{"type":"integer","minimum":0},"uniqueItems":{"type":"boolean"}}},"options":{"type":"object","additionalProperties":{}}},"required":["type","options"]}},"required":["schema"]}},"statuses":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"isInitial":{"type":"boolean"},"isTerminal":{"type":"boolean"},"capiStage":{"type":"string","enum":["lead","qualified","scheduled","purchased"]}},"required":["key","label"]}},"icon":{"type":"string","maxLength":60},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{3,8}$"},"isPublicIngestable":{"type":"boolean"},"linksToPerson":{"type":"boolean"},"rejectUnknownFields":{"type":"boolean"},"moderationConfig":{"type":"object","properties":{"enabled":{"type":"boolean"},"mode":{"type":"string","enum":["ai_flagged","all_pending"]},"aiModel":{"type":"string","minLength":1,"maxLength":80},"aiThreshold":{"type":"integer","minimum":0,"maximum":100},"customPrompt":{"type":"string","maxLength":2000}},"required":["enabled","mode"]}},"required":["slug","name","schema"]}}}},"responses":{"201":{"description":"Object type created","content":{"application/json":{"schema":{"type":"object","properties":{"objectType":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["system","user"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","boolean","object","reference","image","video","document","asset","date","select"]},"required":{"type":"boolean"},"multiple":{"type":"object","properties":{"minItems":{"type":"integer","minimum":0},"maxItems":{"type":"integer","minimum":0},"uniqueItems":{"type":"boolean"}}},"options":{"type":"object","additionalProperties":{}}},"required":["type","options"]}},"required":["schema"]}},"statuses":{"type":["array","null"],"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"isInitial":{"type":"boolean"},"isTerminal":{"type":"boolean"},"capiStage":{"type":"string","enum":["lead","qualified","scheduled","purchased"]}},"required":["key","label"]}},"isPublicIngestable":{"type":"boolean"},"isHiddenFromUi":{"type":"boolean"},"linksToPerson":{"type":"boolean","description":"When true, writes for this type auto-attach or create a Person spine record and store its id as personRefId."},"linksToCompany":{"type":"boolean","description":"Reserved company attribution flag. Use Person spine and declared CRM relations as the stable public model unless company spine support is explicitly documented."},"identityFields":{"type":["array","null"],"items":{"type":"string"},"description":"For the person type, fields used to match the Person spine. For other types, fields used for same-type upsert/dedupe behavior."},"rejectUnknownFields":{"type":"boolean"},"relations":{"type":"object","additionalProperties":{"type":"object","properties":{"relationId":{"type":"string"},"label":{"type":"string"},"targetTypeSlug":{"type":"string"},"multiple":{"type":"boolean"}},"required":["relationId","label","targetTypeSlug","multiple"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["slug","name","description","kind","icon","color","schema","statuses","isPublicIngestable","isHiddenFromUi","linksToPerson","linksToCompany","identityFields","rejectUnknownFields","relations","createdAt","updatedAt"]}},"required":["objectType"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/object-types/{typeSlug}":{"get":{"tags":["CRM"],"summary":"Get object type","description":"Get a single CRM object type by slug.","operationId":"getObjectType","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"typeSlug","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"objectType":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["system","user"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","boolean","object","reference","image","video","document","asset","date","select"]},"required":{"type":"boolean"},"multiple":{"type":"object","properties":{"minItems":{"type":"integer","minimum":0},"maxItems":{"type":"integer","minimum":0},"uniqueItems":{"type":"boolean"}}},"options":{"type":"object","additionalProperties":{}}},"required":["type","options"]}},"required":["schema"]}},"statuses":{"type":["array","null"],"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"isInitial":{"type":"boolean"},"isTerminal":{"type":"boolean"},"capiStage":{"type":"string","enum":["lead","qualified","scheduled","purchased"]}},"required":["key","label"]}},"isPublicIngestable":{"type":"boolean"},"isHiddenFromUi":{"type":"boolean"},"linksToPerson":{"type":"boolean","description":"When true, writes for this type auto-attach or create a Person spine record and store its id as personRefId."},"linksToCompany":{"type":"boolean","description":"Reserved company attribution flag. Use Person spine and declared CRM relations as the stable public model unless company spine support is explicitly documented."},"identityFields":{"type":["array","null"],"items":{"type":"string"},"description":"For the person type, fields used to match the Person spine. For other types, fields used for same-type upsert/dedupe behavior."},"rejectUnknownFields":{"type":"boolean"},"relations":{"type":"object","additionalProperties":{"type":"object","properties":{"relationId":{"type":"string"},"label":{"type":"string"},"targetTypeSlug":{"type":"string"},"multiple":{"type":"boolean"}},"required":["relationId","label","targetTypeSlug","multiple"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["slug","name","description","kind","icon","color","schema","statuses","isPublicIngestable","isHiddenFromUi","linksToPerson","linksToCompany","identityFields","rejectUnknownFields","relations","createdAt","updatedAt"]}},"required":["objectType"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["CRM"],"summary":"Update object type","description":"Partially update a CRM object type, including schema fields and spine-linking behavior such as linksToPerson and identityFields.","operationId":"updateObjectType","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"typeSlug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":["string","null"],"maxLength":500},"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","boolean","object","reference","image","video","document","asset","date","select"]},"required":{"type":"boolean"},"multiple":{"type":"object","properties":{"minItems":{"type":"integer","minimum":0},"maxItems":{"type":"integer","minimum":0},"uniqueItems":{"type":"boolean"}}},"options":{"type":"object","additionalProperties":{}}},"required":["type","options"]}},"required":["schema"]}},"statuses":{"type":["array","null"],"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"isInitial":{"type":"boolean"},"isTerminal":{"type":"boolean"},"capiStage":{"type":"string","enum":["lead","qualified","scheduled","purchased"]}},"required":["key","label"]}},"icon":{"type":["string","null"],"maxLength":60},"color":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{3,8}$"},"isPublicIngestable":{"type":"boolean"},"linksToPerson":{"type":"boolean"},"rejectUnknownFields":{"type":"boolean"},"moderationConfig":{"type":["object","null"],"properties":{"enabled":{"type":"boolean"},"mode":{"type":"string","enum":["ai_flagged","all_pending"]},"aiModel":{"type":"string","minLength":1,"maxLength":80},"aiThreshold":{"type":"integer","minimum":0,"maximum":100},"customPrompt":{"type":"string","maxLength":2000}},"required":["enabled","mode"]},"identityFields":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"acknowledgedFieldRemovals":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"objectType":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["system","user"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","boolean","object","reference","image","video","document","asset","date","select"]},"required":{"type":"boolean"},"multiple":{"type":"object","properties":{"minItems":{"type":"integer","minimum":0},"maxItems":{"type":"integer","minimum":0},"uniqueItems":{"type":"boolean"}}},"options":{"type":"object","additionalProperties":{}}},"required":["type","options"]}},"required":["schema"]}},"statuses":{"type":["array","null"],"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"isInitial":{"type":"boolean"},"isTerminal":{"type":"boolean"},"capiStage":{"type":"string","enum":["lead","qualified","scheduled","purchased"]}},"required":["key","label"]}},"isPublicIngestable":{"type":"boolean"},"isHiddenFromUi":{"type":"boolean"},"linksToPerson":{"type":"boolean","description":"When true, writes for this type auto-attach or create a Person spine record and store its id as personRefId."},"linksToCompany":{"type":"boolean","description":"Reserved company attribution flag. Use Person spine and declared CRM relations as the stable public model unless company spine support is explicitly documented."},"identityFields":{"type":["array","null"],"items":{"type":"string"},"description":"For the person type, fields used to match the Person spine. For other types, fields used for same-type upsert/dedupe behavior."},"rejectUnknownFields":{"type":"boolean"},"relations":{"type":"object","additionalProperties":{"type":"object","properties":{"relationId":{"type":"string"},"label":{"type":"string"},"targetTypeSlug":{"type":"string"},"multiple":{"type":"boolean"}},"required":["relationId","label","targetTypeSlug","multiple"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["slug","name","description","kind","icon","color","schema","statuses","isPublicIngestable","isHiddenFromUi","linksToPerson","linksToCompany","identityFields","rejectUnknownFields","relations","createdAt","updatedAt"]}},"required":["objectType"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["CRM"],"summary":"Delete object type","description":"Delete a CRM object type. When records exist and `force=true` is not set, the call is a dry run that returns the affected record count without deleting.","operationId":"deleteObjectType","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"typeSlug","in":"path"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"force","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"recordCount":{"type":"integer"}},"required":["deleted","recordCount"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/slots":{"get":{"tags":["Calendar"],"summary":"List open slots","description":"List open slots for an event type on the connected calendar provider within [start, end].","operationId":"listCalendarSlots","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"eventTypeId","in":"query"},{"schema":{"type":"string"},"required":true,"name":"start","in":"query"},{"schema":{"type":"string"},"required":true,"name":"end","in":"query"},{"schema":{"type":"string"},"required":false,"name":"timeZone","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"slots":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"}},"required":["start"]}}},"required":["slots"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/reservations":{"post":{"tags":["Calendar"],"summary":"Hold a slot","description":"Temporarily hold a slot so a concurrent visitor cannot grab it while the caller finishes a booking flow.","operationId":"createCalendarReservation","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventTypeId":{"type":"integer","exclusiveMinimum":0},"slotUtcStartDate":{"type":"string"},"slotUtcEndDate":{"type":"string"},"reservationDuration":{"type":"integer","exclusiveMinimum":0}},"required":["eventTypeId","slotUtcStartDate","slotUtcEndDate"]}}}},"responses":{"201":{"description":"Reservation created","content":{"application/json":{"schema":{"type":"object","properties":{"reservationUid":{"type":"string"},"reservationUntil":{"type":"string"}},"required":["reservationUid","reservationUntil"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/reservations/{reservationUid}":{"delete":{"tags":["Calendar"],"summary":"Release a slot","description":"Release a previously-held slot before its TTL expires so other visitors can book it.","operationId":"deleteCalendarReservation","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"reservationUid","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"released":{"type":"boolean","enum":[true]}},"required":["released"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/bookings":{"post":{"tags":["Calendar"],"summary":"Create a booking","description":"Create a booking for an event type at a specific start time. Persists on the connected calendar provider and emits a `calendar.booking.created` audit event.","operationId":"createCalendarBooking","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventTypeId":{"type":"integer","exclusiveMinimum":0},"start":{"type":"string"},"attendee":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"timeZone":{"type":"string","minLength":1},"phoneNumber":{"type":"string"}},"required":["name","email","timeZone"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"bookingFieldsResponses":{"type":"object","additionalProperties":{}},"reservationUid":{"type":"string"}},"required":["eventTypeId","start","attendee"]}}}},"responses":{"201":{"description":"Booking created","content":{"application/json":{"schema":{"type":"object","properties":{"bookingUid":{"type":"string"},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"joinUrl":{"type":["string","null"]},"rescheduleUrl":{"type":"string"},"cancelUrl":{"type":"string"},"attendee":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","email"]}},"required":["bookingUid","start","end","joinUrl","rescheduleUrl","cancelUrl","attendee"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/bookings/{uid}":{"get":{"tags":["Calendar"],"summary":"Get a booking","description":"Fetch a single booking by its uid on the connected calendar provider.","operationId":"getCalendarBooking","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"uid","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"bookingUid":{"type":"string"},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"joinUrl":{"type":["string","null"]},"rescheduleUrl":{"type":"string"},"cancelUrl":{"type":"string"},"attendee":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","email"]}},"required":["bookingUid","start","end","joinUrl","rescheduleUrl","cancelUrl","attendee"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/bookings/{uid}:reschedule":{"post":{"tags":["Calendar"],"summary":"Reschedule a booking","description":"Reschedule an existing booking to a new start time. Cal.com creates a new booking linked to the original; the response carries the new `bookingUid`.","operationId":"rescheduleCalendarBooking","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"uid","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"type":"string"},"reschedulingReason":{"type":"string"},"rescheduledBy":{"type":"string","format":"email"},"seatUid":{"type":"string"}},"required":["start"]}}}},"responses":{"201":{"description":"Booking rescheduled","content":{"application/json":{"schema":{"type":"object","properties":{"bookingUid":{"type":"string"},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"joinUrl":{"type":["string","null"]},"rescheduleUrl":{"type":"string"},"cancelUrl":{"type":"string"},"attendee":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","email"]}},"required":["bookingUid","start","end","joinUrl","rescheduleUrl","cancelUrl","attendee"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/bookings/{uid}:cancel":{"post":{"tags":["Calendar"],"summary":"Cancel a booking","description":"Cancel an existing booking. Pass `seatUid` to cancel a single seat on a seated booking; omit it to cancel the whole booking.","operationId":"cancelCalendarBooking","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"uid","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cancellationReason":{"type":"string"},"cancelledBy":{"type":"string","format":"email"},"seatUid":{"type":"string"}}}}}},"responses":{"200":{"description":"Booking cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"bookingUid":{"type":"string"},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"joinUrl":{"type":["string","null"]},"rescheduleUrl":{"type":"string"},"cancelUrl":{"type":"string"},"attendee":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","email"]}},"required":["bookingUid","start","end","joinUrl","rescheduleUrl","cancelUrl","attendee"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/google/busy":{"get":{"tags":["Calendar"],"summary":"Google Calendar busy intervals","description":"List busy intervals on the connected Google Calendar within [timeMin, timeMax). Use it to hide taken slots when rendering availability.","operationId":"getGoogleCalendarBusy","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","description":"Range start (ISO timestamp)."},"required":true,"description":"Range start (ISO timestamp).","name":"timeMin","in":"query"},{"schema":{"type":"string","description":"Range end (ISO timestamp)."},"required":true,"description":"Range end (ISO timestamp).","name":"timeMax","in":"query"},{"schema":{"type":"string","description":"Calendar to inspect. Defaults to the connected primary calendar."},"required":false,"description":"Calendar to inspect. Defaults to the connected primary calendar.","name":"calendarId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"busy":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]}}},"required":["busy"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/google/events":{"post":{"tags":["Calendar"],"summary":"Create a Google Calendar booking","description":"Write a booking event onto the connected Google Calendar (primary by default). Sends a real Google invite when an attendee email is supplied, and re-checks freeBusy — returning 409 if the slot was taken. Requires the connection to have granted the calendar.events write scope.","operationId":"createGoogleCalendarEvent","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"type":"string","description":"Event start (ISO timestamp)."},"end":{"type":"string","description":"Event end (ISO). Defaults to start + `durationMinutes`."},"durationMinutes":{"type":"integer","exclusiveMinimum":0},"timeZone":{"type":"string","description":"IANA zone for start/end, e.g. `America/Phoenix`."},"summary":{"type":"string","minLength":1,"description":"Event title on the calendar."},"description":{"type":"string"},"calendarId":{"type":"string","description":"Calendar to write to. Defaults to the connected primary calendar."},"attendee":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"}},"description":"When an email is present, the lead is invited to the event."},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"conflictCheck":{"type":"boolean","description":"Re-check freeBusy before insert and 409 on a collision. Default true."}},"required":["start","summary"]}}}},"responses":{"201":{"description":"Booking created","content":{"application/json":{"schema":{"type":"object","properties":{"bookingUid":{"type":"string"},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"htmlLink":{"type":["string","null"]},"calendarId":{"type":"string"}},"required":["bookingUid","start","end","htmlLink","calendarId"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/google/events/{eventId}":{"patch":{"tags":["Calendar"],"summary":"Reschedule/update a Google Calendar event","description":"Patch an event on the connected Google Calendar — move its start/end (reschedule) and/or change title/description. Re-notifies attendees unless `notifyAttendees: false`.","operationId":"updateGoogleCalendarEvent","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"eventId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"calendarId":{"type":"string"},"start":{"type":"string","description":"New start (ISO). Required to move the event."},"end":{"type":"string"},"durationMinutes":{"type":"integer","exclusiveMinimum":0},"timeZone":{"type":"string"},"summary":{"type":"string","minLength":1},"description":{"type":"string"},"conflictCheck":{"type":"boolean"},"notifyAttendees":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Event updated","content":{"application/json":{"schema":{"type":"object","properties":{"bookingUid":{"type":"string"},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"htmlLink":{"type":["string","null"]},"calendarId":{"type":"string"}},"required":["bookingUid","start","end","htmlLink","calendarId"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Calendar"],"summary":"Delete a Google Calendar event","description":"Delete an event from the connected Google Calendar. Idempotent — deleting an already-gone event still succeeds. Emails attendees a cancellation unless `notifyAttendees=false`.","operationId":"deleteGoogleCalendarEvent","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"eventId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"calendarId","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"notifyAttendees","in":"query"}],"responses":{"200":{"description":"Event deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers":{"get":{"tags":["Google Ads"],"summary":"List connected Google Ads customers","operationId":"listGoogleAdsCustomers","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"customerId":{"type":"string"},"kind":{"type":"string","enum":["ads_customer","ads_manager"]},"displayName":{"type":["string","null"]},"manager":{"type":"boolean"},"loginCustomerId":{"type":["string","null"]},"parentCustomerId":{"type":["string","null"]},"currencyCode":{"type":["string","null"]},"timeZone":{"type":["string","null"]},"status":{"type":["string","null"]},"connectionExternalId":{"type":["string","null"]},"connectionDisplayName":{"type":["string","null"]}},"required":["id","customerId","kind","displayName","manager","loginCustomerId","parentCustomerId","currencyCode","timeZone","status","connectionExternalId","connectionDisplayName"]}}},"required":["customers"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{managerCustomerId}/clients":{"post":{"tags":["Google Ads"],"summary":"Create Google Ads client account","description":"Create a client account under a connected Google Ads manager account and store it as an integration account.","operationId":"createGoogleAdsCustomerClient","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"managerCustomerId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"descriptiveName":{"type":"string","minLength":1,"maxLength":255},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"timeZone":{"type":"string","minLength":1,"maxLength":64}},"required":["descriptiveName","currencyCode","timeZone"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"id":{"type":"string"},"customerId":{"type":"string"},"kind":{"type":"string","enum":["ads_customer","ads_manager"]},"displayName":{"type":["string","null"]},"manager":{"type":"boolean"},"loginCustomerId":{"type":["string","null"]},"parentCustomerId":{"type":["string","null"]},"currencyCode":{"type":["string","null"]},"timeZone":{"type":["string","null"]},"status":{"type":["string","null"]},"connectionExternalId":{"type":["string","null"]},"connectionDisplayName":{"type":["string","null"]}},"required":["id","customerId","kind","displayName","manager","loginCustomerId","parentCustomerId","currencyCode","timeZone","status","connectionExternalId","connectionDisplayName"]},"resourceName":{"type":"string"},"invitationLink":{"type":["string","null"]}},"required":["customer","resourceName","invitationLink"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaigns":{"get":{"tags":["Google Ads"],"summary":"List Google Ads campaigns","operationId":"listGoogleAdsCampaigns","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"campaignId":{"type":"string"},"resourceName":{"type":"string"},"name":{"type":"string"},"status":{"type":["string","null"]},"servingStatus":{"type":["string","null"]},"advertisingChannelType":{"type":["string","null"]},"advertisingChannelSubType":{"type":["string","null"]},"campaignBudget":{"type":["string","null"]},"biddingStrategyType":{"type":["string","null"]},"startDate":{"type":["string","null"]},"endDate":{"type":["string","null"]},"dailyBudgetMicros":{"type":["number","null"]},"targetCpaMicros":{"type":["number","null"]}},"required":["campaignId","resourceName","name","status","servingStatus","advertisingChannelType","advertisingChannelSubType","campaignBudget","biddingStrategyType","startDate","endDate","dailyBudgetMicros","targetCpaMicros"]}}},"required":["campaigns"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaign-performance":{"get":{"tags":["Google Ads"],"summary":"Get Google Ads campaign performance","operationId":"getGoogleAdsCampaignPerformance","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"endDate","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"id":{"type":"string"},"customerId":{"type":"string"},"kind":{"type":"string","enum":["ads_customer","ads_manager"]},"displayName":{"type":["string","null"]},"manager":{"type":"boolean"},"loginCustomerId":{"type":["string","null"]},"parentCustomerId":{"type":["string","null"]},"currencyCode":{"type":["string","null"]},"timeZone":{"type":["string","null"]},"status":{"type":["string","null"]},"connectionExternalId":{"type":["string","null"]},"connectionDisplayName":{"type":["string","null"]}},"required":["id","customerId","kind","displayName","manager","loginCustomerId","parentCustomerId","currencyCode","timeZone","status","connectionExternalId","connectionDisplayName"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"campaigns":{"type":"array","items":{"type":"object","properties":{"campaignId":{"type":"string"},"campaignName":{"type":"string"},"status":{"type":["string","null"]},"advertisingChannelType":{"type":["string","null"]},"impressions":{"type":"number"},"clicks":{"type":"number"},"costMicros":{"type":"number"},"spend":{"type":"number"},"conversions":{"type":"number"},"conversionsValue":{"type":"number"},"ctr":{"type":"number"},"averageCpcMicros":{"type":"number"}},"required":["campaignId","campaignName","status","advertisingChannelType","impressions","clicks","costMicros","spend","conversions","conversionsValue","ctr","averageCpcMicros"]}}},"required":["customer","startDate","endDate","campaigns"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaign-health":{"get":{"tags":["Google Ads"],"summary":"Get Google Ads campaign health","description":"Derive per-campaign health (live/limited/needs_action/pending_google/off/ended) from serving status, primary status reasons, disapproved ads, and impression-share loss.","operationId":"getGoogleAdsCampaignHealth","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"campaignId","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"campaignId":{"type":"string"},"name":{"type":"string"},"state":{"type":"string","enum":["live","limited","needs_action","pending_google","off","ended"]},"reason":{"type":"string"},"reasonCodes":{"type":"array","items":{"type":"string"}},"nextAction":{"type":["object","null"],"properties":{"code":{"type":"string"},"label":{"type":"string"}},"required":["code","label"]},"status":{"type":["string","null"]},"primaryStatus":{"type":["string","null"]},"servingStatus":{"type":["string","null"]},"disapprovedAdCount":{"type":"number"},"searchBudgetLostImpressionShare":{"type":["number","null"]},"searchRankLostImpressionShare":{"type":["number","null"]}},"required":["campaignId","name","state","reason","reasonCodes","nextAction","status","primaryStatus","servingStatus","disapprovedAdCount","searchBudgetLostImpressionShare","searchRankLostImpressionShare"]}}},"required":["campaigns"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/account-health":{"get":{"tags":["Google Ads"],"summary":"Get Google Ads account health","description":"Derive account-level health from account status, billing status, conversion tracking, and a rollup of campaign health states.","operationId":"getGoogleAdsAccountHealth","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string"},"state":{"type":"string","enum":["live","limited","needs_action","pending_google","off","ended"]},"reason":{"type":"string"},"reasonCodes":{"type":"array","items":{"type":"string"}},"nextAction":{"type":["object","null"],"properties":{"code":{"type":"string"},"label":{"type":"string"}},"required":["code","label"]},"accountStatus":{"type":["string","null"]},"billingStatus":{"type":["string","null"]},"conversionTracking":{"type":"object","properties":{"hasEnabledAction":{"type":"boolean"},"recentConversions":{"type":"number"},"receivingData":{"type":"boolean"}},"required":["hasEnabledAction","recentConversions","receivingData"]},"campaignCounts":{"type":"object","properties":{"live":{"type":"number"},"limited":{"type":"number"},"needs_action":{"type":"number"},"pending_google":{"type":"number"},"off":{"type":"number"},"ended":{"type":"number"}},"required":["live","limited","needs_action","pending_google","off","ended"]}},"required":["customerId","state","reason","reasonCodes","nextAction","accountStatus","billingStatus","conversionTracking","campaignCounts"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaigns/{campaignId}/status":{"patch":{"tags":["Google Ads"],"summary":"Update Google Ads campaign status","description":"Pause or enable a connected Google Ads campaign. Use validateOnly=true to test the mutation without applying it.","operationId":"updateGoogleAdsCampaignStatus","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"campaignId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ENABLED","PAUSED"]},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}},"required":["status"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"type":"object","properties":{"campaignId":{"type":"string"},"resourceName":{"type":"string"},"name":{"type":"string"},"status":{"type":["string","null"]},"servingStatus":{"type":["string","null"]},"advertisingChannelType":{"type":["string","null"]},"advertisingChannelSubType":{"type":["string","null"]},"campaignBudget":{"type":["string","null"]},"biddingStrategyType":{"type":["string","null"]},"startDate":{"type":["string","null"]},"endDate":{"type":["string","null"]},"dailyBudgetMicros":{"type":["number","null"]},"targetCpaMicros":{"type":["number","null"]}},"required":["campaignId","resourceName","name","status","servingStatus","advertisingChannelType","advertisingChannelSubType","campaignBudget","biddingStrategyType","startDate","endDate","dailyBudgetMicros","targetCpaMicros"]}},"required":["campaign"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaigns/{campaignId}":{"patch":{"tags":["Google Ads"],"summary":"Update Google Ads campaign","description":"Update a campaign's name, status, budget, bidding strategy, network settings, and/or schedule. All fields are optional — only provided fields are changed. Use validateOnly=true to test the payload without applying it.","operationId":"updateGoogleAdsCampaign","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"campaignId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"status":{"type":"string","enum":["ENABLED","PAUSED"]},"dailyBudget":{"type":"number","exclusiveMinimum":0},"biddingStrategy":{"type":"string","enum":["MAXIMIZE_CONVERSIONS","MAXIMIZE_CLICKS","MANUAL_CPC","TARGET_CPA"]},"targetCpa":{"type":"number","exclusiveMinimum":0},"networks":{"type":"object","properties":{"targetGoogleSearch":{"type":"boolean"},"targetSearchNetwork":{"type":"boolean"},"targetContentNetwork":{"type":"boolean"}}},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"type":"object","properties":{"campaignId":{"type":"string"},"resourceName":{"type":"string"},"name":{"type":"string"},"status":{"type":["string","null"]},"servingStatus":{"type":["string","null"]},"advertisingChannelType":{"type":["string","null"]},"advertisingChannelSubType":{"type":["string","null"]},"campaignBudget":{"type":["string","null"]},"biddingStrategyType":{"type":["string","null"]},"startDate":{"type":["string","null"]},"endDate":{"type":["string","null"]},"dailyBudgetMicros":{"type":["number","null"]},"targetCpaMicros":{"type":["number","null"]}},"required":["campaignId","resourceName","name","status","servingStatus","advertisingChannelType","advertisingChannelSubType","campaignBudget","biddingStrategyType","startDate","endDate","dailyBudgetMicros","targetCpaMicros"]}},"required":["campaign"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaigns/{campaignId}/ad-groups":{"get":{"tags":["Google Ads"],"summary":"List Google Ads ad groups for a campaign","operationId":"listGoogleAdsAdGroups","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"campaignId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"adGroups":{"type":"array","items":{"type":"object","properties":{"adGroupId":{"type":"string"},"resourceName":{"type":"string"},"campaignId":{"type":"string"},"name":{"type":"string"},"status":{"type":["string","null"]},"type":{"type":["string","null"]},"cpcBidMicros":{"type":["number","null"]}},"required":["adGroupId","resourceName","campaignId","name","status","type","cpcBidMicros"]}}},"required":["adGroups"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Google Ads"],"summary":"Create Google Ads ad group","description":"Create a standard Search ad group under an existing campaign. Use validateOnly=true to test the payload without applying it.","operationId":"createGoogleAdsAdGroup","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"campaignId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"status":{"type":"string","enum":["ENABLED","PAUSED"]},"cpcBid":{"type":"number","exclusiveMinimum":0},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}},"required":["name"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"adGroup":{"type":"object","properties":{"adGroupId":{"type":"string"},"resourceName":{"type":"string"},"campaignId":{"type":"string"},"name":{"type":"string"},"status":{"type":["string","null"]},"type":{"type":["string","null"]},"cpcBidMicros":{"type":["number","null"]}},"required":["adGroupId","resourceName","campaignId","name","status","type","cpcBidMicros"]}},"required":["adGroup"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads":{"get":{"tags":["Google Ads"],"summary":"List Google Ads ads for an ad group","operationId":"listGoogleAdsAds","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"adGroupId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ads":{"type":"array","items":{"type":"object","properties":{"adId":{"type":"string"},"resourceName":{"type":"string"},"adGroupId":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":["string","null"]},"status":{"type":["string","null"]},"finalUrl":{"type":["string","null"]},"headlines":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}}},"required":["adId","resourceName","adGroupId","name","type","status","finalUrl","headlines","descriptions"]}}},"required":["ads"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Google Ads"],"summary":"Create Responsive Search Ad in ad group","description":"Create a new Responsive Search Ad in an ad group. If adResourceNameToRemove is provided, the existing ad is removed in the same mutate call. Use validateOnly=true to test the payload without applying it.","operationId":"upsertGoogleAdsResponsiveSearchAd","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"adGroupId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"headlines":{"type":"array","items":{"type":"string"},"minItems":3,"maxItems":15},"descriptions":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":4},"finalUrl":{"type":"string","format":"uri"},"path1":{"type":"string","maxLength":15},"path2":{"type":"string","maxLength":15},"adResourceNameToRemove":{"type":"string"},"ignorablePolicyTopics":{"type":"array","items":{"type":"string","minLength":1}},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}},"required":["headlines","descriptions","finalUrl"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"resourceName":{"type":["string","null"]},"validateOnly":{"type":"boolean"}},"required":["resourceName","validateOnly"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Google Ads"],"summary":"Remove Google Ads ad","description":"Remove a single ad group ad by its resource name.","operationId":"removeGoogleAdsAd","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"adGroupId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adResourceName":{"type":"string","minLength":1},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}},"required":["adResourceName"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/keywords":{"get":{"tags":["Google Ads"],"summary":"List Google Ads keywords for an ad group","operationId":"listGoogleAdsKeywords","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"adGroupId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"object","properties":{"criterionId":{"type":"string"},"resourceName":{"type":"string"},"adGroupId":{"type":"string"},"text":{"type":"string"},"matchType":{"type":["string","null"]},"status":{"type":["string","null"]},"negative":{"type":"boolean"},"cpcBidMicros":{"type":["number","null"]}},"required":["criterionId","resourceName","adGroupId","text","matchType","status","negative","cpcBidMicros"]}}},"required":["keywords"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Google Ads"],"summary":"Add keywords to Google Ads ad group","description":"Add one or more keywords to an ad group. Uses partialFailure so invalid keywords do not fail the batch. Returns per-row outcomes.","operationId":"addGoogleAdsKeywords","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"adGroupId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1},"matchType":{"type":"string","enum":["BROAD","PHRASE","EXACT"]}},"required":["text","matchType"]},"minItems":1},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}},"required":["keywords"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"success":{"type":"boolean"},"resourceName":{"type":"string"},"error":{}},"required":["index","success"]}}},"required":["results"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Google Ads"],"summary":"Remove Google Ads keyword","description":"Remove a single keyword (adGroupCriterion) from an ad group by its full resource name.","operationId":"removeGoogleAdsKeyword","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"adGroupId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"criterionResourceName":{"type":"string","minLength":1},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}},"required":["criterionResourceName"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaigns/{campaignId}/criteria":{"get":{"tags":["Google Ads"],"summary":"List Google Ads campaign criteria","operationId":"listGoogleAdsCampaignCriteria","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"campaignId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"criteria":{"type":"array","items":{"type":"object","properties":{"criterionId":{"type":"string"},"resourceName":{"type":"string"},"type":{"type":["string","null"]},"status":{"type":["string","null"]},"negative":{"type":"boolean"},"keywordText":{"type":["string","null"]},"keywordMatchType":{"type":["string","null"]},"locationResourceName":{"type":["string","null"]},"languageResourceName":{"type":["string","null"]},"localServiceId":{"type":["string","null"]}},"required":["criterionId","resourceName","type","status","negative"]}}},"required":["criteria"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Google Ads"],"summary":"Add criteria to Google Ads campaign","description":"Add geo-target locations, language targets, and/or negative keywords to a campaign. Use validateOnly=true to test the payload without applying it.","operationId":"addGoogleAdsCampaignCriteria","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"campaignId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locations":{"type":"array","items":{"type":"string","minLength":1}},"languages":{"type":"array","items":{"type":"string","minLength":1}},"negativeKeywords":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1},"matchType":{"type":"string","enum":["BROAD","PHRASE","EXACT"]}},"required":["text","matchType"]}},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"addedCount":{"type":"number"},"resourceNames":{"type":"array","items":{"type":"string"}},"validateOnly":{"type":"boolean"}},"required":["addedCount","resourceNames","validateOnly"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Google Ads"],"summary":"Remove Google Ads campaign criterion","description":"Remove a single campaign criterion (location, language, or negative keyword) by its full resource name.","operationId":"removeGoogleAdsCampaignCriterion","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"campaignId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"criterionResourceName":{"type":"string","minLength":1},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}},"required":["criterionResourceName"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/search-terms":{"get":{"tags":["Google Ads"],"summary":"List Google Ads search terms for a customer","operationId":"listGoogleAdsSearchTerms","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"endDate","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"searchTerms":{"type":"array","items":{"type":"object","properties":{"searchTerm":{"type":"string"},"status":{"type":["string","null"]},"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"averageCpc":{"type":"number"}},"required":["searchTerm","status","impressions","clicks","spend","conversions","ctr","averageCpc"]}}},"required":["searchTerms"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/conversion-actions":{"get":{"tags":["Google Ads"],"summary":"List Google Ads conversion actions","operationId":"listGoogleAdsConversionActions","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"conversionActions":{"type":"array","items":{"type":"object","properties":{"conversionActionId":{"type":"string"},"resourceName":{"type":"string"},"name":{"type":"string"},"status":{"type":["string","null"]},"type":{"type":["string","null"]},"category":{"type":["string","null"]},"origin":{"type":["string","null"]},"primaryForGoal":{"type":"boolean"}},"required":["conversionActionId","resourceName","name","status","type","category","origin","primaryForGoal"]}}},"required":["conversionActions"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Google Ads"],"summary":"Create Google Ads conversion action","description":"Create a conversion action on the customer. Smart Bidding cannot run without an enabled conversion action, and server-side uploads need an UPLOAD_CLICKS action to target. Use validateOnly=true to test the payload without applying it.","operationId":"createGoogleAdsConversionAction","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"loginCustomerId":{"type":["string","null"]},"name":{"type":"string","minLength":1,"maxLength":255},"category":{"type":"string","enum":["DEFAULT","PAGE_VIEW","PURCHASE","SIGNUP","DOWNLOAD","ADD_TO_CART","BEGIN_CHECKOUT","SUBSCRIBE_PAID","PHONE_CALL_LEAD","IMPORTED_LEAD","SUBMIT_LEAD_FORM","BOOK_APPOINTMENT","REQUEST_QUOTE","GET_DIRECTIONS","OUTBOUND_CLICK","CONTACT","ENGAGEMENT","QUALIFIED_LEAD","CONVERTED_LEAD"]},"type":{"type":"string","enum":["WEBPAGE","UPLOAD_CLICKS","UPLOAD_CALLS"],"default":"UPLOAD_CLICKS"},"status":{"type":"string","enum":["ENABLED","HIDDEN"],"default":"ENABLED"},"countingType":{"type":"string","enum":["ONE_PER_CLICK","MANY_PER_CLICK"],"default":"ONE_PER_CLICK"},"defaultValue":{"type":"number","minimum":0},"currencyCode":{"type":"string","minLength":3,"maxLength":3},"primaryForGoal":{"type":"boolean"},"validateOnly":{"type":"boolean"}},"required":["name","category"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"resourceName":{"type":["string","null"]},"validateOnly":{"type":"boolean"}},"required":["resourceName","validateOnly"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/ad-group-performance":{"get":{"tags":["Google Ads"],"summary":"Get Google Ads ad group performance","operationId":"getGoogleAdsAdGroupPerformance","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"endDate","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"averageCpc":{"type":"number"}},"required":["id","name","impressions","clicks","spend","conversions","ctr","averageCpc"]}}},"required":["results"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/keyword-performance":{"get":{"tags":["Google Ads"],"summary":"Get Google Ads keyword performance","operationId":"getGoogleAdsKeywordPerformance","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"endDate","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"campaignId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"averageCpc":{"type":"number"}},"required":["id","name","impressions","clicks","spend","conversions","ctr","averageCpc"]}}},"required":["results"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/ad-performance":{"get":{"tags":["Google Ads"],"summary":"Get Google Ads ad performance","operationId":"getGoogleAdsAdPerformance","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"endDate","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"averageCpc":{"type":"number"}},"required":["id","name","impressions","clicks","spend","conversions","ctr","averageCpc"]}}},"required":["results"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/time-series":{"get":{"tags":["Google Ads"],"summary":"Get Google Ads campaign time-series performance","operationId":"getGoogleAdsCampaignTimeSeries","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"endDate","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"campaignId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"timeSeries":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"conversions":{"type":"number"}},"required":["date","impressions","clicks","spend","conversions"]}}},"required":["timeSeries"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/device-breakdown":{"get":{"tags":["Google Ads"],"summary":"Get Google Ads device performance breakdown","operationId":"getGoogleAdsDeviceBreakdown","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"startDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"endDate","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"campaignId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"averageCpc":{"type":"number"}},"required":["id","name","impressions","clicks","spend","conversions","ctr","averageCpc"]}}},"required":["results"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/keyword-ideas":{"post":{"tags":["Google Ads"],"summary":"Generate Google Ads keyword ideas","operationId":"generateGoogleAdsKeywordIdeas","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"string"}},"url":{"type":"string"},"geoTargetIds":{"type":"array","items":{"type":"string"}},"languageId":{"type":"string"},"loginCustomerId":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ideas":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"avgMonthlySearches":{"type":"number"},"competition":{"type":["string","null"]},"competitionIndex":{"type":["number","null"]},"lowTopOfPageBid":{"type":["number","null"]},"highTopOfPageBid":{"type":["number","null"]}},"required":["text","avgMonthlySearches","competition","competitionIndex","lowTopOfPageBid","highTopOfPageBid"]}}},"required":["ideas"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/geo-targets":{"get":{"tags":["Google Ads"],"summary":"Suggest Google Ads geo targets","operationId":"suggestGoogleAdsGeoTargets","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"locale","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"geoTargets":{"type":"array","items":{"type":"object","properties":{"geoTargetConstantId":{"type":"string"},"resourceName":{"type":"string"},"name":{"type":"string"},"canonicalName":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"targetType":{"type":["string","null"]},"status":{"type":["string","null"]}},"required":["geoTargetConstantId","resourceName","name","canonicalName","countryCode","targetType","status"]}}},"required":["geoTargets"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaigns/search":{"post":{"tags":["Google Ads"],"summary":"Create Google Ads Search campaign","description":"Atomically create a full Search campaign (budget, campaign, criteria, ad group, RSA, keywords) in one mutate call. Use validateOnly=true to test the payload without applying it.","operationId":"createGoogleAdsSearchCampaign","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"loginCustomerId":{"type":["string","null"]},"name":{"type":"string","minLength":1,"maxLength":255},"status":{"type":"string","enum":["ENABLED","PAUSED"]},"dailyBudget":{"type":"number","exclusiveMinimum":0},"biddingStrategy":{"type":"string","enum":["MAXIMIZE_CONVERSIONS","MAXIMIZE_CLICKS","MANUAL_CPC","TARGET_CPA"]},"targetCpa":{"type":"number","exclusiveMinimum":0},"locations":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"adGroupName":{"type":"string","minLength":1,"maxLength":255},"keywords":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1},"matchType":{"type":"string","enum":["BROAD","PHRASE","EXACT"]}},"required":["text","matchType"]}},"negativeKeywords":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1},"matchType":{"type":"string","enum":["BROAD","PHRASE","EXACT"]}},"required":["text","matchType"]}},"ad":{"type":"object","properties":{"headlines":{"type":"array","items":{"type":"string"},"minItems":3,"maxItems":15},"descriptions":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":4},"finalUrl":{"type":"string","format":"uri"},"path1":{"type":"string"},"path2":{"type":"string"}},"required":["headlines","descriptions","finalUrl"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exemptPolicyViolationKeys":{"type":"array","items":{"type":"object","properties":{"policyName":{"type":"string","minLength":1},"violatingText":{"type":"string","minLength":1}},"required":["policyName"]}},"ignorablePolicyTopics":{"type":"array","items":{"type":"string","minLength":1}},"autoExemptPolicyViolations":{"type":"boolean"},"validateOnly":{"type":"boolean"}},"required":["name","dailyBudget","biddingStrategy","locations","languages","adGroupName","keywords","ad"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"campaignResourceName":{"type":"string"},"validateOnly":{"type":"boolean"},"appliedPolicyExemptions":{"type":"array","items":{"type":"object","properties":{"policyName":{"type":"string"},"violatingText":{"type":"string"}},"required":["policyName"]}}},"required":["campaignResourceName","validateOnly"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}":{"patch":{"tags":["Google Ads"],"summary":"Update Google Ads ad group","description":"Update an ad group's name, status, and/or CPC bid. All fields are optional — only provided fields are changed. Use validateOnly=true to test the payload without applying it.","operationId":"updateGoogleAdsAdGroup","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"adGroupId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"status":{"type":"string","enum":["ENABLED","PAUSED"]},"cpcBid":{"type":"number","exclusiveMinimum":0},"loginCustomerId":{"type":"string","minLength":1},"validateOnly":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"adGroup":{"type":"object","properties":{"adGroupId":{"type":"string"},"resourceName":{"type":"string"},"campaignId":{"type":"string"},"name":{"type":"string"},"status":{"type":["string","null"]},"type":{"type":["string","null"]},"cpcBidMicros":{"type":["number","null"]}},"required":["adGroupId","resourceName","campaignId","name","status","type","cpcBidMicros"]}},"required":["adGroup"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/google-ads/customers/{customerId}/campaigns/{campaignId}/targeted-locations":{"get":{"tags":["Google Ads"],"summary":"Get a campaign’s targeted locations resolved to coordinates","description":"Resolve a campaign’s location criteria into plottable points (zip/city/region centroids, country centroids). Unresolved targets are returned with null coordinates.","operationId":"getGoogleAdsCampaignTargetedLocations","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"campaignId","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"loginCustomerId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"locations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["country","region","city","zip","radius"]},"label":{"type":"string"},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"radiusMiles":{"type":"number"},"included":{"type":"boolean"},"resolved":{"type":"boolean"},"countryCode":{"type":"string"},"zip":{"type":"string"},"boundary":{"type":"object","properties":{"type":{"type":"string","enum":["Polygon","MultiPolygon"]},"coordinates":{"type":"array","items":{}}},"required":["type","coordinates"]}},"required":["id","kind","label","lat","lng","included","resolved"]}}},"required":["locations"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/geo/zip-search":{"get":{"tags":["Geo"],"summary":"Search US ZIPs by code or \"City, ST\"","operationId":"geoZipSearch","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"q","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"zip":{"type":"string"},"label":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}},"required":["zip","label","lat","lng"]}}},"required":["results"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/geo/zcta-in-bounds":{"get":{"tags":["Geo"],"summary":"ZIP boundaries intersecting a map viewport","description":"Returns ZIP/ZCTA boundary polygons intersecting the bbox (minLng,minLat,maxLng,maxLat). Capped; call only when zoomed in.","operationId":"geoZctaInBounds","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"bbox","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"features":{"type":"array","items":{"type":"object","properties":{"zip":{"type":"string"},"geometry":{"type":"object","properties":{"type":{"type":"string","enum":["Polygon","MultiPolygon"]},"coordinates":{"type":"array","items":{}}},"required":["type","coordinates"]}},"required":["zip","geometry"]}}},"required":["features"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"502":{"description":"Bad gateway","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/event-types":{"get":{"tags":["Calendar"],"summary":"List event types","description":"List the bookable event types available on the connected calendar provider. Use the returned `id` as the `eventTypeId` argument for `slots`, `reservations`, and `bookings`.","operationId":"listCalendarEventTypes","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"eventTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"title":{"type":"string"},"lengthInMinutes":{"type":"integer","minimum":0},"hidden":{"type":"boolean"}},"required":["id","slug","title","lengthInMinutes","hidden"]}}},"required":["eventTypes"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Calendar"],"summary":"Create an event type","description":"Create a new bookable event type. Use `locations` to set Zoom/Meet/in-person/custom-link, `beforeEventBuffer`/`afterEventBuffer` for buffer time, `bookingFields` to add intake questions, and `scheduleId` to bind to a specific availability schedule. Emits `calendar.event_type.created`.","operationId":"createCalendarEventType","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"lengthInMinutes":{"type":"integer","exclusiveMinimum":0},"description":{"type":"string"},"locations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integration":{"type":"string"}},"required":["type","integration"]},{"type":"object","properties":{"type":{"type":"string","enum":["address"]},"address":{"type":"string"},"public":{"type":"boolean"}},"required":["type","address"]},{"type":"object","properties":{"type":{"type":"string","enum":["link"]},"link":{"type":"string","format":"uri"},"public":{"type":"boolean"}},"required":["type","link"]},{"type":"object","properties":{"type":{"type":"string","enum":["phone"]},"phone":{"type":"string"},"public":{"type":"boolean"}},"required":["type","phone"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeePhone"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeAddress"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeDefined"]}},"required":["type"]}]}},"bookingFields":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"slug":{"type":"string","minLength":1},"label":{"type":"string"},"required":{"type":"boolean"},"placeholder":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"hidden":{"type":"boolean"},"disableOnPrefill":{"type":"boolean"}},"required":["type","slug"]}},"disableGuests":{"type":"boolean"},"slotInterval":{"type":["integer","null"]},"minimumBookingNotice":{"type":"integer","minimum":0},"beforeEventBuffer":{"type":"integer","minimum":0},"afterEventBuffer":{"type":"integer","minimum":0},"scheduleId":{"type":"integer","exclusiveMinimum":0},"hidden":{"type":"boolean"},"requiresConfirmation":{"type":"boolean"},"successRedirectUrl":{"type":"string","format":"uri"},"customName":{"type":"string"},"lengthInMinutesOptions":{"type":"array","items":{"type":"integer","exclusiveMinimum":0}}},"required":["title","slug","lengthInMinutes"]}}}},"responses":{"201":{"description":"Event type created","content":{"application/json":{"schema":{"type":"object","properties":{"eventType":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"lengthInMinutes":{"type":"integer","minimum":0},"lengthInMinutesOptions":{"type":["array","null"],"items":{"type":"integer"}},"hidden":{"type":"boolean"},"locations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integration":{"type":"string"}},"required":["type","integration"]},{"type":"object","properties":{"type":{"type":"string","enum":["address"]},"address":{"type":"string"},"public":{"type":"boolean"}},"required":["type","address"]},{"type":"object","properties":{"type":{"type":"string","enum":["link"]},"link":{"type":"string","format":"uri"},"public":{"type":"boolean"}},"required":["type","link"]},{"type":"object","properties":{"type":{"type":"string","enum":["phone"]},"phone":{"type":"string"},"public":{"type":"boolean"}},"required":["type","phone"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeePhone"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeAddress"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeDefined"]}},"required":["type"]}]}},"bookingFields":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"slug":{"type":"string","minLength":1},"label":{"type":"string"},"required":{"type":"boolean"},"placeholder":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"hidden":{"type":"boolean"},"disableOnPrefill":{"type":"boolean"}},"required":["type","slug"]}},"disableGuests":{"type":["boolean","null"]},"slotInterval":{"type":["integer","null"]},"minimumBookingNotice":{"type":["integer","null"]},"beforeEventBuffer":{"type":["integer","null"]},"afterEventBuffer":{"type":["integer","null"]},"scheduleId":{"type":["integer","null"]},"requiresConfirmation":{"type":["boolean","null"]},"successRedirectUrl":{"type":["string","null"]},"customName":{"type":["string","null"]}},"required":["id","slug","title","description","lengthInMinutes","lengthInMinutesOptions","hidden","locations","bookingFields","disableGuests","slotInterval","minimumBookingNotice","beforeEventBuffer","afterEventBuffer","scheduleId","requiresConfirmation","successRedirectUrl","customName"]}},"required":["eventType"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/event-types/{eventTypeId}":{"get":{"tags":["Calendar"],"summary":"Get an event type","description":"Fetch the full configuration of a single event type — duration, locations, buffers, intake fields, and the schedule it references.","operationId":"getCalendarEventType","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"eventTypeId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"eventType":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"lengthInMinutes":{"type":"integer","minimum":0},"lengthInMinutesOptions":{"type":["array","null"],"items":{"type":"integer"}},"hidden":{"type":"boolean"},"locations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integration":{"type":"string"}},"required":["type","integration"]},{"type":"object","properties":{"type":{"type":"string","enum":["address"]},"address":{"type":"string"},"public":{"type":"boolean"}},"required":["type","address"]},{"type":"object","properties":{"type":{"type":"string","enum":["link"]},"link":{"type":"string","format":"uri"},"public":{"type":"boolean"}},"required":["type","link"]},{"type":"object","properties":{"type":{"type":"string","enum":["phone"]},"phone":{"type":"string"},"public":{"type":"boolean"}},"required":["type","phone"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeePhone"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeAddress"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeDefined"]}},"required":["type"]}]}},"bookingFields":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"slug":{"type":"string","minLength":1},"label":{"type":"string"},"required":{"type":"boolean"},"placeholder":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"hidden":{"type":"boolean"},"disableOnPrefill":{"type":"boolean"}},"required":["type","slug"]}},"disableGuests":{"type":["boolean","null"]},"slotInterval":{"type":["integer","null"]},"minimumBookingNotice":{"type":["integer","null"]},"beforeEventBuffer":{"type":["integer","null"]},"afterEventBuffer":{"type":["integer","null"]},"scheduleId":{"type":["integer","null"]},"requiresConfirmation":{"type":["boolean","null"]},"successRedirectUrl":{"type":["string","null"]},"customName":{"type":["string","null"]}},"required":["id","slug","title","description","lengthInMinutes","lengthInMinutesOptions","hidden","locations","bookingFields","disableGuests","slotInterval","minimumBookingNotice","beforeEventBuffer","afterEventBuffer","scheduleId","requiresConfirmation","successRedirectUrl","customName"]}},"required":["eventType"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["Calendar"],"summary":"Update an event type","description":"Partially update an event type. Any field omitted is left unchanged. Emits `calendar.event_type.updated`.","operationId":"updateCalendarEventType","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"eventTypeId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"lengthInMinutes":{"type":"integer","exclusiveMinimum":0},"description":{"type":"string"},"locations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integration":{"type":"string"}},"required":["type","integration"]},{"type":"object","properties":{"type":{"type":"string","enum":["address"]},"address":{"type":"string"},"public":{"type":"boolean"}},"required":["type","address"]},{"type":"object","properties":{"type":{"type":"string","enum":["link"]},"link":{"type":"string","format":"uri"},"public":{"type":"boolean"}},"required":["type","link"]},{"type":"object","properties":{"type":{"type":"string","enum":["phone"]},"phone":{"type":"string"},"public":{"type":"boolean"}},"required":["type","phone"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeePhone"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeAddress"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeDefined"]}},"required":["type"]}]}},"bookingFields":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"slug":{"type":"string","minLength":1},"label":{"type":"string"},"required":{"type":"boolean"},"placeholder":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"hidden":{"type":"boolean"},"disableOnPrefill":{"type":"boolean"}},"required":["type","slug"]}},"disableGuests":{"type":"boolean"},"slotInterval":{"type":["integer","null"]},"minimumBookingNotice":{"type":"integer","minimum":0},"beforeEventBuffer":{"type":"integer","minimum":0},"afterEventBuffer":{"type":"integer","minimum":0},"scheduleId":{"type":"integer","exclusiveMinimum":0},"hidden":{"type":"boolean"},"requiresConfirmation":{"type":"boolean"},"successRedirectUrl":{"type":"string","format":"uri"},"customName":{"type":"string"},"lengthInMinutesOptions":{"type":"array","items":{"type":"integer","exclusiveMinimum":0}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"eventType":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"lengthInMinutes":{"type":"integer","minimum":0},"lengthInMinutesOptions":{"type":["array","null"],"items":{"type":"integer"}},"hidden":{"type":"boolean"},"locations":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integration":{"type":"string"}},"required":["type","integration"]},{"type":"object","properties":{"type":{"type":"string","enum":["address"]},"address":{"type":"string"},"public":{"type":"boolean"}},"required":["type","address"]},{"type":"object","properties":{"type":{"type":"string","enum":["link"]},"link":{"type":"string","format":"uri"},"public":{"type":"boolean"}},"required":["type","link"]},{"type":"object","properties":{"type":{"type":"string","enum":["phone"]},"phone":{"type":"string"},"public":{"type":"boolean"}},"required":["type","phone"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeePhone"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeAddress"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["attendeeDefined"]}},"required":["type"]}]}},"bookingFields":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"slug":{"type":"string","minLength":1},"label":{"type":"string"},"required":{"type":"boolean"},"placeholder":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"hidden":{"type":"boolean"},"disableOnPrefill":{"type":"boolean"}},"required":["type","slug"]}},"disableGuests":{"type":["boolean","null"]},"slotInterval":{"type":["integer","null"]},"minimumBookingNotice":{"type":["integer","null"]},"beforeEventBuffer":{"type":["integer","null"]},"afterEventBuffer":{"type":["integer","null"]},"scheduleId":{"type":["integer","null"]},"requiresConfirmation":{"type":["boolean","null"]},"successRedirectUrl":{"type":["string","null"]},"customName":{"type":["string","null"]}},"required":["id","slug","title","description","lengthInMinutes","lengthInMinutesOptions","hidden","locations","bookingFields","disableGuests","slotInterval","minimumBookingNotice","beforeEventBuffer","afterEventBuffer","scheduleId","requiresConfirmation","successRedirectUrl","customName"]}},"required":["eventType"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Calendar"],"summary":"Delete an event type","description":"Delete an event type. Existing bookings made against it remain. Emits `calendar.event_type.deleted`.","operationId":"deleteCalendarEventType","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"eventTypeId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/schedules":{"get":{"tags":["Calendar"],"summary":"List schedules","description":"List the availability schedules on the connected calendar provider. Each schedule defines a timezone and the weekly windows the user is bookable.","operationId":"listCalendarSchedules","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"timeZone":{"type":"string"},"isDefault":{"type":"boolean"},"availability":{"type":"array","items":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string","enum":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},"minItems":1},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["days","startTime","endTime"]}},"overrides":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","startTime","endTime"]}}},"required":["id","name","timeZone","isDefault","availability","overrides"]}}},"required":["schedules"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Calendar"],"summary":"Create a schedule","description":"Create a new availability schedule. `timeZone` controls how `availability`/`overrides` times are interpreted. Setting `isDefault: true` makes any event type without an explicit `scheduleId` use this schedule. Emits `calendar.schedule.created`.","operationId":"createCalendarSchedule","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"timeZone":{"type":"string","minLength":1},"isDefault":{"type":"boolean"},"availability":{"type":"array","items":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string","enum":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},"minItems":1},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["days","startTime","endTime"]}},"overrides":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","startTime","endTime"]}}},"required":["name","timeZone","isDefault"]}}}},"responses":{"201":{"description":"Schedule created","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"timeZone":{"type":"string"},"isDefault":{"type":"boolean"},"availability":{"type":"array","items":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string","enum":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},"minItems":1},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["days","startTime","endTime"]}},"overrides":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","startTime","endTime"]}}},"required":["id","name","timeZone","isDefault","availability","overrides"]}},"required":["schedule"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/calendar/schedules/{scheduleId}":{"get":{"tags":["Calendar"],"summary":"Get a schedule","description":"Fetch a single availability schedule by id.","operationId":"getCalendarSchedule","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"scheduleId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"timeZone":{"type":"string"},"isDefault":{"type":"boolean"},"availability":{"type":"array","items":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string","enum":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},"minItems":1},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["days","startTime","endTime"]}},"overrides":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","startTime","endTime"]}}},"required":["id","name","timeZone","isDefault","availability","overrides"]}},"required":["schedule"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["Calendar"],"summary":"Update a schedule","description":"Partially update a schedule. Any field omitted is left unchanged; arrays passed replace the prior value wholesale. Emits `calendar.schedule.updated`.","operationId":"updateCalendarSchedule","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"scheduleId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"timeZone":{"type":"string","minLength":1},"isDefault":{"type":"boolean"},"availability":{"type":"array","items":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string","enum":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},"minItems":1},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["days","startTime","endTime"]}},"overrides":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","startTime","endTime"]}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"timeZone":{"type":"string"},"isDefault":{"type":"boolean"},"availability":{"type":"array","items":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string","enum":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},"minItems":1},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["days","startTime","endTime"]}},"overrides":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","startTime","endTime"]}}},"required":["id","name","timeZone","isDefault","availability","overrides"]}},"required":["schedule"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Calendar"],"summary":"Delete a schedule","description":"Delete an availability schedule. Event types bound to it via `scheduleId` fall back to the default schedule. Emits `calendar.schedule.deleted`.","operationId":"deleteCalendarSchedule","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"scheduleId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"412":{"description":"Precondition failed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/object-records":{"get":{"tags":["CRM"],"summary":"List object records","description":"List records of a given object type. Records may include personRefId, the Person spine join key for human attribution.","operationId":"listObjectRecords","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"typeSlug","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt","displayName"]},"required":false,"name":"orderBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"orderDirection","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeTotal","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"typeSlug":{"type":"string"},"displayName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"data":{"type":"object","additionalProperties":{}},"personRefId":{"type":["string","null"],"description":"Person spine record id attached during create/update when this type links to Person and the payload carries matching identity. Use this as the durable join key for all data about one human."},"companyRefId":{"type":["string","null"],"description":"Reserved promoted company attribution id. Company spine support is not the primary public contract; model company relationships through CRM relations unless documented otherwise."},"amountCents":{"type":["string","null"],"pattern":"^-?\\d+$","description":"Money in minor units, decimal-string-encoded to preserve precision beyond Number.MAX_SAFE_INTEGER."},"currency":{"type":["string","null"]},"status":{"type":["string","null"]},"occurredAt":{"type":["string","null"],"format":"date-time"},"providerExternalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":["string","null"]},"updatedBy":{"type":["string","null"]}},"required":["id","typeSlug","displayName","externalId","data","personRefId","companyRefId","amountCents","currency","status","occurredAt","providerExternalId","createdAt","updatedAt","createdBy","updatedBy"]}},"pagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["limit","offset"]},"total":{"type":["integer","null"]}},"required":["records","pagination","total"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["CRM"],"summary":"Create object record","description":"Create a new record of the given object type. If the type has linksToPerson enabled and the payload carries matching identity, the service auto-attaches or creates a Person and returns personRefId.","operationId":"createObjectRecord","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"typeSlug":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z][a-z0-9_]*$"},"data":{"type":"object","additionalProperties":{}},"externalId":{"type":"string","maxLength":200},"relations":{"type":"object","additionalProperties":{"type":"object","properties":{"add":{"type":"array","items":{"type":"string","format":"uuid"}},"remove":{"type":"array","items":{"type":"string","format":"uuid"}}}}}},"required":["typeSlug"]}}}},"responses":{"201":{"description":"Object record created","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string"},"typeSlug":{"type":"string"},"displayName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"data":{"type":"object","additionalProperties":{}},"personRefId":{"type":["string","null"],"description":"Person spine record id attached during create/update when this type links to Person and the payload carries matching identity. Use this as the durable join key for all data about one human."},"companyRefId":{"type":["string","null"],"description":"Reserved promoted company attribution id. Company spine support is not the primary public contract; model company relationships through CRM relations unless documented otherwise."},"amountCents":{"type":["string","null"],"pattern":"^-?\\d+$","description":"Money in minor units, decimal-string-encoded to preserve precision beyond Number.MAX_SAFE_INTEGER."},"currency":{"type":["string","null"]},"status":{"type":["string","null"]},"occurredAt":{"type":["string","null"],"format":"date-time"},"providerExternalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":["string","null"]},"updatedBy":{"type":["string","null"]}},"required":["id","typeSlug","displayName","externalId","data","personRefId","companyRefId","amountCents","currency","status","occurredAt","providerExternalId","createdAt","updatedAt","createdBy","updatedBy"]}},"required":["record"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/object-records:bulk-upsert":{"post":{"tags":["CRM"],"summary":"Bulk-upsert object records","description":"Idempotent bulk upsert keyed on `providerExternalId`. Each row is independent — a single bad row reports its error in the result and does not abort the batch. Used by external importers (CRM migrations, sync jobs) that re-run safely.","operationId":"bulkUpsertObjectRecords","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"typeSlug":{"type":"string","minLength":1,"maxLength":120},"records":{"type":"array","items":{"type":"object","properties":{"providerExternalId":{"type":"string","minLength":1,"maxLength":200},"data":{"type":"object","additionalProperties":{}},"occurredAt":{"type":"string","format":"date-time"}},"required":["providerExternalId","data"]},"minItems":1}},"required":["typeSlug","records"]}}}},"responses":{"200":{"description":"Per-record upsert results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"providerExternalId":{"type":"string"},"status":{"type":"string","enum":["inserted","updated","failed"]},"recordId":{"type":"string"},"error":{"type":"string"}},"required":["providerExternalId","status"]}}},"required":["results"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/object-records:journey":{"get":{"tags":["CRM"],"summary":"Get a provider record journey","description":"Resolve a typed CRM record by providerExternalId and return its paginated cross-channel journey with first-touch and last-touch attribution. For a cloned Close lead, use `typeSlug=person` and `providerExternalId=close:lead:<lead_id>`. Authenticate with `Authorization: ApiKey <key>` using a project service-account key scoped to `crm_objects:read`.","operationId":"getObjectRecordJourneyByProviderExternalId","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"typeSlug","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":true,"name":"providerExternalId","in":"query"},{"schema":{"type":"string","maxLength":500},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Comma-separated journey kinds: web, communication, engagement, commerce, lifecycle, advertising, system."},"required":false,"description":"Comma-separated journey kinds: web, communication, engagement, commerce, lifecycle, advertising, system.","name":"kinds","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string"},"typeSlug":{"type":"string"},"displayName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"data":{"type":"object","additionalProperties":{}},"personRefId":{"type":["string","null"],"description":"Person spine record id attached during create/update when this type links to Person and the payload carries matching identity. Use this as the durable join key for all data about one human."},"companyRefId":{"type":["string","null"],"description":"Reserved promoted company attribution id. Company spine support is not the primary public contract; model company relationships through CRM relations unless documented otherwise."},"amountCents":{"type":["string","null"],"pattern":"^-?\\d+$","description":"Money in minor units, decimal-string-encoded to preserve precision beyond Number.MAX_SAFE_INTEGER."},"currency":{"type":["string","null"]},"status":{"type":["string","null"]},"occurredAt":{"type":["string","null"],"format":"date-time"},"providerExternalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":["string","null"]},"updatedBy":{"type":["string","null"]}},"required":["id","typeSlug","displayName","externalId","data","personRefId","companyRefId","amountCents","currency","status","occurredAt","providerExternalId","createdAt","updatedAt","createdBy","updatedBy"]},"journey":{"type":"object","properties":{"header":{"type":"object","properties":{"firstTouch":{"type":["object","null"],"properties":{"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_term":{"type":"string"},"utm_content":{"type":"string"},"gclid":{"type":"string"},"fbclid":{"type":"string"},"msclkid":{"type":"string"},"ttclid":{"type":"string"},"wbraid":{"type":"string"},"gbraid":{"type":"string"},"li_fat_id":{"type":"string"},"twclid":{"type":"string"},"epik":{"type":"string"},"dclid":{"type":"string"},"sapt_cid":{"type":"string"},"referrer":{"type":"string"},"landingPath":{"type":"string"},"userAgent":{"type":"string"},"ip":{"type":"string"},"fbc":{"type":"string"},"fbp":{"type":"string"}}},"lastTouch":{"type":["object","null"],"properties":{"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_term":{"type":"string"},"utm_content":{"type":"string"},"gclid":{"type":"string"},"fbclid":{"type":"string"},"msclkid":{"type":"string"},"ttclid":{"type":"string"},"wbraid":{"type":"string"},"gbraid":{"type":"string"},"li_fat_id":{"type":"string"},"twclid":{"type":"string"},"epik":{"type":"string"},"dclid":{"type":"string"},"sapt_cid":{"type":"string"},"referrer":{"type":"string"},"landingPath":{"type":"string"},"userAgent":{"type":"string"},"ip":{"type":"string"},"fbc":{"type":"string"},"fbp":{"type":"string"}}},"firstSeenAt":{"type":["string","null"],"format":"date-time"},"lastSeenAt":{"type":["string","null"],"format":"date-time"},"webSessions":{"type":"integer"},"pageviews":{"type":"integer"},"revenueCents":{"type":"integer"},"orderCount":{"type":"integer"},"totalTouches":{"type":"integer"},"deviceCount":{"type":"integer"},"identities":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"},"socials":{"type":"array","items":{"type":"string"}}}}},"required":["firstTouch","lastTouch","firstSeenAt","lastSeenAt","webSessions","pageviews","revenueCents","orderCount","totalTouches","deviceCount","identities"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ledger","analytics","scheduled","calendar"]},"kind":{"type":"string","enum":["web","communication","engagement","commerce","lifecycle","advertising","system"]},"type":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"scheduledFor":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["sent","delivered","opened","clicked","failed","scheduled","waiting"]},"title":{"type":"string"},"channel":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"recordId":{"type":"string"},"workflowId":{"type":"string"},"provenance":{"type":"object","properties":{"workflowId":{"type":"string"},"runId":{"type":"string"},"stepIndex":{"type":"integer"},"totalSteps":{"type":"integer"},"campaignId":{"type":"string"}}},"cancel":{"type":"object","properties":{"kind":{"type":"string","enum":["workflow_run_v2","scheduled_email_send","scheduled_post","scheduled_execution"]},"id":{"type":"string"}},"required":["kind","id"]},"detail":{"type":"object","additionalProperties":{}}},"required":["id","source","kind","type","occurredAt","title","detail"]}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]}},"required":["record","journey"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/integrations/close/journey":{"get":{"tags":["Integrations","CRM"],"summary":"Get a Close lead journey","description":"Return the Sapt web journey for one native Close lead without importing it into Sapt CRM. Sapt reads the lead from the project Close connection, then resolves every tracked browser by exact Close id, normalized email/phone, or a single-candidate fbclid. A valid lead with no tracked visit returns `matched: false` and an empty journey. Authenticate with `Authorization: ApiKey <key>` using a project service-account key scoped to `crm_objects:read`.","operationId":"getCloseLeadJourney","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","maxLength":500},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Comma-separated journey kinds: web, communication, engagement, commerce, lifecycle, advertising, system."},"required":false,"description":"Comma-separated journey kinds: web, communication, engagement, commerce, lifecycle, advertising, system.","name":"kinds","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Close lead id, for example `lead_6ANU`."},"required":true,"description":"Close lead id, for example `lead_6ANU`.","name":"close_lead_id","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"close_lead_id":{"type":"string"},"matched":{"type":"boolean","description":"Whether this Close lead resolved to at least one tracked Sapt visitor."},"match_method":{"type":["string","null"],"enum":["close_lead_id","identity","fbclid",null],"description":"Strongest resolution signal used: an exact stamped Close id, normalized email/phone, or a single-candidate first-touch fbclid."},"visitor_ids":{"type":"array","items":{"type":"string"},"description":"Every first-party browser/device included in the returned journey."},"journey":{"type":"object","properties":{"header":{"type":"object","properties":{"firstTouch":{"type":["object","null"],"properties":{"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_term":{"type":"string"},"utm_content":{"type":"string"},"gclid":{"type":"string"},"fbclid":{"type":"string"},"msclkid":{"type":"string"},"ttclid":{"type":"string"},"wbraid":{"type":"string"},"gbraid":{"type":"string"},"li_fat_id":{"type":"string"},"twclid":{"type":"string"},"epik":{"type":"string"},"dclid":{"type":"string"},"sapt_cid":{"type":"string"},"referrer":{"type":"string"},"landingPath":{"type":"string"},"userAgent":{"type":"string"},"ip":{"type":"string"},"fbc":{"type":"string"},"fbp":{"type":"string"}}},"lastTouch":{"type":["object","null"],"properties":{"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_term":{"type":"string"},"utm_content":{"type":"string"},"gclid":{"type":"string"},"fbclid":{"type":"string"},"msclkid":{"type":"string"},"ttclid":{"type":"string"},"wbraid":{"type":"string"},"gbraid":{"type":"string"},"li_fat_id":{"type":"string"},"twclid":{"type":"string"},"epik":{"type":"string"},"dclid":{"type":"string"},"sapt_cid":{"type":"string"},"referrer":{"type":"string"},"landingPath":{"type":"string"},"userAgent":{"type":"string"},"ip":{"type":"string"},"fbc":{"type":"string"},"fbp":{"type":"string"}}},"firstSeenAt":{"type":["string","null"],"format":"date-time"},"lastSeenAt":{"type":["string","null"],"format":"date-time"},"webSessions":{"type":"integer"},"pageviews":{"type":"integer"},"revenueCents":{"type":"integer"},"orderCount":{"type":"integer"},"totalTouches":{"type":"integer"},"deviceCount":{"type":"integer"},"identities":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"},"socials":{"type":"array","items":{"type":"string"}}}}},"required":["firstTouch","lastTouch","firstSeenAt","lastSeenAt","webSessions","pageviews","revenueCents","orderCount","totalTouches","deviceCount","identities"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ledger","analytics","scheduled","calendar"]},"kind":{"type":"string","enum":["web","communication","engagement","commerce","lifecycle","advertising","system"]},"type":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"scheduledFor":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["sent","delivered","opened","clicked","failed","scheduled","waiting"]},"title":{"type":"string"},"channel":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"recordId":{"type":"string"},"workflowId":{"type":"string"},"provenance":{"type":"object","properties":{"workflowId":{"type":"string"},"runId":{"type":"string"},"stepIndex":{"type":"integer"},"totalSteps":{"type":"integer"},"campaignId":{"type":"string"}}},"cancel":{"type":"object","properties":{"kind":{"type":"string","enum":["workflow_run_v2","scheduled_email_send","scheduled_post","scheduled_execution"]},"id":{"type":"string"}},"required":["kind","id"]},"detail":{"type":"object","additionalProperties":{}}},"required":["id","source","kind","type","occurredAt","title","detail"]}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]}},"required":["close_lead_id","matched","match_method","visitor_ids","journey"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/object-records/{recordId}":{"get":{"tags":["CRM"],"summary":"Get object record","description":"Get a single object record by id.","operationId":"getObjectRecord","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"recordId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string"},"typeSlug":{"type":"string"},"displayName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"data":{"type":"object","additionalProperties":{}},"personRefId":{"type":["string","null"],"description":"Person spine record id attached during create/update when this type links to Person and the payload carries matching identity. Use this as the durable join key for all data about one human."},"companyRefId":{"type":["string","null"],"description":"Reserved promoted company attribution id. Company spine support is not the primary public contract; model company relationships through CRM relations unless documented otherwise."},"amountCents":{"type":["string","null"],"pattern":"^-?\\d+$","description":"Money in minor units, decimal-string-encoded to preserve precision beyond Number.MAX_SAFE_INTEGER."},"currency":{"type":["string","null"]},"status":{"type":["string","null"]},"occurredAt":{"type":["string","null"],"format":"date-time"},"providerExternalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":["string","null"]},"updatedBy":{"type":["string","null"]}},"required":["id","typeSlug","displayName","externalId","data","personRefId","companyRefId","amountCents","currency","status","occurredAt","providerExternalId","createdAt","updatedAt","createdBy","updatedBy"]}},"required":["record"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["CRM"],"summary":"Update object record","description":"Partially update an object record. `data` is a partial merge — pass `null` for a key to delete it. Optional `expectedData` (JSONB containment) and `expectedStatus` fields make the write conditional; a stale precondition returns 409 without changing the record. Person-linked types may refresh personRefId from identity-bearing data.","operationId":"updateObjectRecord","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"recordId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{}},"externalId":{"type":["string","null"],"maxLength":200},"expectedData":{"type":"object","additionalProperties":{}},"expectedStatus":{"type":["string","null"],"minLength":1,"maxLength":40},"relations":{"type":"object","additionalProperties":{"type":"object","properties":{"add":{"type":"array","items":{"type":"string","format":"uuid"}},"remove":{"type":"array","items":{"type":"string","format":"uuid"}}}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string"},"typeSlug":{"type":"string"},"displayName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"data":{"type":"object","additionalProperties":{}},"personRefId":{"type":["string","null"],"description":"Person spine record id attached during create/update when this type links to Person and the payload carries matching identity. Use this as the durable join key for all data about one human."},"companyRefId":{"type":["string","null"],"description":"Reserved promoted company attribution id. Company spine support is not the primary public contract; model company relationships through CRM relations unless documented otherwise."},"amountCents":{"type":["string","null"],"pattern":"^-?\\d+$","description":"Money in minor units, decimal-string-encoded to preserve precision beyond Number.MAX_SAFE_INTEGER."},"currency":{"type":["string","null"]},"status":{"type":["string","null"]},"occurredAt":{"type":["string","null"],"format":"date-time"},"providerExternalId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":["string","null"]},"updatedBy":{"type":["string","null"]}},"required":["id","typeSlug","displayName","externalId","data","personRefId","companyRefId","amountCents","currency","status","occurredAt","providerExternalId","createdAt","updatedAt","createdBy","updatedBy"]}},"required":["record"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["CRM"],"summary":"Delete object record","description":"Hard-delete an object record. Cascades to edges via FK.","operationId":"deleteObjectRecord","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"recordId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/workflows":{"get":{"tags":["Workflows"],"summary":"List workflows","description":"List every workflow in the project. Optional `typeSlug` / `eventType` filters narrow to workflows that match a specific trigger.","operationId":"listWorkflows","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"typeSlug","in":"query"},{"schema":{"type":"string"},"required":false,"name":"eventType","in":"query"},{"schema":{"type":"string","description":"Comma-separated tags; matches any supplied tag."},"required":false,"description":"Comma-separated tags; matches any supplied tag.","name":"tags","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workflows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"triggerTypeSlug":{"type":["string","null"]},"triggerEventType":{"type":"string"},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"},"revision":{"type":"string","minLength":1,"maxLength":128},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","tags","triggerTypeSlug","triggerEventType","actions","isActive","revision","createdAt","updatedAt"]}}},"required":["workflows"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Workflows"],"summary":"Create workflow","description":"Create a workflow. The optional `isActive` field is retained for backward compatibility; new integrations should use the workflow-drafts resource and activate only after reviewing readiness. Requires a real user identity — service-account creation is rejected because the executor needs an unambiguous principal at dispatch time.","operationId":"createWorkflow","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":1000},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":12},"triggerTypeSlug":{"type":["string","null"],"minLength":1,"maxLength":120},"triggerEventType":{"type":"string","minLength":1,"maxLength":120},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"}},"required":["name","triggerTypeSlug","triggerEventType","actions"]}}}},"responses":{"201":{"description":"Workflow created","content":{"application/json":{"schema":{"type":"object","properties":{"workflow":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"triggerTypeSlug":{"type":["string","null"]},"triggerEventType":{"type":"string"},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"},"revision":{"type":"string","minLength":1,"maxLength":128},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","tags","triggerTypeSlug","triggerEventType","actions","isActive","revision","createdAt","updatedAt"]}},"required":["workflow"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/workflows/{id}":{"get":{"tags":["Workflows"],"summary":"Get workflow","description":"Fetch a single workflow by id.","operationId":"getWorkflow","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workflow":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"triggerTypeSlug":{"type":["string","null"]},"triggerEventType":{"type":"string"},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"},"revision":{"type":"string","minLength":1,"maxLength":128},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","tags","triggerTypeSlug","triggerEventType","actions","isActive","revision","createdAt","updatedAt"]}},"required":["workflow"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["Workflows"],"summary":"Update workflow","description":"Partially update a workflow. Any omitted field is unchanged; `isActive` remains accepted for backward compatibility. `expectedRevision` is optional for existing clients and guards against stale overwrites when supplied. New integrations should use the workflow-drafts resource.","operationId":"updateWorkflow","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":1000},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":12},"triggerTypeSlug":{"type":["string","null"],"minLength":1,"maxLength":120},"triggerEventType":{"type":"string","minLength":1,"maxLength":120},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"},"expectedRevision":{"type":"string","minLength":1,"maxLength":128}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workflow":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"triggerTypeSlug":{"type":["string","null"]},"triggerEventType":{"type":"string"},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"},"revision":{"type":"string","minLength":1,"maxLength":128},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","tags","triggerTypeSlug","triggerEventType","actions","isActive","revision","createdAt","updatedAt"]}},"required":["workflow"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Workflows"],"summary":"Delete workflow","description":"Permanently delete a workflow and its run history. `expectedRevision` is optional for backward compatibility and prevents deleting a newer definition when supplied.","operationId":"deleteWorkflow","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/workflow-drafts":{"post":{"tags":["Workflows"],"summary":"Create workflow draft","description":"Create an inactive workflow draft. This additive resource is the revision-safe authoring contract; it never publishes at birth.","operationId":"createWorkflowDraft","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":1000},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":12},"triggerTypeSlug":{"type":["string","null"],"minLength":1,"maxLength":120},"triggerEventType":{"type":"string","minLength":1,"maxLength":120},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean","enum":[false]}},"required":["name","triggerTypeSlug","triggerEventType","actions"]}}}},"responses":{"201":{"description":"Workflow draft created","content":{"application/json":{"schema":{"type":"object","properties":{"workflow":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"triggerTypeSlug":{"type":["string","null"]},"triggerEventType":{"type":"string"},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"},"revision":{"type":"string","minLength":1,"maxLength":128},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","tags","triggerTypeSlug","triggerEventType","actions","isActive","revision","createdAt","updatedAt"]}},"required":["workflow"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/workflow-drafts/{workflowId}":{"patch":{"tags":["Workflows"],"summary":"Update workflow draft","description":"Update an inactive workflow definition using its latest revision. This endpoint cannot change activation state and refuses stale writes.","operationId":"updateWorkflowDraft","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"workflowId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":1000},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":12},"triggerTypeSlug":{"type":["string","null"],"minLength":1,"maxLength":120},"triggerEventType":{"type":"string","minLength":1,"maxLength":120},"triggerCondition":{},"actions":{"type":"array","items":{}},"expectedRevision":{"type":"string","minLength":1,"maxLength":128}},"required":["expectedRevision"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workflow":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"triggerTypeSlug":{"type":["string","null"]},"triggerEventType":{"type":"string"},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"},"revision":{"type":"string","minLength":1,"maxLength":128},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","tags","triggerTypeSlug","triggerEventType","actions","isActive","revision","createdAt","updatedAt"]}},"required":["workflow"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/workflows/{workflowId}:set-active":{"post":{"tags":["Workflows"],"summary":"Activate or pause workflow","description":"Set a workflow active or inactive using the latest reviewed revision. Activation evaluates the same tenant integration readiness gate as the dashboard and MCP surfaces; pausing is always allowed.","operationId":"setWorkflowActive","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"workflowId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"isActive":{"type":"boolean"},"expectedRevision":{"type":"string","minLength":1,"maxLength":128}},"required":["isActive","expectedRevision"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workflow":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"triggerTypeSlug":{"type":["string","null"]},"triggerEventType":{"type":"string"},"triggerCondition":{},"actions":{"type":"array","items":{}},"isActive":{"type":"boolean"},"revision":{"type":"string","minLength":1,"maxLength":128},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","tags","triggerTypeSlug","triggerEventType","actions","isActive","revision","createdAt","updatedAt"]}},"required":["workflow"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/workflows/{id}/run-now":{"post":{"tags":["Workflows"],"summary":"Run a scheduled workflow immediately","description":"Bypass the cron-due check and fire a scheduled workflow now. `expectedRevision` is optional for backward compatibility and pins execution to the reviewed definition when supplied. Event-triggered workflows fire when their event arrives.","operationId":"runWorkflowNow","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"string","minLength":1,"maxLength":128},"requestId":{"type":"string","format":"uuid"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Workflow dispatched","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"}},"required":["eventId"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/workflows/test-run":{"post":{"tags":["Workflows"],"summary":"Dry-run a workflow draft","description":"Evaluate a draft workflow against the most recent matching event (or a specific `eventId`). No real sends, writes, or HTTP calls are made — the response shows what each step would do.","operationId":"testRunWorkflow","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"draft":{"type":"object","properties":{"triggerTypeSlug":{"type":["string","null"]},"triggerEventType":{"type":"string","minLength":1},"triggerCondition":{},"actions":{"type":"array","items":{}}},"required":["triggerTypeSlug","triggerEventType","actions"]},"eventId":{"type":"string"}},"required":["draft"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"sampleEventId":{"type":["string","null"]},"conditionPassed":{"type":"boolean"},"steps":{"type":["array","null"],"items":{}},"reason":{"type":"string"}},"required":["sampleEventId","conditionPassed","steps"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/workflow-runs":{"get":{"tags":["Workflows"],"summary":"List recent workflow runs","description":"Most-recent-first list of workflow executions for this project. Filter by `workflowId` to narrow to a single workflow.","operationId":"listWorkflowRuns","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"workflowId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"triggerSource":{"type":"string"},"triggerEventType":{"type":"string"},"triggerTypeSlug":{"type":["string","null"]},"status":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"},"nextSendAt":{"type":["string","null"],"format":"date-time"},"actionsCompleted":{"type":"array","items":{}},"progress":{"type":"object","properties":{"completedSteps":{"type":"integer","minimum":0},"successfulSteps":{"type":"integer","minimum":0},"currentStepKind":{"type":["string","null"]},"currentStepLabel":{"type":["string","null"]},"summary":{"type":"string"}},"required":["completedSteps","successfulSteps","currentStepKind","currentStepLabel","summary"]},"captured":{},"errorMessage":{"type":["string","null"]},"triggerEventId":{"type":"string"}},"required":["id","workflowId","workflowName","triggerSource","triggerEventType","triggerTypeSlug","status","startedAt","finishedAt","nextSendAt","actionsCompleted","progress","errorMessage","triggerEventId"]}}},"required":["runs"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/oauth-clients":{"get":{"tags":["OAuth Clients"],"summary":"List my OAuth clients","description":"List every developer OAuth client owned by the caller.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"clientId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"redirectURLs":{"type":"array","items":{"type":"string"}},"disabled":{"type":"boolean"},"projectId":{"type":["string","null"],"format":"uuid"},"userId":{"type":["string","null"]},"kind":{"type":["string","null"]},"icon":{"type":["string","null"]},"description":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"metadata":{"type":["string","null"]},"defaultMemberRoleIds":{"type":"array","items":{"type":"string"}},"allowedScopes":{"type":"array","items":{"type":"string"}},"authenticationScheme":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","name","type","redirectURLs","disabled","projectId","userId","kind","icon","description","homepageUrl","metadata","defaultMemberRoleIds","allowedScopes","authenticationScheme","createdAt","updatedAt"]}}},"required":["clients"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["OAuth Clients"],"summary":"Create OAuth client","description":"Register a developer OAuth client owned by the caller. The token issued after consent carries `account:full` and acts on behalf of every consenting user across all of their Sapt projects. The plaintext `clientSecret` is returned only at create time — capture it immediately. Public PKCE clients receive `clientSecret: null`.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"redirectURLs":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1},"clientType":{"type":"string","enum":["web","public"]},"description":{"type":"string","maxLength":1000},"homepageUrl":{"type":"string","format":"uri"},"icon":{"type":"string","format":"uri"}},"required":["name","redirectURLs"]}}}},"responses":{"201":{"description":"OAuth client created","content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"},"clientSecret":{"type":["string","null"]},"client":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"clientId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"redirectURLs":{"type":"array","items":{"type":"string"}},"disabled":{"type":"boolean"},"projectId":{"type":["string","null"],"format":"uuid"},"userId":{"type":["string","null"]},"kind":{"type":["string","null"]},"icon":{"type":["string","null"]},"description":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"metadata":{"type":["string","null"]},"defaultMemberRoleIds":{"type":"array","items":{"type":"string"}},"allowedScopes":{"type":"array","items":{"type":"string"}},"authenticationScheme":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","name","type","redirectURLs","disabled","projectId","userId","kind","icon","description","homepageUrl","metadata","defaultMemberRoleIds","allowedScopes","authenticationScheme","createdAt","updatedAt"]}},"required":["clientId","clientSecret","client"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/oauth-clients/{clientId}":{"patch":{"tags":["OAuth Clients"],"summary":"Update OAuth client","description":"Update a developer OAuth client owned by the caller. Pass `null` for `description`, `homepageUrl`, or `icon` to clear them.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"clientId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"redirectURLs":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1},"disabled":{"type":"boolean"},"description":{"type":["string","null"],"maxLength":1000},"homepageUrl":{"type":["string","null"],"format":"uri"},"icon":{"type":["string","null"],"format":"uri"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"clientId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"redirectURLs":{"type":"array","items":{"type":"string"}},"disabled":{"type":"boolean"},"projectId":{"type":["string","null"],"format":"uuid"},"userId":{"type":["string","null"]},"kind":{"type":["string","null"]},"icon":{"type":["string","null"]},"description":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"metadata":{"type":["string","null"]},"defaultMemberRoleIds":{"type":"array","items":{"type":"string"}},"allowedScopes":{"type":"array","items":{"type":"string"}},"authenticationScheme":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","name","type","redirectURLs","disabled","projectId","userId","kind","icon","description","homepageUrl","metadata","defaultMemberRoleIds","allowedScopes","authenticationScheme","createdAt","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["OAuth Clients"],"summary":"Delete OAuth client","description":"Delete a developer OAuth client owned by the caller. Cascades to access tokens and consent records. Cannot be undone.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"clientId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/oauth-clients/{clientId}/rotate-secret":{"post":{"tags":["OAuth Clients"],"summary":"Rotate OAuth client secret","description":"Rotate the `client_secret` of a developer OAuth client owned by the caller. Previously-issued access tokens remain valid until their natural expiry; this only invalidates the secret used to mint new tokens. Rejected for public PKCE clients.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"clientId","in":"path"}],"responses":{"200":{"description":"Secret rotated","content":{"application/json":{"schema":{"type":"object","properties":{"clientSecret":{"type":"string"}},"required":["clientSecret"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/roles":{"get":{"tags":["Project Roles"],"summary":"List project roles","description":"Get all roles for a specific project. Requires project:read permission.","operationId":"listProjectRoles","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"List of project roles","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]}}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Project Roles"],"summary":"Create project role","description":"Create a new role for a project. Requires project:write permission.","operationId":"createProjectRole","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}}},"required":["name","permissions"]}}}},"responses":{"200":{"description":"Created project role","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/roles/{roleId}":{"get":{"tags":["Project Roles"],"summary":"Get project role","description":"Get details of a specific project role. Requires project:read permission.","operationId":"getProjectRole","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"roleId","in":"path"}],"responses":{"200":{"description":"Project role details","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["Project Roles"],"summary":"Update project role","description":"Update an existing project role. Requires project:write permission.","operationId":"updateProjectRole","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"roleId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Updated project role","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Project Roles"],"summary":"Delete project role","description":"Delete a project role. Requires project:write permission.","operationId":"deleteProjectRole","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"roleId","in":"path"}],"responses":{"200":{"description":"Role deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/templates":{"get":{"tags":["Project Templates"],"summary":"List project templates","description":"List the project templates saved on this project. Templates seed roles, sidebar, workflows, and CRM types/relations into a new sub-project when referenced at creation.","operationId":"listProjectTemplates","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"List of project templates","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectTemplate"}}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"post":{"tags":["Project Templates"],"summary":"Create project template","description":"Create a new project template on this project. Roles inside the bundle are capped to permissions the caller already holds.","operationId":"createProjectTemplate","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":["string","null"],"maxLength":500},"bundle":{}},"required":["name"]}}}},"responses":{"201":{"description":"Created project template","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/ProjectTemplate"}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/templates/{templateId}":{"get":{"tags":["Project Templates"],"summary":"Get project template","description":"Get a single project template by id.","operationId":"getProjectTemplate","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"templateId","in":"path"}],"responses":{"200":{"description":"Project template details","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/ProjectTemplate"}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"patch":{"tags":["Project Templates"],"summary":"Update project template","description":"Update a project template. Omitted fields are left unchanged.","operationId":"updateProjectTemplate","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"templateId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":["string","null"],"maxLength":500},"bundle":{}}}}}},"responses":{"200":{"description":"Updated project template","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/ProjectTemplate"}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Project Templates"],"summary":"Delete project template","description":"Delete a project template. Does not affect previously-applied sub-projects.","operationId":"deleteProjectTemplate","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"templateId","in":"path"}],"responses":{"200":{"description":"Project template deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/snapshot":{"post":{"tags":["Project Templates"],"summary":"Snapshot a project","description":"Capture this project's live configuration into a new reusable template (snapshot) in one step. Omit `include` to capture EVERYTHING — roles, sidebar, workflows, CRM object types/relations/column config, custom person fields, CMS content types, branding, brand-voice context, and agents. Set keys in `include` (e.g. `{ \"branding\": true }`) to restrict capture to those subsystems. Live CMS content items are only cloned when `include.starterContent` is set. Account-specific references (sender emails, connected-account ids) are scrubbed and reported in `warnings`.","operationId":"snapshotProject","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":["string","null"],"maxLength":500},"include":{},"variables":{},"tokenize":{}},"required":["name"]}}}},"responses":{"201":{"description":"Snapshot saved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/ProjectTemplate"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["template","warnings"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/templates/{templateId}/apply":{"post":{"tags":["Project Templates"],"summary":"Apply a template to a new sub-project","description":"Create a new sub-project under this (parent) project and stamp the template onto it — the GHL \"create from snapshot\" flow. Supply `variableValues` for any `{{variables}}` the template declares. Returns the new project and an apply report (what landed vs. what failed). Requires `sub_projects:write` on the parent project.","operationId":"applyProjectTemplate","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"templateId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"variableValues":{"type":"object","additionalProperties":{"type":"string"}}},"required":["name"]}}}},"responses":{"201":{"description":"Sub-project created from template","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","createdAt"]},"templateApply":{"type":"object","properties":{"status":{"type":"string","enum":["applied","failed"]},"report":{"$ref":"#/components/schemas/SnapshotApplyReport"},"error":{"type":"string"}},"required":["status"]}},"required":["project"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/templates/{templateId}/load":{"post":{"tags":["Project Templates"],"summary":"Load a snapshot into an existing project","description":"Additively load this template's configuration into an EXISTING project (`targetProjectId` in the body) — the GHL \"load snapshot into a sub-account\" flow. Assets that already exist on the target are SKIPPED, never overwritten. The path `{projectId}` is the template owner; the caller must hold admin access on the target project and template-read on the owner. Workflows are loaded paused. Returns an apply report (added vs. skipped vs. failed).","operationId":"loadProjectTemplate","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"templateId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetProjectId":{"type":"string","format":"uuid"}},"required":["targetProjectId"]}}}},"responses":{"200":{"description":"Snapshot loaded","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/SnapshotApplyReport"}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/projects/{projectId}/sidebar":{"get":{"tags":["Dashboard Sidebar"],"summary":"Get sidebar configuration","description":"Get the sidebar sections rendered for a project.","operationId":"getProjectSidebar","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Sidebar configuration","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","maxLength":100},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"featureId":{"type":"string"},"pluginId":{"type":"string"},"href":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":100},"customLabel":{"type":"string","maxLength":100},"icon":{"type":"string","minLength":1,"maxLength":64}},"required":["label","icon"]}}},"required":["id","label","items"]}}},"required":["sections"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"put":{"tags":["Dashboard Sidebar"],"summary":"Replace sidebar configuration","description":"Replace the entire sidebar section list for a project. Hiding an entry never denies authority — a user with read access to the underlying resource can still reach it by URL.","operationId":"setProjectSidebar","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","maxLength":100},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"featureId":{"type":"string"},"pluginId":{"type":"string"},"href":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":100},"customLabel":{"type":"string","maxLength":100},"icon":{"type":"string","minLength":1,"maxLength":64}},"required":["label","icon"]}}},"required":["id","label","items"]}}},"required":["sections"]}}}},"responses":{"200":{"description":"Updated sidebar configuration","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","maxLength":100},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"featureId":{"type":"string"},"pluginId":{"type":"string"},"href":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":100},"customLabel":{"type":"string","maxLength":100},"icon":{"type":"string","minLength":1,"maxLength":64}},"required":["label","icon"]}}},"required":["id","label","items"]}}},"required":["sections"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/sidebar-catalog":{"get":{"tags":["Dashboard Sidebar"],"summary":"List available sidebar features","description":"Returns the catalog of feature ids that can appear in a sidebar section, with their default labels, icons, and required read-resource permissions.","operationId":"getSidebarCatalog","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Sidebar feature catalog","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"features":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"defaultIcon":{"type":"string"},"requiresReadAccessTo":{"type":"string"},"deprecated":{"type":"boolean"}},"required":["id","label","description","defaultIcon"]}}},"required":["features"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/service-accounts":{"post":{"tags":["Service Accounts"],"summary":"Create service account","description":"Create a new service account, optionally with an initial project membership. Requires service_accounts:write permission.","operationId":"createServiceAccount","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"description":{"type":"string","maxLength":500},"platformRole":{"type":"string","enum":["admin","member","contractor","sales_rep"]},"projectId":{"type":"string"},"projectRoleIds":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"200":{"description":"Created service account","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","suspended","revoked"]},"platformRole":{"type":["string","null"],"enum":["admin","member","contractor","sales_rep",null]},"projectId":{"type":["string","null"]},"projectRoleIds":{"type":["array","null"],"items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","description","status","platformRole","projectId","projectRoleIds","createdAt","updatedAt"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"get":{"tags":["Service Accounts"],"summary":"List service accounts","description":"List service accounts by project or platform scope. Requires project:read or platform service_accounts:read permission.","operationId":"listServiceAccounts","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"platform","in":"query"}],"responses":{"200":{"description":"List of service accounts","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","suspended","revoked"]},"platformRole":{"type":["string","null"],"enum":["admin","member","contractor","sales_rep",null]},"projectId":{"type":["string","null"]},"projectRoleIds":{"type":["array","null"],"items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","description","status","platformRole","projectId","projectRoleIds","createdAt","updatedAt"]}}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/google-analytics/auth/connect":{"post":{"tags":["Google Analytics"],"summary":"Generate Google Analytics OAuth URL","description":"Generate a URL to redirect user to Google for GA4 + GSC authorization","operationId":"generateGAAuthUrl","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"generateGAAuthUrl","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"}},"required":["projectId"]}}}},"responses":{"200":{"description":"OAuth URL generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"authUrl":{"type":"string","format":"uri"}},"required":["authUrl"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/google-business/auth/connect":{"post":{"tags":["Google Business"],"summary":"Generate Google Business Profile OAuth URL","description":"Generate a URL to redirect user to Google for GBP authorization","operationId":"generateGbpAuthUrl","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"generateGbpAuthUrl","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"}},"required":["projectId"]}}}},"responses":{"200":{"description":"OAuth URL generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"authUrl":{"type":"string","format":"uri"}},"required":["authUrl"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/integrations/oauth/{providerId}/connect":{"post":{"tags":["Integrations"],"summary":"Begin an OAuth integration connection","description":"Deprecated — use POST /projects/{projectId}/connect-sessions. This legacy route remains for existing callers.","operationId":"beginIntegrationOAuthConnect","deprecated":true,"security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"beginOAuthConnect","parameters":[{"schema":{"type":"string"},"required":true,"name":"providerId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"redirectUrl":{"type":"string","format":"uri"}},"required":["projectId"]}}}},"responses":{"200":{"description":"Connect session created","content":{"application/json":{"schema":{"type":"object","properties":{"connectUrl":{"type":"string","format":"uri"},"sessionId":{"type":"string","format":"uuid"},"expiresAt":{"type":"string","format":"date-time"}},"required":["connectUrl","sessionId","expiresAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/accounts/{projectId}":{"get":{"tags":["Socials","Accounts"],"summary":"List connected social accounts","description":"Every social account connected to the project — Instagram, Facebook, TikTok, YouTube and Google Business Profile. The `id` returned here is the `socialAccountId` that the posting, scheduling and analytics endpoints take.","operationId":"listSocialAccounts","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"listSocialAccounts","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Connected social accounts","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"platform":{"type":"string"},"platformAccountId":{"type":"string"},"username":{"type":"string"},"displayName":{"type":["string","null"]},"profilePictureUrl":{"type":["string","null"]},"profileUrl":{"type":["string","null"]},"followersCount":{"type":["number","null"]},"isActive":{"type":"boolean"},"tokenExpiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","platform","platformAccountId","username","displayName","profilePictureUrl","profileUrl","followersCount","isActive","tokenExpiresAt","createdAt"]}}},"required":["accounts"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/analytics/instagram/{projectId}/{accountId}":{"get":{"tags":["Socials","Analytics"],"summary":"Get Instagram account analytics","description":"Get insights and analytics for an Instagram account including reach, interactions, and demographics","operationId":"getInstagramAnalytics","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getInstagramAnalytics","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","default":"30"},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Analytics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"accountId":{"type":"string"},"username":{"type":"string"},"impressions":{"type":"number"},"reach":{"type":"number"},"totalInteractions":{"type":"number"},"accountsEngaged":{"type":"number"},"followerCount":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"replies":{"type":"number"},"audienceGenderAge":{"type":"object","additionalProperties":{"type":"number"}},"audienceCountry":{"type":"object","additionalProperties":{"type":"number"}},"audienceCity":{"type":"object","additionalProperties":{"type":"number"}},"dailyMetrics":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"impressions":{"type":"number"},"reach":{"type":"number"},"totalInteractions":{"type":"number"},"accountsEngaged":{"type":"number"},"followerCount":{"type":"number"}},"required":["date","impressions","reach","totalInteractions","accountsEngaged","followerCount"]}},"fetchedAt":{"type":"string"}},"required":["accountId","username","impressions","reach","totalInteractions","accountsEngaged","followerCount","likes","comments","shares","saves","replies","dailyMetrics","fetchedAt"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/analytics/instagram/{projectId}/{accountId}/media":{"get":{"tags":["Socials","Analytics"],"summary":"Get Instagram media analytics","description":"Get analytics for Instagram posts including engagement, reach, and interactions per post","operationId":"getInstagramMediaAnalytics","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getInstagramMediaAnalytics","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","default":"25"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Media analytics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"media":{"type":"array","items":{"type":"object","properties":{"mediaId":{"type":"string"},"caption":{"type":"string"},"mediaType":{"type":"string"},"mediaUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"permalink":{"type":"string"},"timestamp":{"type":"string"},"likeCount":{"type":"number"},"commentsCount":{"type":"number"},"shares":{"type":"number"},"impressions":{"type":"number"},"reach":{"type":"number"},"saved":{"type":"number"},"engagement":{"type":"number"}},"required":["mediaId","mediaType","timestamp","likeCount","commentsCount","shares","impressions","reach","saved","engagement"]}}},"required":["media"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/analytics/facebook/{projectId}/{accountId}":{"get":{"tags":["Socials","Analytics"],"summary":"Get Facebook Page analytics","description":"Get insights and analytics for a Facebook Page including reach, engagement, and followers","operationId":"getFacebookAnalytics","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getFacebookAnalytics","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","default":"30"},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Analytics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"accountId":{"type":"string"},"pageName":{"type":"string"},"followers":{"type":"number"},"reach":{"type":"number"},"pageViews":{"type":"number"},"engagedUsers":{"type":"number"},"reactions":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"dailyMetrics":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"reach":{"type":"number"},"pageViews":{"type":"number"},"engagedUsers":{"type":"number"}},"required":["date","reach","pageViews","engagedUsers"]}},"fetchedAt":{"type":"string"}},"required":["accountId","pageName","followers","reach","pageViews","engagedUsers","reactions","comments","shares","dailyMetrics","fetchedAt"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/analytics/facebook/{projectId}/{accountId}/posts":{"get":{"tags":["Socials","Analytics"],"summary":"Get Facebook Page posts analytics","description":"Get analytics for Facebook Page posts including engagement metrics","operationId":"getFacebookPostsAnalytics","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getFacebookPostsAnalytics","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Posts analytics retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"posts":{"type":"array","items":{"type":"object","properties":{"postId":{"type":"string"},"message":{"type":"string"},"createdTime":{"type":"string"},"fullPicture":{"type":"string"},"permalinkUrl":{"type":"string"},"reactions":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"engagement":{"type":"number"}},"required":["postId","createdTime","reactions","comments","shares","engagement"]}}},"required":["posts"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/media/{projectId}/stream-upload":{"put":{"tags":["Socials","Content Calendar"],"summary":"Stream media upload","description":"Stream an image or video straight to storage and get back a staging handle. Send the raw bytes as the request body with the file's own `Content-Type` (`image/*` or `video/*`) — not multipart, not base64. Pass the returned `handle` in `uploadedHandles` on **Create post**. This is the upload path for anything larger than a few megabytes; inline `mediaItems` base64 is capped by Worker memory.","operationId":"streamUploadPostMedia","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"streamUploadPostMedia","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","description":"Original filename; used to derive the extension."},"required":false,"description":"Original filename; used to derive the extension.","name":"filename","in":"query"}],"requestBody":{"description":"Raw image or video bytes.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Media staged","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"handle":{"type":"object","properties":{"stagingId":{"type":"string"},"ext":{"type":"string"}},"required":["stagingId","ext"]},"preview":{"type":"object","properties":{"r2Url":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"number"}},"required":["r2Url","contentType","sizeBytes"]}},"required":["handle","preview"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/posts/{projectId}":{"post":{"tags":["Socials","Content Calendar"],"summary":"Create post","description":"Create a post for any connected platform — Instagram, Facebook, TikTok, YouTube or Google Business Profile. Get `socialAccountId` from **List connected social accounts**. Set `publishNow: true` to publish immediately, or `scheduledFor` (with `timezone`) to schedule. Attach media either inline as base64 `mediaItems` or, for anything large, by streaming it to **Stream media upload** first and passing the returned handles as `uploadedHandles`. Instagram Stories must be published immediately.","operationId":"createScheduledPost","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"createScheduledPost","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"socialAccountId":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["instagram","facebook","tiktok","google_business","youtube"],"default":"instagram"},"caption":{"type":"string","maxLength":63206},"mediaType":{"type":"string","enum":["IMAGE","REELS","CAROUSEL","STORIES","PHOTO","VIDEO","LINK"]},"linkUrl":{"type":"string","format":"uri"},"publishNow":{"type":"boolean"},"scheduledFor":{"type":"string"},"timezone":{"type":"string","default":"UTC"},"mediaItems":{"type":"array","items":{"type":"object","properties":{"base64":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"}},"required":["base64","filename","mimeType"]}},"coverImage":{"type":"object","properties":{"base64":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"}},"required":["base64","filename","mimeType"]}},"required":["socialAccountId","caption","mediaType"]}}}},"responses":{"200":{"description":"Scheduled post created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string"},"socialAccountId":{"type":"string","format":"uuid"},"platform":{"type":"string"},"caption":{"type":"string"},"mediaType":{"type":"string"},"linkUrl":{"type":["string","null"]},"coverR2Url":{"type":["string","null"]},"containerId":{"type":["string","null"]},"scheduledFor":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string"},"publishedAt":{"type":["string","null"]},"permalink":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"r2Key":{"type":"string"},"r2Url":{"type":"string"},"mediaType":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"orderIndex":{"type":"number"}},"required":["id","r2Key","r2Url","mediaType","filename","mimeType","sizeBytes","orderIndex"]}},"account":{"type":"object","properties":{"username":{"type":"string"},"profilePictureUrl":{"type":["string","null"]}},"required":["username","profilePictureUrl"]}},"required":["id","projectId","socialAccountId","platform","caption","mediaType","containerId","scheduledFor","timezone","status","publishedAt","permalink","errorMessage","createdAt","updatedAt"]}},"required":["post"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"get":{"tags":["Socials","Content Calendar"],"summary":"List scheduled posts","description":"Get all scheduled posts for a project with optional filters","operationId":"listScheduledPosts","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"listScheduledPosts","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Posts retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"posts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string"},"socialAccountId":{"type":"string","format":"uuid"},"platform":{"type":"string"},"caption":{"type":"string"},"mediaType":{"type":"string"},"linkUrl":{"type":["string","null"]},"coverR2Url":{"type":["string","null"]},"containerId":{"type":["string","null"]},"scheduledFor":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string"},"publishedAt":{"type":["string","null"]},"permalink":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"r2Key":{"type":"string"},"r2Url":{"type":"string"},"mediaType":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"orderIndex":{"type":"number"}},"required":["id","r2Key","r2Url","mediaType","filename","mimeType","sizeBytes","orderIndex"]}},"account":{"type":"object","properties":{"username":{"type":"string"},"profilePictureUrl":{"type":["string","null"]}},"required":["username","profilePictureUrl"]}},"required":["id","projectId","socialAccountId","platform","caption","mediaType","containerId","scheduledFor","timezone","status","publishedAt","permalink","errorMessage","createdAt","updatedAt"]}}},"required":["posts"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/posts/{projectId}/{postId}":{"get":{"tags":["Socials","Content Calendar"],"summary":"Get scheduled post","description":"Get details of a specific scheduled post","operationId":"getScheduledPost","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getScheduledPost","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"}],"responses":{"200":{"description":"Post retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string"},"socialAccountId":{"type":"string","format":"uuid"},"platform":{"type":"string"},"caption":{"type":"string"},"mediaType":{"type":"string"},"linkUrl":{"type":["string","null"]},"coverR2Url":{"type":["string","null"]},"containerId":{"type":["string","null"]},"scheduledFor":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string"},"publishedAt":{"type":["string","null"]},"permalink":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"r2Key":{"type":"string"},"r2Url":{"type":"string"},"mediaType":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"orderIndex":{"type":"number"}},"required":["id","r2Key","r2Url","mediaType","filename","mimeType","sizeBytes","orderIndex"]}},"account":{"type":"object","properties":{"username":{"type":"string"},"profilePictureUrl":{"type":["string","null"]}},"required":["username","profilePictureUrl"]}},"required":["id","projectId","socialAccountId","platform","caption","mediaType","containerId","scheduledFor","timezone","status","publishedAt","permalink","errorMessage","createdAt","updatedAt"]}},"required":["post"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"put":{"tags":["Socials","Content Calendar"],"summary":"Update scheduled post","description":"Update a draft or scheduled post (cannot update published posts)","operationId":"updateScheduledPost","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"updateScheduledPost","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"caption":{"type":"string","maxLength":2200},"scheduledFor":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled"]}}}}}},"responses":{"200":{"description":"Post updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string"},"socialAccountId":{"type":"string","format":"uuid"},"platform":{"type":"string"},"caption":{"type":"string"},"mediaType":{"type":"string"},"linkUrl":{"type":["string","null"]},"coverR2Url":{"type":["string","null"]},"containerId":{"type":["string","null"]},"scheduledFor":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string"},"publishedAt":{"type":["string","null"]},"permalink":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"r2Key":{"type":"string"},"r2Url":{"type":"string"},"mediaType":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"orderIndex":{"type":"number"}},"required":["id","r2Key","r2Url","mediaType","filename","mimeType","sizeBytes","orderIndex"]}},"account":{"type":"object","properties":{"username":{"type":"string"},"profilePictureUrl":{"type":["string","null"]}},"required":["username","profilePictureUrl"]}},"required":["id","projectId","socialAccountId","platform","caption","mediaType","containerId","scheduledFor","timezone","status","publishedAt","permalink","errorMessage","createdAt","updatedAt"]}},"required":["post"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Socials","Content Calendar"],"summary":"Delete scheduled post","description":"Delete a scheduled post and cancel Instagram container if exists","operationId":"deleteScheduledPost","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"deleteScheduledPost","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"}],"responses":{"200":{"description":"Post deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/posts/{projectId}/{postId}/status":{"get":{"tags":["Socials","Content Calendar"],"summary":"Get post status","description":"Get the current status of a post (lightweight endpoint for polling)","operationId":"getPostStatus","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getPostStatus","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"}],"responses":{"200":{"description":"Post status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"status":{"type":"string","enum":["draft","queued","uploading","publishing","scheduled","published","failed"]},"errorMessage":{"type":["string","null"]},"permalink":{"type":["string","null"]},"publishedAt":{"type":["string","null"]}},"required":["status","errorMessage","permalink","publishedAt"]}},"required":["success","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/posts/{projectId}/{postId}/media/{mediaId}":{"delete":{"tags":["Socials","Content Calendar"],"summary":"Delete post media","description":"Remove one media item from a scheduled post and delete its stored blob. The post itself is left in place.","operationId":"deleteScheduledPostMedia","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"deleteScheduledPostMedia","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"mediaId","in":"path"}],"responses":{"200":{"description":"Media item deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/posts/{projectId}/{postId}/publish":{"post":{"tags":["Socials","Content Calendar"],"summary":"Publish post immediately","description":"Publish a scheduled or draft post right now, bypassing its `scheduledFor` time. Also the retry path for a post whose status is `failed` — publishing re-runs delivery from the failed state, so no separate retry call is needed.","operationId":"publishPostNow","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"publishPostNow","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"}],"responses":{"200":{"description":"Post published successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"postId":{"type":"string"},"dispatched":{"type":"string","enum":["queued","sync"]},"permalink":{"type":["string","null"]}},"required":["postId","dispatched","permalink"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/comments/instagram/{projectId}/{mediaId}":{"get":{"tags":["Socials","Comments"],"summary":"Get Instagram comments","description":"Get comments on an Instagram media object","operationId":"getInstagramComments","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getInstagramComments","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"mediaId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Comments retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}},"required":["comments"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/comments/instagram/{projectId}/{commentId}/reply":{"post":{"tags":["Socials","Comments"],"summary":"Reply to Instagram comment","description":"Reply to a comment on Instagram","operationId":"replyInstagramComment","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"replyInstagramComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"message":{"type":"string","maxLength":2200}},"required":["accountId","message"]}}}},"responses":{"200":{"description":"Reply posted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"commentId":{"type":"string"}},"required":["commentId"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/comments/instagram/{projectId}/{commentId}/hide":{"post":{"tags":["Socials","Comments"],"summary":"Hide/unhide Instagram comment","description":"Hide or unhide a comment on Instagram","operationId":"hideInstagramComment","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"hideInstagramComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"hide":{"type":"boolean"}},"required":["accountId","hide"]}}}},"responses":{"200":{"description":"Comment visibility updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/comments/instagram/{projectId}/{commentId}":{"delete":{"tags":["Socials","Comments"],"summary":"Delete Instagram comment","description":"Delete a comment on Instagram","operationId":"deleteInstagramComment","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"deleteInstagramComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Comment deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/comments/facebook/{projectId}/{postId}":{"get":{"tags":["Socials","Comments"],"summary":"Get Facebook comments","description":"Get comments on a Facebook post","operationId":"getFacebookComments","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getFacebookComments","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"postId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Comments retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}},"required":["comments"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/comments/facebook/{projectId}/{commentId}/reply":{"post":{"tags":["Socials","Comments"],"summary":"Reply to Facebook comment","description":"Reply to a comment on Facebook","operationId":"replyFacebookComment","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"replyFacebookComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"message":{"type":"string"}},"required":["accountId","message"]}}}},"responses":{"200":{"description":"Reply posted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"commentId":{"type":"string"}},"required":["commentId"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/comments/facebook/{projectId}/{commentId}/hide":{"post":{"tags":["Socials","Comments"],"summary":"Hide/unhide Facebook comment","description":"Hide or unhide a comment on Facebook","operationId":"hideFacebookComment","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"hideFacebookComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"hide":{"type":"boolean"}},"required":["accountId","hide"]}}}},"responses":{"200":{"description":"Comment visibility updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/comments/facebook/{projectId}/{commentId}":{"delete":{"tags":["Socials","Comments"],"summary":"Delete Facebook comment","description":"Delete a comment on Facebook","operationId":"deleteFacebookComment","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"deleteFacebookComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Comment deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/engagement/facebook/{projectId}/{postId}/published":{"delete":{"tags":["Socials","Engagement"],"summary":"Delete published Facebook post","description":"Delete a published post from a Facebook Page","operationId":"deletePublishedFacebookPost","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"deletePublishedFacebookPost","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"postId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Post deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/engagement/facebook/{projectId}/{postId}/like":{"post":{"tags":["Socials","Engagement"],"summary":"Like Facebook post as Page","description":"Like a post as the Facebook Page","operationId":"likeFacebookPost","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"likeFacebookPost","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"postId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"}},"required":["accountId"]}}}},"responses":{"200":{"description":"Post liked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Socials","Engagement"],"summary":"Unlike Facebook post as Page","description":"Remove like from a post as the Facebook Page","operationId":"unlikeFacebookPost","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"unlikeFacebookPost","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"postId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Like removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/engagement/facebook/{projectId}/{postId}/comments":{"post":{"tags":["Socials","Engagement"],"summary":"Create comment on Facebook post","description":"Create a top-level comment on a Facebook post as the Page","operationId":"createFacebookComment","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"createFacebookComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"postId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"message":{"type":"string","minLength":1}},"required":["accountId","message"]}}}},"responses":{"200":{"description":"Comment created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"commentId":{"type":"string"}},"required":["commentId"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/engagement/instagram/{projectId}/{mediaId}/comments":{"post":{"tags":["Socials","Engagement"],"summary":"Create comment on Instagram post","description":"Create a top-level comment on your own Instagram post","operationId":"createInstagramComment","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"createInstagramComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"mediaId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"message":{"type":"string","minLength":1}},"required":["accountId","message"]}}}},"responses":{"200":{"description":"Comment created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"commentId":{"type":"string"}},"required":["commentId"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/accounts/{projectId}/{accountId}":{"get":{"tags":["Ads"],"summary":"Get ad accounts","description":"Get all ad accounts accessible by the connected Facebook account","operationId":"getAdAccounts","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getAdAccounts","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Ad accounts fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"adAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"accountStatus":{"type":"number"},"currency":{"type":"string"},"timezone":{"type":"string"},"amountSpent":{"type":"string"},"business":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","name","accountStatus","currency","timezone","amountSpent"]}}},"required":["adAccounts"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/accounts/{projectId}":{"get":{"tags":["Ads"],"summary":"Get all ad accounts in project","description":"Get every ad account reachable across all Meta connections in the project, deduped by ad-account id. Each row carries the connectionId whose token reaches it — pass that as `accountId` to downstream `/hierarchy`, etc.","operationId":"getAllAdAccountsForProject","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getAllAdAccountsForProject","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Project ad accounts fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"adAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"accountStatus":{"type":"number"},"currency":{"type":"string"},"timezone":{"type":"string"},"amountSpent":{"type":"string"},"business":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"connectionId":{"type":"string"},"connectionLabel":{"type":["string","null"]},"connectionExternalId":{"type":["string","null"]}},"required":["id","name","accountStatus","currency","timezone","amountSpent","connectionId","connectionLabel","connectionExternalId"]}}},"required":["adAccounts"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/hierarchy/{projectId}/{accountId}/{adAccountId}":{"get":{"tags":["Ads"],"summary":"Get ads hierarchy","description":"Get complete campaign/ad set/ad hierarchy in one optimized request. Use `datePreset=maximum` to pull lifetime insights for paused/historical campaigns (the `last_30d` default returns null insights for entities with no recent spend).","operationId":"getAdsHierarchy","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getAdsHierarchy","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"adAccountId","in":"path"},{"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_month","last_month","this_quarter","last_quarter","this_year","last_year","maximum"]},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Hierarchy fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"objective":{"type":"string"},"dailyBudget":{"type":["string","null"]},"lifetimeBudget":{"type":["string","null"]},"adSets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"destinationType":{"type":["string","null"]},"dailyBudget":{"type":["string","null"]},"lifetimeBudget":{"type":["string","null"]},"optimizationGoal":{"type":"string"},"billingEvent":{"type":"string"},"startTime":{"type":["string","null"]},"endTime":{"type":["string","null"]},"ads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"creative":{"type":["object","null"],"properties":{"id":{"type":"string"},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"message":{"type":["string","null"]},"linkUrl":{"type":["string","null"]},"videoId":{"type":["string","null"]},"headline":{"type":["string","null"]},"description":{"type":["string","null"]},"messageOptions":{"type":"array","items":{"type":"string"}},"headlineOptions":{"type":"array","items":{"type":"string"}},"descriptionOptions":{"type":"array","items":{"type":"string"}},"callToActionType":{"type":["string","null"]},"leadForm":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]}},"required":["id","imageUrl","thumbnailUrl","message","linkUrl","videoId","headline","description","callToActionType","leadForm"]},"insights":{"type":["object","null"],"properties":{"impressions":{"type":"string"},"reach":{"type":"string"},"clicks":{"type":"string"},"spend":{"type":"string"},"ctr":{"type":["string","null"]},"cpc":{"type":["string","null"]},"cpm":{"type":["string","null"]},"frequency":{"type":["string","null"]}},"required":["impressions","reach","clicks","spend","ctr","cpc","cpm","frequency"]}},"required":["id","name","status","effectiveStatus","creative","insights"]}},"insights":{"type":["object","null"],"properties":{"impressions":{"type":"string"},"reach":{"type":"string"},"clicks":{"type":"string"},"spend":{"type":"string"},"ctr":{"type":["string","null"]},"cpc":{"type":["string","null"]},"cpm":{"type":["string","null"]},"frequency":{"type":["string","null"]}},"required":["impressions","reach","clicks","spend","ctr","cpc","cpm","frequency"]},"targeting":{"type":["object","null"],"properties":{"geoLocations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"radius":{"type":"number"},"distance_unit":{"type":"string"}},"required":["key"]}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"}},"required":["key"]}}}},"ageMin":{"type":"number"},"ageMax":{"type":"number"},"genders":{"type":"array","items":{"type":"number"}},"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"behaviors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"customAudiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"excludedCustomAudiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"required":["id","name","status","effectiveStatus","destinationType","dailyBudget","lifetimeBudget","optimizationGoal","billingEvent","startTime","endTime","ads","insights","targeting"]}},"insights":{"type":["object","null"],"properties":{"impressions":{"type":"string"},"reach":{"type":"string"},"clicks":{"type":"string"},"spend":{"type":"string"},"ctr":{"type":["string","null"]},"cpc":{"type":["string","null"]},"cpm":{"type":["string","null"]},"frequency":{"type":["string","null"]}},"required":["impressions","reach","clicks","spend","ctr","cpc","cpm","frequency"]}},"required":["id","name","status","effectiveStatus","objective","dailyBudget","lifetimeBudget","adSets","insights"]}}},"required":["campaigns"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/campaigns/{projectId}/{accountId}":{"post":{"tags":["Ads"],"summary":"Create campaign","description":"Create a new campaign (PAUSED by default for safety)","operationId":"createCampaign","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"createCampaign","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"adAccountId":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":400},"objective":{"type":"string","enum":["OUTCOME_AWARENESS","OUTCOME_ENGAGEMENT","OUTCOME_LEADS","OUTCOME_SALES","OUTCOME_TRAFFIC","OUTCOME_APP_PROMOTION"]},"specialAdCategories":{"type":"array","items":{"type":"string","enum":["NONE","EMPLOYMENT","HOUSING","CREDIT","ISSUES_ELECTIONS_POLITICS","ONLINE_GAMBLING_AND_GAMING","FINANCIAL_PRODUCTS_SERVICES"]}},"dailyBudget":{"type":"integer","exclusiveMinimum":0},"lifetimeBudget":{"type":"integer","exclusiveMinimum":0}},"required":["adAccountId","name","objective"]}}}},"responses":{"200":{"description":"Campaign created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","PAUSED"]},"objective":{"type":"string","enum":["OUTCOME_AWARENESS","OUTCOME_ENGAGEMENT","OUTCOME_LEADS","OUTCOME_SALES","OUTCOME_TRAFFIC","OUTCOME_APP_PROMOTION"]}},"required":["id","name","status","objective"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/campaigns/{projectId}/{accountId}/{campaignId}/status":{"patch":{"tags":["Ads"],"summary":"Update campaign status","description":"Pause or resume a campaign. ACTIVE = spending money.","operationId":"updateCampaignStatus","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"updateCampaignStatus","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"campaignId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","PAUSED"]}},"required":["status"]}}}},"responses":{"200":{"description":"Status updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","PAUSED"]}},"required":["id","status"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/campaigns/{projectId}/{accountId}/{campaignId}":{"delete":{"tags":["Ads"],"summary":"Delete campaign","description":"Delete (archive) a campaign. Cannot be undone.","operationId":"deleteCampaign","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"deleteCampaign","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"campaignId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/adsets/{projectId}/{accountId}":{"post":{"tags":["Ads"],"summary":"Create ad set","description":"Create a new ad set within a campaign (PAUSED by default)","operationId":"createAdSet","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"createAdSet","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"string"},"optimizationGoal":{"type":"string","enum":["NONE","APP_INSTALLS","APP_INSTALLS_AND_OFFSITE_CONVERSIONS","AD_RECALL_LIFT","ADVERTISER_SILOED_VALUE","AUTOMATIC_OBJECTIVE","CONVERSATIONS","DERIVED_EVENTS","ENGAGED_USERS","EVENT_RESPONSES","IMPRESSIONS","IN_APP_VALUE","LANDING_PAGE_VIEWS","LEAD_GENERATION","LINK_CLICKS","MEANINGFUL_CALL_ATTEMPT","MESSAGING_APPOINTMENT_CONVERSION","MESSAGING_PURCHASE_CONVERSION","OFFSITE_CONVERSIONS","PAGE_LIKES","POST_ENGAGEMENT","PROFILE_AND_PAGE_ENGAGEMENT","PROFILE_VISIT","QUALITY_CALL","QUALITY_LEAD","REACH","REMINDERS_SET","SUBSCRIBERS","THRUPLAY","TWO_SECOND_CONTINUOUS_VIDEO_VIEWS","VALUE","VISIT_INSTAGRAM_PROFILE"]},"billingEvent":{"type":"string","enum":["APP_INSTALLS","CLICKS","IMPRESSIONS","LINK_CLICKS","NONE","OFFER_CLAIMS","PAGE_LIKES","POST_ENGAGEMENT","THRUPLAY","PURCHASE","LISTING_INTERACTION"]},"targeting":{"type":"object","properties":{"geoLocations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"countryGroups":{"type":"array","items":{"type":"string"}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"radius":{"type":"number"},"distanceUnit":{"type":"string"},"regionId":{"type":"string"},"region":{"type":"string"},"country":{"type":"string"}},"required":["key"]}},"zips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"}},"required":["key"]}},"geoMarkets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"customLocations":{"type":"array","items":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"},"radius":{"type":"number"},"distanceUnit":{"type":"string"},"addressString":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"}},"required":["latitude","longitude"]}},"electoralDistricts":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"largeGeoAreas":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"mediumGeoAreas":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"smallGeoAreas":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"metroAreas":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"subcities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"neighborhoods":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"subneighborhoods":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"places":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"radius":{"type":"number"},"distanceUnit":{"type":"string"}},"required":["key"]}},"locationClusterIds":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"locationTypes":{"type":"array","items":{"type":"string"}}}},"excludedGeoLocations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"countryGroups":{"type":"array","items":{"type":"string"}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"radius":{"type":"number"},"distanceUnit":{"type":"string"},"regionId":{"type":"string"},"region":{"type":"string"},"country":{"type":"string"}},"required":["key"]}},"zips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"}},"required":["key"]}},"geoMarkets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"customLocations":{"type":"array","items":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"},"radius":{"type":"number"},"distanceUnit":{"type":"string"},"addressString":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"}},"required":["latitude","longitude"]}},"electoralDistricts":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"largeGeoAreas":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"mediumGeoAreas":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"smallGeoAreas":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"metroAreas":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"subcities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"neighborhoods":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"subneighborhoods":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"places":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"radius":{"type":"number"},"distanceUnit":{"type":"string"}},"required":["key"]}},"locationClusterIds":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"]}},"locationTypes":{"type":"array","items":{"type":"string"}}}},"ageMin":{"type":"number"},"ageMax":{"type":"number"},"genders":{"type":"array","items":{"type":"number"}},"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"behaviors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"customAudiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"excludedCustomAudiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"placements":{"type":"object","properties":{"devicePlatforms":{"type":"array","items":{"type":"string","enum":["mobile","desktop"]}},"publisherPlatforms":{"type":"array","items":{"type":"string","enum":["facebook","instagram","messenger","audience_network"]}},"facebookPositions":{"type":"array","items":{"type":"string"}},"instagramPositions":{"type":"array","items":{"type":"string"}},"messengerPositions":{"type":"array","items":{"type":"string"}},"audienceNetworkPositions":{"type":"array","items":{"type":"string"}}}},"workEducation":{"type":"object","properties":{"employers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"workPositions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"educationSchools":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"educationMajors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}}},"detailedDemographics":{"type":"object","properties":{"relationshipStatuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"familyStatuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"lifeEvents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"income":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}}},"exclusions":{"type":"object","additionalProperties":{}},"rawTargeting":{"type":"object","additionalProperties":{}}}},"startTime":{"type":"string"},"endTime":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["ACTIVE","PAUSED"],"default":"PAUSED"},"dailyBudget":{"type":"integer","exclusiveMinimum":0},"lifetimeBudget":{"type":"integer","exclusiveMinimum":0},"bidAmount":{"type":"integer","exclusiveMinimum":0}},"required":["campaignId","optimizationGoal","billingEvent","targeting","name"]}}}},"responses":{"200":{"description":"Ad set created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"adSet":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"]}},"required":["adSet"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/adsets/{projectId}/{accountId}/{adSetId}/status":{"patch":{"tags":["Ads"],"summary":"Update ad set status","description":"Pause or resume an ad set","operationId":"updateAdSetStatus","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"updateAdSetStatus","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"adSetId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","PAUSED"]}},"required":["status"]}}}},"responses":{"200":{"description":"Status updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","PAUSED"]}},"required":["id","status"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/adsets/{projectId}/{accountId}/{adSetId}":{"delete":{"tags":["Ads"],"summary":"Delete ad set","description":"Delete (archive) an ad set. Cannot be undone.","operationId":"deleteAdSet","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"deleteAdSet","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"adSetId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/ads/{projectId}/{accountId}":{"post":{"tags":["Ads"],"summary":"Create ad","description":"Create a new ad within an ad set (PAUSED by default, pending review)","operationId":"createAd","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"createAd","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"adSetId":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["ACTIVE","PAUSED"],"default":"PAUSED"},"creative":{"type":"object","properties":{"pageId":{"type":"string"},"videoId":{"type":"string"},"callToAction":{"type":"string","enum":["ADD_TO_CART","APPLY_NOW","BOOK_NOW","BOOK_TRAVEL","BUY_NOW","BUY_TICKETS","CALL","CALL_ME","CALL_NOW","CONTACT","CONTACT_US","DONATE","DONATE_NOW","DOWNLOAD","EVENT_RSVP","FIND_A_GROUP","GET_DIRECTIONS","GET_OFFER","GET_OFFER_VIEW","GET_QUOTE","GET_SHOWTIMES","GET_STARTED","INQUIRE_NOW","INSTAGRAM_MESSAGE","INSTALL_APP","INSTALL_MOBILE_APP","LEARN_MORE","LIKE_PAGE","LISTEN_MUSIC","LISTEN_NOW","MESSAGE_PAGE","MOBILE_DOWNLOAD","NO_BUTTON","OPEN_LINK","ORDER_NOW","PLAY_GAME","RECORD_NOW","REQUEST_TIME","SEE_MENU","SHARE","SHOP_NOW","SIGN_UP","START_ORDER","SUBSCRIBE","UPDATE_APP","USE_APP","USE_MOBILE_APP","VIDEO_CALL","VIEW_PRODUCT","WATCH_MORE","WATCH_VIDEO","WHATSAPP_MESSAGE"]},"message":{"type":"string","maxLength":2000},"linkUrl":{"type":"string","format":"uri"},"imageUrl":{"type":"string","format":"uri"},"headline":{"type":"string","maxLength":40},"description":{"type":"string","maxLength":200}}}},"required":["adSetId","name","creative"]}}}},"responses":{"200":{"description":"Ad created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"ad":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"]}},"required":["ad"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/ads/{projectId}/{accountId}/{adId}/status":{"patch":{"tags":["Ads"],"summary":"Update ad status","description":"Pause or resume an ad","operationId":"updateAdStatus","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"updateAdStatus","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"adId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","PAUSED"]}},"required":["status"]}}}},"responses":{"200":{"description":"Status updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","PAUSED"]}},"required":["id","status"]}},"required":["success","data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/ads/{projectId}/{accountId}/{adId}":{"delete":{"tags":["Ads"],"summary":"Delete ad","description":"Delete (archive) an ad. Cannot be undone.","operationId":"deleteAd","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"deleteAd","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"adId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/insights/{projectId}/{accountId}/demographic":{"get":{"tags":["Ads"],"summary":"Demographic insights","description":"Age/gender breakdown for a campaign, ad set, or ad.","operationId":"getAdsDemographicInsights","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getDemographicInsights","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"entityId","in":"query"},{"schema":{"type":"string","enum":["account","campaign","adset","ad"]},"required":true,"name":"level","in":"query"},{"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_month","last_month","this_quarter","last_quarter","this_year","last_year","maximum"]},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Insights fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/insights/{projectId}/{accountId}/platform":{"get":{"tags":["Ads"],"summary":"Platform & placement insights","description":"Publisher platform × placement-position breakdown (Facebook feed, IG Reels, etc.).","operationId":"getAdsPlatformInsights","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getPlatformInsights","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"entityId","in":"query"},{"schema":{"type":"string","enum":["account","campaign","adset","ad"]},"required":true,"name":"level","in":"query"},{"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_month","last_month","this_quarter","last_quarter","this_year","last_year","maximum"]},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Insights fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/insights/{projectId}/{accountId}/video":{"get":{"tags":["Ads"],"summary":"Video insights","description":"Video play counts and quartile retention (P25/P50/P75/P95/P100) for video ads.","operationId":"getAdsVideoInsights","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getVideoInsights","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"entityId","in":"query"},{"schema":{"type":"string","enum":["account","campaign","adset","ad"]},"required":true,"name":"level","in":"query"},{"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_month","last_month","this_quarter","last_quarter","this_year","last_year","maximum"]},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Insights fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/insights/{projectId}/{accountId}/conversion":{"get":{"tags":["Ads"],"summary":"Conversion insights","description":"Per-action-type conversion counts, values, and costs.","operationId":"getAdsConversionInsights","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getConversionInsights","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"entityId","in":"query"},{"schema":{"type":"string","enum":["account","campaign","adset","ad"]},"required":true,"name":"level","in":"query"},{"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_month","last_month","this_quarter","last_quarter","this_year","last_year","maximum"]},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Insights fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/insights/{projectId}/{accountId}/engagement":{"get":{"tags":["Ads"],"summary":"Engagement insights","description":"Likes, comments, shares, saves, and other engagement actions for the entity.","operationId":"getAdsEngagementInsights","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getEngagementInsights","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"entityId","in":"query"},{"schema":{"type":"string","enum":["account","campaign","adset","ad"]},"required":true,"name":"level","in":"query"},{"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_month","last_month","this_quarter","last_quarter","this_year","last_year","maximum"]},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Insights fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/insights/{projectId}/{accountId}/time-series":{"get":{"tags":["Ads"],"summary":"Time-series insights","description":"Daily (or rolled-up) impressions/reach/clicks/spend over the chosen window. Pass `timeIncrement` (1..90) to roll up to N-day buckets; default daily.","operationId":"getAdsTimeSeriesInsights","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getTimeSeriesInsights","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"entityId","in":"query"},{"schema":{"type":"string","enum":["account","campaign","adset","ad"]},"required":true,"name":"level","in":"query"},{"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_month","last_month","this_quarter","last_quarter","this_year","last_year","maximum"]},"required":false,"name":"datePreset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":90},"required":false,"name":"timeIncrement","in":"query"}],"responses":{"200":{"description":"Insights fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/socials/ads/insights/{projectId}/{accountId}/conversion-time-series":{"get":{"tags":["Ads"],"summary":"Conversion time-series insights","description":"Daily (or rolled-up) per-action-type conversion counts and values.","operationId":"getAdsConversionTimeSeries","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getConversionTimeSeries","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"entityId","in":"query"},{"schema":{"type":"string","enum":["account","campaign","adset","ad"]},"required":true,"name":"level","in":"query"},{"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_month","last_month","this_quarter","last_quarter","this_year","last_year","maximum"]},"required":false,"name":"datePreset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":90},"required":false,"name":"timeIncrement","in":"query"}],"responses":{"200":{"description":"Insights fetched","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{}},"required":["success"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/team/members":{"get":{"tags":["Team"],"summary":"List team members","description":"Get all team members for a project. Any project member can view this.","operationId":"listTeamMembers","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"listMembers","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"query"}],"responses":{"200":{"description":"List of team members","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"User ID"},"name":{"type":["string","null"],"description":"User display name"},"email":{"type":"string","format":"email","description":"User email"},"image":{"type":["string","null"],"format":"uri","description":"User profile image"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]},"description":"Project roles assigned to member"},"isOwner":{"type":"boolean","description":"Whether this member is the project owner"},"createdAt":{"type":"string","format":"date-time","description":"When user account was created"}},"required":["userId","name","email","image","roles","isOwner","createdAt"]}}},"required":["members"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/team/invite":{"post":{"tags":["Team"],"summary":"Invite team member","description":"Invite a new member to a project by email. Only project admins can invite members. Creates an invitation that is sent via email.","operationId":"inviteTeamMember","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"invite","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteTeamMemberRequest"}}}},"responses":{"201":{"description":"Invitation sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"action":{"type":"string","enum":["invited","skipped"]},"invitationId":{"type":["string","null"]},"reason":{"type":"string"}},"required":["success","action","invitationId"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/team/members/{userId}":{"patch":{"tags":["Team"],"summary":"Update member roles","description":"Update a team member roles. Only project admins can update roles. Cannot remove admin access from yourself if you are the only admin.","operationId":"updateTeamMemberRoles","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"updateRoles","parameters":[{"schema":{"type":"string","example":"user-uuid"},"required":true,"name":"userId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamMemberRolesRequest"}}}},"responses":{"200":{"description":"Member roles updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"userId":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]}}},"required":["success","userId","projectId","roles"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}},"delete":{"tags":["Team"],"summary":"Remove team member","description":"Remove a team member from a project. Only project admins can remove members. Cannot remove yourself if you are the only admin.","operationId":"removeTeamMember","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"remove","parameters":[{"schema":{"type":"string","example":"user-uuid"},"required":true,"name":"userId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Member removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"userId":{"type":"string"},"projectId":{"type":"string","format":"uuid"}},"required":["success","userId","projectId"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/users/me":{"get":{"tags":["Users"],"summary":"Get current user","description":"Get the currently authenticated user details","operationId":"me","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current user details","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","description":"Unique user identifier"},"email":{"type":"string","format":"email","description":"User email address"},"name":{"type":["string","null"],"description":"User display name"},"image":{"type":["string","null"],"format":"uri","description":"User profile image URL"},"emailVerified":{"type":["boolean","null"],"description":"Whether email is verified"},"platformRole":{"type":"string","enum":["admin","member","contractor","sales_rep"],"description":"Platform-level role for RBAC system"},"createdAt":{"type":"string","format":"date-time","description":"Account creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","email","name","image","emailVerified","platformRole","createdAt","updatedAt"]}},"required":["user"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/users":{"get":{"tags":["Users"],"summary":"List users","description":"Get all users the authenticated user has permission to see. Platform admins can see all users. Other users can see members of their projects.","operationId":"listUsers","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"list","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"List of users with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique user identifier"},"email":{"type":"string","format":"email","description":"User email address"},"name":{"type":["string","null"],"description":"User display name"},"image":{"type":["string","null"],"format":"uri","description":"User profile image URL"},"emailVerified":{"type":["boolean","null"],"description":"Whether email is verified"},"platformRole":{"type":"string","enum":["admin","member","contractor","sales_rep"],"description":"Platform-level role for RBAC system"},"createdAt":{"type":"string","format":"date-time","description":"Account creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","email","name","image","emailVerified","platformRole","createdAt","updatedAt"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["limit","offset","hasMore"]}},"required":["users","pagination"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/users/{userId}":{"get":{"tags":["Users"],"summary":"Get user by ID","description":"Get details of a specific user","operationId":"getUser","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"get","parameters":[{"schema":{"type":"string","example":"XDiv1yktFVk5DZXaTW5m2KOTdFAivSzY"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"User details","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","description":"Unique user identifier"},"email":{"type":"string","format":"email","description":"User email address"},"name":{"type":["string","null"],"description":"User display name"},"image":{"type":["string","null"],"format":"uri","description":"User profile image URL"},"emailVerified":{"type":["boolean","null"],"description":"Whether email is verified"},"platformRole":{"type":"string","enum":["admin","member","contractor","sales_rep"],"description":"Platform-level role for RBAC system"},"createdAt":{"type":"string","format":"date-time","description":"Account creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","email","name","image","emailVerified","platformRole","createdAt","updatedAt"]}},"required":["user"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/users/{userId}/projects":{"get":{"tags":["Users"],"summary":"Get user project memberships","description":"Get all projects a user is a member of (that the requester can see)","operationId":"getUserProjects","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","example":"XDiv1yktFVk5DZXaTW5m2KOTdFAivSzY"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"User project memberships","content":{"application/json":{"schema":{"type":"object","properties":{"memberships":{"type":"array","items":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"projectName":{"type":"string"},"projectSlug":{"type":"string"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]},"description":"Project roles assigned to member"}},"required":["projectId","projectName","projectSlug","roles"]}}},"required":["memberships"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/users/{userId}/projects/{projectId}/roles":{"get":{"tags":["Users"],"summary":"Get user roles in project","description":"Get all roles a user has in a specific project. This endpoint requires no special permissions and can be used by any authenticated user.","operationId":"getUserProjectRoles","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","example":"XDiv1yktFVk5DZXaTW5m2KOTdFAivSzY"},"required":true,"name":"userId","in":"path"},{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174001"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"User roles in project","content":{"application/json":{"schema":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"permissions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","description","permissions","createdAt","updatedAt"]},"description":"All roles the user has in the project"}},"required":["roles"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/web-analytics/config/{projectId}":{"get":{"tags":["Web Analytics"],"summary":"Get analytics config","description":"Get analytics configuration for a project. Returns null if not configured.","operationId":"getWebAnalyticsConfig","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getConfig","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Analytics configuration","content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":["object","null"],"properties":{"id":{"type":"string"},"projectId":{"type":"string"},"ga4PropertyId":{"type":["string","null"]},"ga4IntegrationAccountId":{"type":["string","null"]},"gscSiteUrl":{"type":["string","null"]},"gscIntegrationAccountId":{"type":["string","null"]},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","ga4PropertyId","ga4IntegrationAccountId","gscSiteUrl","gscIntegrationAccountId","enabled","createdAt","updatedAt"]}},"required":["config"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}},"/web-analytics/{projectId}":{"get":{"tags":["Web Analytics"],"summary":"Get analytics data","description":"Get analytics data from all configured sources (Cloudflare, GA4, GSC). Returns partial data with errors if some sources fail.","operationId":"getWebAnalytics","security":[{"bearerAuth":[]}],"x-speakeasy-name-override":"getAnalytics","parameters":[{"schema":{"type":"string","format":"uuid","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date in YYYY-MM-DD format","example":"2024-01-01"},"required":true,"description":"Start date in YYYY-MM-DD format","name":"startDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date in YYYY-MM-DD format","example":"2024-01-31"},"required":true,"description":"End date in YYYY-MM-DD format","name":"endDate","in":"query"}],"responses":{"200":{"description":"Analytics data","content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string"},"dateRange":{"type":"object","properties":{"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["startDate","endDate"]},"ga4":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["ga4"]},"totalPageviews":{"type":"integer"},"totalVisitors":{"type":"integer"},"totalVisits":{"type":"integer"},"bounceRate":{"type":"number"},"avgSessionDuration":{"type":"number"},"dailyMetrics":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"pageviews":{"type":"integer"},"visitors":{"type":"integer"},"visits":{"type":"integer"},"bounceRate":{"type":"number"},"avgSessionDuration":{"type":"number"}},"required":["date","pageviews","visitors","visits"]}},"topPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"pageviews":{"type":"integer"},"visitors":{"type":"integer"}},"required":["path","pageviews","visitors"]}},"topReferrers":{"type":"array","items":{"type":"object","properties":{"referrer":{"type":"string"},"visits":{"type":"integer"}},"required":["referrer","visits"]}},"topCountries":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string"},"countryName":{"type":"string"},"visitors":{"type":"integer"}},"required":["country","visitors"]}},"trafficSources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"medium":{"type":"string"},"sessions":{"type":"integer"},"users":{"type":"integer"},"bounceRate":{"type":"number"}},"required":["source","medium","sessions","users"]}},"landingPages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"integer"},"users":{"type":"integer"},"bounceRate":{"type":"number"},"avgSessionDuration":{"type":"number"}},"required":["path","sessions","users"]}},"outboundLinks":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"domain":{"type":"string"},"clicks":{"type":"integer"}},"required":["url","domain","clicks"]}},"devices":{"type":"array","items":{"type":"object","properties":{"device":{"type":"string","enum":["desktop","mobile","tablet"]},"sessions":{"type":"integer"},"users":{"type":"integer"},"bounceRate":{"type":"number"}},"required":["device","sessions","users"]}},"browsers":{"type":"array","items":{"type":"object","properties":{"browser":{"type":"string"},"users":{"type":"integer"}},"required":["browser","users"]}},"operatingSystems":{"type":"array","items":{"type":"object","properties":{"os":{"type":"string"},"users":{"type":"integer"}},"required":["os","users"]}},"usStates":{"type":"array","items":{"type":"object","properties":{"region":{"type":"string"},"regionCode":{"type":"string"},"visitors":{"type":"integer"}},"required":["region","visitors"]}},"fetchedAt":{"type":"string","format":"date-time"}},"required":["source","totalPageviews","totalVisitors","totalVisits","dailyMetrics","fetchedAt"]},"gsc":{"type":["object","null"],"properties":{"totalClicks":{"type":"integer"},"totalImpressions":{"type":"integer"},"averageCtr":{"type":"number"},"averagePosition":{"type":"number"},"dailyMetrics":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"clicks":{"type":"integer"},"impressions":{"type":"integer"},"ctr":{"type":"number"},"position":{"type":"number"}},"required":["date","clicks","impressions","ctr","position"]}},"topQueries":{"type":"array","items":{"type":"object","properties":{"query":{"type":"string"},"clicks":{"type":"integer"},"impressions":{"type":"integer"},"ctr":{"type":"number"},"position":{"type":"number"}},"required":["query","clicks","impressions","ctr","position"]}},"topPages":{"type":"array","items":{"type":"object","properties":{"page":{"type":"string"},"clicks":{"type":"integer"},"impressions":{"type":"integer"},"ctr":{"type":"number"},"position":{"type":"number"}},"required":["page","clicks","impressions","ctr","position"]}},"fetchedAt":{"type":"string","format":"date-time"}},"required":["totalClicks","totalImpressions","averageCtr","averagePosition","dailyMetrics","topQueries","topPages","fetchedAt"]},"errors":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ga4","gsc"]},"message":{"type":"string"},"code":{"type":"string"}},"required":["source","message"]}},"fetchedAt":{"type":"string","format":"date-time"}},"required":["projectId","dateRange","ga4","gsc","fetchedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code for programmatic handling"}},"required":["message"]}}}}}}}},"webhooks":{},"tags":[{"name":"Accounts","description":"The social accounts connected to a project. Start here — the `id` of an account is the `socialAccountId` that every posting, scheduling and analytics call takes."},{"name":"Actions"},{"name":"Ads"},{"name":"Agents"},{"name":"Analytics","description":"Account- and post-level organic performance for connected Instagram and Facebook accounts."},{"name":"Assets"},{"name":"Auth"},{"name":"CMS"},{"name":"CRM"},{"name":"Calendar"},{"name":"Comments","description":"Read, reply to, hide and delete comments on published Instagram and Facebook posts."},{"name":"Content Calendar","description":"Create, schedule, update and publish organic posts, and stage the media they carry. Publishing a post whose status is `failed` retries it."},{"name":"Contracts"},{"name":"Conversions","description":"Meta server-side Conversions API (CAPI): discover pixels, connect a pixel + CAPI token, and send deduped server-side conversions."},{"name":"Dashboard Sidebar"},{"name":"Emails"},{"name":"Engagement","description":"Act as the Page or account on published posts: comment, like, unlike, and delete a published post."},{"name":"Geo"},{"name":"Google Ads"},{"name":"Google Analytics"},{"name":"Google Business"},{"name":"Integrations","description":"Connect third-party providers (Meta, Gmail, Google Business Profile, …). List providers, mint OAuth connect links, and poll connection status."},{"name":"Invitations"},{"name":"Memory"},{"name":"OAuth Clients"},{"name":"Project Roles"},{"name":"Project Templates"},{"name":"Projects"},{"name":"Schedules"},{"name":"Service Accounts"},{"name":"Socials","description":"Organic social: the connected accounts, the content calendar, media staging, publishing, comments and engagement across Instagram, Facebook, TikTok, YouTube and Google Business Profile."},{"name":"Team"},{"name":"Users"},{"name":"Web Analytics"},{"name":"Workflows"}]}