{"openapi":"3.1.0","info":{"title":"ZeroPipeline","description":"ZeroPipeline - API-first micro CRM service","version":"1.0.0"},"paths":{"/health/live":{"get":{"summary":"Live Health Check","description":"Liveness probe for container orchestration.","operationId":"live_health_check_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/health":{"get":{"summary":"Legacy Health Check","description":"Backward-compatible health check endpoint for load balancers and monitoring.","operationId":"legacy_health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/health":{"get":{"tags":["Meta"],"summary":"Health Check","description":"Readiness health endpoint with dependency status.","operationId":"health_check_api_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/changelog":{"get":{"tags":["Meta"],"summary":"Api Changelog","description":"Return the current API versioning metadata and changelog location.","operationId":"api_changelog_api_v1_changelog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/health/live":{"get":{"tags":["Meta"],"summary":"Live Health Check","description":"Liveness probe for container orchestration.","operationId":"live_health_check_api_v1_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/health/ready":{"get":{"tags":["Meta"],"summary":"Readiness Health Check","description":"Dependency-aware readiness probe used by the Railway deploy gate.\n\nReturns 503 when any hard dependency (ZeroDB, Redis) is unreachable\nso Railway can roll the deploy back automatically. Implementation\nlives in :mod:`app.health` to keep the dependency wiring testable\nin isolation.","operationId":"readiness_health_check_api_v1_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/health/ready":{"get":{"summary":"Readiness Health Check","description":"Dependency-aware readiness probe used by the Railway deploy gate.\n\nReturns 503 when any hard dependency (ZeroDB, Redis) is unreachable\nso Railway can roll the deploy back automatically. Implementation\nlives in :mod:`app.health` to keep the dependency wiring testable\nin isolation.","operationId":"readiness_health_check_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/me":{"get":{"tags":["Auth"],"summary":"Get Current User Info","description":"Get current authenticated user information.","operationId":"get_current_user_info_api_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentUser"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/admin-only":{"get":{"tags":["Auth"],"summary":"Admin Only Endpoint","description":"Test endpoint requiring admin role.","operationId":"admin_only_endpoint_api_v1_admin_only_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/sales-only":{"get":{"tags":["Auth"],"summary":"Sales Only Endpoint","description":"Test endpoint requiring sales_rep or admin role.","operationId":"sales_only_endpoint_api_v1_sales_only_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/viewer-only":{"get":{"tags":["Auth"],"summary":"Viewer Only Endpoint","description":"Test endpoint requiring viewer, sales_rep, or admin role.","operationId":"viewer_only_endpoint_api_v1_viewer_only_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/agents/status":{"get":{"tags":["Agents"],"summary":"Agent Status","description":"Return the status of autonomous agent loops.","operationId":"agent_status_api_v1_agents_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agents":{"get":{"tags":["agents"],"summary":"List Agents","description":"List agents, optionally filtered by status.","operationId":"list_agents_api_v1_agents_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/auth/create-trial-checkout":{"post":{"tags":["Auth"],"summary":"Start a Stripe trial checkout for a not-yet-registered visitor","description":"Proxy to the AINative gateway's anonymous trial-checkout flow.\n\nUsed when registration returns ``TRIAL_CARD_REQUIRED``: the account can't\nbe created until the visitor completes a Stripe Checkout session, so this\ncall happens before any ZeroPipeline auth token exists.","operationId":"create_trial_checkout_api_v1_auth_create_trial_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["Auth"],"summary":"Create a new account","description":"Proxy registration to the AINative auth gateway.","operationId":"register_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Sign in and obtain tokens","description":"Proxy login to the AINative auth gateway.\n\nThe browser cannot call api.ainative.studio directly due to CORS restrictions,\nso this endpoint forwards the credentials server-side and returns the token pair.","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/auth/refresh":{"post":{"tags":["Auth"],"summary":"Refresh Token","operationId":"refresh_token_api_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenPairResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/auth/revoke":{"post":{"tags":["Auth"],"summary":"Revoke Refresh Token","operationId":"revoke_refresh_token_api_v1_auth_revoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRevokeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/logout":{"post":{"tags":["Auth"],"summary":"Logout","description":"Revoke the caller's access token and all their refresh tokens (#202).\n\nThe presented access token's ``jti`` is written to the tenant-scoped\nRedis denylist with a TTL matching its remaining ``exp``. Once Redis\nreaps the key the token will naturally have expired, so the denylist\ndoes not grow unbounded.","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/auth/google/authorize":{"get":{"tags":["Auth"],"summary":"Redirect to Google OAuth consent screen","operationId":"google_authorize_api_v1_auth_google_authorize_get","parameters":[{"name":"redirect_uri","in":"query","required":false,"schema":{"type":"string","description":"Frontend callback URL","default":"https://pipeline.ainative.studio/auth/google/callback","title":"Redirect Uri"},"description":"Frontend callback URL"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/auth/google":{"post":{"tags":["Auth"],"summary":"Exchange Google auth code for ZeroPipeline JWT","operationId":"google_login_api_v1_auth_google_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/api-keys":{"post":{"tags":["API Keys"],"summary":"Create an API key (plaintext shown once)","operationId":"create_api_key_api_v1_api_keys_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["API Keys"],"summary":"List API keys (no plaintext)","operationId":"list_api_keys_api_v1_api_keys_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"include_revoked","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Revoked"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/api-keys/{key_id}":{"delete":{"tags":["API Keys"],"summary":"Revoke an API key","operationId":"revoke_api_key_api_v1_api_keys__key_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/pipelines":{"post":{"tags":["pipelines"],"summary":"Create Pipeline","description":"Create a new pipeline with optional stages.\n\n- **name**: Pipeline name (unique per organization)\n- **owner_id**: User ID of pipeline owner\n- **stages**: Optional list of stages to create with pipeline\n- **meta**: Optional metadata dictionary\n\nReturns the created pipeline with all nested stages.","operationId":"create_pipeline_api_v1_pipelines_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["pipelines"],"summary":"List Pipelines","description":"List pipelines with pagination.\n\nQuery parameters:\n- **limit**: Items per page (default: 25, max: 200)\n- **offset**: Number of items to skip (default: 0)\n- **owner_id**: Optional filter by pipeline owner\n\nReturns a paginated list of pipelines (without nested stages).","operationId":"list_pipelines_api_v1_pipelines_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"owner_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by owner","title":"Owner Id"},"description":"Filter by owner"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":25,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedPipelines"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/pipelines/{pipeline_id}":{"get":{"tags":["pipelines"],"summary":"Get Pipeline","description":"Get a single pipeline by ID.\n\nReturns the pipeline with all nested stages ordered by order_index.","operationId":"get_pipeline_api_v1_pipelines__pipeline_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["pipelines"],"summary":"Update Pipeline","description":"Update pipeline details.\n\nSupports optimistic locking via version field:\n- Include current version in payload\n- Returns 409 Conflict if version mismatch\n\nUpdatable fields:\n- **name**: Pipeline name\n- **owner_id**: Pipeline owner\n- **meta**: Metadata dictionary\n- **version**: Current version for optimistic locking","operationId":"update_pipeline_api_v1_pipelines__pipeline_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["pipelines"],"summary":"Delete Pipeline","description":"Soft delete a pipeline.\n\nSets deleted_at timestamp but does not remove from database.\nDeleted pipelines are excluded from queries and remain restorable for 30 days.","operationId":"delete_pipeline_api_v1_pipelines__pipeline_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/pipelines/{pipeline_id}/restore":{"post":{"tags":["pipelines"],"summary":"Restore Pipeline","description":"Restore a soft-deleted pipeline within the 30-day window.","operationId":"restore_pipeline_api_v1_pipelines__pipeline_id__restore_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/pipelines/{pipeline_id}/stages":{"post":{"tags":["pipelines"],"summary":"Add Stage","description":"Add a new stage to a pipeline.\n\n- **name**: Stage name (unique within pipeline)\n- **order_index**: Optional position in pipeline (auto-assigned if omitted)\n- **rules**: Optional transition rules:\n    - **required_fields**: List of deal fields required before entering this stage\n    - **disallow_skip**: If true, deals cannot skip this stage\n    - **allowed_next_stage_ids**: Whitelist of valid next stages\n\nReturns the created stage.","operationId":"add_stage_api_v1_pipelines__pipeline_id__stages_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StageCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["pipelines"],"summary":"List Stages","description":"List all stages for a pipeline.\n\nReturns stages ordered by order_index.","operationId":"list_stages_api_v1_pipelines__pipeline_id__stages_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Stage"},"title":"Response List Stages Api V1 Pipelines  Pipeline Id  Stages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/pipelines/{pipeline_id}/stages/{stage_id}":{"patch":{"tags":["pipelines"],"summary":"Update Stage","description":"Update a stage.\n\nUpdatable fields:\n- **name**: Stage name\n- **order_index**: Position in pipeline\n- **rules**: Transition rules\n\nNote: Changing order_index requires ensuring no conflicts with existing stages.","operationId":"update_stage_api_v1_pipelines__pipeline_id__stages__stage_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}},{"name":"stage_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Stage Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StageUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["pipelines"],"summary":"Delete Stage","description":"Soft delete a stage.\n\nSets deleted_at timestamp but does not remove from database.","operationId":"delete_stage_api_v1_pipelines__pipeline_id__stages__stage_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}},{"name":"stage_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Stage Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/pipelines/{pipeline_id}/stages/reorder":{"post":{"tags":["pipelines"],"summary":"Reorder Stages","description":"Reorder stages in a pipeline.\n\n- **stage_ids**: Ordered list of all stage IDs in desired sequence\n\nAll stages must belong to the specified pipeline.\nReturns the reordered stages.","operationId":"reorder_stages_api_v1_pipelines__pipeline_id__stages_reorder_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string","format":"uuid"},"title":"Stage Ids"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Stage"},"title":"Response Reorder Stages Api V1 Pipelines  Pipeline Id  Stages Reorder Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/activities":{"post":{"tags":["activities"],"summary":"Log Activity","description":"Create a new activity log entry.\n\nActivities are append-only and cannot be modified or deleted.\n\n- **activity_type**: Type of activity (e.g., deal.created, pipeline.updated)\n- **actor_id**: Optional user who performed the action (defaults to current user)\n- **related_to_type**: Type of related entity (e.g., 'deal', 'pipeline')\n- **related_to_id**: ID of the related entity\n- **description**: Optional human-readable description\n- **meta**: Optional metadata dictionary\n\nReturns the created activity log entry.","operationId":"log_activity_api_v1_activities_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["activities"],"summary":"List Activities","description":"List activities with advanced filtering and pagination.\n\nQuery parameters:\n- **limit**: Items per page (default: 50, max: 200)\n- **offset**: Number of items to skip (default: 0)\n- **related_to_id**: Filter by related entity ID\n- **related_to_type**: Filter by related entity type (e.g., 'deal', 'pipeline')\n- **activity_type**: Filter by activity type\n- **actor_id**: Filter by user who performed the action\n- **from_date**: Filter activities from this date\n- **to_date**: Filter activities until this date\n\nReturns paginated list of activities ordered by most recent first.","operationId":"list_activities_api_v1_activities_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"related_to_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by related entity ID","title":"Related To Id"},"description":"Filter by related entity ID"},{"name":"related_to_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by related entity type","title":"Related To Type"},"description":"Filter by related entity type"},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Alias for related_to_id","title":"Entity Id"},"description":"Alias for related_to_id"},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for related_to_type","title":"Entity Type"},"description":"Alias for related_to_type"},{"name":"activity_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ActivityType"},{"type":"null"}],"description":"Filter by activity type","title":"Activity Type"},"description":"Filter by activity type"},{"name":"actor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by actor","title":"Actor Id"},"description":"Filter by actor"},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter from this date (ISO 8601)","title":"From Date"},"description":"Filter from this date (ISO 8601)"},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter until this date (ISO 8601)","title":"To Date"},"description":"Filter until this date (ISO 8601)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":50,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedActivities"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/activities/types":{"get":{"tags":["activities"],"summary":"List Activity Types","description":"List all available activity types with labels and categories.\n\nReturns a list of activity types useful for populating frontend dropdowns.\nEach entry includes:\n- **value**: The enum value used in API calls\n- **label**: Human-readable label\n- **category**: Either \"crm\" (user-initiated) or \"system\" (auto-generated)","operationId":"list_activity_types_api_v1_activities_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Activity Types Api V1 Activities Types Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/activities/{activity_id}":{"get":{"tags":["activities"],"summary":"Get Activity","description":"Get a single activity by ID.\n\nReturns the activity log entry.","operationId":"get_activity_api_v1_activities__activity_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"activity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Activity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/activities/feed/{related_to_id}":{"get":{"tags":["activities"],"summary":"Get Activity Feed","description":"Get activity feed for a specific entity.\n\nThis endpoint provides a chronological feed of all activities\nrelated to a specific entity (e.g., all activities for a deal).\n\nPath parameters:\n- **related_to_id**: ID of the entity to get activities for\n\nQuery parameters:\n- **limit**: Items per page (default: 50, max: 200)\n- **offset**: Number of items to skip (default: 0)\n\nReturns paginated list of activities ordered by most recent first.","operationId":"get_activity_feed_api_v1_activities_feed__related_to_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"related_to_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Related To Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":50,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedActivities"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/activities/by-type/{activity_type}":{"get":{"tags":["activities"],"summary":"List Activities By Type","description":"List activities by type.\n\nPath parameters:\n- **activity_type**: Type of activity to filter by\n\nQuery parameters:\n- **limit**: Items per page (default: 50, max: 200)\n- **offset**: Number of items to skip (default: 0)\n\nReturns paginated list of activities ordered by most recent first.","operationId":"list_activities_by_type_api_v1_activities_by_type__activity_type__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"activity_type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ActivityType"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":50,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedActivities"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/activities/by-actor/{actor_id}":{"get":{"tags":["activities"],"summary":"List Activities By Actor","description":"List activities by actor (user who performed the action).\n\nPath parameters:\n- **actor_id**: ID of the actor/user\n\nQuery parameters:\n- **limit**: Items per page (default: 50, max: 200)\n- **offset**: Number of items to skip (default: 0)\n\nReturns paginated list of activities ordered by most recent first.","operationId":"list_activities_by_actor_api_v1_activities_by_actor__actor_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"actor_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Actor Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":50,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedActivities"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/customers":{"post":{"tags":["customers"],"summary":"Create Customer","operationId":"create_customer_api_v1_customers_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["customers"],"summary":"List Customers","operationId":"list_customers_api_v1_customers_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Page Size"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":500,"minimum":1},{"type":"null"}],"description":"Alias for page_size","title":"Limit"},"description":"Alias for page_size"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by source (e.g. ax_audit, vc_import)","title":"Source"},"description":"Filter by source (e.g. ax_audit, vc_import)"},{"name":"source_is_null","in":"query","required":false,"schema":{"type":"boolean","description":"Filter to contacts with null/empty source","default":false,"title":"Source Is Null"},"description":"Filter to contacts with null/empty source"},{"name":"untagged","in":"query","required":false,"schema":{"type":"boolean","description":"Filter to contacts with no tags","default":false,"title":"Untagged"},"description":"Filter to contacts with no tags"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated tags to filter by (contacts must have ALL specified tags)","title":"Tags"},"description":"Comma-separated tags to filter by (contacts must have ALL specified tags)"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":3},{"type":"null"}],"description":"Search across name, email, phone, company, title","title":"Q"},"description":"Search across name, email, phone, company, title"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":3},{"type":"null"}],"description":"Alias for q — search across name, email, phone, company, title","title":"Search"},"description":"Alias for q — search across name, email, phone, company, title"},{"name":"contacted_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter to contacts contacted before this date","title":"Contacted Before"},"description":"Filter to contacts contacted before this date"},{"name":"contacted_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter to contacts contacted after this date","title":"Contacted After"},"description":"Filter to contacts contacted after this date"},{"name":"not_contacted","in":"query","required":false,"schema":{"type":"boolean","description":"Filter to contacts never contacted","default":false,"title":"Not Contacted"},"description":"Filter to contacts never contacted"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedCustomers"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/customers/check-duplicates":{"post":{"tags":["customers"],"summary":"Check Duplicates","description":"Check for potential duplicate customers by email domain or phone prefix.","operationId":"check_duplicates_api_v1_customers_check_duplicates_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/customers/import":{"post":{"tags":["customers"],"summary":"Import Customers","operationId":"import_customers_api_v1_customers_import_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_customers_api_v1_customers_import_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerImportSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/customers/bulk":{"post":{"tags":["customers"],"summary":"Bulk Create Customers","description":"Bulk create up to 10,000 customers in a single request.\n\nTarget: 10K contacts in <10 seconds. Deduplicates on email.\nUses direct Postgres batch insert for maximum throughput.\n\nRefs #4271","operationId":"bulk_create_customers_api_v1_customers_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerBulkCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerBulkResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/customers/bulk-tag":{"post":{"tags":["customers"],"summary":"Bulk add/remove tags on contacts matching filters","description":"Add or remove tags on all contacts matching the given filter criteria.\n\nFilters can combine source, status, existing tags, and missing tags.\nProcesses up to 50k contacts per call.","operationId":"bulk_tag_customers_api_v1_customers_bulk_tag_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTagRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTagResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/customers/tag-stats":{"get":{"tags":["customers"],"summary":"Tag coverage statistics","description":"Return aggregate tag coverage statistics for all contacts in the org.\n\nComputes total, tagged, and untagged counts plus breakdowns by source\nand by tag.  Useful for auditing import quality and finding untagged\nsegments.","operationId":"get_tag_stats_api_v1_customers_tag_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagCoverageStats"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/customers/{customer_id}/warm-intros":{"get":{"tags":["customers"],"summary":"Get Warm Intros","operationId":"get_warm_intros_api_v1_customers__customer_id__warm_intros_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/customers/{customer_id}/related":{"get":{"tags":["customers"],"summary":"Get Related Customers","description":"Return customers related to this customer via the relationship graph.\n\nFinds contacts linked to the same company or fund using enrichment-derived\ngraph edges.","operationId":"get_related_customers_api_v1_customers__customer_id__related_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/customers/{customer_id}/timeline":{"get":{"tags":["customers"],"summary":"Get Customer Timeline","operationId":"get_customer_timeline_api_v1_customers__customer_id__timeline_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/customers/{customer_id}":{"get":{"tags":["customers"],"summary":"Get Customer","operationId":"get_customer_api_v1_customers__customer_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["customers"],"summary":"Update Customer","operationId":"update_customer_api_v1_customers__customer_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["customers"],"summary":"Delete Customer","operationId":"delete_customer_api_v1_customers__customer_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/customers/{customer_id}/restore":{"post":{"tags":["customers"],"summary":"Restore Customer","operationId":"restore_customer_api_v1_customers__customer_id__restore_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/deals":{"post":{"tags":["deals"],"summary":"Create Deal","operationId":"create_deal_api_v1_deals_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["deals"],"summary":"List Deals","operationId":"list_deals_api_v1_deals_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Pipeline Id"}},{"name":"stage_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Stage Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter deals linked to this customer","title":"Customer Id"},"description":"Filter deals linked to this customer"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":3},{"type":"null"}],"description":"Search deals by name","title":"Q"},"description":"Search deals by name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":25,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedDeals"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/deals/{deal_id}":{"get":{"tags":["deals"],"summary":"Get Deal","operationId":"get_deal_api_v1_deals__deal_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["deals"],"summary":"Update Deal","operationId":"update_deal_api_v1_deals__deal_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["deals"],"summary":"Delete Deal","operationId":"delete_deal_api_v1_deals__deal_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/deals/{deal_id}/score":{"get":{"tags":["deals"],"summary":"Get Deal Score","description":"Return the auto-calculated 0-100 health score for a deal.","operationId":"get_deal_score_api_v1_deals__deal_id__score_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/deals/{deal_id}/restore":{"post":{"tags":["deals"],"summary":"Restore Deal","operationId":"restore_deal_api_v1_deals__deal_id__restore_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/deals/{deal_id}/notes":{"post":{"tags":["deals"],"summary":"Add Deal Note","description":"Add a quick note to a deal without using the full activity schema.","operationId":"add_deal_note_api_v1_deals__deal_id__notes_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealNoteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/deals/{deal_id}/invoice":{"post":{"tags":["deals"],"summary":"Create an invoice from a won deal in the org's accounting system","description":"Push a won deal to the org's connected accounting system (QuickBooks or Xero).\n\nErrors:\n- **400** if the deal is not in ``won`` status.\n- **409** if an invoice has already been created for this deal.\n- **422** if no accounting integration is configured for the org.","operationId":"create_invoice_from_deal_api_v1_deals__deal_id__invoice_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealInvoiceResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/objects":{"post":{"tags":["custom-objects"],"summary":"Create Object","description":"Create a custom object definition and provision its record table.","operationId":"create_object_api_v1_objects_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["custom-objects"],"summary":"List Objects","description":"List all custom object definitions for the current org.","operationId":"list_objects_api_v1_objects_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":25,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedObjects"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/objects/{slug}":{"get":{"tags":["custom-objects"],"summary":"Get Object","description":"Get a custom object definition by slug.","operationId":"get_object_api_v1_objects__slug__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["custom-objects"],"summary":"Update Object","description":"Update a custom object definition (name, icon, or fields).","operationId":"update_object_api_v1_objects__slug__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Slug"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["custom-objects"],"summary":"Delete Object","description":"Soft-delete a custom object definition.","operationId":"delete_object_api_v1_objects__slug__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Slug"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/objects/{slug}/records":{"post":{"tags":["custom-objects"],"summary":"Create Record","description":"Create a record in a custom object table after field validation.","operationId":"create_record_api_v1_objects__slug__records_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Slug"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["custom-objects"],"summary":"List Records","description":"List records for a custom object with pagination.","operationId":"list_records_api_v1_objects__slug__records_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":25,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedRecords"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/objects/{slug}/records/{record_id}":{"get":{"tags":["custom-objects"],"summary":"Get Record","description":"Get a single record by ID.","operationId":"get_record_api_v1_objects__slug__records__record_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Slug"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["custom-objects"],"summary":"Update Record","description":"Update a record after validating against the object's field schema.","operationId":"update_record_api_v1_objects__slug__records__record_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Slug"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Record Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["custom-objects"],"summary":"Delete Record","description":"Soft-delete a record.","operationId":"delete_record_api_v1_objects__slug__records__record_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Slug"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Record Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/objects/{object_type}/fields":{"post":{"tags":["object-fields"],"summary":"Add Custom Field","description":"Add a custom field to a standard object type. Admin only.","operationId":"add_custom_field_api_v1_objects__object_type__fields_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"object_type","in":"path","required":true,"schema":{"type":"string","description":"Standard object type (deals, customers)","title":"Object Type"},"description":"Standard object type (deals, customers)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFieldRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["object-fields"],"summary":"List Fields","description":"List all fields (standard + custom) for an object type.","operationId":"list_fields_api_v1_objects__object_type__fields_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"object_type","in":"path","required":true,"schema":{"type":"string","description":"Standard object type (deals, customers)","title":"Object Type"},"description":"Standard object type (deals, customers)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FieldConfig"},"title":"Response List Fields Api V1 Objects  Object Type  Fields Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/objects/{object_type}/fields/{field_slug}":{"patch":{"tags":["object-fields"],"summary":"Rename Field","description":"Rename a field's display label. Works for standard and custom fields. Admin only.","operationId":"rename_field_api_v1_objects__object_type__fields__field_slug__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"object_type","in":"path","required":true,"schema":{"type":"string","description":"Standard object type (deals, customers)","title":"Object Type"},"description":"Standard object type (deals, customers)"},{"name":"field_slug","in":"path","required":true,"schema":{"type":"string","description":"Field slug to rename","title":"Field Slug"},"description":"Field slug to rename"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameFieldRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["object-fields"],"summary":"Delete Custom Field","description":"Soft-delete a custom field. Standard fields cannot be deleted. Admin only.","operationId":"delete_custom_field_api_v1_objects__object_type__fields__field_slug__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"object_type","in":"path","required":true,"schema":{"type":"string","description":"Standard object type (deals, customers)","title":"Object Type"},"description":"Standard object type (deals, customers)"},{"name":"field_slug","in":"path","required":true,"schema":{"type":"string","description":"Custom field slug to delete","title":"Field Slug"},"description":"Custom field slug to delete"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/products":{"post":{"tags":["products"],"summary":"Create Product","description":"Create a new product.\n\nRequired permissions: sales_rep or admin\n\nRequest body:\n- **name**: Product name (required, max 255 characters)\n- **sku**: Stock Keeping Unit (required, max 100 characters, auto-uppercased)\n- **description**: Optional product description (max 2000 characters)\n- **price**: Product price (required, must be >= 0, 2 decimal places)\n- **cost**: Optional cost price (must be >= 0, 2 decimal places)\n- **is_active**: Active status (default: true)\n- **meta**: Optional metadata dictionary\n\nReturns the created product with audit fields.\n\nRaises:\n- **409 Conflict**: If SKU already exists in organization\n- **422 Validation Error**: If data validation fails","operationId":"create_product_api_v1_products_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["products"],"summary":"List Products","description":"List products with pagination.\n\nRequired permissions: viewer, sales_rep, or admin\n\nQuery parameters:\n- **limit**: Items per page (default: 25, min: 1, max: 200)\n- **offset**: Number of items to skip (default: 0)\n- **is_active**: Optional filter by active status (true/false)\n\nReturns paginated list of products sorted by creation date (newest first).","operationId":"list_products_api_v1_products_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active status","title":"Is Active"},"description":"Filter by active status"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":25,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedProducts"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/products/search":{"get":{"tags":["products"],"summary":"Search Products","description":"Search products with advanced filters.\n\nRequired permissions: viewer, sales_rep, or admin\n\nQuery parameters:\n- **query**: Text search in name, SKU, and description (case-insensitive)\n- **is_active**: Filter by active status (true/false)\n- **min_price**: Minimum price (inclusive)\n- **max_price**: Maximum price (inclusive)\n- **limit**: Items per page (default: 25, min: 1, max: 200)\n- **offset**: Number of items to skip (default: 0)\n\nReturns paginated list of matching products.\n\nNote: Text search and price filters are applied as post-processing\non the results, so pagination counts may vary.","operationId":"search_products_api_v1_products_search_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"query","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"description":"Search in name, SKU, description","title":"Query"},"description":"Search in name, SKU, description"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active status","title":"Is Active"},"description":"Filter by active status"},{"name":"min_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Minimum price filter","title":"Min Price"},"description":"Minimum price filter"},{"name":"max_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum price filter","title":"Max Price"},"description":"Maximum price filter"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":25,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedProducts"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/products/{product_id}":{"get":{"tags":["products"],"summary":"Get Product","description":"Get a single product by ID.\n\nRequired permissions: viewer, sales_rep, or admin\n\nPath parameters:\n- **product_id**: UUID of the product to retrieve\n\nReturns the product with all details.\n\nRaises:\n- **404 Not Found**: If product does not exist or is not in the user's organization","operationId":"get_product_api_v1_products__product_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product UUID","title":"Product Id"},"description":"Product UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["products"],"summary":"Update Product","description":"Update product details.\n\nRequired permissions: sales_rep or admin\n\nPath parameters:\n- **product_id**: UUID of the product to update\n\nRequest body (all fields optional):\n- **name**: Product name (max 255 characters)\n- **sku**: Stock Keeping Unit (max 100 characters, auto-uppercased)\n- **description**: Product description (max 2000 characters)\n- **price**: Product price (must be >= 0, 2 decimal places)\n- **cost**: Cost price (must be >= 0, 2 decimal places)\n- **is_active**: Active status\n- **meta**: Metadata dictionary\n- **version**: Current version for optimistic locking\n\nSupports optimistic locking via version field:\n- Include current version in payload\n- Returns 409 Conflict if version mismatch\n\nReturns the updated product.\n\nRaises:\n- **404 Not Found**: If product does not exist\n- **409 Conflict**: If SKU already exists or version conflict\n- **422 Validation Error**: If data validation fails","operationId":"update_product_api_v1_products__product_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product UUID","title":"Product Id"},"description":"Product UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["products"],"summary":"Delete Product","description":"Soft delete a product.\n\nRequired permissions: sales_rep or admin\n\nPath parameters:\n- **product_id**: UUID of the product to delete\n\nSets deleted_at timestamp but does not remove from database.\nDeleted products are excluded from queries.\n\nReturns no content on success.\n\nRaises:\n- **404 Not Found**: If product does not exist","operationId":"delete_product_api_v1_products__product_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product UUID","title":"Product Id"},"description":"Product UUID"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/products/sku/{sku}":{"get":{"tags":["products"],"summary":"Get Product By Sku","description":"Get a product by SKU.\n\nRequired permissions: viewer, sales_rep, or admin\n\nPath parameters:\n- **sku**: Product SKU (case-insensitive, will be uppercased)\n\nReturns the product if found.\n\nRaises:\n- **404 Not Found**: If no product with the SKU exists in the user's organization","operationId":"get_product_by_sku_api_v1_products_sku__sku__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"sku","in":"path","required":true,"schema":{"type":"string","maxLength":100,"description":"Product SKU","title":"Sku"},"description":"Product SKU"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/payments/portal-session":{"post":{"tags":["billing"],"summary":"Create Portal Session","description":"Create a Stripe Customer Portal session for subscription self-service.","operationId":"create_portal_session_api_v1_payments_portal_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/billing/portal-session":{"post":{"tags":["billing"],"summary":"Create Billing Portal Session","description":"Return a Stripe Customer Portal session URL for the tenant's admin.\n\nAdmins can land directly in Stripe's hosted portal to update payment\nmethods, download invoices, and cancel — no support ticket required. The\n``return_url`` override is validated against the frontend origin allowlist\nso the endpoint cannot be coerced into an open redirect.","operationId":"create_billing_portal_session_api_v1_billing_portal_session_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalSessionRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/payments/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout Session","description":"Create a Stripe Checkout session for a paid plan.","operationId":"create_checkout_session_api_v1_payments_checkout_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/payments/subscription":{"get":{"tags":["billing"],"summary":"Get Subscription","description":"Return the organization's current billing state.","operationId":"get_subscription_api_v1_payments_subscription_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscription"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["billing"],"summary":"Update Subscription","description":"Upgrade or downgrade an active Stripe subscription.","operationId":"update_subscription_api_v1_payments_subscription_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscription"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/payments/history":{"get":{"tags":["billing"],"summary":"Get Payment History","description":"List recent invoice and payment events for the org.","operationId":"get_payment_history_api_v1_payments_history_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/payments/usage":{"get":{"tags":["billing"],"summary":"Get Billing Usage","description":"Return current usage versus configured plan limits for the org.","operationId":"get_billing_usage_api_v1_payments_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUsageResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/me/billing-status":{"get":{"tags":["billing"],"summary":"Get Me Billing Status","description":"Return frontend-friendly billing warning state for the current user.","operationId":"get_me_billing_status_api_v1_me_billing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingStatusResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/payments/subscription/cancel":{"post":{"tags":["billing"],"summary":"Cancel Subscription","description":"Cancel an active Stripe subscription.","operationId":"cancel_subscription_api_v1_payments_subscription_cancel_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscription"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tags":{"get":{"tags":["Tags"],"summary":"List Tags","description":"Return distinct tags used across customers, deals, and tasks.","operationId":"list_tags_api_v1_tags_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Tag prefix filter","title":"Q"},"description":"Tag prefix filter"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks":{"post":{"tags":["tasks"],"summary":"Create Task","operationId":"create_task_api_v1_tasks_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["tasks"],"summary":"List Tasks","operationId":"list_tasks_api_v1_tasks_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/TaskStatus"},{"type":"null"}],"title":"Status"}},{"name":"assignee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assignee Id"}},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/TaskPriority"},{"type":"null"}],"title":"Priority"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":25,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedTasks"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task","operationId":"get_task_api_v1_tasks__task_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["tasks"],"summary":"Update Task","operationId":"update_task_api_v1_tasks__task_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["tasks"],"summary":"Delete Task","operationId":"delete_task_api_v1_tasks__task_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tasks/{task_id}/restore":{"post":{"tags":["tasks"],"summary":"Restore Task","operationId":"restore_task_api_v1_tasks__task_id__restore_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/analytics/dashboard":{"get":{"tags":["Analytics"],"summary":"Dashboard Summary","operationId":"dashboard_summary_api_v1_analytics_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/analytics/revenue/timeseries":{"get":{"tags":["Analytics"],"summary":"Revenue Timeseries","operationId":"revenue_timeseries_api_v1_analytics_revenue_timeseries_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(weekly|monthly|quarterly)$","default":"monthly","title":"Period"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start period, e.g. 2026-01","title":"Start"},"description":"Start period, e.g. 2026-01"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End period, e.g. 2026-12","title":"End"},"description":"End period, e.g. 2026-12"},{"name":"owner_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"}},{"name":"pipeline_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Pipeline Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/analytics/deals":{"get":{"tags":["Analytics"],"summary":"Deal Analytics","operationId":"deal_analytics_api_v1_analytics_deals_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"owner_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/analytics/tasks":{"get":{"tags":["Analytics"],"summary":"Task Analytics","operationId":"task_analytics_api_v1_analytics_tasks_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"assignee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assignee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/analytics/stale-deals":{"get":{"tags":["Analytics"],"summary":"Stale Deals","operationId":"stale_deals_api_v1_analytics_stale_deals_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Days without activity","default":14,"title":"Days"},"description":"Days without activity"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/analytics/pipeline/{pipeline_id}":{"get":{"tags":["Analytics"],"summary":"Pipeline Analytics","operationId":"pipeline_analytics_api_v1_analytics_pipeline__pipeline_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pipeline Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/analytics/customers":{"get":{"tags":["Analytics"],"summary":"Customer Analytics","operationId":"customer_analytics_api_v1_analytics_customers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/reports/deals":{"get":{"tags":["Reports"],"summary":"Report Deals","operationId":"report_deals_api_v1_reports_deals_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-01-01","title":"Date From"},"description":"ISO date, e.g. 2026-01-01"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-12-31","title":"Date To"},"description":"ISO date, e.g. 2026-12-31"},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Scope the report to this customer's deals","title":"Customer Id"},"description":"Scope the report to this customer's deals"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reports/outreach":{"get":{"tags":["Reports"],"summary":"Report Outreach","operationId":"report_outreach_api_v1_reports_outreach_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-01-01","title":"Date From"},"description":"ISO date, e.g. 2026-01-01"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-12-31","title":"Date To"},"description":"ISO date, e.g. 2026-12-31"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reports/pipeline":{"get":{"tags":["Reports"],"summary":"Report Pipeline","operationId":"report_pipeline_api_v1_reports_pipeline_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-01-01","title":"Date From"},"description":"ISO date, e.g. 2026-01-01"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-12-31","title":"Date To"},"description":"ISO date, e.g. 2026-12-31"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/reports/contacts":{"get":{"tags":["Reports"],"summary":"Report Contacts","operationId":"report_contacts_api_v1_reports_contacts_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-01-01","title":"Date From"},"description":"ISO date, e.g. 2026-01-01"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-12-31","title":"Date To"},"description":"ISO date, e.g. 2026-12-31"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/ai-feedback":{"post":{"tags":["AI Feedback"],"summary":"Create Feedback","operationId":"create_feedback_api_v1_ai_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIFeedbackCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIFeedbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/ai-feedback/summary":{"get":{"tags":["AI Feedback"],"summary":"Get Feedback Summary","operationId":"get_feedback_summary_api_v1_ai_feedback_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIFeedbackSummary"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/audit/logs":{"post":{"tags":["audit"],"summary":"Create Audit Log","operationId":"create_audit_log_api_v1_audit_logs_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLog"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["audit"],"summary":"List Audit Logs","operationId":"list_audit_logs_api_v1_audit_logs_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Page Size"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"actor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedAuditLogs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/audit/logs/{log_id}":{"get":{"tags":["audit"],"summary":"Get Audit Log","operationId":"get_audit_log_api_v1_audit_logs__log_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLog"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/audit/gdpr/export":{"post":{"tags":["audit"],"summary":"Gdpr Export","operationId":"gdpr_export_api_v1_audit_gdpr_export_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDPRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDPRExportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/audit/gdpr/delete":{"post":{"tags":["audit"],"summary":"Gdpr Delete","operationId":"gdpr_delete_api_v1_audit_gdpr_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDPRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDPRDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/automations":{"post":{"tags":["automations"],"summary":"Create Automation","operationId":"create_automation_api_v1_automations_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["automations"],"summary":"List Automations","operationId":"list_automations_api_v1_automations_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Items per page","default":25,"title":"Limit"},"description":"Items per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Offset"},"description":"Number of items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedAutomations"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/automations/{automation_id}":{"get":{"tags":["automations"],"summary":"Get Automation","operationId":"get_automation_api_v1_automations__automation_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Automation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["automations"],"summary":"Update Automation","operationId":"update_automation_api_v1_automations__automation_id__put","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Automation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["automations"],"summary":"Delete Automation","operationId":"delete_automation_api_v1_automations__automation_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Automation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/automations/trigger":{"post":{"tags":["automations"],"summary":"Trigger Event","operationId":"trigger_event_api_v1_automations_trigger_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerEventRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/orgs/{org_id}/members":{"get":{"tags":["invitations"],"summary":"List Org Members","description":"List active members of the org (Settings -> Team).\n\nAny authenticated member of the org can view the roster — this is not\nadmin-gated the way invitation creation is, since every member should be\nable to see who else is on the team. Scoped to the caller's own org via\n``current_user.org_id`` rather than trusting the ``org_id`` path param,\nmatching the pattern used by the invitations endpoints above.","operationId":"list_org_members_api_v1_orgs__org_id__members_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/orgs/{org_id}/invitations":{"post":{"tags":["invitations"],"summary":"Create Invitation","description":"Send an invitation email with a signed token link.\n\nRequires admin role. Rate limited to prevent invite spam.","operationId":"create_invitation_api_v1_orgs__org_id__invitations_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Invitation Api V1 Orgs  Org Id  Invitations Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["invitations"],"summary":"List Invitations","description":"List pending and accepted invitations for the org. Admin only.","operationId":"list_invitations_api_v1_orgs__org_id__invitations_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"invitation_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/invitations/accept":{"post":{"tags":["invitations"],"summary":"Accept Invitation","description":"Accept an invitation using the signed token from the email link.\n\nThis endpoint is unauthenticated — the token itself proves authorization.","operationId":"accept_invitation_api_v1_invitations_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationAccept"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Accept Invitation Api V1 Invitations Accept Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/auth/password-reset/request":{"post":{"tags":["auth"],"summary":"Request Password Reset","description":"Request a password reset email.\n\nAlways returns 204 regardless of whether the email is registered, to\navoid leaking account existence.","operationId":"request_password_reset_api_v1_auth_password_reset_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/auth/password-reset/confirm":{"post":{"tags":["auth"],"summary":"Confirm Password Reset","description":"Complete the password reset with a one-time token.","operationId":"confirm_password_reset_api_v1_auth_password_reset_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetConfirm"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetConfirmResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/account":{"get":{"tags":["account"],"summary":"Get Workspace","description":"Return the current user's organization/workspace info.","operationId":"get_workspace_api_v1_account_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["account"],"summary":"Request Account Deletion","description":"Soft-delete immediately and schedule hard-delete after the grace period.","operationId":"request_account_deletion_api_v1_account_delete","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletionResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"patch":{"tags":["account"],"summary":"Update Workspace","description":"Update the current user's organization/workspace info.","operationId":"update_workspace_api_v1_account_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/account/export":{"post":{"tags":["account"],"summary":"Request Account Export","description":"Queue a GDPR data export and email a signed download URL.","operationId":"request_account_export_api_v1_account_export_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AccountExportRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountExportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/account/export/download":{"get":{"tags":["account"],"summary":"Download Account Export","description":"Download the JSON payload for a signed export token.\n\nUnauthenticated — the signed token grants access. The service verifies\nthe HMAC signature and TTL before returning the payload.","operationId":"download_account_export_api_v1_account_export_download_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","minLength":8,"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountExportDownload"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/users/me":{"get":{"tags":["Users"],"summary":"Get My Profile","description":"Return the current authenticated user's profile.\n\nThe ``avatar_url`` is re-signed on every request with a short TTL so a\nleaked URL expires quickly (issue #206).","operationId":"get_my_profile_api_v1_users_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"patch":{"tags":["Users"],"summary":"Update My Profile","description":"Update the current authenticated user's profile fields.","operationId":"update_my_profile_api_v1_users_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/users/me/avatar":{"get":{"tags":["Users"],"summary":"Get My Avatar","description":"Return a freshly-signed URL for the current user's avatar.\n\nThe URL is re-signed on every call so callers can always get a URL\nwhose TTL is fresh (issue #206).","operationId":"get_my_avatar_api_v1_users_me_avatar_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Users"],"summary":"Upload Avatar","description":"Upload a profile photo for the current user.\n\nAccepts JPEG or PNG images up to ``PROFILE_PHOTO_MAX_BYTES`` (default 5 MB).\nReturns a short-lived signed URL — ``PROFILE_PHOTO_URL_TTL_SECONDS`` —\nthat resolves through the ``/files/profile-photos`` download endpoint.","operationId":"upload_avatar_api_v1_users_me_avatar_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_avatar_api_v1_users_me_avatar_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["Users"],"summary":"Delete Avatar","description":"Remove the current user's profile photo.","operationId":"delete_avatar_api_v1_users_me_avatar_delete","responses":{"204":{"description":"Successful Response"},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/users/me/onboarding":{"get":{"tags":["Onboarding"],"summary":"Get Onboarding","description":"Return the current user's onboarding checklist.","operationId":"get_onboarding_api_v1_users_me_onboarding_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingChecklistResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/users/me/onboarding/{key}/dismiss":{"post":{"tags":["Onboarding"],"summary":"Dismiss Onboarding Step","description":"Dismiss an onboarding step for the current user.","operationId":"dismiss_onboarding_step_api_v1_users_me_onboarding__key__dismiss_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingChecklistResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/commission-tiers":{"post":{"tags":["Commissions"],"summary":"Create Tier","operationId":"create_tier_api_v1_commission_tiers_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionTierCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionTier"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Commissions"],"summary":"List Tiers","operationId":"list_tiers_api_v1_commission_tiers_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CommissionTier"},"title":"Response List Tiers Api V1 Commission Tiers Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/commission-tiers/{tier_id}":{"get":{"tags":["Commissions"],"summary":"Get Tier","operationId":"get_tier_api_v1_commission_tiers__tier_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tier_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tier Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionTier"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Commissions"],"summary":"Update Tier","operationId":"update_tier_api_v1_commission_tiers__tier_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tier_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tier Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionTierUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionTier"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Commissions"],"summary":"Delete Tier","operationId":"delete_tier_api_v1_commission_tiers__tier_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"tier_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tier Id"}},{"name":"audit_logger","in":"query","required":false,"schema":{"title":"Audit Logger"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/analytics/commissions":{"get":{"tags":["Commissions"],"summary":"Team Commission Summary","operationId":"team_commission_summary_api_v1_analytics_commissions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CommissionSummary"},"type":"array","title":"Response Team Commission Summary Api V1 Analytics Commissions Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/analytics/commissions/{owner_id}":{"get":{"tags":["Commissions"],"summary":"Rep Commission Summary","operationId":"rep_commission_summary_api_v1_analytics_commissions__owner_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"owner_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Owner Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CommissionSummary"},"title":"Response Rep Commission Summary Api V1 Analytics Commissions  Owner Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhooks":{"post":{"tags":["webhooks"],"summary":"Create Webhook","operationId":"create_webhook_api_v1_webhooks_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["webhooks"],"summary":"List Webhooks","operationId":"list_webhooks_api_v1_webhooks_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookResponse"},"title":"Response List Webhooks Api V1 Webhooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhooks/{webhook_id}":{"get":{"tags":["webhooks"],"summary":"Get Webhook","operationId":"get_webhook_api_v1_webhooks__webhook_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["webhooks"],"summary":"Update Webhook","operationId":"update_webhook_api_v1_webhooks__webhook_id__put","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["webhooks"],"summary":"Delete Webhook","operationId":"delete_webhook_api_v1_webhooks__webhook_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhooks/{webhook_id}/test":{"post":{"tags":["webhooks"],"summary":"Test Webhook","description":"Send a test.ping event to verify the webhook endpoint works.","operationId":"test_webhook_api_v1_webhooks__webhook_id__test_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhooks/{webhook_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"List Deliveries","operationId":"list_deliveries_api_v1_webhooks__webhook_id__deliveries_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryResponse"},"title":"Response List Deliveries Api V1 Webhooks  Webhook Id  Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/events/stream":{"get":{"tags":["events"],"summary":"Real-time event stream (SSE)","description":"Opens a persistent SSE connection. The client receives newline-delimited ``text/event-stream`` frames for every event published on the requested channels. Only events belonging to the authenticated tenant are forwarded.","operationId":"stream_events_api_v1_events_stream_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"channels","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"One or more event-bus channels to subscribe to. Defaults to [zeropipeline.events].","title":"Channels"},"description":"One or more event-bus channels to subscribe to. Defaults to [zeropipeline.events]."}],"responses":{"200":{"description":"Successful Response","content":{"text/event-stream":{}}},"401":{"description":"Not authenticated"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/twilio/configure":{"get":{"tags":["integrations"],"summary":"Retrieve the current Twilio configuration","description":"Return the stored Twilio configuration for the org (no auth token).","operationId":"get_twilio_config_api_v1_integrations_twilio_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioConfigureResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Store Twilio credentials for SMS sending","description":"Store the Twilio account SID, auth token, and from-number for the org.\n\nThe auth token is stored but never echoed back in responses.","operationId":"configure_twilio_api_v1_integrations_twilio_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioConfigureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwilioConfigureResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/quickbooks/configure":{"get":{"tags":["integrations"],"summary":"Retrieve the current QuickBooks Online configuration","description":"Return the stored QBO configuration for the org (no secrets).","operationId":"get_quickbooks_config_api_v1_integrations_quickbooks_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksConfigureResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Store QuickBooks Online credentials","description":"Store QBO OAuth credentials for the org.  Secrets are never echoed back.","operationId":"configure_quickbooks_api_v1_integrations_quickbooks_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksConfigureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksConfigureResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/xero/configure":{"get":{"tags":["integrations"],"summary":"Retrieve the current Xero configuration","description":"Return the stored Xero configuration for the org (no secrets).","operationId":"get_xero_config_api_v1_integrations_xero_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroConfigureResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Store Xero OAuth credentials","description":"Store Xero OAuth credentials for the org.  Secrets are never echoed back.","operationId":"configure_xero_api_v1_integrations_xero_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroConfigureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroConfigureResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations":{"get":{"tags":["integrations"],"summary":"List all integrations and their configuration status","description":"Return every known integration with its connected/disconnected status.","operationId":"list_integrations_api_v1_integrations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Integrations Api V1 Integrations Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/apollo/configure":{"get":{"tags":["integrations"],"summary":"Get Apollo.io status","operationId":"get_apollo_config_api_v1_integrations_apollo_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Connect Apollo.io","operationId":"configure_apollo_api_v1_integrations_apollo_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["integrations"],"summary":"Disconnect Apollo.io","operationId":"delete_apollo_config_api_v1_integrations_apollo_configure_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Apollo Config Api V1 Integrations Apollo Configure Delete"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/hunter/configure":{"get":{"tags":["integrations"],"summary":"Get Hunter.io status","operationId":"get_hunter_config_api_v1_integrations_hunter_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Connect Hunter.io","operationId":"configure_hunter_api_v1_integrations_hunter_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["integrations"],"summary":"Disconnect Hunter.io","operationId":"delete_hunter_config_api_v1_integrations_hunter_configure_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Hunter Config Api V1 Integrations Hunter Configure Delete"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/zoominfo/configure":{"get":{"tags":["integrations"],"summary":"Get ZoomInfo status","operationId":"get_zoominfo_config_api_v1_integrations_zoominfo_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Connect ZoomInfo","operationId":"configure_zoominfo_api_v1_integrations_zoominfo_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["integrations"],"summary":"Disconnect ZoomInfo","operationId":"delete_zoominfo_config_api_v1_integrations_zoominfo_configure_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Zoominfo Config Api V1 Integrations Zoominfo Configure Delete"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/luma/configure":{"get":{"tags":["integrations"],"summary":"Get Luma status","operationId":"get_luma_config_api_v1_integrations_luma_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Connect Luma","operationId":"configure_luma_api_v1_integrations_luma_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["integrations"],"summary":"Disconnect Luma","operationId":"delete_luma_config_api_v1_integrations_luma_configure_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Luma Config Api V1 Integrations Luma Configure Delete"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/luma/status":{"get":{"tags":["integrations"],"summary":"Verify the stored Luma key actually works against Luma's API","description":"Return Luma's real connection status, not just \"a key is stored\".\n\nCaches the result per org for ``_LUMA_STATUS_CACHE_TTL_SECONDS`` so this\ndoesn't become its own rate-limit problem against Luma's API.","operationId":"get_luma_status_api_v1_integrations_luma_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LumaStatusResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/otter/configure":{"get":{"tags":["integrations"],"summary":"Get Otter status","operationId":"get_otter_config_api_v1_integrations_otter_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Connect Otter","operationId":"configure_otter_api_v1_integrations_otter_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["integrations"],"summary":"Disconnect Otter","operationId":"delete_otter_config_api_v1_integrations_otter_configure_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Otter Config Api V1 Integrations Otter Configure Delete"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/fireflies/configure":{"get":{"tags":["integrations"],"summary":"Get Fireflies status","operationId":"get_fireflies_config_api_v1_integrations_fireflies_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Connect Fireflies","operationId":"configure_fireflies_api_v1_integrations_fireflies_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["integrations"],"summary":"Disconnect Fireflies","operationId":"delete_fireflies_config_api_v1_integrations_fireflies_configure_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Fireflies Config Api V1 Integrations Fireflies Configure Delete"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/grain/configure":{"get":{"tags":["integrations"],"summary":"Get Grain status","operationId":"get_grain_config_api_v1_integrations_grain_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Connect Grain","operationId":"configure_grain_api_v1_integrations_grain_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["integrations"],"summary":"Disconnect Grain","operationId":"delete_grain_config_api_v1_integrations_grain_configure_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Grain Config Api V1 Integrations Grain Configure Delete"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/tldv/configure":{"get":{"tags":["integrations"],"summary":"Get tl;dv status","operationId":"get_tldv_config_api_v1_integrations_tldv_configure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["integrations"],"summary":"Connect tl;dv","operationId":"configure_tldv_api_v1_integrations_tldv_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["integrations"],"summary":"Disconnect tl;dv","operationId":"delete_tldv_config_api_v1_integrations_tldv_configure_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete Tldv Config Api V1 Integrations Tldv Configure Delete"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/luma/events":{"get":{"tags":["luma"],"summary":"List Luma events","description":"Return all events from the org's connected Luma calendar, newest first.","operationId":"list_events_api_v1_luma_events_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Events Api V1 Luma Events Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/luma/events/{event_id}/guests":{"get":{"tags":["luma"],"summary":"List guests for a Luma event","description":"Return guests for a Luma event, default approved only.","operationId":"list_event_guests_api_v1_luma_events__event_id__guests_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}},{"name":"approval_status","in":"query","required":false,"schema":{"type":"string","description":"Filter by approval_status","default":"approved","title":"Approval Status"},"description":"Filter by approval_status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Event Guests Api V1 Luma Events  Event Id  Guests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/luma/events/{event_id}/import":{"post":{"tags":["luma"],"summary":"Import Luma event guests as CRM leads","description":"Fetch guests from a Luma event and create customer records.\n\nOnly imports guests who have a ticket or answered registration questions.\nDeduplicates against ALL existing customers in the org (any source).","operationId":"import_event_guests_api_v1_luma_events__event_id__import_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}},{"name":"approval_status","in":"query","required":false,"schema":{"type":"string","description":"Guest approval status to import","default":"approved","title":"Approval Status"},"description":"Guest approval status to import"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LumaImportSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/edo/bootstrap":{"post":{"tags":["Economic Development"],"summary":"Idempotently provision the EDO business registry and pipeline","description":"Admin-only. Requires the organization to already be EDO-enabled.\n\nSafe to call repeatedly: reuses an existing, compatible setup rather\nthan creating duplicates.","operationId":"bootstrap_edo_workspace_api_v1_edo_bootstrap_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDOBootstrapResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/edo/enable":{"post":{"tags":["Economic Development"],"summary":"Allowlist an organization for the EDO workspace pilot (operator-only)","description":"Set ``org.meta.edo_enabled = true`` for the given organization.\n\nRestricted to the internal service identity, not any customer's own\norg admin — this is a platform-operator decision (which pilot\norganizations get early access), not a self-service setting.","operationId":"enable_edo_for_org_api_v1_edo_enable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDOEnableRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDOEnableResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/search":{"get":{"tags":["Search"],"summary":"Semantic Search","description":"Semantic search across CRM data using natural language.","operationId":"semantic_search_api_v1_search_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":3,"description":"Natural language search query","title":"Q"},"description":"Natural language search query"},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type: activity, customer, deal","title":"Entity Type"},"description":"Filter by entity type: activity, customer, deal"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/search/reindex":{"post":{"tags":["Search"],"summary":"Reindex Embeddings","description":"Reindex all CRM data into vector embeddings.","operationId":"reindex_embeddings_api_v1_search_reindex_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/icp":{"get":{"tags":["icp"],"summary":"List Icp Profiles","description":"List all ICP profiles for the authenticated user's organization.","operationId":"list_icp_profiles_api_v1_icp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ICPProfileResponse"},"type":"array","title":"Response List Icp Profiles Api V1 Icp Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["icp"],"summary":"Create Icp Profile","description":"Create a new ICP profile for the authenticated user's organization.","operationId":"create_icp_profile_api_v1_icp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPProfileCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/icp/{icp_id}":{"get":{"tags":["icp"],"summary":"Get Icp Profile","description":"Get a single ICP profile by ID.","operationId":"get_icp_profile_api_v1_icp__icp_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"icp_id","in":"path","required":true,"schema":{"type":"string","title":"Icp Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["icp"],"summary":"Update Icp Profile","description":"Update an existing ICP profile.","operationId":"update_icp_profile_api_v1_icp__icp_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"icp_id","in":"path","required":true,"schema":{"type":"string","title":"Icp Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPProfileUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["icp"],"summary":"Delete Icp Profile","description":"Soft-delete an ICP profile.","operationId":"delete_icp_profile_api_v1_icp__icp_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"icp_id","in":"path","required":true,"schema":{"type":"string","title":"Icp Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/discovery/jobs":{"get":{"tags":["discovery"],"summary":"List Discovery Jobs","description":"List all discovery jobs for the authenticated organization.","operationId":"list_discovery_jobs_api_v1_discovery_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DiscoveryJobResponse"},"type":"array","title":"Response List Discovery Jobs Api V1 Discovery Jobs Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["discovery"],"summary":"Start Discovery Job","description":"Start a new lead discovery job.\n\nThe job runs asynchronously as a background task. Poll\n``GET /api/v1/discovery/jobs/{job_id}`` for status updates.","operationId":"start_discovery_job_api_v1_discovery_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryJobCreate"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/discovery/jobs/{job_id}":{"get":{"tags":["discovery"],"summary":"Get Discovery Job","description":"Get the status and summary of a specific discovery job.","operationId":"get_discovery_job_api_v1_discovery_jobs__job_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outreach/campaigns":{"post":{"tags":["outreach"],"summary":"Create and launch an outreach campaign","description":"Validate the campaign request, persist it, create a background job,\nand return 202 Accepted with ``job_id`` and ``campaign_id``.","operationId":"create_campaign_api_v1_outreach_campaigns_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachCampaignCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["outreach"],"summary":"List outreach campaigns for the organisation","description":"Return campaigns belonging to the caller's organisation.","operationId":"list_campaigns_api_v1_outreach_campaigns_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutreachCampaignResponse"},"title":"Response List Campaigns Api V1 Outreach Campaigns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outreach/campaigns/{campaign_id}":{"get":{"tags":["outreach"],"summary":"Get a single campaign with its job status","description":"Return campaign details and associated job status.","operationId":"get_campaign_api_v1_outreach_campaigns__campaign_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Campaign Api V1 Outreach Campaigns  Campaign Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outreach/jobs/{job_id}":{"get":{"tags":["outreach"],"summary":"Get outreach job status","description":"Return the current status of an outreach background job.","operationId":"get_job_status_api_v1_outreach_jobs__job_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachJobStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outreach/campaigns/{campaign_id}/recipients/remove":{"post":{"tags":["outreach"],"summary":"Manually remove one recipient from an active sequence","description":"Pull a single recipient out of a running sequence.\n\nThe recipient receives no further steps of this campaign. Idempotent —\nremoving an already-exited recipient returns the original exit.","operationId":"remove_recipient_api_v1_outreach_campaigns__campaign_id__recipients_remove_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachRecipientRemove"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Recipient Api V1 Outreach Campaigns  Campaign Id  Recipients Remove Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outreach/campaigns/{campaign_id}/exits":{"get":{"tags":["outreach"],"summary":"List recipients that exited a campaign's sequence","description":"Return every recorded exit for a campaign, with reasons.","operationId":"list_campaign_exits_api_v1_outreach_campaigns__campaign_id__exits_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Campaign Exits Api V1 Outreach Campaigns  Campaign Id  Exits Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/outreach/unsubscribe":{"post":{"tags":["outreach"],"summary":"Public one-click unsubscribe (HMAC-signed token, no auth)","description":"Opt a recipient out of outreach via a signed link from an email.\n\nDeliberately unauthenticated — the recipient is not a ZeroPipeline user.\nThe HMAC token binds the opt-out to one org + customer, so a caller can\nonly ever unsubscribe the recipient the link was issued for. Always\nreturns 200 for a valid token so the endpoint cannot be used to probe\nwhich contacts exist.","operationId":"unsubscribe_api_v1_outreach_unsubscribe_post","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","description":"HMAC-signed opt-out token","title":"Token"},"description":"HMAC-signed opt-out token"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Unsubscribe Api V1 Outreach Unsubscribe Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/approvals":{"post":{"tags":["approvals"],"summary":"Create a pending approval (agent-initiated)","description":"Agents call this endpoint to request human approval for a high-stakes action.\n\nThe approval is stored as *pending* until a human operator approves or rejects it.","operationId":"create_approval_api_v1_approvals_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["approvals"],"summary":"List approvals for the organisation","description":"Return approvals scoped to the caller's organisation.\n\nUse ``?status=pending`` to surface only items awaiting review.","operationId":"list_approvals_api_v1_approvals_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ApprovalStatus"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalResponse"},"title":"Response List Approvals Api V1 Approvals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/approvals/{approval_id}":{"get":{"tags":["approvals"],"summary":"Get a single approval","description":"Return a single approval record, enforcing org-scoping.","operationId":"get_approval_api_v1_approvals__approval_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/approvals/{approval_id}/approve":{"post":{"tags":["approvals"],"summary":"Approve a pending approval","description":"Mark a pending approval as approved.\n\nSets ``status=approved``, ``resolved_at`` to now, and ``resolved_by``\nto the current user's email.","operationId":"approve_approval_api_v1_approvals__approval_id__approve_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/approvals/{approval_id}/reject":{"post":{"tags":["approvals"],"summary":"Reject a pending approval","description":"Mark a pending approval as rejected.\n\nSets ``status=rejected``, ``resolved_at`` to now, and ``resolved_by``\nto the current user's email.","operationId":"reject_approval_api_v1_approvals__approval_id__reject_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/email/connect":{"post":{"tags":["email-sync"],"summary":"Connect Email","operationId":"connect_email_api_v1_integrations_email_connect_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailConnectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/email/callback":{"get":{"tags":["email-sync"],"summary":"Email Oauth Callback","description":"Handle OAuth callback from Google or Microsoft.\n\nThe ``state`` parameter carries the org_id that initiated the flow.","operationId":"email_oauth_callback_api_v1_integrations_email_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"provider","in":"query","required":false,"schema":{"type":"string","default":"google","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/email/status":{"get":{"tags":["email-sync"],"summary":"Email Sync Status","operationId":"email_sync_status_api_v1_integrations_email_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSyncStatus"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/email/disconnect":{"delete":{"tags":["email-sync"],"summary":"Disconnect Email","operationId":"disconnect_email_api_v1_integrations_email_disconnect_delete","responses":{"204":{"description":"Successful Response"},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/emails":{"get":{"tags":["email-sync"],"summary":"List Emails","operationId":"list_emails_api_v1_emails_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Page Size"}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Contact Id"}},{"name":"deal_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Deal Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/emails/{email_id}":{"get":{"tags":["email-sync"],"summary":"Get Email","operationId":"get_email_api_v1_emails__email_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"email_id","in":"path","required":true,"schema":{"type":"string","title":"Email Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRecord"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/enrichment/enrich/{customer_id}":{"post":{"tags":["enrichment"],"summary":"Enrich Single Customer","description":"Enrich a single customer record using the specified method.\n\nMethods: ai (default), google-places, apollo-people, browser-scrape, full.","operationId":"enrich_single_customer_api_v1_enrichment_enrich__customer_id__post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/EnrichMethod","default":"ai"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/enrichment/enrich":{"post":{"tags":["enrichment"],"summary":"Enrich Customers","description":"Enrich multiple customer records using the specified method.\n\nAccepts up to 100 customer IDs. Methods: ai, google-places,\napollo-people, browser-scrape, full.","operationId":"enrich_customers_api_v1_enrichment_enrich_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/EnrichMethod","default":"ai"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/calendar/connect":{"post":{"tags":["calendar"],"summary":"Initiate OAuth connection to a calendar provider","description":"Build and return the OAuth authorization URL.\n\nThe frontend should redirect the user to the returned URL. After the user\ngrants access, the provider redirects back to the callback endpoint.","operationId":"connect_calendar_api_v1_integrations_calendar_connect_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/calendar/callback":{"get":{"tags":["calendar"],"summary":"Handle OAuth callback from calendar provider","description":"Exchange the authorization code for tokens and store them.\n\nIn production, the ``state`` parameter should be validated against the\nvalue stored when ``/connect`` was called (e.g. in Redis or a short-lived\nZeroDB row). This implementation performs the token exchange and stores\ncredentials.","operationId":"calendar_oauth_callback_api_v1_integrations_calendar_callback_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","description":"Authorization code from provider","title":"Code"},"description":"Authorization code from provider"},{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"CSRF state token","title":"State"},"description":"CSRF state token"},{"name":"provider","in":"query","required":true,"schema":{"$ref":"#/components/schemas/CalendarProvider","description":"Calendar provider"},"description":"Calendar provider"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarCallbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/integrations/calendar/status":{"get":{"tags":["calendar"],"summary":"Get calendar connection status","description":"Return whether a calendar provider is connected, and sync metadata.","operationId":"calendar_status_api_v1_integrations_calendar_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarSyncStatus"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/integrations/calendar/disconnect":{"delete":{"tags":["calendar"],"summary":"Disconnect calendar integration","description":"Revoke stored tokens and mark the calendar integration as disconnected.","operationId":"disconnect_calendar_api_v1_integrations_calendar_disconnect_delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CalendarProvider"},{"type":"null"}],"description":"Specific provider to disconnect (omit for all)","title":"Provider"},"description":"Specific provider to disconnect (omit for all)"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/meetings":{"get":{"tags":["calendar"],"summary":"List synced meetings","description":"Return a paginated list of synced calendar meetings.\n\nSupports filtering by linked contact, date range, and upcoming/past.","operationId":"list_meetings_api_v1_meetings_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by linked customer","title":"Contact Id"},"description":"Filter by linked customer"},{"name":"upcoming","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Only future meetings","title":"Upcoming"},"description":"Only future meetings"},{"name":"past","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Only past meetings","title":"Past"},"description":"Only past meetings"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Meetings on or after","title":"Start Date"},"description":"Meetings on or after"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Meetings on or before","title":"End Date"},"description":"Meetings on or before"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeetingListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/meetings/{meeting_id}":{"get":{"tags":["calendar"],"summary":"Get meeting detail","description":"Return a single meeting by ID.","operationId":"get_meeting_api_v1_meetings__meeting_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"meeting_id","in":"path","required":true,"schema":{"type":"string","title":"Meeting Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeetingRecord"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/ai/chat":{"post":{"tags":["AI Assistant"],"summary":"Ai Chat","description":"Send a message to the AI CRM agent.\n\nThe agent can query and mutate CRM data on behalf of the user using\nbuilt-in tools (create_deal, list_pipelines, search_customers, etc.).\n\nBy default returns a streaming SSE response. Set ``stream: false``\nin the request body for a single JSON response.","operationId":"ai_chat_api_v1_ai_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/ai/feedback":{"post":{"tags":["AI Assistant"],"summary":"Ai Feedback","description":"Record thumbs up/down feedback on an AI response.","operationId":"ai_feedback_api_v1_ai_feedback_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"conversation_id","in":"query","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"message_id","in":"query","required":false,"schema":{"type":"string","title":"Message Id"}},{"name":"feedback","in":"query","required":true,"schema":{"type":"string","pattern":"^(positive|negative)$","title":"Feedback"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/ingest":{"post":{"tags":["notes"],"summary":"Ingest Note","description":"Ingest meeting notes from external tools.\n\nAuto-links to customers by matching attendee emails, auto-links to\ndeals if any matched customer has an open deal, creates task records\nfor each action item, and logs an activity entry.\n\nWhen a transcript is supplied, LLM extraction does NOT run inline: the\nnote is saved with ``extraction_status: \"pending\"`` and a background job\nfinishes the work (#568). Everything that is a cheap ZeroDB lookup —\nattendee/customer matching, deal linking, the activity entry, and tasks\nfor action items the SOURCE already supplied — still happens\nsynchronously, so the caller gets the linked record back immediately.\n\nRefs #364, #568","operationId":"ingest_note_api_v1_notes_ingest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteIngestRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/notes":{"post":{"tags":["notes"],"summary":"Create Note","description":"Create a new note on an entity.\n\n- **entity_type**: Type of parent entity (e.g., 'deal', 'customer')\n- **entity_id**: ID of the parent entity\n- **title**: Optional note title\n- **content**: Note body text","operationId":"create_note_api_v1_notes_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["notes"],"summary":"List Notes","description":"List notes with optional entity filters.\n\n- **entity_type**: Filter by parent entity type\n- **entity_id**: Filter by parent entity ID\n- **limit**: Max items per page (default 50, max 200)\n- **offset**: Number of items to skip","operationId":"list_notes_api_v1_notes_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by entity ID","title":"Entity Id"},"description":"Filter by entity ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max items to return","default":50,"title":"Limit"},"description":"Max items to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Items to skip","default":0,"title":"Offset"},"description":"Items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedNotes"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/calls":{"get":{"tags":["notes"],"summary":"List Calls","description":"List ingested calls with their extracted buying signals.\n\nReturns call/meeting notes created by ``POST /notes/ingest`` (webhook or\nmanual), each projected with its summary, linked records, action item\ncount, and structured signals.\n\nRefs #542","operationId":"list_calls_api_v1_notes_calls_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max items to return","default":50,"title":"Limit"},"description":"Max items to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Items to skip","default":0,"title":"Offset"},"description":"Items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedCalls"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{note_id}/retry-extraction":{"post":{"tags":["notes"],"summary":"Retry Call Extraction","description":"Re-queue transcript extraction for a call whose extraction did not land.\n\nResets the record to ``extraction_status: \"pending\"`` and enqueues the\nsame background worker the ingest path uses, reading the transcript back\noff the saved note (there is no request body to take it from).\n\nThis is also the recovery path for the one honest limitation of\nin-process background tasks: a process restart mid-job abandons the work\nand leaves the row ``pending`` forever, and this is how a user gets it\nmoving again.\n\nRefs #568","operationId":"retry_call_extraction_api_v1_notes__note_id__retry_extraction_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Note Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Retry Call Extraction Api V1 Notes  Note Id  Retry Extraction Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notes/{note_id}":{"get":{"tags":["notes"],"summary":"Get Note","description":"Get a single note by ID.","operationId":"get_note_api_v1_notes__note_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Note Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["notes"],"summary":"Update Note","description":"Update a note's title or content.\n\n- **title**: Updated title (optional)\n- **content**: Updated content (optional)","operationId":"update_note_api_v1_notes__note_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Note Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["notes"],"summary":"Delete Note","description":"Soft-delete a note.","operationId":"delete_note_api_v1_notes__note_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Note Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/comments":{"post":{"tags":["comments"],"summary":"Create Comment","description":"Create a new comment on an entity.\n\n- **entity_type**: Type of parent entity (e.g., 'deal', 'customer')\n- **entity_id**: ID of the parent entity\n- **content**: Comment text\n- **parent_id**: Optional parent comment ID for threading","operationId":"create_comment_api_v1_comments_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["comments"],"summary":"List Comments","description":"List comments with optional entity filters.\n\n- **entity_type**: Filter by parent entity type\n- **entity_id**: Filter by parent entity ID\n- **limit**: Max items per page (default 50, max 200)\n- **offset**: Number of items to skip","operationId":"list_comments_api_v1_comments_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by entity ID","title":"Entity Id"},"description":"Filter by entity ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max items to return","default":50,"title":"Limit"},"description":"Max items to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Items to skip","default":0,"title":"Offset"},"description":"Items to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedComments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/comments/{comment_id}":{"delete":{"tags":["comments"],"summary":"Delete Comment","description":"Soft-delete a comment.","operationId":"delete_comment_api_v1_comments__comment_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Comment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/oauth/apps":{"get":{"tags":["OAuth"],"summary":"List registered OAuth applications","operationId":"list_apps_api_v1_oauth_apps_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/OAuthAppResponse"},"type":"array","title":"Response List Apps Api V1 Oauth Apps Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["OAuth"],"summary":"Register a new OAuth application","operationId":"register_app_api_v1_oauth_apps_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAppCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAppResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/oauth/apps/{app_id}":{"delete":{"tags":["OAuth"],"summary":"Delete an OAuth application","operationId":"delete_app_api_v1_oauth_apps__app_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/oauth/authorize":{"get":{"tags":["OAuth"],"summary":"Authorization endpoint — validate params and present consent","description":"Validate authorization parameters and return a consent prompt.\n\nIn a browser-based flow this would render an HTML consent page. For an\nAPI-first CRM the response is JSON so the frontend or CLI can render\nits own UI and POST back to approve.","operationId":"authorize_get_api_v1_oauth_authorize_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"client_id","in":"query","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","title":"Redirect Uri"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"","title":"Scope"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"response_type","in":"query","required":false,"schema":{"type":"string","default":"code","title":"Response Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["OAuth"],"summary":"Approve authorization — generates auth code and redirects","operationId":"authorize_post_api_v1_oauth_authorize_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_authorize_post_api_v1_oauth_authorize_post"}}}},"responses":{"302":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/oauth/token":{"post":{"tags":["OAuth"],"summary":"Exchange auth code or refresh token for access token","operationId":"token_endpoint_api_v1_oauth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_token_endpoint_api_v1_oauth_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/oauth/revoke":{"post":{"tags":["OAuth"],"summary":"Revoke an access or refresh token","operationId":"revoke_token_api_v1_oauth_revoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/oauth/introspect":{"get":{"tags":["OAuth"],"summary":"Introspect a token — check validity and return claims","operationId":"introspect_token_api_v1_oauth_introspect_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntrospectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/views":{"post":{"tags":["views"],"summary":"Create View","description":"Create a new saved view.","operationId":"create_view_api_v1_views_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["views"],"summary":"List Views","description":"List saved views, optionally filtered by entity_type.","operationId":"list_views_api_v1_views_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ViewResponse"},"title":"Response List Views Api V1 Views Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/views/templates":{"get":{"tags":["views"],"summary":"List View Templates","description":"List starter segment templates available to pre-populate a new saved view.","operationId":"list_view_templates_api_v1_views_templates_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ViewTemplate"},"title":"Response List View Templates Api V1 Views Templates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/views/from-template":{"post":{"tags":["views"],"summary":"Create View From Template","description":"Create a new saved view pre-populated from a starter template.","operationId":"create_view_from_template_api_v1_views_from_template_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewFromTemplateCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/views/{view_id}":{"get":{"tags":["views"],"summary":"Get View","description":"Get a single saved view by ID.","operationId":"get_view_api_v1_views__view_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"view_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"View Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["views"],"summary":"Update View","description":"Update an existing saved view.","operationId":"update_view_api_v1_views__view_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"view_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"View Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["views"],"summary":"Delete View","description":"Soft-delete a saved view.","operationId":"delete_view_api_v1_views__view_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"view_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"View Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/security/org-defaults":{"get":{"tags":["Security"],"summary":"List all org-wide default settings","operationId":"list_org_wide_defaults_api_v1_security_org_defaults_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Security"],"summary":"Set org-wide default access level for an object type (admin only)","operationId":"set_org_wide_default_api_v1_security_org_defaults_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgWideDefault"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/security/profiles":{"get":{"tags":["Security"],"summary":"List security profiles","operationId":"list_profiles_api_v1_security_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Security"],"summary":"Create a security profile (admin only)","operationId":"create_profile_api_v1_security_profiles_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/security/profiles/{profile_id}":{"get":{"tags":["Security"],"summary":"Get a single security profile","operationId":"get_profile_api_v1_security_profiles__profile_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Security"],"summary":"Update a security profile (admin only)","operationId":"update_profile_api_v1_security_profiles__profile_id__patch","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Security"],"summary":"Delete a security profile (admin only)","operationId":"delete_profile_api_v1_security_profiles__profile_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/security/profiles/{profile_id}/assign/{user_id}":{"post":{"tags":["Security"],"summary":"Assign a security profile to a user (admin only)","operationId":"assign_profile_to_user_api_v1_security_profiles__profile_id__assign__user_id__post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/sso/settings":{"get":{"tags":["SSO"],"summary":"Get SSO/SCIM settings for the current org (admin only)","description":"Return the org's plan, entitlement, connection, and SCIM tokens.\n\nDeliberately NOT behind ``require_enterprise_tier``: the Security tab has\nto render an honest upgrade prompt for non-Enterprise admins, which needs\nthe plan. It returns no configuration for an unentitled org, and every\nmutating endpoint below is hard-gated.","operationId":"get_sso_settings_api_v1_sso_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOSettingsResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/sso/connection":{"put":{"tags":["SSO"],"summary":"Create or replace the org's IdP connection (Enterprise, admin only)","description":"Configure the IdP. Validated against the IdP's discovery document first.\n\nValidating before storing means an admin finds out immediately that an\nissuer URL is wrong, rather than discovering it when their users cannot\nlog in.","operationId":"upsert_connection_api_v1_sso_connection_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOConnectionCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOConnectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"delete":{"tags":["SSO"],"summary":"Delete the org's IdP connection (Enterprise, admin only)","operationId":"delete_connection_api_v1_sso_connection_delete","responses":{"204":{"description":"Successful Response"},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"patch":{"tags":["SSO"],"summary":"Partially update the org's IdP connection (Enterprise, admin only)","description":"Update selected fields, e.g. toggle ``enabled`` or rotate the secret.","operationId":"update_connection_api_v1_sso_connection_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOConnectionUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOConnectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/sso/scim-tokens":{"post":{"tags":["SSO"],"summary":"Mint a SCIM bearer token (Enterprise, admin only)","description":"Create a token for the IdP's SCIM provisioning config.\n\nThe plaintext is returned exactly once — only its SHA-256 hash is stored.","operationId":"create_scim_token_api_v1_sso_scim_tokens_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":120,"description":"Label for the token","title":"Name"},"description":"Label for the token"}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SCIMTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["SSO"],"summary":"List SCIM tokens (Enterprise, admin only)","operationId":"list_scim_tokens_api_v1_sso_scim_tokens_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SCIMTokenResponse"},"title":"Response List Scim Tokens Api V1 Sso Scim Tokens Get"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/sso/scim-tokens/{token_id}":{"delete":{"tags":["SSO"],"summary":"Revoke a SCIM token (Enterprise, admin only)","operationId":"revoke_scim_token_api_v1_sso_scim_tokens__token_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","title":"Token Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/sso/discover":{"get":{"tags":["SSO"],"summary":"Check whether an email domain uses SSO","description":"Tell the login page whether to show an SSO button for this email.\n\nIntentionally reveals nothing beyond \"this domain federates, under this\ndisplay name\" — no user existence, no org membership.","operationId":"discover_sso_api_v1_sso_discover_get","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","description":"Email address typed on the login page","title":"Email"},"description":"Email address typed on the login page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSODiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/sso/authorize":{"get":{"tags":["SSO"],"summary":"Begin SSO login — returns the IdP authorization URL","description":"Resolve the org's IdP from *email* and build its authorization URL.","operationId":"sso_authorize_api_v1_sso_authorize_get","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","description":"Email address used to resolve the IdP","title":"Email"},"description":"Email address used to resolve the IdP"},{"name":"redirect_uri","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Frontend callback URL; defaults to the configured one","title":"Redirect Uri"},"description":"Frontend callback URL; defaults to the configured one"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOAuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/sso/callback":{"post":{"tags":["SSO"],"summary":"Exchange an IdP authorization code for a ZeroPipeline JWT","description":"Complete SSO login and mint the same JWT every other login path mints.\n\nMirrors ``POST /auth/google`` end to end — resolve or provision the user,\nresolve org membership, then ``_mint_jwt`` — so ``app/core/deps.py``\nvalidates an SSO session with no changes at all.","operationId":"sso_callback_api_v1_sso_callback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOCallbackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOCallbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/scim/v2/ServiceProviderConfig":{"get":{"tags":["SCIM"],"summary":"SCIM service provider capabilities","description":"Advertise which SCIM features this server implements.\n\nHonest about the limits: ``patch`` and ``filter`` are supported, bulk and\nsort are not, and group writes are not (ZeroPipeline has no group concept\nseparate from org membership).","operationId":"service_provider_config_api_v1_scim_v2_ServiceProviderConfig_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/scim/v2/Users":{"get":{"tags":["SCIM"],"summary":"List or filter provisioned users","operationId":"list_users_api_v1_scim_v2_Users_get","parameters":[{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SCIM filter, e.g. userName eq \"a@b.com\"","title":"Filter"},"description":"SCIM filter, e.g. userName eq \"a@b.com\""},{"name":"startIndex","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Startindex"}},{"name":"count","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":0,"default":100,"title":"Count"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["SCIM"],"summary":"Provision a new user from the directory","operationId":"create_user_api_v1_scim_v2_Users_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/scim/v2/Users/{user_id}":{"get":{"tags":["SCIM"],"summary":"Get one provisioned user","operationId":"get_user_api_v1_scim_v2_Users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["SCIM"],"summary":"Replace a provisioned user","operationId":"replace_user_api_v1_scim_v2_Users__user_id__put","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["SCIM"],"summary":"Patch a provisioned user (deactivate/reactivate)","operationId":"patch_user_api_v1_scim_v2_Users__user_id__patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["SCIM"],"summary":"Deactivate a provisioned user","description":"Deactivate rather than destroy.\n\nSCIM DELETE means \"this person is gone from the directory\". Tombstoning\nrevokes their access immediately (see ``SCIMService.deactivate_user``)\nwhile preserving the CRM records they own — destroying the user row would\norphan deals, activities and audit history.","operationId":"delete_user_api_v1_scim_v2_Users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/scim/v2/Groups":{"get":{"tags":["SCIM"],"summary":"List groups (read-only)","operationId":"list_groups_api_v1_scim_v2_Groups_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/scim/v2/Groups/{group_id}":{"get":{"tags":["SCIM"],"summary":"Get one group (read-only)","operationId":"get_group_api_v1_scim_v2_Groups__group_id__get","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","title":"Group Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/webhooks/notes":{"post":{"tags":["webhooks-ingest"],"summary":"Webhook Notes","description":"Webhook endpoint for external note-taking tools.\n\nAuthenticates via API key (``X-API-Key`` header) with the ``write:notes``\nscope. Accepts raw webhook payloads from Otter.ai, Fireflies.ai, and\ngeneric formats, maps them to the standard ingestion schema, and\nprocesses them through the note ingestion pipeline.\n\nRefs #364","operationId":"webhook_notes_api_v1_webhooks_notes_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteIngestResponse"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/startup-program/apply":{"post":{"tags":["startup-program"],"summary":"Apply To Startup Program","description":"Store a Startup Program application for manual review.","operationId":"apply_to_startup_program_api_v1_startup_program_apply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartupProgramApplication"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartupProgramApplicationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"default":{"description":"Structured error envelope (see ErrorResponse).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"AIFeedbackCreate":{"properties":{"response_id":{"type":"string","maxLength":255,"minLength":1,"title":"Response Id"},"rating":{"type":"integer","maximum":5,"minimum":1,"title":"Rating"},"topic":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Topic"},"comment":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Comment"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["response_id","rating"],"title":"AIFeedbackCreate","description":"Payload for recording feedback on an AI response."},"AIFeedbackResponse":{"properties":{"id":{"type":"string","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"response_id":{"type":"string","title":"Response Id"},"rating":{"type":"integer","title":"Rating"},"topic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topic"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","org_id","user_id","response_id","rating"],"title":"AIFeedbackResponse","description":"Stored feedback record."},"AIFeedbackSummary":{"properties":{"total_feedback":{"type":"integer","title":"Total Feedback"},"average_rating":{"type":"number","title":"Average Rating"},"satisfaction_rate":{"type":"number","title":"Satisfaction Rate"},"rating_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Rating Breakdown"},"topics":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Topics"}},"type":"object","required":["total_feedback","average_rating","satisfaction_rate","rating_breakdown","topics"],"title":"AIFeedbackSummary","description":"Aggregated AI feedback metrics."},"APIKeyCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"role":{"$ref":"#/components/schemas/APIKeyRole","description":"Coarse-grained role: 'agent', 'admin', or 'read-only'.","default":"agent"},"scopes":{"items":{"type":"string"},"type":"array","maxItems":64,"title":"Scopes"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Optional expiration timestamp (UTC). Key is rejected after this time."}},"additionalProperties":false,"type":"object","required":["name"],"title":"APIKeyCreate"},"APIKeyCreateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"role":{"$ref":"#/components/schemas/APIKeyRole","default":"agent"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"key":{"type":"string","title":"Key","description":"Plaintext API key. Shown only once at creation; store it securely."}},"type":"object","required":["id","org_id","user_id","name","prefix","key"],"title":"APIKeyCreateResponse"},"APIKeyListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/APIKeyMetadata"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"APIKeyListResponse"},"APIKeyMetadata":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"role":{"$ref":"#/components/schemas/APIKeyRole","default":"agent"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","org_id","user_id","name","prefix"],"title":"APIKeyMetadata"},"APIKeyRole":{"type":"string","enum":["agent","admin","read-only"],"title":"APIKeyRole","description":"Coarse-grained role for an API key.\n\nThis determines the overall privilege level of the key, independent of\nfine-grained ``scopes``.  An \"agent\" key can only perform actions that\nagents are permitted to execute; an \"admin\" key has full access; a\n\"read-only\" key is limited to GET requests."},"AccountDeletionResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Always 'scheduled' on success."},"deletion_id":{"type":"string","format":"uuid","title":"Deletion Id","description":"Id of the scheduled deletion job."},"scheduled_for":{"type":"string","format":"date-time","title":"Scheduled For","description":"When hard-delete will run."},"grace_period_days":{"type":"integer","title":"Grace Period Days","description":"Days between soft-delete and hard-delete."}},"type":"object","required":["status","deletion_id","scheduled_for","grace_period_days"],"title":"AccountDeletionResponse","description":"Response payload after scheduling a GDPR deletion."},"AccountExportDownload":{"properties":{"user":{"additionalProperties":true,"type":"object","title":"User"},"deals":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Deals"},"activities":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Activities"},"tasks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tasks"},"audit_logs":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Audit Logs"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"export_id":{"type":"string","format":"uuid","title":"Export Id"}},"type":"object","required":["user","deals","activities","tasks","audit_logs","generated_at","export_id"],"title":"AccountExportDownload","description":"Full JSON payload delivered by the signed download link."},"AccountExportRequest":{"properties":{},"type":"object","title":"AccountExportRequest","description":"Request payload for POST /account/export.\n\nCurrently empty — the caller is identified from the bearer token — but\nexists so we can extend with format selectors (e.g. json/csv) later."},"AccountExportResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Always 'queued' on success."},"export_id":{"type":"string","format":"uuid","title":"Export Id","description":"Id of the queued export job."},"expires_at":{"type":"string","format":"date-time","title":"Expires At","description":"When the signed download URL expires."}},"type":"object","required":["status","export_id","expires_at"],"title":"AccountExportResponse","description":"Response payload after queuing an account export."},"ActionSchema":{"properties":{"type":{"type":"string","enum":["send_email","webhook_post","stage_transition","send_sms"],"title":"Type"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["type"],"title":"ActionSchema","description":"An action to execute when the automation fires."},"Activity":{"properties":{"activity_type":{"$ref":"#/components/schemas/ActivityType","description":"Type of activity"},"actor_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor Id","description":"User who performed the activity"},"related_to_type":{"type":"string","maxLength":50,"minLength":1,"title":"Related To Type","description":"Type of related entity (e.g., 'deal', 'pipeline')"},"related_to_id":{"type":"string","format":"uuid","title":"Related To Id","description":"ID of the related entity"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Human-readable description"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"actor_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Type"},"actor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Name"},"related_to_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related To Name"}},"type":"object","required":["activity_type","related_to_type","related_to_id","id","org_id","created_at"],"title":"Activity","description":"Schema for Activity response.\n\nNote: Activities do not have version or updated_at fields since they are immutable.\nThey also do not have deleted_at since they cannot be deleted."},"ActivityCreate":{"properties":{"activity_type":{"$ref":"#/components/schemas/ActivityType","description":"Type of activity"},"actor_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor Id","description":"User who performed the activity"},"related_to_type":{"type":"string","maxLength":50,"minLength":1,"title":"Related To Type","description":"Type of related entity (e.g., 'deal', 'pipeline')"},"related_to_id":{"type":"string","format":"uuid","title":"Related To Id","description":"ID of the related entity"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Human-readable description"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata"}},"type":"object","required":["activity_type","related_to_type","related_to_id"],"title":"ActivityCreate","description":"Schema for creating a new activity log entry.\n\nNote: Activities are append-only. There is no update or delete schema."},"ActivityType":{"type":"string","enum":["deal.created","deal.updated","deal.deleted","deal.stage_changed","deal.owner_changed","pipeline.created","pipeline.updated","pipeline.deleted","stage.created","stage.updated","stage.deleted","user.login","user.logout","call","email","meeting","note","task","custom"],"title":"ActivityType","description":"Enumeration of activity types."},"AddFieldRequest":{"properties":{"field_slug":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Field Slug","description":"Machine-readable slug (lowercase, underscores only)"},"display_label":{"type":"string","maxLength":200,"minLength":1,"title":"Display Label"},"field_type":{"$ref":"#/components/schemas/FieldType"},"required":{"type":"boolean","title":"Required","default":false},"default_value":{"title":"Default Value"},"options":{"items":{"type":"string"},"type":"array","title":"Options","description":"Allowed values for select/multi_select fields"}},"type":"object","required":["field_slug","display_label","field_type"],"title":"AddFieldRequest","description":"Request body for adding a custom field to a standard object."},"ApiKeyIntegrationRequest":{"properties":{"api_key":{"type":"string","maxLength":512,"minLength":1,"title":"Api Key"}},"type":"object","required":["api_key"],"title":"ApiKeyIntegrationRequest"},"ApiKeyIntegrationResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"configured":{"type":"boolean","title":"Configured","default":true},"key_preview":{"type":"string","title":"Key Preview"}},"type":"object","required":["provider","key_preview"],"title":"ApiKeyIntegrationResponse"},"ApprovalCreate":{"properties":{"agent_name":{"type":"string","title":"Agent Name"},"action_type":{"type":"string","title":"Action Type"},"entity_type":{"type":"string","title":"Entity Type"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"description":{"type":"string","title":"Description"},"payload":{"additionalProperties":true,"type":"object","title":"Payload","default":{}}},"type":"object","required":["agent_name","action_type","entity_type","description"],"title":"ApprovalCreate"},"ApprovalResponse":{"properties":{"id":{"type":"string","title":"Id"},"org_id":{"type":"string","title":"Org Id"},"agent_name":{"type":"string","title":"Agent Name"},"action_type":{"type":"string","title":"Action Type"},"entity_type":{"type":"string","title":"Entity Type"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"description":{"type":"string","title":"Description"},"payload":{"additionalProperties":true,"type":"object","title":"Payload","default":{}},"status":{"$ref":"#/components/schemas/ApprovalStatus"},"requested_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By"},"created_at":{"type":"string","title":"Created At"},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"}},"type":"object","required":["id","org_id","agent_name","action_type","entity_type","entity_id","description","status","created_at","resolved_at","resolved_by"],"title":"ApprovalResponse"},"ApprovalStatus":{"type":"string","enum":["pending","approved","rejected"],"title":"ApprovalStatus"},"AuditAction":{"type":"string","enum":["create","update","delete","restore"],"title":"AuditAction"},"AuditLog":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"actor_id":{"type":"string","format":"uuid","title":"Actor Id"},"action":{"$ref":"#/components/schemas/AuditAction"},"entity_type":{"type":"string","title":"Entity Type"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"changes":{"additionalProperties":true,"type":"object","title":"Changes"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"agent_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Type"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","org_id","actor_id","action","entity_type","entity_id","created_at"],"title":"AuditLog"},"AuditLogCreate":{"properties":{"action":{"$ref":"#/components/schemas/AuditAction","description":"Action performed"},"entity_type":{"type":"string","maxLength":50,"minLength":1,"title":"Entity Type","description":"Type of entity affected"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id","description":"ID of the affected entity"},"changes":{"additionalProperties":true,"type":"object","title":"Changes","description":"Before/after change data"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"}},"type":"object","required":["action","entity_type","entity_id"],"title":"AuditLogCreate"},"AutomationCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"trigger_type":{"type":"string","maxLength":100,"title":"Trigger Type"},"trigger_config":{"$ref":"#/components/schemas/TriggerConfigSchema"},"conditions":{"items":{"$ref":"#/components/schemas/ConditionSchema"},"type":"array","title":"Conditions"},"actions":{"items":{"$ref":"#/components/schemas/ActionSchema"},"type":"array","minItems":1,"title":"Actions"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["name","trigger_type","actions"],"title":"AutomationCreate","description":"Schema for creating an automation."},"AutomationResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"name":{"type":"string","title":"Name"},"trigger_type":{"type":"string","title":"Trigger Type"},"trigger_config":{"additionalProperties":true,"type":"object","title":"Trigger Config"},"conditions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Conditions"},"actions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Actions"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["id","org_id","name","trigger_type","trigger_config","conditions","actions","is_active","created_at","updated_at"],"title":"AutomationResponse","description":"Schema for automation API responses."},"AutomationUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"trigger_type":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Trigger Type"},"trigger_config":{"anyOf":[{"$ref":"#/components/schemas/TriggerConfigSchema"},{"type":"null"}]},"conditions":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConditionSchema"},"type":"array"},{"type":"null"}],"title":"Conditions"},"actions":{"anyOf":[{"items":{"$ref":"#/components/schemas/ActionSchema"},"type":"array"},{"type":"null"}],"title":"Actions"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"AutomationUpdate","description":"Schema for updating an automation."},"AvatarResponse":{"properties":{"avatar_url":{"type":"string","title":"Avatar Url"}},"type":"object","required":["avatar_url"],"title":"AvatarResponse","description":"Response for avatar upload."},"BillingBanner":{"properties":{"show":{"type":"boolean","title":"Show","default":false},"variant":{"type":"string","title":"Variant","default":"info"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","title":"BillingBanner","description":"Frontend-facing billing notice metadata."},"BillingPlan":{"type":"string","enum":["free","starter","pro","business","enterprise"],"title":"BillingPlan","description":"Supported ZeroPipeline billing plans.\n\nMaps to AINative subscription_tier slugs. STARTER is the entry-level paid\ntier; FREE is the default for orgs with no active subscription."},"BillingStatusResponse":{"properties":{"plan":{"$ref":"#/components/schemas/BillingPlan"},"status":{"type":"string","title":"Status"},"billing_state":{"type":"string","title":"Billing State"},"write_blocked":{"type":"boolean","title":"Write Blocked","default":false},"banner":{"$ref":"#/components/schemas/BillingBanner"}},"type":"object","required":["plan","status","billing_state"],"title":"BillingStatusResponse","description":"Billing status summary for current user surfaces."},"BillingSubscription":{"properties":{"plan":{"$ref":"#/components/schemas/BillingPlan"},"status":{"type":"string","title":"Status"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id"},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"portal_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Portal Url"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"}},"type":"object","required":["plan","status"],"title":"BillingSubscription","description":"Current billing status for an organization."},"BillingUsageResponse":{"properties":{"plan":{"$ref":"#/components/schemas/BillingPlan"},"status":{"type":"string","title":"Status"},"resources":{"additionalProperties":{"$ref":"#/components/schemas/UsageResourceSnapshot"},"type":"object","title":"Resources"},"has_warnings":{"type":"boolean","title":"Has Warnings","default":false}},"type":"object","required":["plan","status","resources"],"title":"BillingUsageResponse","description":"Current usage versus plan limits for the org."},"Body_authorize_post_api_v1_oauth_authorize_post":{"properties":{"client_id":{"type":"string","title":"Client Id"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"scope":{"type":"string","title":"Scope","default":""},"state":{"type":"string","title":"State","default":""},"response_type":{"type":"string","title":"Response Type","default":"code"}},"type":"object","required":["client_id","redirect_uri"],"title":"Body_authorize_post_api_v1_oauth_authorize_post"},"Body_import_customers_api_v1_customers_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_customers_api_v1_customers_import_post"},"Body_token_endpoint_api_v1_oauth_token_post":{"properties":{"grant_type":{"type":"string","title":"Grant Type"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"}},"type":"object","required":["grant_type"],"title":"Body_token_endpoint_api_v1_oauth_token_post"},"Body_upload_avatar_api_v1_users_me_avatar_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_avatar_api_v1_users_me_avatar_post"},"BulkTagRequest":{"properties":{"add_tags":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Add Tags","description":"Tags to add to matching contacts"},"remove_tags":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Remove Tags","description":"Tags to remove from matching contacts"},"filter_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Source","description":"Match contacts with this source"},"filter_source_is_null":{"type":"boolean","title":"Filter Source Is Null","description":"Match contacts where source is null or empty","default":false},"filter_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Status","description":"Match contacts with this status"},"filter_tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Filter Tags","description":"Match contacts that have ALL of these tags"},"filter_missing_tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Filter Missing Tags","description":"Match contacts that are missing ANY of these tags"},"filter_untagged":{"type":"boolean","title":"Filter Untagged","description":"Match only contacts with no tags","default":false}},"additionalProperties":false,"type":"object","title":"BulkTagRequest","description":"Bulk add/remove tags on contacts matching filter criteria."},"BulkTagResult":{"properties":{"matched":{"type":"integer","title":"Matched","default":0},"updated":{"type":"integer","title":"Updated","default":0},"skipped":{"type":"integer","title":"Skipped","default":0},"errors":{"type":"integer","title":"Errors","default":0},"elapsed_seconds":{"type":"number","title":"Elapsed Seconds","default":0}},"type":"object","title":"BulkTagResult","description":"Result of a bulk tag operation."},"CalendarCallbackResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"provider":{"$ref":"#/components/schemas/CalendarProvider"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Calendar account email if available"}},"type":"object","required":["connected","provider"],"title":"CalendarCallbackResponse","description":"Result of processing the OAuth callback."},"CalendarConnectRequest":{"properties":{"provider":{"$ref":"#/components/schemas/CalendarProvider","description":"Calendar provider to connect"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri","description":"OAuth redirect URI override (defaults to server callback URL)"}},"type":"object","required":["provider"],"title":"CalendarConnectRequest","description":"Request to initiate OAuth connection to a calendar provider."},"CalendarConnectResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"},"state":{"type":"string","title":"State","description":"CSRF state token to verify on callback"}},"type":"object","required":["authorization_url","state"],"title":"CalendarConnectResponse","description":"OAuth authorization URL for the user to visit."},"CalendarProvider":{"type":"string","enum":["google_calendar","outlook_calendar"],"title":"CalendarProvider","description":"Supported calendar OAuth providers."},"CalendarSyncStatus":{"properties":{"connected":{"type":"boolean","title":"Connected"},"provider":{"anyOf":[{"$ref":"#/components/schemas/CalendarProvider"},{"type":"null"}]},"last_sync":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync"},"meeting_count":{"type":"integer","title":"Meeting Count","default":0}},"type":"object","required":["connected"],"title":"CalendarSyncStatus","description":"Current calendar integration status for the org."},"CallListItem":{"properties":{"note_id":{"type":"string","format":"uuid","title":"Note Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"source":{"type":"string","title":"Source","default":""},"summary":{"type":"string","title":"Summary","default":""},"attendees":{"items":{"type":"string"},"type":"array","title":"Attendees"},"action_items":{"items":{"type":"string"},"type":"array","title":"Action Items"},"action_item_count":{"type":"integer","title":"Action Item Count","default":0},"key_decisions":{"items":{"type":"string"},"type":"array","title":"Key Decisions"},"signals":{"$ref":"#/components/schemas/CallSignals"},"extraction_status":{"type":"string","title":"Extraction Status","description":"Why this record's extracted fields look the way they do: 'ok' (model answered and was parsed), 'empty' (model answered with unusable output), 'failed' (the extraction call itself never returned — not the same as a quiet call), or 'skipped' (no transcript supplied)","default":"ok"},"extraction_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Error","description":"Human-readable reason when extraction_status is not 'ok'"},"transcript_truncated":{"type":"boolean","title":"Transcript Truncated","description":"True when the source transcript exceeded the extraction service's length limit and was cut before being analyzed -- an 'ok' extraction with this set may be missing signals discussed after the cutoff","default":false},"linked_entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked Entity Type"},"linked_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Linked Entity Id"},"linked_customer_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Linked Customer Ids"},"linked_deal_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Linked Deal Ids"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["note_id"],"title":"CallListItem","description":"A single ingested call for the Calls surface.\n\nRefs #542"},"CallSignals":{"properties":{"competitor_mentions":{"items":{"type":"string"},"type":"array","title":"Competitor Mentions","description":"Competitor or incumbent vendor names named on the call"},"budget_mentioned":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget Mentioned","description":"Budget/price figure discussed, if any"},"timeline_mentioned":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timeline Mentioned","description":"Decision or purchase timeline discussed, if any"},"objections":{"items":{"type":"string"},"type":"array","title":"Objections","description":"Concerns or blockers the prospect raised"}},"type":"object","title":"CallSignals","description":"Structured buying signals extracted from a call transcript.\n\nRefs #542"},"ChatRequest":{"properties":{"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"stream":{"type":"boolean","title":"Stream","default":true}},"type":"object","required":["message"],"title":"ChatRequest","description":"Request body for the AI chat endpoint."},"ChatResponse":{"properties":{"message":{"type":"string","title":"Message"},"conversation_id":{"type":"string","title":"Conversation Id"},"sources":{"items":{},"type":"array","title":"Sources"},"latency_ms":{"type":"integer","title":"Latency Ms"},"actions_taken":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Actions Taken","description":"List of CRM tool calls made by the agent, with inputs and outcomes."}},"type":"object","required":["message","conversation_id","latency_ms"],"title":"ChatResponse","description":"Non-streaming chat response."},"CheckoutRequest":{"properties":{"plan":{"$ref":"#/components/schemas/BillingPlan","description":"Requested plan tier"},"success_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Success Url","description":"Override post-checkout success URL"},"cancel_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Cancel Url","description":"Override post-checkout cancel URL"}},"type":"object","required":["plan"],"title":"CheckoutRequest","description":"Request payload for starting Stripe Checkout."},"CheckoutResponse":{"properties":{"checkout_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Checkout Url"},"session_id":{"type":"string","title":"Session Id"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"plan":{"$ref":"#/components/schemas/BillingPlan"}},"type":"object","required":["checkout_url","session_id","plan"],"title":"CheckoutResponse","description":"Stripe Checkout session response."},"Comment":{"properties":{"entity_type":{"type":"string","maxLength":50,"minLength":1,"title":"Entity Type","description":"Type of parent entity (e.g., 'deal', 'customer')"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id","description":"ID of the parent entity"},"content":{"type":"string","maxLength":5000,"minLength":1,"title":"Content","description":"Comment text"},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Id","description":"Parent comment ID for threading"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["entity_type","entity_id","content","id","org_id","created_at"],"title":"Comment","description":"Schema for Comment response."},"CommentCreate":{"properties":{"entity_type":{"type":"string","maxLength":50,"minLength":1,"title":"Entity Type","description":"Type of parent entity (e.g., 'deal', 'customer')"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id","description":"ID of the parent entity"},"content":{"type":"string","maxLength":5000,"minLength":1,"title":"Content","description":"Comment text"},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Id","description":"Parent comment ID for threading"}},"type":"object","required":["entity_type","entity_id","content"],"title":"CommentCreate","description":"Schema for creating a new comment."},"CommissionSummary":{"properties":{"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"owner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Name"},"deals_won":{"type":"integer","title":"Deals Won"},"total_revenue":{"type":"string","title":"Total Revenue"},"total_commission":{"type":"string","title":"Total Commission"},"tiers_applied":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tiers Applied"}},"type":"object","required":["owner_id","deals_won","total_revenue","total_commission","tiers_applied"],"title":"CommissionSummary","description":"Schema for per-rep commission summary."},"CommissionTier":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"min_value":{"type":"string","title":"Min Value"},"max_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Value"},"rate_percentage":{"type":"string","title":"Rate Percentage"},"is_active":{"type":"boolean","title":"Is Active","default":true},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["name","min_value","rate_percentage","id","org_id","version","created_at","updated_at"],"title":"CommissionTier","description":"Schema for Commission Tier response."},"CommissionTierCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"min_value":{"anyOf":[{"type":"number","minimum":0},{"type":"string"}],"title":"Min Value"},"max_value":{"anyOf":[{"type":"number","minimum":0},{"type":"string"},{"type":"null"}],"title":"Max Value"},"rate_percentage":{"anyOf":[{"type":"number","maximum":100,"minimum":0},{"type":"string"}],"title":"Rate Percentage"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["name","min_value","rate_percentage"],"title":"CommissionTierCreate","description":"Schema for creating a new commission tier."},"CommissionTierUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"min_value":{"anyOf":[{"type":"number","minimum":0},{"type":"string"},{"type":"null"}],"title":"Min Value"},"max_value":{"anyOf":[{"type":"number","minimum":0},{"type":"string"},{"type":"null"}],"title":"Max Value"},"rate_percentage":{"anyOf":[{"type":"number","maximum":100,"minimum":0},{"type":"string"},{"type":"null"}],"title":"Rate Percentage"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}},"additionalProperties":false,"type":"object","title":"CommissionTierUpdate","description":"Schema for updating an existing commission tier."},"ConditionSchema":{"properties":{"field":{"type":"string","title":"Field"},"operator":{"type":"string","enum":["eq","neq","gt","lt","contains"],"title":"Operator"},"value":{"title":"Value"}},"type":"object","required":["field","operator","value"],"title":"ConditionSchema","description":"A single condition to evaluate against event data."},"CurrentUser":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id","description":"User ID from JWT"},"email":{"type":"string","title":"Email","description":"User email"},"org_id":{"type":"string","format":"uuid","title":"Org Id","description":"Current organization ID"},"role":{"$ref":"#/components/schemas/OrgRole","description":"Role in current organization"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name","description":"Agent identifier, e.g. 'lead-discovery-agent'"},"agent_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Type","description":"Agent category: 'mcp', 'background-job', 'chat', etc."},"is_agent":{"type":"boolean","title":"Is Agent","description":"True when the request originates from an API-key-authenticated agent","default":false}},"type":"object","required":["user_id","email","org_id","role"],"title":"CurrentUser","description":"Current authenticated user information."},"CursorPaginatedActivities":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Activity"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"CursorPaginatedActivities","description":"Cursor-like pagination envelope for activity list endpoints."},"CursorPaginatedAutomations":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AutomationResponse"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"CursorPaginatedAutomations","description":"Cursor-like pagination envelope for automation list endpoints."},"CursorPaginatedDeals":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DealList"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"CursorPaginatedDeals","description":"Cursor-like pagination envelope for deal list endpoints."},"CursorPaginatedObjects":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ObjectDefinitionList"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"CursorPaginatedObjects","description":"Cursor-like pagination envelope for custom object definitions."},"CursorPaginatedPipelines":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PipelineList"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"CursorPaginatedPipelines","description":"Cursor-like pagination envelope for pipeline list endpoints."},"CursorPaginatedProducts":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProductList"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"CursorPaginatedProducts","description":"Cursor-like pagination envelope for product list endpoints."},"CursorPaginatedRecords":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RecordResponse"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"CursorPaginatedRecords","description":"Cursor-like pagination envelope for custom object records."},"CursorPaginatedTasks":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TaskList"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"CursorPaginatedTasks","description":"Cursor-like pagination envelope for task list endpoints."},"Customer":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"source":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Source"},"status":{"type":"string","maxLength":50,"title":"Status","default":"active"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"contacted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Contacted At"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["name","id","org_id","version","created_at","updated_at"],"title":"Customer","description":"Schema for Customer response."},"CustomerBulkCreate":{"properties":{"customers":{"items":{"$ref":"#/components/schemas/CustomerBulkItem"},"type":"array","maxItems":10000,"minItems":1,"title":"Customers"},"source":{"type":"string","maxLength":100,"title":"Source","description":"Required — identifies the import origin (e.g. 'vc_import', 'investor-list')"},"default_tags":{"items":{"type":"string"},"type":"array","title":"Default Tags","description":"Tags applied to every contact in this batch"},"skip_duplicates":{"type":"boolean","title":"Skip Duplicates","description":"Skip contacts with existing emails","default":true}},"type":"object","required":["customers","source"],"title":"CustomerBulkCreate","description":"Bulk import request — up to 10,000 contacts per request."},"CustomerBulkItem":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"source":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Source"},"status":{"type":"string","maxLength":50,"title":"Status","default":"active"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"contacted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Contacted At"}},"type":"object","required":["name"],"title":"CustomerBulkItem","description":"Single customer in a bulk import request — relaxed validation for speed."},"CustomerBulkResult":{"properties":{"created":{"type":"integer","title":"Created","default":0},"skipped":{"type":"integer","title":"Skipped","default":0},"errors":{"type":"integer","title":"Errors","default":0},"total":{"type":"integer","title":"Total","default":0},"elapsed_seconds":{"type":"number","title":"Elapsed Seconds","default":0},"error_details":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Error Details"}},"type":"object","title":"CustomerBulkResult","description":"Result of a bulk import operation."},"CustomerCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"source":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Source"},"status":{"type":"string","maxLength":50,"title":"Status","default":"active"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"contacted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Contacted At"}},"type":"object","required":["name"],"title":"CustomerCreate","description":"Schema for creating a new customer."},"CustomerImportResult":{"properties":{"row_number":{"type":"integer","minimum":1,"title":"Row Number"},"status":{"type":"string","title":"Status","description":"created, skipped, or error"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}},"type":"object","required":["row_number","status"],"title":"CustomerImportResult","description":"Per-row outcome for bulk customer imports."},"CustomerImportSummary":{"properties":{"created":{"type":"integer","title":"Created","default":0},"skipped":{"type":"integer","title":"Skipped","default":0},"errors":{"type":"integer","title":"Errors","default":0},"results":{"items":{"$ref":"#/components/schemas/CustomerImportResult"},"type":"array","title":"Results"}},"type":"object","title":"CustomerImportSummary","description":"Summary response for bulk customer imports."},"CustomerList":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"source":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Source"},"status":{"type":"string","maxLength":50,"title":"Status","default":"active"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"contacted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Contacted At"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","id","org_id","version","created_at","updated_at"],"title":"CustomerList","description":"Schema for Customer in list responses."},"CustomerUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"source":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Source"},"status":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Status"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"},"contacted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Contacted At"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Required for optimistic locking"}},"additionalProperties":false,"type":"object","title":"CustomerUpdate","description":"Schema for updating an existing customer."},"Deal":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"pipeline_id":{"type":"string","format":"uuid","title":"Pipeline Id"},"stage_id":{"type":"string","format":"uuid","title":"Stage Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"currency":{"type":"string","maxLength":3,"title":"Currency","default":"USD"},"expected_close_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Close Date"},"probability":{"anyOf":[{"type":"integer","maximum":100,"minimum":0},{"type":"null"}],"title":"Probability"},"status":{"type":"string","maxLength":50,"title":"Status","default":"open"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["name","pipeline_id","stage_id","id","org_id","version","created_at","updated_at"],"title":"Deal","description":"Schema for Deal response."},"DealCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"pipeline_id":{"type":"string","format":"uuid","title":"Pipeline Id"},"stage_id":{"type":"string","format":"uuid","title":"Stage Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"value":{"anyOf":[{"type":"number","minimum":0},{"type":"string"},{"type":"null"}],"title":"Value"},"currency":{"type":"string","maxLength":3,"title":"Currency","default":"USD"},"expected_close_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Close Date"},"probability":{"anyOf":[{"type":"integer","maximum":100,"minimum":0},{"type":"null"}],"title":"Probability"},"status":{"type":"string","maxLength":50,"title":"Status","default":"open"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"}},"type":"object","required":["name","pipeline_id","stage_id"],"title":"DealCreate","description":"Schema for creating a new deal."},"DealInvoiceResult":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id","description":"ID assigned by the accounting system"},"provider":{"type":"string","title":"Provider","description":"Accounting provider: 'quickbooks' or 'xero'"},"status":{"type":"string","title":"Status","description":"Invoice status returned by provider"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Deep-link URL in the accounting system"}},"type":"object","required":["invoice_id","provider","status"],"title":"DealInvoiceResult","description":"Schema for the result of creating an invoice from a won deal."},"DealList":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"name":{"type":"string","title":"Name"},"pipeline_id":{"type":"string","format":"uuid","title":"Pipeline Id"},"stage_id":{"type":"string","format":"uuid","title":"Stage Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"status":{"type":"string","title":"Status"},"score":{"anyOf":[{"type":"integer","maximum":100,"minimum":0},{"type":"null"}],"title":"Score","description":"Auto-calculated health score"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","org_id","name","pipeline_id","stage_id","status","version","created_at","updated_at"],"title":"DealList","description":"Schema for Deal in list responses."},"DealNoteCreate":{"properties":{"text":{"type":"string","maxLength":5000,"minLength":1,"title":"Text","description":"Note content"}},"type":"object","required":["text"],"title":"DealNoteCreate","description":"Schema for adding a quick note to a deal."},"DealUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"stage_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Stage Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"value":{"anyOf":[{"type":"number","minimum":0},{"type":"string"},{"type":"null"}],"title":"Value"},"currency":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Currency"},"expected_close_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Close Date"},"probability":{"anyOf":[{"type":"integer","maximum":100,"minimum":0},{"type":"null"}],"title":"Probability"},"status":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Status"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Required for optimistic locking"}},"additionalProperties":false,"type":"object","title":"DealUpdate","description":"Schema for updating an existing deal."},"DiscoveryJobCreate":{"properties":{"icp_id":{"type":"string","title":"Icp Id","description":"ID of the ICP profile to use for discovery"},"pipeline_id":{"type":"string","title":"Pipeline Id","description":"Pipeline ID where discovered deals will be placed"},"stage_id":{"type":"string","title":"Stage Id","description":"Stage ID for newly created deals"},"limit":{"type":"integer","maximum":200,"minimum":1,"title":"Limit","description":"Max candidates to discover","default":50},"query":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Query","description":"Optional natural language search hint"}},"type":"object","required":["icp_id","pipeline_id","stage_id"],"title":"DiscoveryJobCreate","description":"Request body to start a new lead discovery job."},"DiscoveryJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"org_id":{"type":"string","title":"Org Id"},"icp_id":{"type":"string","title":"Icp Id"},"pipeline_id":{"type":"string","title":"Pipeline Id"},"stage_id":{"type":"string","title":"Stage Id"},"limit":{"type":"integer","title":"Limit"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"status":{"type":"string","title":"Status"},"total_found":{"type":"integer","title":"Total Found","default":0},"total_qualified":{"type":"integer","title":"Total Qualified","default":0},"total_inserted":{"type":"integer","title":"Total Inserted","default":0},"total_dupes":{"type":"integer","title":"Total Dupes","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"blocked_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blocked Reason"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["job_id","org_id","icp_id","pipeline_id","stage_id","limit","status"],"title":"DiscoveryJobResponse","description":"Response shape for a discovery job record."},"EDOBootstrapResponse":{"properties":{"object_slug":{"type":"string","title":"Object Slug"},"object_id":{"type":"string","title":"Object Id"},"pipeline_id":{"type":"string","title":"Pipeline Id"},"stage_ids":{"additionalProperties":{"type":"string"},"type":"object","title":"Stage Ids","description":"Stage name -> stage ID for the EDO pipeline"},"template_version":{"type":"integer","title":"Template Version"},"created":{"type":"boolean","title":"Created","description":"True if this call created new resources; False if it found an existing, compatible setup and left it untouched"}},"type":"object","required":["object_slug","object_id","pipeline_id","template_version","created"],"title":"EDOBootstrapResponse","description":"Result of an EDO workspace bootstrap call."},"EDOEnableRequest":{"properties":{"org_id":{"type":"string","format":"uuid","title":"Org Id"}},"type":"object","required":["org_id"],"title":"EDOEnableRequest"},"EDOEnableResponse":{"properties":{"org_id":{"type":"string","title":"Org Id"},"edo_enabled":{"type":"boolean","title":"Edo Enabled"}},"type":"object","required":["org_id","edo_enabled"],"title":"EDOEnableResponse"},"EmailConnectRequest":{"properties":{"provider":{"type":"string","enum":["google","microsoft"],"title":"Provider"}},"type":"object","required":["provider"],"title":"EmailConnectRequest"},"EmailConnectResponse":{"properties":{"redirect_url":{"type":"string","title":"Redirect Url"}},"type":"object","required":["redirect_url"],"title":"EmailConnectResponse"},"EmailListResponse":{"properties":{"emails":{"items":{"$ref":"#/components/schemas/EmailRecord"},"type":"array","title":"Emails"},"total":{"type":"integer","title":"Total","default":0},"page":{"type":"integer","title":"Page","default":1},"page_size":{"type":"integer","title":"Page Size","default":25}},"type":"object","title":"EmailListResponse"},"EmailRecord":{"properties":{"id":{"type":"string","title":"Id"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Email"},"to_emails":{"items":{"type":"string"},"type":"array","title":"To Emails"},"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"deal_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Deal Id"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},"type":"object","required":["id"],"title":"EmailRecord"},"EmailSyncStatus":{"properties":{"connected":{"type":"boolean","title":"Connected"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"last_sync":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync"},"email_count":{"type":"integer","title":"Email Count","default":0}},"type":"object","required":["connected"],"title":"EmailSyncStatus"},"EnrichMethod":{"type":"string","enum":["ai","google-places","apollo-people","browser-scrape","full"],"title":"EnrichMethod","description":"Available enrichment methods."},"EnrichRequest":{"properties":{"customer_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"minItems":1,"title":"Customer Ids"}},"type":"object","required":["customer_ids"],"title":"EnrichRequest","description":"Request to enrich one or more customers."},"EnrichResult":{"properties":{"total":{"type":"integer","title":"Total"},"enriched":{"type":"integer","title":"Enriched"},"failed":{"type":"integer","title":"Failed"},"results":{"items":{"$ref":"#/components/schemas/EnrichResultItem"},"type":"array","title":"Results"}},"type":"object","required":["total","enriched","failed","results"],"title":"EnrichResult","description":"Aggregate result of a batch enrichment request."},"EnrichResultItem":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"status":{"type":"string","title":"Status","description":"success, error, or timeout"},"enrichment":{"anyOf":[{"$ref":"#/components/schemas/EnrichmentData"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["customer_id","status"],"title":"EnrichResultItem","description":"Result of enriching a single customer."},"EnrichmentData":{"properties":{"investment_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Investment Stage","description":"Investment stage: pre-seed, seed, series-a, series-b, growth, multi-stage"},"investor_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Investor Type","description":"Investor type: lp, fof, gp, vc, angel, family_office, endowment, cvc, accelerator, or null"},"venture_studio_lp":{"type":"boolean","title":"Venture Studio Lp","description":"True if this LP/FOF backs venture studios / the studio model specifically","default":false},"thesis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thesis","description":"Brief investment thesis (1-2 sentences)"},"focus_areas":{"items":{"type":"string"},"type":"array","title":"Focus Areas","description":"Focus areas like ai, saas, fintech"},"key_people":{"items":{"$ref":"#/components/schemas/KeyPerson"},"type":"array","title":"Key People","description":"Known partners/principals"},"firm_website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Website","description":"Firm website URL"},"business_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Category","description":"Business type: restaurant, gym, salon, etc."},"owner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Name","description":"Owner or decision-maker name"},"social_profiles":{"additionalProperties":{"type":"string"},"type":"object","title":"Social Profiles","description":"Platform → URL/handle"},"employee_count_estimate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Count Estimate","description":"Range: 1-10, 11-50, 51-200, etc."},"business_hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Hours","description":"Operating hours summary"},"business_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Description","description":"About text from website or listing"},"enriched_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enriched At","description":"ISO-8601 timestamp of enrichment"},"enrichment_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrichment Source","description":"Source of enrichment data"},"enrichment_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrichment Model","description":"AI model used for enrichment"},"enrichment_methods":{"items":{"type":"string"},"type":"array","title":"Enrichment Methods","description":"Methods that contributed data"}},"type":"object","title":"EnrichmentData","description":"Structured enrichment data stored in customer.meta.enrichment."},"FieldConfig":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"org_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Org Id"},"object_type":{"type":"string","title":"Object Type"},"field_slug":{"type":"string","title":"Field Slug"},"display_label":{"type":"string","title":"Display Label"},"field_type":{"$ref":"#/components/schemas/FieldType"},"required":{"type":"boolean","title":"Required","default":false},"default_value":{"title":"Default Value"},"options":{"items":{"type":"string"},"type":"array","title":"Options"},"is_custom":{"type":"boolean","title":"Is Custom","default":false},"is_active":{"type":"boolean","title":"Is Active","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["object_type","field_slug","display_label","field_type"],"title":"FieldConfig","description":"Response model for a single field configuration."},"FieldDefinition":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"field_type":{"$ref":"#/components/schemas/FieldType"},"required":{"type":"boolean","title":"Required","default":false},"default_value":{"title":"Default Value"},"options":{"items":{"type":"string"},"type":"array","title":"Options","description":"Allowed values for select/multi_select fields"}},"type":"object","required":["name","field_type"],"title":"FieldDefinition","description":"Schema for a single field within a custom object definition."},"FieldPermission":{"properties":{"field_name":{"type":"string","maxLength":255,"minLength":1,"title":"Field Name"},"visible":{"type":"boolean","title":"Visible","description":"Whether the field is returned in API responses","default":true},"editable":{"type":"boolean","title":"Editable","description":"Whether the field can be written via API","default":true}},"type":"object","required":["field_name"],"title":"FieldPermission","description":"Visibility and editability for a single field on a CRM object."},"FieldType":{"type":"string","enum":["text","number","currency","date","select","multi_select","checkbox","url","email","phone","record_reference"],"title":"FieldType","description":"Supported field types for custom object definitions."},"GDPRDeleteResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"deleted_at":{"type":"string","format":"date-time","title":"Deleted At"},"tables_processed":{"items":{"type":"string"},"type":"array","title":"Tables Processed"},"records_anonymized":{"type":"integer","title":"Records Anonymized"}},"type":"object","required":["user_id","deleted_at","tables_processed","records_anonymized"],"title":"GDPRDeleteResponse"},"GDPRExportResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"exported_at":{"type":"string","format":"date-time","title":"Exported At"},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["user_id","exported_at","data"],"title":"GDPRExportResponse"},"GDPRRequest":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id","description":"User ID to export/delete data for"}},"type":"object","required":["user_id"],"title":"GDPRRequest"},"GoogleAuthRequest":{"properties":{"code":{"type":"string","title":"Code"},"redirect_uri":{"type":"string","title":"Redirect Uri"}},"type":"object","required":["code","redirect_uri"],"title":"GoogleAuthRequest"},"GoogleAuthResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"GoogleAuthResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ICPCriteria":{"properties":{"industries":{"items":{"type":"string"},"type":"array","title":"Industries","description":"e.g. ['fintech', 'saas']"},"company_size_min":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Company Size Min","description":"Minimum employee count"},"company_size_max":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Company Size Max","description":"Maximum employee count"},"geographies":{"items":{"type":"string"},"type":"array","title":"Geographies","description":"e.g. ['US', 'Canada']"},"funding_stages":{"items":{"type":"string"},"type":"array","title":"Funding Stages","description":"e.g. ['Series A', 'Series B']"},"target_titles":{"items":{"type":"string"},"type":"array","title":"Target Titles","description":"e.g. ['CEO', 'VP Sales', 'Founder']"},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords","description":"Signals to look for in company/person descriptions"},"exclusions":{"items":{"type":"string"},"type":"array","title":"Exclusions","description":"Company names or domains to skip"}},"type":"object","title":"ICPCriteria","description":"Criteria defining an ideal customer profile."},"ICPProfileCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Display name for this ICP profile"},"criteria":{"$ref":"#/components/schemas/ICPCriteria"},"min_score":{"type":"integer","maximum":100,"minimum":0,"title":"Min Score","description":"Leads below this score are dropped","default":60}},"type":"object","required":["name"],"title":"ICPProfileCreate","description":"Schema for creating a new ICP profile."},"ICPProfileResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Display name for this ICP profile"},"criteria":{"$ref":"#/components/schemas/ICPCriteria"},"min_score":{"type":"integer","maximum":100,"minimum":0,"title":"Min Score","description":"Leads below this score are dropped","default":60},"id":{"type":"string","title":"Id"},"org_id":{"type":"string","title":"Org Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","id","org_id","created_at","updated_at"],"title":"ICPProfileResponse","description":"Schema for ICP profile response."},"ICPProfileUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"criteria":{"anyOf":[{"$ref":"#/components/schemas/ICPCriteria"},{"type":"null"}]},"min_score":{"anyOf":[{"type":"integer","maximum":100,"minimum":0},{"type":"null"}],"title":"Min Score"}},"additionalProperties":false,"type":"object","title":"ICPProfileUpdate","description":"Schema for updating an existing ICP profile."},"IntrospectResponse":{"properties":{"active":{"type":"boolean","title":"Active"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"exp":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exp"}},"type":"object","required":["active"],"title":"IntrospectResponse","description":"OAuth 2.0 token introspection response (RFC 7662)."},"InvitationAccept":{"properties":{"token":{"type":"string","title":"Token","description":"Signed invitation token from the email link"}},"type":"object","required":["token"],"title":"InvitationAccept"},"InvitationCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Email address to invite"},"role":{"$ref":"#/components/schemas/OrgRole","description":"Role to assign upon acceptance","default":"viewer"}},"type":"object","required":["email"],"title":"InvitationCreate"},"InvitationListResponse":{"properties":{"invitations":{"items":{"$ref":"#/components/schemas/InvitationResponse"},"type":"array","title":"Invitations"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["invitations","total"],"title":"InvitationListResponse"},"InvitationResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"role":{"$ref":"#/components/schemas/OrgRole"},"status":{"$ref":"#/components/schemas/InvitationStatus"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"invited_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Invited By"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"}},"type":"object","required":["id","email","role","status","org_id"],"title":"InvitationResponse"},"InvitationStatus":{"type":"string","enum":["pending","accepted","expired","revoked"],"title":"InvitationStatus"},"KeyPerson":{"properties":{"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"}},"type":"object","required":["name","role"],"title":"KeyPerson","description":"A key person at an investment firm."},"LinkedCustomer":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["id"],"title":"LinkedCustomer","description":"A customer matched during note ingestion."},"LinkedDeal":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["id"],"title":"LinkedDeal","description":"A deal auto-linked during note ingestion."},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"LoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token","refresh_token"],"title":"LoginResponse"},"LogoutResponse":{"properties":{"revoked_tokens":{"type":"integer","title":"Revoked Tokens"}},"type":"object","required":["revoked_tokens"],"title":"LogoutResponse"},"LumaImportSummary":{"properties":{"imported":{"type":"integer","title":"Imported","default":0},"skipped_duplicate":{"type":"integer","title":"Skipped Duplicate","default":0},"skipped_unqualified":{"type":"integer","title":"Skipped Unqualified","default":0},"total":{"type":"integer","title":"Total","default":0},"event_name":{"type":"string","title":"Event Name","default":""}},"type":"object","title":"LumaImportSummary"},"LumaStatusResponse":{"properties":{"provider":{"type":"string","title":"Provider","default":"luma"},"status":{"type":"string","title":"Status"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"checked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checked At"},"cached":{"type":"boolean","title":"Cached","default":false}},"type":"object","required":["status"],"title":"LumaStatusResponse"},"MeetingAttendee":{"properties":{"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"response_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Status"}},"type":"object","required":["email"],"title":"MeetingAttendee","description":"An attendee on a calendar meeting."},"MeetingListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MeetingRecord"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page","default":1},"page_size":{"type":"integer","title":"Page Size","default":50}},"type":"object","required":["items","total"],"title":"MeetingListResponse","description":"Paginated list of meetings."},"MeetingRecord":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"title":{"type":"string","title":"Title"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"attendees":{"items":{"$ref":"#/components/schemas/MeetingAttendee"},"type":"array","title":"Attendees"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"meeting_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meeting Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"customer_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Customer Ids","description":"Linked CRM customer IDs (matched by attendee email)"},"deal_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Deal Id"},"provider":{"$ref":"#/components/schemas/CalendarProvider"},"external_id":{"type":"string","title":"External Id","description":"Calendar provider event ID"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","org_id","title","start_time","end_time","provider","external_id","created_at"],"title":"MeetingRecord","description":"A synced calendar meeting stored in ZeroDB."},"MemberListResponse":{"properties":{"members":{"items":{"$ref":"#/components/schemas/MemberResponse"},"type":"array","title":"Members"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["members","total"],"title":"MemberListResponse"},"MemberResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"role":{"$ref":"#/components/schemas/OrgRole"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"}},"type":"object","required":["id","email","name","role"],"title":"MemberResponse","description":"A single org member, rendered from a ``users`` row with its\n``org_members`` role merged in by ``AuthService.list_organization_members``."},"Note":{"properties":{"entity_type":{"type":"string","maxLength":50,"minLength":1,"title":"Entity Type","description":"Type of parent entity (e.g., 'deal', 'customer')"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id","description":"ID of the parent entity"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title","description":"Optional note title"},"content":{"type":"string","maxLength":10000,"minLength":1,"title":"Content","description":"Note body text"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata (e.g. call-intelligence signals)"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version","default":1},"created_at":{"type":"string","format":"date-time","title":"Created At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["entity_type","entity_id","content","id","org_id","created_at"],"title":"Note","description":"Schema for Note response."},"NoteCreate":{"properties":{"entity_type":{"type":"string","maxLength":50,"minLength":1,"title":"Entity Type","description":"Type of parent entity (e.g., 'deal', 'customer')"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id","description":"ID of the parent entity"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title","description":"Optional note title"},"content":{"type":"string","maxLength":10000,"minLength":1,"title":"Content","description":"Note body text"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata (e.g. call-intelligence signals)"}},"type":"object","required":["entity_type","entity_id","content"],"title":"NoteCreate","description":"Schema for creating a new note."},"NoteIngestRequest":{"properties":{"source":{"type":"string","maxLength":100,"minLength":1,"title":"Source","description":"Source tool name (e.g., 'otter.ai', 'fireflies.ai', 'manual')"},"meeting_title":{"type":"string","maxLength":255,"minLength":1,"title":"Meeting Title","description":"Title of the meeting"},"attendees":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Attendees","description":"List of attendee email addresses"},"transcript":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"title":"Transcript","description":"Full meeting transcript (used for AI summarization when summary is empty)"},"summary":{"type":"string","maxLength":10000,"title":"Summary","description":"Meeting summary (auto-generated from transcript if empty)","default":""},"action_items":{"items":{"type":"string"},"type":"array","title":"Action Items","description":"List of action items extracted from the meeting"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Arbitrary metadata from the source tool"}},"type":"object","required":["source","meeting_title","attendees"],"title":"NoteIngestRequest","description":"Schema for ingesting meeting notes from external tools."},"NoteIngestResponse":{"properties":{"note_id":{"type":"string","format":"uuid","title":"Note Id"},"linked_customers":{"items":{"$ref":"#/components/schemas/LinkedCustomer"},"type":"array","title":"Linked Customers"},"linked_deals":{"items":{"$ref":"#/components/schemas/LinkedDeal"},"type":"array","title":"Linked Deals"},"tasks_created":{"type":"integer","title":"Tasks Created","default":0},"summary":{"type":"string","title":"Summary","default":""},"signals":{"$ref":"#/components/schemas/CallSignals","description":"Structured buying signals extracted from the transcript"},"extraction_status":{"type":"string","title":"Extraction Status","description":"'ok', 'empty', 'failed', or 'skipped' — lets the caller tell an extraction failure apart from a call with nothing to extract (#560)","default":"skipped"},"extraction_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Error","description":"Human-readable reason when extraction_status is not 'ok'"},"transcript_truncated":{"type":"boolean","title":"Transcript Truncated","description":"True when the source transcript exceeded the extraction service's length limit and was cut before being analyzed -- an 'ok' extraction with this set may be missing signals discussed after the cutoff","default":false}},"type":"object","required":["note_id"],"title":"NoteIngestResponse","description":"Response from the note ingestion endpoint."},"NoteUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title","description":"Updated title"},"content":{"anyOf":[{"type":"string","maxLength":10000,"minLength":1},{"type":"null"}],"title":"Content","description":"Updated content"}},"type":"object","title":"NoteUpdate","description":"Schema for updating an existing note."},"OAuthAppCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"redirect_uri":{"type":"string","maxLength":2048,"minLength":1,"title":"Redirect Uri"},"description":{"type":"string","maxLength":1024,"title":"Description","default":""}},"additionalProperties":false,"type":"object","required":["name","redirect_uri"],"title":"OAuthAppCreate","description":"Request body for registering a new OAuth application."},"OAuthAppResponse":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id"},"name":{"type":"string","title":"Name"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"description":{"type":"string","title":"Description","default":""},"created_at":{"type":"string","title":"Created At"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["id","client_id","name","redirect_uri","created_at"],"title":"OAuthAppResponse","description":"Public metadata for a registered OAuth application."},"ObjectCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"icon":{"type":"string","maxLength":50,"title":"Icon","default":"cube"},"fields":{"items":{"$ref":"#/components/schemas/FieldDefinition"},"type":"array","minItems":1,"title":"Fields","description":"At least one field is required"}},"type":"object","required":["name","fields"],"title":"ObjectCreate","description":"Schema for creating a custom object definition."},"ObjectDefinition":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"icon":{"type":"string","title":"Icon"},"fields":{"items":{"$ref":"#/components/schemas/FieldDefinition"},"type":"array","title":"Fields"},"version":{"type":"integer","title":"Version","default":1},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["id","org_id","name","slug","icon","fields","created_at","updated_at"],"title":"ObjectDefinition","description":"Response model for a custom object definition."},"ObjectDefinitionList":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"icon":{"type":"string","title":"Icon"},"field_count":{"type":"integer","title":"Field Count","description":"Number of fields defined"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","slug","icon","field_count","created_at","updated_at"],"title":"ObjectDefinitionList","description":"Compact response for listing custom objects."},"ObjectPermission":{"properties":{"object_type":{"type":"string","maxLength":100,"minLength":1,"title":"Object Type"},"can_create":{"type":"boolean","title":"Can Create","default":false},"can_read":{"type":"boolean","title":"Can Read","default":false},"can_update":{"type":"boolean","title":"Can Update","default":false},"can_delete":{"type":"boolean","title":"Can Delete","default":false},"field_permissions":{"items":{"$ref":"#/components/schemas/FieldPermission"},"type":"array","title":"Field Permissions"}},"type":"object","required":["object_type"],"title":"ObjectPermission","description":"CRUD + field-level permissions for a single CRM object type."},"ObjectUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"icon":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Icon"},"fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldDefinition"},"type":"array"},{"type":"null"}],"title":"Fields"}},"additionalProperties":false,"type":"object","title":"ObjectUpdate","description":"Schema for updating a custom object definition."},"OnboardingChecklistResponse":{"properties":{"steps":{"items":{"$ref":"#/components/schemas/OnboardingStep"},"type":"array","title":"Steps"},"completed_count":{"type":"integer","title":"Completed Count"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["steps","completed_count","total"],"title":"OnboardingChecklistResponse","description":"Response payload for ``GET /users/me/onboarding``."},"OnboardingStep":{"properties":{"key":{"type":"string","title":"Key","description":"Stable machine identifier for this step"},"label":{"type":"string","title":"Label","description":"Human-readable label shown in the UI"},"completed":{"type":"boolean","title":"Completed","description":"Whether the step is satisfied"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"UTC timestamp when the step first transitioned to completed"},"dismissed":{"type":"boolean","title":"Dismissed","description":"Whether the user has explicitly dismissed this step","default":false}},"type":"object","required":["key","label","completed"],"title":"OnboardingStep","description":"A single step in the user's onboarding checklist."},"OrgRole":{"type":"string","enum":["admin","sales_rep","viewer"],"title":"OrgRole","description":"Organization membership roles for RBAC."},"OrgWideDefault":{"properties":{"object_type":{"type":"string","maxLength":100,"minLength":1,"title":"Object Type","description":"CRM object type, e.g. 'customers', 'deals'"},"access_level":{"type":"string","enum":["private","read_only","read_write"],"title":"Access Level","description":"Default access level for all users without an explicit profile override"}},"type":"object","required":["object_type","access_level"],"title":"OrgWideDefault","description":"Per-object-type default access level for the entire organisation."},"OutreachCampaignCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Campaign name"},"sequence":{"$ref":"#/components/schemas/OutreachSequence","description":"Outreach sequence to execute"},"customer_ids":{"items":{"type":"string","format":"uuid"},"type":"array","minItems":1,"title":"Customer Ids","description":"Target customer IDs"},"pipeline_id":{"type":"string","format":"uuid","title":"Pipeline Id","description":"Pipeline to associate deals with"},"stage_id":{"type":"string","format":"uuid","title":"Stage Id","description":"Stage to place new deals into"},"send_window":{"$ref":"#/components/schemas/SendWindow","description":"When this campaign is permitted to send. Sends attempted outside the window are deferred until it next opens, never dropped. Defaults to Mon-Fri 09:00-17:00 UTC with no rate limit."},"exit_criteria":{"$ref":"#/components/schemas/OutreachExitCriteria","description":"Conditions that remove a recipient from the sequence early"}},"type":"object","required":["name","sequence","customer_ids","pipeline_id","stage_id"],"title":"OutreachCampaignCreate","description":"Payload for creating a new outreach campaign."},"OutreachCampaignResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Campaign ID"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status","description":"Current campaign status"},"step_count":{"type":"integer","title":"Step Count","description":"Number of steps in the sequence"},"customer_count":{"type":"integer","title":"Customer Count","description":"Number of targeted customers"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"org_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Org Id"}},"type":"object","required":["id","name","status","step_count","customer_count","created_at"],"title":"OutreachCampaignResponse","description":"Response returned after campaign creation or retrieval."},"OutreachExitCriteria":{"properties":{"stop_on_unsubscribe":{"type":"boolean","title":"Stop On Unsubscribe","description":"Stop sending to a recipient who has unsubscribed (opted out via the public unsubscribe endpoint) or who is on the existing-relationship cold-outreach suppression list.","default":true},"stop_on_stage_change":{"type":"boolean","title":"Stop On Stage Change","description":"Stop sending once any deal linked to the recipient has moved off the campaign's target stage — i.e. the recipient has progressed and no longer needs cold follow-up.","default":false},"stop_on_reply":{"type":"boolean","title":"Stop On Reply","description":"Stop sending once the recipient's address produces a reply, bounce, or spam complaint. Reply detection is signaled by the Resend inbound/event webhook (issue #614): outbound sends carry a correlation tag, and POST /webhooks/resend maps email.bounced / email.complained (always observable) and, when Resend inbound parsing is configured on the sending domain, email.received (best-effort reply signal — Resend's event catalog has no dedicated 'reply' event) back to this campaign/recipient and records the exit. Note this only covers email steps; LinkedIn replies are not observed.","default":false}},"type":"object","title":"OutreachExitCriteria","description":"Conditions that remove a recipient from a sequence before it finishes.\n\nEach enabled criterion is evaluated immediately before every sequence\nstep, so a recipient who exits mid-sequence receives no further steps."},"OutreachJobStatus":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Unique job identifier"},"campaign_id":{"type":"string","title":"Campaign Id","description":"Associated campaign ID"},"status":{"type":"string","title":"Status","description":"Job status: queued | running | completed | failed"},"total":{"type":"integer","title":"Total","description":"Total outreach actions planned","default":0},"sent":{"type":"integer","title":"Sent","description":"Actions successfully sent / queued","default":0},"failed":{"type":"integer","title":"Failed","description":"Actions that failed","default":0},"created_at":{"type":"string","title":"Created At","description":"ISO-8601 creation timestamp"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At","description":"ISO-8601 completion timestamp"}},"type":"object","required":["job_id","campaign_id","status","created_at"],"title":"OutreachJobStatus","description":"Status of an outreach background job."},"OutreachRecipientRemove":{"properties":{"customer_id":{"type":"string","format":"uuid","title":"Customer Id","description":"Customer to remove from the campaign's sequence"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note","description":"Optional reason recorded on the exit"}},"type":"object","required":["customer_id"],"title":"OutreachRecipientRemove","description":"Payload for manually removing one recipient from an active sequence."},"OutreachSequence":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Sequence name"},"steps":{"items":{"$ref":"#/components/schemas/OutreachStep"},"type":"array","minItems":1,"title":"Steps","description":"Ordered list of outreach steps"}},"type":"object","required":["name","steps"],"title":"OutreachSequence","description":"An ordered list of outreach steps with a human-readable name."},"OutreachStep":{"properties":{"step_type":{"$ref":"#/components/schemas/StepType","description":"Channel for this step"},"delay_days":{"type":"integer","minimum":0,"title":"Delay Days","description":"Days to wait after the previous step before sending","default":0},"subject":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Subject","description":"Email subject line (ignored for LinkedIn steps)"},"body_template":{"type":"string","maxLength":5000,"minLength":1,"title":"Body Template","description":"Message body. Supports {{name}}, {{company}}, {{title}} placeholders"}},"type":"object","required":["step_type","body_template"],"title":"OutreachStep","description":"A single step within an outreach sequence."},"PaginatedAuditLogs":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AuditLog"},"type":"array","title":"Items"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"},"total_pages":{"type":"integer","title":"Total Pages"}},"type":"object","required":["items","page","page_size","total","total_pages"],"title":"PaginatedAuditLogs"},"PaginatedCalls":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CallListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"PaginatedCalls","description":"Paginated response for the Calls list."},"PaginatedComments":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Comment"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"PaginatedComments","description":"Paginated response for comment list."},"PaginatedCustomers":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CustomerList"},"type":"array","title":"Items"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"},"total_pages":{"type":"integer","title":"Total Pages"}},"type":"object","required":["items","page","page_size","total","total_pages"],"title":"PaginatedCustomers","description":"Paginated response for customer list."},"PaginatedNotes":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Note"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"PaginatedNotes","description":"Paginated response for note list."},"PasswordResetConfirm":{"properties":{"token":{"type":"string","minLength":1,"title":"Token","description":"One-time reset token from the email link"},"new_password":{"type":"string","minLength":1,"title":"New Password","description":"New plaintext password"}},"type":"object","required":["token","new_password"],"title":"PasswordResetConfirm","description":"Body for POST /auth/password-reset/confirm."},"PasswordResetConfirmResponse":{"properties":{"status":{"type":"string","title":"Status","default":"ok"}},"type":"object","title":"PasswordResetConfirmResponse","description":"Successful confirmation response."},"PasswordResetRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Email of the account requesting a reset"}},"type":"object","required":["email"],"title":"PasswordResetRequest","description":"Body for POST /auth/password-reset/request."},"PaymentHistoryItem":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"status":{"type":"string","title":"Status"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"}},"type":"object","required":["id","type","status","occurred_at"],"title":"PaymentHistoryItem","description":"A billing event shown in payment history."},"PaymentHistoryResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PaymentHistoryItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"PaymentHistoryResponse","description":"Payment history response."},"Pipeline":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"stages":{"items":{"$ref":"#/components/schemas/Stage"},"type":"array","title":"Stages"}},"type":"object","required":["name","id","org_id","version","created_at","updated_at"],"title":"Pipeline","description":"Schema for Pipeline response with nested stages."},"PipelineCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"stages":{"items":{"$ref":"#/components/schemas/StageCreate"},"type":"array","title":"Stages"}},"type":"object","required":["name"],"title":"PipelineCreate","description":"Schema for creating a new pipeline."},"PipelineList":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["name","id","org_id","version","created_at","updated_at"],"title":"PipelineList","description":"Schema for Pipeline in list responses (without nested stages)."},"PipelineUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Required for optimistic locking"}},"additionalProperties":false,"type":"object","title":"PipelineUpdate","description":"Schema for updating an existing pipeline."},"PortalSessionRequest":{"properties":{"return_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Return Url","description":"Where to send the user after they leave the Stripe portal."}},"type":"object","title":"PortalSessionRequest","description":"Optional overrides for a Stripe Customer Portal session.\n\n``return_url`` is validated against the application's configured frontend\norigin allowlist in :class:`app.services.billing_service.BillingService` so\nthat callers cannot use this endpoint as an open redirect."},"PortalSessionResponse":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"expires_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires At","description":"Unix timestamp at which the portal session URL stops working."}},"type":"object","required":["url"],"title":"PortalSessionResponse","description":"Stripe Customer Portal session URL."},"Product":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"sku":{"type":"string","maxLength":100,"minLength":1,"title":"Sku"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"price":{"type":"string","title":"Price"},"cost":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost"},"is_active":{"type":"boolean","title":"Is Active","default":true},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["name","sku","price","id","org_id","version","created_at","updated_at"],"title":"Product","description":"Schema for Product response."},"ProductCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"sku":{"type":"string","maxLength":100,"minLength":1,"title":"Sku"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"price":{"anyOf":[{"type":"number","minimum":0},{"type":"string"}],"title":"Price"},"cost":{"anyOf":[{"type":"number","minimum":0},{"type":"string"},{"type":"null"}],"title":"Cost"},"is_active":{"type":"boolean","title":"Is Active","default":true},"meta":{"additionalProperties":true,"type":"object","title":"Meta"}},"type":"object","required":["name","sku","price"],"title":"ProductCreate","description":"Schema for creating a new product."},"ProductList":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"sku":{"type":"string","maxLength":100,"minLength":1,"title":"Sku"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"price":{"type":"string","title":"Price"},"cost":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost"},"is_active":{"type":"boolean","title":"Is Active","default":true},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","sku","price","id","org_id","version","created_at","updated_at"],"title":"ProductList","description":"Schema for Product in list responses."},"ProductUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"sku":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Sku"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"price":{"anyOf":[{"type":"number","minimum":0},{"type":"string"},{"type":"null"}],"title":"Price"},"cost":{"anyOf":[{"type":"number","minimum":0},{"type":"string"},{"type":"null"}],"title":"Cost"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Required for optimistic locking"}},"additionalProperties":false,"type":"object","title":"ProductUpdate","description":"Schema for updating an existing product."},"ProfileCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Human-readable profile name"},"object_permissions":{"items":{"$ref":"#/components/schemas/ObjectPermission"},"type":"array","title":"Object Permissions"}},"type":"object","required":["name"],"title":"ProfileCreate","description":"Payload for creating a security profile."},"ProfileResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"org_id":{"type":"string","title":"Org Id"},"object_permissions":{"items":{"$ref":"#/components/schemas/ObjectPermission"},"type":"array","title":"Object Permissions"}},"type":"object","required":["id","name","org_id"],"title":"ProfileResponse","description":"Security profile returned from the API."},"ProfileUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"object_permissions":{"anyOf":[{"items":{"$ref":"#/components/schemas/ObjectPermission"},"type":"array"},{"type":"null"}],"title":"Object Permissions"}},"type":"object","title":"ProfileUpdate","description":"Payload for updating a security profile."},"QuickBooksConfigureRequest":{"properties":{"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"},"access_token":{"type":"string","title":"Access Token"},"realm_id":{"type":"string","title":"Realm Id"}},"type":"object","required":["client_id","client_secret","access_token","realm_id"],"title":"QuickBooksConfigureRequest","description":"Credentials for QuickBooks Online.\n\naccess_token and client_secret are write-only and never echoed back."},"QuickBooksConfigureResponse":{"properties":{"client_id":{"type":"string","title":"Client Id"},"realm_id":{"type":"string","title":"Realm Id"},"configured":{"type":"boolean","title":"Configured","default":true}},"type":"object","required":["client_id","realm_id"],"title":"QuickBooksConfigureResponse"},"RecordCreate":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Record data validated against the object's field schema"}},"type":"object","required":["data"],"title":"RecordCreate","description":"Schema for creating a record in a custom object table."},"RecordResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"object_slug":{"type":"string","title":"Object Slug"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"version":{"type":"integer","title":"Version","default":1},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["id","org_id","object_slug","data","created_at","updated_at"],"title":"RecordResponse","description":"Response model for a single custom object record."},"RecordUpdate":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Partial record data validated against the object's field schema"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Required for optimistic locking"}},"additionalProperties":false,"type":"object","required":["data"],"title":"RecordUpdate","description":"Schema for updating a record in a custom object table."},"RegisterRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"company":{"type":"string","title":"Company","default":""}},"type":"object","required":["name","email","password"],"title":"RegisterRequest"},"RenameFieldRequest":{"properties":{"display_label":{"type":"string","maxLength":200,"minLength":1,"title":"Display Label"}},"additionalProperties":false,"type":"object","required":["display_label"],"title":"RenameFieldRequest","description":"Request body for renaming a field's display label."},"RevokeRequest":{"properties":{"token":{"type":"string","title":"Token"}},"additionalProperties":false,"type":"object","required":["token"],"title":"RevokeRequest","description":"Token revocation request."},"RevokeResponse":{"properties":{"revoked":{"type":"boolean","title":"Revoked"}},"type":"object","required":["revoked"],"title":"RevokeResponse"},"SCIMTokenResponse":{"properties":{"id":{"type":"string","title":"Id"},"org_id":{"type":"string","title":"Org Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token","description":"Plaintext bearer token. Returned only at creation time."},"scim_base_url":{"type":"string","title":"Scim Base Url"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","org_id","name","prefix","scim_base_url"],"title":"SCIMTokenResponse","description":"A freshly minted SCIM bearer token. The plaintext is shown once."},"SSOAuthorizeResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"},"state":{"type":"string","title":"State"},"redirect_uri":{"type":"string","title":"Redirect Uri","description":"The exact redirect_uri embedded in authorization_url. OIDC requires the token exchange to present a byte-identical value, so the caller must replay this on POST /sso/callback rather than recomputing it.","default":""}},"type":"object","required":["authorization_url","state"],"title":"SSOAuthorizeResponse","description":"Where the browser should send the user to start IdP authentication."},"SSOCallbackRequest":{"properties":{"code":{"type":"string","minLength":1,"title":"Code"},"state":{"type":"string","minLength":1,"title":"State"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri","description":"Must match the redirect_uri used to start the flow."}},"type":"object","required":["code","state"],"title":"SSOCallbackRequest","description":"Authorization code returned by the IdP, exchanged for a ZeroPipeline JWT."},"SSOCallbackResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"email":{"type":"string","title":"Email"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token","email"],"title":"SSOCallbackResponse","description":"Mirrors the Google login response so the frontend can share a code path."},"SSOConnectionCreate":{"properties":{"protocol":{"$ref":"#/components/schemas/SSOProtocol","description":"Federation protocol. Only 'oidc' is supported in v1.","default":"oidc"},"display_name":{"type":"string","maxLength":120,"minLength":1,"title":"Display Name","description":"Label shown on the SSO sign-in button (e.g. 'Acme Okta')."},"issuer":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Issuer","description":"OIDC issuer URL, e.g. https://acme.okta.com. Discovery metadata is fetched from {issuer}/.well-known/openid-configuration."},"client_id":{"type":"string","maxLength":255,"minLength":1,"title":"Client Id"},"email_domains":{"items":{"type":"string"},"type":"array","title":"Email Domains","description":"Email domains this connection claims (e.g. ['acme.com']). Used to route a user to the right IdP from the login page, and to reject IdP-asserted identities from outside the org's own domains."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether members may use this connection to sign in.","default":true},"client_secret":{"type":"string","minLength":1,"title":"Client Secret","description":"OIDC client secret. Stored encrypted-at-rest and never returned."}},"type":"object","required":["display_name","issuer","client_id","client_secret"],"title":"SSOConnectionCreate","description":"Create/replace payload. The client secret is write-only."},"SSOConnectionResponse":{"properties":{"id":{"type":"string","title":"Id"},"org_id":{"type":"string","title":"Org Id"},"protocol":{"$ref":"#/components/schemas/SSOProtocol"},"display_name":{"type":"string","title":"Display Name"},"issuer":{"type":"string","title":"Issuer"},"client_id":{"type":"string","title":"Client Id"},"email_domains":{"items":{"type":"string"},"type":"array","title":"Email Domains"},"enabled":{"type":"boolean","title":"Enabled"},"client_secret_set":{"type":"boolean","title":"Client Secret Set","description":"True when a client secret is stored. The secret itself is never returned."},"callback_url":{"type":"string","title":"Callback Url","description":"Redirect URI to register with the IdP."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"last_login_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login At"}},"type":"object","required":["id","org_id","protocol","display_name","issuer","client_id","email_domains","enabled","client_secret_set","callback_url"],"title":"SSOConnectionResponse","description":"Connection as returned to an admin. Never includes the client secret."},"SSOConnectionUpdate":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Display Name"},"issuer":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Issuer"},"client_id":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Client Secret"},"email_domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Domains"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"SSOConnectionUpdate","description":"Partial update. Omitted fields keep their stored value."},"SSODiscoveryResponse":{"properties":{"sso_enabled":{"type":"boolean","title":"Sso Enabled"},"org_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"protocol":{"anyOf":[{"$ref":"#/components/schemas/SSOProtocol"},{"type":"null"}]}},"type":"object","required":["sso_enabled"],"title":"SSODiscoveryResponse","description":"Unauthenticated login-page probe: does this email domain use SSO?"},"SSOProtocol":{"type":"string","enum":["oidc"],"title":"SSOProtocol","description":"Identity-federation protocol used by the org's IdP connection.\n\nOnly OIDC is implemented in v1 — every IdP ZeroPipeline targets (Okta,\nAzure AD / Entra ID, Google Workspace) exposes an OIDC endpoint, and OIDC\nreuses the existing OAuth code-exchange path already proven by the Google\nlogin flow. The enum exists so a SAML connection can be added later\nwithout a breaking change to stored rows or the public API shape."},"SSOSettingsResponse":{"properties":{"plan":{"type":"string","title":"Plan"},"sso_entitled":{"type":"boolean","title":"Sso Entitled","description":"True when the org's plan includes SSO/SCIM (Enterprise)."},"connection":{"anyOf":[{"$ref":"#/components/schemas/SSOConnectionResponse"},{"type":"null"}]},"scim_tokens":{"items":{"$ref":"#/components/schemas/SCIMTokenResponse"},"type":"array","title":"Scim Tokens"}},"type":"object","required":["plan","sso_entitled"],"title":"SSOSettingsResponse","description":"Everything the Security tab needs in one call."},"SendWindow":{"properties":{"allowed_days":{"items":{"type":"integer"},"type":"array","maxItems":7,"minItems":1,"title":"Allowed Days","description":"Allowed ISO weekdays on which sends may occur (1=Monday .. 7=Sunday). Defaults to Mon-Fri."},"start_hour":{"type":"integer","maximum":23,"minimum":0,"title":"Start Hour","description":"First hour of the send window, inclusive (0-23), org-local","default":9},"end_hour":{"type":"integer","maximum":24,"minimum":1,"title":"End Hour","description":"End of the send window, exclusive (1-24), org-local. 9-17 permits 09:00 through 16:59.","default":17},"timezone":{"type":"string","maxLength":64,"minLength":1,"title":"Timezone","description":"IANA timezone name the hours are expressed in, e.g. America/New_York","default":"UTC"},"max_sends_per_hour":{"type":"integer","maximum":10000,"minimum":0,"title":"Max Sends Per Hour","description":"Maximum sends permitted per rolling hour. 0 disables rate limiting.","default":0}},"type":"object","title":"SendWindow","description":"Constrains *when* a campaign's steps are allowed to send.\n\nHours are interpreted in ``timezone`` (org-local). Recipient-local\nevaluation is not supported because the customer model carries no\ntimezone field — see ``app/services/send_window.py`` for the rationale."},"Stage":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"order_index":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Order Index"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"color":{"anyOf":[{"type":"string","maxLength":7,"pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Color","description":"Hex color for the stage column header, e.g. #6366f1"},"rules":{"$ref":"#/components/schemas/StageRules"},"id":{"type":"string","format":"uuid","title":"Id"},"pipeline_id":{"type":"string","format":"uuid","title":"Pipeline Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["name","id","pipeline_id","org_id","version","created_at","updated_at"],"title":"Stage","description":"Schema for Stage response."},"StageCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"order_index":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Order Index"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"color":{"anyOf":[{"type":"string","maxLength":7,"pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Color","description":"Hex color for the stage column header, e.g. #6366f1"},"rules":{"$ref":"#/components/schemas/StageRules"}},"type":"object","required":["name"],"title":"StageCreate","description":"Schema for creating a new stage."},"StageRules":{"properties":{"required_fields":{"items":{"type":"string"},"type":"array","title":"Required Fields"},"disallow_skip":{"type":"boolean","title":"Disallow Skip","default":false},"allowed_next_stage_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Allowed Next Stage Ids"}},"additionalProperties":false,"type":"object","title":"StageRules","description":"Validation rules for stage transitions.\n\nAttributes:\n    required_fields: List of deal field names that must be populated\n    disallow_skip: If true, deals cannot skip directly to stages after this one\n    allowed_next_stage_ids: Whitelist of stage IDs that can follow this stage"},"StageUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"order_index":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Order Index"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"color":{"anyOf":[{"type":"string","maxLength":7,"pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Color"},"rules":{"anyOf":[{"$ref":"#/components/schemas/StageRules"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"StageUpdate","description":"Schema for updating an existing stage."},"StartupProgramApplication":{"properties":{"company_name":{"type":"string","maxLength":200,"minLength":1,"title":"Company Name"},"founder_name":{"type":"string","maxLength":200,"minLength":1,"title":"Founder Name"},"email":{"type":"string","format":"email","title":"Email"},"website":{"type":"string","maxLength":500,"title":"Website","default":""},"funding_stage":{"type":"string","maxLength":100,"minLength":1,"title":"Funding Stage"},"description":{"type":"string","maxLength":4000,"minLength":1,"title":"Description"}},"type":"object","required":["company_name","founder_name","email","funding_stage","description"],"title":"StartupProgramApplication","description":"Body for POST /startup-program/apply.\n\nSubmitted from the public, unauthenticated marketing page at\n/startup-program — there is no org/user context yet."},"StartupProgramApplicationResponse":{"properties":{"status":{"type":"string","title":"Status","default":"received"},"message":{"type":"string","title":"Message","default":"Thanks — we'll review your application and follow up within 2 business days."}},"type":"object","title":"StartupProgramApplicationResponse","description":"Successful submission response."},"StepType":{"type":"string","enum":["email","linkedin"],"title":"StepType","description":"Supported outreach step types."},"SubscriptionCancelRequest":{"properties":{"at_period_end":{"type":"boolean","title":"At Period End","description":"Whether to cancel at the current billing period end","default":true}},"type":"object","title":"SubscriptionCancelRequest","description":"Request payload for canceling a subscription."},"SubscriptionUpdateRequest":{"properties":{"plan":{"$ref":"#/components/schemas/BillingPlan","description":"Target plan tier"}},"type":"object","required":["plan"],"title":"SubscriptionUpdateRequest","description":"Request payload for changing an active subscription."},"TagCoverageStats":{"properties":{"total":{"type":"integer","title":"Total"},"tagged":{"type":"integer","title":"Tagged"},"untagged":{"type":"integer","title":"Untagged"},"by_source":{"items":{"$ref":"#/components/schemas/TagSourceStat"},"type":"array","title":"By Source"},"by_tag":{"items":{"$ref":"#/components/schemas/TagStat"},"type":"array","title":"By Tag"}},"type":"object","required":["total","tagged","untagged","by_source","by_tag"],"title":"TagCoverageStats","description":"Aggregate tag coverage statistics across all contacts."},"TagSourceStat":{"properties":{"source":{"type":"string","title":"Source"},"count":{"type":"integer","title":"Count"},"tagged_count":{"type":"integer","title":"Tagged Count"}},"type":"object","required":["source","count","tagged_count"],"title":"TagSourceStat","description":"Per-source breakdown in tag coverage stats."},"TagStat":{"properties":{"tag":{"type":"string","title":"Tag"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["tag","count"],"title":"TagStat","description":"Per-tag count in tag coverage stats."},"Task":{"properties":{"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"assignee_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assignee Id"},"related_to_type":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Related To Type"},"related_to_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Related To Id"},"priority":{"$ref":"#/components/schemas/TaskPriority","default":"medium"},"status":{"$ref":"#/components/schemas/TaskStatus","default":"todo"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["title","id","org_id","version","created_at","updated_at"],"title":"Task","description":"Schema for Task response."},"TaskCreate":{"properties":{"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"assignee_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assignee Id"},"related_to_type":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Related To Type"},"related_to_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Related To Id"},"priority":{"$ref":"#/components/schemas/TaskPriority","default":"medium"},"status":{"$ref":"#/components/schemas/TaskStatus","default":"todo"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"}},"type":"object","required":["title"],"title":"TaskCreate","description":"Schema for creating a new task."},"TaskList":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"title":{"type":"string","title":"Title"},"assignee_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assignee Id"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"status":{"$ref":"#/components/schemas/TaskStatus"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","org_id","title","priority","status","version","created_at","updated_at"],"title":"TaskList","description":"Schema for Task in list responses."},"TaskPriority":{"type":"string","enum":["low","medium","high","urgent"],"title":"TaskPriority","description":"Task priority levels."},"TaskStatus":{"type":"string","enum":["todo","in_progress","done","cancelled"],"title":"TaskStatus","description":"Task status values."},"TaskUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"assignee_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assignee Id"},"related_to_type":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Related To Type"},"related_to_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Related To Id"},"priority":{"anyOf":[{"$ref":"#/components/schemas/TaskPriority"},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/TaskStatus"},{"type":"null"}]},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Required for optimistic locking"}},"additionalProperties":false,"type":"object","title":"TaskUpdate","description":"Schema for updating an existing task."},"TokenPairResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["access_token","refresh_token","expires_in"],"title":"TokenPairResponse"},"TokenRefreshRequest":{"properties":{"token":{"type":"string","title":"Token","description":"Access or refresh token to exchange"}},"type":"object","required":["token"],"title":"TokenRefreshRequest"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"Bearer"},"expires_in":{"type":"integer","title":"Expires In"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"scope":{"type":"string","title":"Scope","default":""}},"type":"object","required":["access_token","expires_in"],"title":"TokenResponse","description":"OAuth 2.0 token response."},"TokenRevokeRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token","description":"Refresh token to revoke"}},"type":"object","required":["refresh_token"],"title":"TokenRevokeRequest"},"TrialCheckoutRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"}},"type":"object","required":["email"],"title":"TrialCheckoutRequest"},"TrialCheckoutResponse":{"properties":{"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","title":"TrialCheckoutResponse"},"TriggerConfigSchema":{"properties":{"from_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Stage"},"to_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Stage"},"extra":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra"}},"type":"object","title":"TriggerConfigSchema","description":"Configuration for an automation trigger."},"TriggerEventRequest":{"properties":{"event_type":{"type":"string","maxLength":100,"title":"Event Type"},"event_data":{"additionalProperties":true,"type":"object","title":"Event Data"}},"type":"object","required":["event_type"],"title":"TriggerEventRequest","description":"Schema for manually triggering an event."},"TwilioConfigureRequest":{"properties":{"account_sid":{"type":"string","title":"Account Sid"},"auth_token":{"type":"string","title":"Auth Token"},"from_number":{"type":"string","title":"From Number"}},"type":"object","required":["account_sid","auth_token","from_number"],"title":"TwilioConfigureRequest"},"TwilioConfigureResponse":{"properties":{"account_sid":{"type":"string","title":"Account Sid"},"from_number":{"type":"string","title":"From Number"},"configured":{"type":"boolean","title":"Configured","default":true}},"type":"object","required":["account_sid","from_number"],"title":"TwilioConfigureResponse"},"UsageResourceSnapshot":{"properties":{"current":{"type":"integer","title":"Current"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"},"percent_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Percent Used"},"warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning"}},"type":"object","required":["current"],"title":"UsageResourceSnapshot","description":"Usage snapshot for a single billable resource."},"UserProfileResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"job_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Title"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","email","created_at","updated_at"],"title":"UserProfileResponse","description":"Schema for user profile response."},"UserProfileUpdate":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone"},"job_title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Job Title"},"department":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Department"},"location":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Location"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"}},"additionalProperties":false,"type":"object","title":"UserProfileUpdate","description":"Schema for updating the current user's profile."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ViewCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"entity_type":{"type":"string","maxLength":50,"minLength":1,"title":"Entity Type"},"filters":{"additionalProperties":true,"type":"object","title":"Filters"},"sort":{"additionalProperties":true,"type":"object","title":"Sort"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns"},"shared":{"type":"boolean","title":"Shared","default":false}},"type":"object","required":["name","entity_type"],"title":"ViewCreate","description":"Schema for creating a new saved view."},"ViewFromTemplateCreate":{"properties":{"entity_type":{"type":"string","maxLength":50,"minLength":1,"title":"Entity Type"},"template_key":{"type":"string","maxLength":100,"minLength":1,"title":"Template Key"},"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Optional override for the view name"}},"type":"object","required":["entity_type","template_key"],"title":"ViewFromTemplateCreate","description":"Schema for creating a new saved view from a starter template."},"ViewResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"name":{"type":"string","title":"Name"},"entity_type":{"type":"string","title":"Entity Type"},"filters":{"additionalProperties":true,"type":"object","title":"Filters"},"sort":{"additionalProperties":true,"type":"object","title":"Sort"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns"},"shared":{"type":"boolean","title":"Shared","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["id","org_id","name","entity_type","created_at","updated_at"],"title":"ViewResponse","description":"Schema for Saved View response."},"ViewTemplate":{"properties":{"key":{"type":"string","title":"Key","description":"Stable identifier for the template"},"entity_type":{"type":"string","title":"Entity Type"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"filters":{"additionalProperties":true,"type":"object","title":"Filters"},"sort":{"additionalProperties":true,"type":"object","title":"Sort"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns"}},"type":"object","required":["key","entity_type","name","description"],"title":"ViewTemplate","description":"A starter segment template a user can pick from when creating a view.\n\nTemplates pre-populate sensible filter/sort criteria for a common\nuse case (e.g. \"Open deals\", \"New leads\") instead of starting from a\nblank saved view. Filter keys are restricted to what the underlying\nlist endpoints actually support today."},"ViewUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters"},"sort":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Sort"},"columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Columns"},"shared":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Shared"}},"additionalProperties":false,"type":"object","title":"ViewUpdate","description":"Schema for updating an existing saved view."},"WebhookCreate":{"properties":{"url":{"type":"string","minLength":1,"format":"uri","title":"Url"},"events":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Events"},"secret":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Secret"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["url","events"],"title":"WebhookCreate","description":"Schema for registering a new webhook."},"WebhookDeliveryResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"webhook_id":{"type":"string","format":"uuid","title":"Webhook Id"},"event_type":{"type":"string","title":"Event Type"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"status":{"type":"string","title":"Status"},"attempts":{"type":"integer","title":"Attempts"},"response_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Status"},"response_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Body"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"next_retry_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Retry At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","webhook_id","event_type","payload","status","attempts","created_at","updated_at"],"title":"WebhookDeliveryResponse","description":"Schema for webhook delivery log entries."},"WebhookResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"updated_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["id","org_id","url","events","is_active","created_at","updated_at"],"title":"WebhookResponse","description":"Schema for webhook API responses (secret is never returned)."},"WebhookUpdate":{"properties":{"url":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"secret":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Secret"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"WebhookUpdate","description":"Schema for updating a webhook."},"WorkspaceResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"}},"type":"object","required":["id","name"],"title":"WorkspaceResponse"},"WorkspaceUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"domain":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Domain"}},"additionalProperties":false,"type":"object","title":"WorkspaceUpdate"},"XeroConfigureRequest":{"properties":{"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"},"access_token":{"type":"string","title":"Access Token"},"tenant_id":{"type":"string","title":"Tenant Id"}},"type":"object","required":["client_id","client_secret","access_token","tenant_id"],"title":"XeroConfigureRequest","description":"Credentials for Xero.\n\naccess_token and client_secret are write-only and never echoed back."},"XeroConfigureResponse":{"properties":{"client_id":{"type":"string","title":"Client Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"configured":{"type":"boolean","title":"Configured","default":true}},"type":"object","required":["client_id","tenant_id"],"title":"XeroConfigureResponse"},"ErrorDetail":{"description":"Legacy nested error payload, kept for backwards compatibility.","properties":{"type":{"title":"Type","type":"string"},"message":{"title":"Message","type":"string"},"details":{"additionalProperties":true,"title":"Details","type":"object"},"correlation_id":{"title":"Correlation Id","type":"string"},"timestamp":{"format":"date-time","title":"Timestamp","type":"string"}},"required":["type","message","correlation_id","timestamp"],"title":"ErrorDetail","type":"object"},"ErrorResponse":{"description":"Envelope for all API errors.\n\nThe top-level ``error_code``/``message``/``details``/``request_id`` keys\nare the #211 contract. ``error`` is the legacy envelope kept so previously\ngenerated typed clients do not break immediately — it will be removed in a\nfuture major version.","properties":{"error_code":{"description":"Stable machine-readable identifier — e.g. ``subscription_past_due``. Never localized; safe to branch on in the UI.","title":"Error Code","type":"string"},"message":{"description":"Human-readable error message.","title":"Message","type":"string"},"details":{"additionalProperties":true,"description":"Optional structured metadata about the error.","title":"Details","type":"object"},"request_id":{"description":"Server-assigned request identifier, matching the ``X-Request-ID`` header and the logging correlation id.","title":"Request Id","type":"string"},"error":{"$ref":"#/components/schemas/ErrorDetail","description":"Deprecated pre-#211 nested payload. New clients should ignore."}},"required":["error_code","message","request_id","error"],"title":"ErrorResponse","type":"object"},"RateLimitErrorResponse":{"description":"Structured rate limit error payload.\n\nRetains the legacy top-level ``detail``/``limit``/``remaining`` fields so\nthe existing TS client and dashboards keep working, and adds the #211\nenvelope (``error_code``, ``message``, ``request_id``) alongside.","properties":{"detail":{"default":"Rate limit exceeded","title":"Detail","type":"string"},"limit":{"minimum":1,"title":"Limit","type":"integer"},"remaining":{"default":0,"minimum":0,"title":"Remaining","type":"integer"},"reset_at":{"format":"date-time","title":"Reset At","type":"string"},"retry_after":{"minimum":0,"title":"Retry After","type":"integer"},"error_code":{"default":"rate_limit_exceeded","title":"Error Code","type":"string"},"message":{"default":"Rate limit exceeded","title":"Message","type":"string"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Request Id"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorDetail"},{"type":"null"}],"default":null}},"required":["limit","reset_at","retry_after"],"title":"RateLimitErrorResponse","type":"object"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"},"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"servers":[{"url":"https://zeropipeline.ainative.studio","description":"ZeroPipeline production. Paths in this document already include the /api/v1 prefix."}]}