{"openapi":"3.1.0","info":{"title":"Work Hub Service","description":"Task management and meeting knowledge service for the Haiven platform.","version":"1.0.0"},"paths":{"/health":{"get":{"tags":["health"],"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/v1/tasks":{"get":{"tags":["tasks"],"summary":"List Tasks","description":"List tasks with optional filters and pagination.","operationId":"list_tasks_api_v1_tasks_get","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":20,"title":"Page Size"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"}},{"name":"company_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"}},{"name":"assignee","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"source_application","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Application"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tasks"],"summary":"Create Task","description":"Create a new task.","operationId":"create_task_api_v1_tasks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task","description":"Fetch a single task by ID.","operationId":"get_task_api_v1_tasks__task_id__get","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/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tasks"],"summary":"Update Task","description":"Partially update a task.","operationId":"update_task_api_v1_tasks__task_id__patch","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tasks"],"summary":"Delete Task","description":"Hard-delete a task (prefer status=archived for soft-delete).","operationId":"delete_task_api_v1_tasks__task_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/{task_id}/voice-instructions":{"patch":{"tags":["tasks"],"summary":"Add Voice Instruction","description":"Append a voice instruction to a task.","operationId":"add_voice_instruction_api_v1_tasks__task_id__voice_instructions_patch","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInstructionAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/{task_id}/artifacts":{"patch":{"tags":["tasks"],"summary":"Add Artifact","description":"Append an artifact reference to a task.","operationId":"add_artifact_api_v1_tasks__task_id__artifacts_patch","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/{task_id}/history":{"get":{"tags":["tasks"],"summary":"Get Task History","description":"Return the full history array for a task.","operationId":"get_task_history_api_v1_tasks__task_id__history_get","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":{"type":"array","items":{},"title":"Response Get Task History Api V1 Tasks  Task Id  History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/{task_id}/draft":{"post":{"tags":["tasks"],"summary":"Generate Draft","description":"Generate an AI draft for a task using Qdrant context retrieval + LiteLLM completion.","operationId":"generate_draft_api_v1_tasks__task_id__draft_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/{task_id}/drafts":{"get":{"tags":["tasks"],"summary":"List Drafts","description":"List all drafts for a task, newest first.","operationId":"list_drafts_api_v1_tasks__task_id__drafts_get","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/DraftListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/meetings":{"get":{"tags":["meetings"],"summary":"List Meetings","description":"List meetings with optional company/project filters.","operationId":"list_meetings_api_v1_meetings_get","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":20,"title":"Page Size"}},{"name":"company_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"}}],"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"}}}}}}},"/api/v1/meetings/{meeting_id}":{"get":{"tags":["meetings"],"summary":"Get Meeting","description":"Fetch a single meeting by ID.","operationId":"get_meeting_api_v1_meetings__meeting_id__get","parameters":[{"name":"meeting_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Meeting Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeetingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/meetings/search":{"post":{"tags":["meetings"],"summary":"Search Meetings","description":"Semantic search over meeting notes via Qdrant.","operationId":"search_meetings_api_v1_meetings_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeetingSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeetingSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/scribe":{"post":{"tags":["webhooks"],"summary":"Receive Scribe Webhook","description":"Receive an approved meeting transcript from Meeting Scribe.\n\nFlow:\n1. Verify HMAC-SHA256 signature against WH_WEBHOOK_SECRET.\n2. Parse ScribeWebhookPayload.\n3. Resolve company/project from metadata (auto-create if missing).\n4. Upsert meeting row (idempotent on scribe_job_id).\n5. Create Task rows from extracted tasks list (source=scribe).\n6. Embed meeting notes into Qdrant.\n7. Acknowledge with 200 so Scribe stops retrying.","operationId":"receive_scribe_webhook_api_webhooks_scribe_post","parameters":[{"name":"X-Scribe-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Scribe-Signature"}}],"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"}}}}}}},"/api/v1/companies":{"get":{"tags":["taxonomy"],"summary":"List Companies","operationId":"list_companies_api_v1_companies_get","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":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompanyResponse"},"title":"Response List Companies Api V1 Companies Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["taxonomy"],"summary":"Create Company","operationId":"create_company_api_v1_companies_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/companies/{company_id}":{"get":{"tags":["taxonomy"],"summary":"Get Company","operationId":"get_company_api_v1_companies__company_id__get","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["taxonomy"],"summary":"Update Company","operationId":"update_company_api_v1_companies__company_id__patch","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["taxonomy"],"summary":"Delete Company","operationId":"delete_company_api_v1_companies__company_id__delete","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/projects":{"get":{"tags":["taxonomy"],"summary":"List Projects","operationId":"list_projects_api_v1_projects_get","parameters":[{"name":"company_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectResponse"},"title":"Response List Projects Api V1 Projects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["taxonomy"],"summary":"Create Project","operationId":"create_project_api_v1_projects_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/projects/{project_id}":{"get":{"tags":["taxonomy"],"summary":"Get Project","operationId":"get_project_api_v1_projects__project_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["taxonomy"],"summary":"Update Project","operationId":"update_project_api_v1_projects__project_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["taxonomy"],"summary":"Delete Project","operationId":"delete_project_api_v1_projects__project_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tags":{"get":{"tags":["taxonomy"],"summary":"List Tags","operationId":"list_tags_api_v1_tags_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TagResponse"},"type":"array","title":"Response List Tags Api V1 Tags Get"}}}}}},"post":{"tags":["taxonomy"],"summary":"Create Tag","operationId":"create_tag_api_v1_tags_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tags/{tag_id}":{"delete":{"tags":["taxonomy"],"summary":"Delete Tag","operationId":"delete_tag_api_v1_tags__tag_id__delete","parameters":[{"name":"tag_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tag Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/import/document":{"post":{"tags":["imports"],"summary":"Import Document","description":"Ingest a single document: create a DB row and embed content into Qdrant.","operationId":"import_document_api_v1_import_document_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDocumentRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/import/upload":{"post":{"tags":["imports"],"summary":"Upload File","description":"Upload a file (PDF, DOCX, EML, HTML, CSV, MD, TXT) and ingest into Qdrant.","operationId":"upload_file_api_v1_import_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_api_v1_import_upload_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/import/audio":{"post":{"tags":["imports"],"summary":"Upload Audio","description":"Upload an audio/video file for transcription via haiven-transcribe and ingest into Qdrant.","operationId":"upload_audio_api_v1_import_audio_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_audio_api_v1_import_audio_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/import/directory":{"post":{"tags":["imports"],"summary":"Import Directory","description":"Recursively import supported files under a mounted directory.","operationId":"import_directory_api_v1_import_directory_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDirectoryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDirectoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/import/pst":{"post":{"tags":["imports"],"summary":"Import Pst","description":"Import all emails and calendar items from an Outlook PST archive.\n\nExtracts each message using readpst, deduplicates by Message-ID, and\ningests all new messages into the document store with full email metadata.\nReturns a batch summary — does not block per-message errors.","operationId":"import_pst_api_v1_import_pst_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_pst_api_v1_import_pst_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPstResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/backfill/scribe-notes":{"post":{"tags":["backfill"],"summary":"Backfill historical Scribe meeting notes from disk","description":"Scan a directory for *-notes.md files and ingest any not already in the database.\n\nPrefers *-validated.md over *-notes.md when both exist for the same UUID.\nSet dry_run=True for a read-only scan.","operationId":"backfill_scribe_notes_api_v1_backfill_scribe_notes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackfillScribeNotesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackfillScribeNotesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/email/send":{"post":{"tags":["email"],"summary":"Send Email","description":"Send an email via Microsoft Graph API.\n\nRate limited to 20 sends per hour. Optionally threads a reply by setting\nthread_id to the Message-ID of the email being replied to.","operationId":"send_email_api_v1_email_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/email/sync":{"post":{"tags":["email"],"summary":"Trigger Sync","description":"Trigger an immediate incremental email sync.","operationId":"trigger_sync_api_v1_email_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/email/backfill":{"post":{"tags":["email"],"summary":"Trigger Backfill","description":"Backfill emails within a date range. Maximum 30 days per request.","operationId":"trigger_backfill_api_v1_email_backfill_post","parameters":[{"name":"since_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start date for backfill (YYYY-MM-DD)","title":"Since Date"},"description":"Start date for backfill (YYYY-MM-DD)"},{"name":"before_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"End date for backfill (exclusive, YYYY-MM-DD)","title":"Before Date"},"description":"End date for backfill (exclusive, YYYY-MM-DD)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/email/status":{"get":{"tags":["email"],"summary":"Get Status","description":"Return email sync status per folder.","operationId":"get_status_api_v1_email_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/email/config":{"get":{"tags":["email"],"summary":"Get Config","description":"Return current email connector configuration (password masked).","operationId":"get_config_api_v1_email_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/email/folders":{"get":{"tags":["email"],"summary":"List Folders","description":"List available IMAP folders for the configured account.","operationId":"list_folders_api_v1_email_folders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/calendar/events":{"get":{"tags":["calendar"],"summary":"List Events","description":"List calendar events within a date/time range.\n\nBoth `start` and `end` must be ISO 8601 datetime strings (e.g. 2026-03-01T00:00:00Z).\nReturns up to 50 events ordered by start time.","operationId":"list_events_api_v1_calendar_events_get","parameters":[{"name":"start","in":"query","required":true,"schema":{"type":"string","title":"Start"}},{"name":"end","in":"query","required":true,"schema":{"type":"string","title":"End"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Events Api V1 Calendar Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["calendar"],"summary":"Create Event","description":"Create a new calendar event.\n\nStart and end must be ISO 8601 datetime strings in UTC (e.g. 2026-03-01T14:00:00).\nAttendees is a list of email address strings.\nReturns HTTP 409 with conflict detail if a conflicting event exists.","operationId":"create_event_api_v1_calendar_events_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calendar/events/{event_id}":{"delete":{"tags":["calendar"],"summary":"Delete Event","description":"Delete a calendar event by its Graph API event ID.","operationId":"delete_event_api_v1_calendar_events__event_id__delete","parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calendar/health":{"get":{"tags":["calendar"],"summary":"Calendar Health","description":"Check Microsoft Graph API calendar access.\n\nFetches the primary calendar metadata to verify credentials and permissions.\nReturns 200 with calendar info on success, 502/503 on failure.","operationId":"calendar_health_api_v1_calendar_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Calendar Health Api V1 Calendar Health Get"}}}}}}}},"components":{"schemas":{"ArtifactAdd":{"properties":{"type":{"type":"string","minLength":1,"title":"Type"},"path":{"type":"string","minLength":1,"title":"Path"}},"type":"object","required":["type","path"],"title":"ArtifactAdd"},"BackfillScribeNotesRequest":{"properties":{"notes_dir":{"type":"string","title":"Notes Dir","description":"Absolute path to the directory containing *-notes.md files","default":"/mnt/storage/meeting-notes/notes/"},"dry_run":{"type":"boolean","title":"Dry Run","description":"Scan and report without writing to DB or Qdrant","default":false}},"type":"object","title":"BackfillScribeNotesRequest"},"BackfillScribeNotesResponse":{"properties":{"total_found":{"type":"integer","title":"Total Found"},"already_exists":{"type":"integer","title":"Already Exists"},"processed":{"type":"integer","title":"Processed"},"failed":{"type":"integer","title":"Failed"},"dry_run":{"type":"boolean","title":"Dry Run"},"would_process":{"items":{"type":"string"},"type":"array","title":"Would Process"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["total_found","already_exists","processed","failed","dry_run"],"title":"BackfillScribeNotesResponse"},"Body_import_pst_api_v1_import_pst_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["file"],"title":"Body_import_pst_api_v1_import_pst_post"},"Body_upload_audio_api_v1_import_audio_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"language":{"type":"string","title":"Language","default":"en"},"model":{"type":"string","title":"Model","default":"auto"},"diarize":{"type":"boolean","title":"Diarize","default":false},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["file"],"title":"Body_upload_audio_api_v1_import_audio_post"},"Body_upload_file_api_v1_import_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"doc_type":{"type":"string","title":"Doc Type","default":"general"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["file"],"title":"Body_upload_file_api_v1_import_upload_post"},"CalendarEventRequest":{"properties":{"summary":{"type":"string","title":"Summary"},"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"attendees":{"items":{"type":"string"},"type":"array","title":"Attendees"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""}},"type":"object","required":["summary","start","end","attendees"],"title":"CalendarEventRequest"},"CalendarEventResponse":{"properties":{"id":{"type":"string","title":"Id"},"summary":{"type":"string","title":"Summary"},"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"attendees":{"items":{"type":"string"},"type":"array","title":"Attendees"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"web_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Link"}},"type":"object","required":["id","summary","start","end","attendees"],"title":"CalendarEventResponse"},"CompanyCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"domain":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Domain"},"ai_discovered":{"type":"boolean","title":"Ai Discovered","default":false}},"type":"object","required":["name"],"title":"CompanyCreate"},"CompanyResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"ai_discovered":{"type":"boolean","title":"Ai Discovered"},"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","domain","ai_discovered","created_at","updated_at"],"title":"CompanyResponse"},"CompanyUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"ai_discovered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ai Discovered"}},"type":"object","title":"CompanyUpdate"},"DraftListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DraftResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"DraftListResponse"},"DraftRequest":{"properties":{"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt","description":"Optional additional instructions for draft generation"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"LiteLLM model override"}},"type":"object","title":"DraftRequest"},"DraftResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"task_id":{"type":"string","format":"uuid","title":"Task Id"},"content":{"type":"string","title":"Content"},"model":{"type":"string","title":"Model"},"context_chunks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Context Chunks"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","task_id","content","model","context_chunks","version","created_at"],"title":"DraftResponse"},"EmailSendRequest":{"properties":{"to":{"type":"string","title":"To"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"}},"type":"object","required":["to","subject","body"],"title":"EmailSendRequest"},"EmailSendResponse":{"properties":{"status":{"type":"string","title":"Status"},"message_id":{"type":"string","title":"Message Id"}},"type":"object","required":["status","message_id"],"title":"EmailSendResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"postgres":{"type":"boolean","title":"Postgres"},"qdrant":{"type":"boolean","title":"Qdrant"},"litellm":{"type":"boolean","title":"Litellm"},"version":{"type":"string","title":"Version","default":"1.0.0"}},"type":"object","required":["status","postgres","qdrant","litellm"],"title":"HealthResponse"},"ImportDirectoryRequest":{"properties":{"path":{"type":"string","title":"Path","description":"Absolute path to directory (must be a mounted volume)"},"recursive":{"type":"boolean","title":"Recursive","default":true},"skip_existing":{"type":"boolean","title":"Skip Existing","default":true},"doc_type":{"type":"string","title":"Doc Type","default":"general"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["path"],"title":"ImportDirectoryRequest"},"ImportDirectoryResponse":{"properties":{"files_processed":{"type":"integer","title":"Files Processed"},"documents_created":{"type":"integer","title":"Documents Created"},"files_skipped":{"type":"integer","title":"Files Skipped"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["files_processed","documents_created","files_skipped","errors"],"title":"ImportDirectoryResponse"},"ImportDocumentRequest":{"properties":{"title":{"type":"string","maxLength":500,"minLength":1,"title":"Title"},"doc_type":{"type":"string","title":"Doc Type","default":"general"},"source":{"type":"string","title":"Source","default":"import"},"content":{"type":"string","minLength":1,"title":"Content","description":"Raw document text to ingest"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"},"source_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source File"}},"type":"object","required":["title","content"],"title":"ImportDocumentRequest"},"ImportDocumentResponse":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"qdrant_document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qdrant Document Id"},"embedding_status":{"type":"string","title":"Embedding Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["document_id","qdrant_document_id","embedding_status","message"],"title":"ImportDocumentResponse"},"ImportPstResponse":{"properties":{"message":{"type":"string","title":"Message"},"filename":{"type":"string","title":"Filename"},"documents_ingested":{"type":"integer","title":"Documents Ingested"},"documents_skipped":{"type":"integer","title":"Documents Skipped"},"errors":{"type":"integer","title":"Errors"},"error_details":{"items":{"type":"string"},"type":"array","title":"Error Details"}},"type":"object","required":["message","filename","documents_ingested","documents_skipped","errors","error_details"],"title":"ImportPstResponse"},"ImportUploadResponse":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"qdrant_document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qdrant Document Id"},"embedding_status":{"type":"string","title":"Embedding Status"},"message":{"type":"string","title":"Message"},"extracted_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extracted Title"},"format_detected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format Detected"}},"type":"object","required":["document_id","qdrant_document_id","embedding_status","message"],"title":"ImportUploadResponse"},"MeetingListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MeetingResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["items","total","page","page_size"],"title":"MeetingListResponse"},"MeetingResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"scribe_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scribe Job Id"},"title":{"type":"string","title":"Title"},"attendees":{"items":{"type":"string"},"type":"array","title":"Attendees"},"notes_md":{"type":"string","title":"Notes Md"},"qdrant_document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Qdrant Document Id"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","scribe_job_id","title","attendees","notes_md","qdrant_document_id","company_id","project_id","created_at"],"title":"MeetingResponse"},"MeetingSearchRequest":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"Semantic search query"},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":10},"score_threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Score Threshold"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"}},"type":"object","required":["query"],"title":"MeetingSearchRequest"},"MeetingSearchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MeetingSearchResultItem"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"},"query_time_ms":{"type":"number","title":"Query Time Ms"}},"type":"object","required":["results","total","query_time_ms"],"title":"MeetingSearchResponse"},"MeetingSearchResultItem":{"properties":{"meeting_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Meeting Id"},"title":{"type":"string","title":"Title"},"score":{"type":"number","title":"Score"},"excerpt":{"type":"string","title":"Excerpt"},"attendees":{"items":{"type":"string"},"type":"array","title":"Attendees"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["meeting_id","title","score","excerpt","attendees","created_at"],"title":"MeetingSearchResultItem"},"ProjectCreate":{"properties":{"company_id":{"type":"string","format":"uuid","title":"Company Id"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"status":{"type":"string","title":"Status","default":"active"}},"type":"object","required":["company_id","name"],"title":"ProjectCreate"},"ProjectResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"company_id":{"type":"string","format":"uuid","title":"Company Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","name","status","created_at","updated_at"],"title":"ProjectResponse"},"ProjectUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"ProjectUpdate"},"TagCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"source":{"type":"string","title":"Source","default":"manual"}},"type":"object","required":["name"],"title":"TagCreate"},"TagResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"source":{"type":"string","title":"Source"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","source","created_at"],"title":"TagResponse"},"TaskCreate":{"properties":{"title":{"type":"string","maxLength":500,"minLength":1,"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"assignee":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Assignee"},"status":{"type":"string","title":"Status","default":"open"},"priority":{"type":"string","title":"Priority","default":"medium"},"source":{"type":"string","title":"Source","default":"manual"},"source_application":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Application"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"tag_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Tag Ids"}},"type":"object","required":["title"],"title":"TaskCreate"},"TaskListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TaskResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["items","total","page","page_size"],"title":"TaskListResponse"},"TaskResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"assignee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee"},"status":{"type":"string","title":"Status"},"priority":{"type":"string","title":"Priority"},"source":{"type":"string","title":"Source"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"tags":{"items":{"$ref":"#/components/schemas/TagResponse"},"type":"array","title":"Tags","default":[]},"voice_instructions":{"items":{},"type":"array","title":"Voice Instructions","default":[]},"artifacts":{"items":{},"type":"array","title":"Artifacts","default":[]},"history":{"items":{},"type":"array","title":"History","default":[]},"source_application":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Application"}},"type":"object","required":["id","title","description","assignee","status","priority","source","company_id","project_id","context","due_date","created_at","updated_at"],"title":"TaskResponse"},"TaskUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"assignee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"source_application":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Application"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"tag_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Tag Ids"}},"type":"object","title":"TaskUpdate"},"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"},"VoiceInstructionAdd":{"properties":{"instruction":{"type":"string","minLength":1,"title":"Instruction"}},"type":"object","required":["instruction"],"title":"VoiceInstructionAdd"},"WebhookResponse":{"properties":{"accepted":{"type":"boolean","title":"Accepted"},"message":{"type":"string","title":"Message"}},"type":"object","required":["accepted","message"],"title":"WebhookResponse"}}}}