{"components":{"responses":{},"schemas":{},"securitySchemes":{"bearer_auth":{"description":"Meridian API key obtained from /settings/integrations. Pass as `Authorization: Bearer <token>`.","scheme":"bearer","type":"http"}}},"info":{"description":"Tenant-scoped CRM API. Endpoints are authenticated by user-scoped :meridian-kind API keys that inherit the issuing user's role and permissions. Endpoints land in Phase 3+.","title":"Meridian API","version":"0.107.7"},"openapi":"3.0.0","paths":{"/api/meridian/v1/issues":{"get":{"callbacks":{},"description":"Returns all issues for the authenticated organization.","operationId":"MeridianWeb.Api.Meridian.IssuesController.index","parameters":[{"description":"Filter by status","in":"query","name":"status","required":false,"schema":{"type":"string"}},{"description":"Search by title or description","in":"query","name":"search","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"type":"object"},"type":"array"}},"type":"object"}}},"description":"Issue list"}},"security":[{"bearer_auth":[]}],"summary":"List issues","tags":["Meridian · Issues"]}},"/api/meridian/v1/workspace":{"get":{"callbacks":{},"description":"Returns the workspace id, name, slug, locale, timezone, and plan status\nfor the authenticated organization. Read-only.\n","operationId":"MeridianWeb.Api.Meridian.WorkspaceController.show","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Workspace"}},"security":[{"bearer_auth":[]}],"summary":"Get the current workspace","tags":["Meridian · Workspace"]},"patch":{"callbacks":{},"description":"Updates name, preferred_locale, or timezone. Does not change the slug,\nthe plan, or billing. Requires admin_settings_edit.\n","operationId":"MeridianWeb.Api.Meridian.WorkspaceController.update","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"description":"Workspace display name.","type":"string"},"preferred_locale":{"description":"Workspace locale. fr or en.","enum":["fr","en"],"type":"string"},"timezone":{"description":"IANA timezone. Example: America/Montreal.","type":"string"}},"type":"object"}}},"description":"Workspace fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated workspace"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update workspace name, locale, or timezone","tags":["Meridian · Workspace"]}},"/api/meridian/v1/finance/invoices":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.InvoicesController.index","parameters":[{"description":"","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"","in":"query","name":"status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invoice list"}},"security":[{"bearer_auth":[]}],"summary":"List finance invoices","tags":["Meridian · Finance"]},"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.InvoicesController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"company_id":{"type":"integer"},"currency":{"type":"string"},"due_date":{"format":"date","type":"string"},"gst_cents":{"type":"integer"},"idempotency_key":{"type":"string"},"invoice_number":{"type":"string"},"issue_date":{"format":"date","type":"string"},"lines":{"description":"Detail lines","items":{"properties":{"description":{"type":"string"},"quantity":{"type":"number"},"taxable":{"type":"boolean"},"unit_price_cents":{"type":"integer"}},"required":["description"],"type":"object"},"type":"array"},"notes":{"type":"string"},"opportunity_id":{"type":"integer"},"project_id":{"type":"integer"},"qst_cents":{"type":"integer"},"subtotal_cents":{"type":"integer"}},"required":["invoice_number","company_id","issue_date","subtotal_cents","idempotency_key"],"type":"object"}}},"description":"Invoice attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created invoice"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a finance invoice","tags":["Meridian · Finance"]}},"/api/meridian/v1/finance/invoices/{id}":{"patch":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.InvoicesController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"due_date":{"format":"date","type":"string"},"notes":{"type":"string"}},"type":"object"}}},"description":"Invoice attributes","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated invoice"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a draft or sent invoice (due date, notes)","tags":["Meridian · Finance"]}},"/api/meridian/v1/clients/{id}":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ClientsController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Client"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get client by ID","tags":["Meridian · Clients"]},"patch":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ClientsController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"client_origin":{"type":"string"},"client_status":{"type":"string"},"description":{"type":"string"},"employee_count":{"type":"integer"},"industry":{"type":"string"},"linkedin_url":{"type":"string"},"location":{"type":"string"},"manual_last_contact_kind":{"type":"string"},"manual_last_contact_on":{"format":"date","type":"string"},"manual_step_note":{"type":"string"},"name":{"type":"string"},"next_action":{"type":"string"},"notes":{"type":"string"},"preferred_locale":{"type":"string"},"qualification_status":{"type":"string"},"service_interests":{"type":"string"},"tax_exempt":{"type":"boolean"},"tax_id":{"type":"string"},"tax_id_type":{"type":"string"},"website":{"type":"string"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated client"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a client","tags":["Meridian · Clients"]}},"/api/meridian/v1/knowledge":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.KnowledgeController.index","parameters":[{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO8601 timestamp filter","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Article list"},"401":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"}},"security":[{"bearer_auth":[]}],"summary":"List knowledge articles","tags":["Meridian · Knowledge"]},"post":{"callbacks":{},"description":"Enters the approval queue. The article is not published until approved by an admin. Returns 202 Accepted.","operationId":"MeridianWeb.Api.Meridian.KnowledgeController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body":{"type":"string"},"scope_id":{"type":"integer"},"scope_type":{"enum":["organization","company"],"type":"string"},"title":{"type":"string"}},"required":["title","body","scope_type","scope_id"],"type":"object"}}},"description":"Article attributes","required":false},"responses":{"202":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Queued for review"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Submit a knowledge article for approval","tags":["Meridian · Knowledge"]}},"/api/meridian/v1/finance/expenses":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.ExpensesController.index","parameters":[{"description":"","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"","in":"query","name":"status","required":false,"schema":{"type":"string"}},{"description":"","in":"query","name":"from_date","required":false,"schema":{"type":"string"}},{"description":"","in":"query","name":"to_date","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Expense list"}},"security":[{"bearer_auth":[]}],"summary":"List finance expenses","tags":["Meridian · Finance"]},"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.ExpensesController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"beneficiary_user_id":{"type":"integer"},"category_id":{"type":"integer"},"cca_class_id":{"description":"CCA (DPA) class ID for capital assets","type":"integer"},"company_id":{"description":"Supplier (company) ID","type":"integer"},"deductible_pct":{"type":"integer"},"description":{"type":"string"},"document_id":{"description":"Receipt document ID (upload via documents tools first)","type":"integer"},"expense_date":{"format":"date","type":"string"},"fx_rate":{"description":"Exchange rate to CAD as a decimal string (e.g. \"1.36\")","type":"string"},"fx_rate_date":{"format":"date","type":"string"},"fx_rate_source":{"type":"string"},"gst_cents":{"type":"integer"},"idempotency_key":{"type":"string"},"original_amount_cents":{"type":"integer"},"original_currency":{"description":"Original currency (e.g. USD) when paid in foreign currency","type":"string"},"payment_account_id":{"type":"integer"},"payment_method":{"description":"operating (Virement bancaire, Chèque), employee_expense, credit_card (Carte de crédit), other (Comptant, Autre)","type":"string"},"qst_cents":{"type":"integer"},"reference_number":{"type":"string"},"subtotal_cents":{"type":"integer"},"vendor_id":{"description":"Alias for company_id (Invoice Ninja imports)","type":"integer"}},"required":["description","expense_date","payment_method","subtotal_cents","idempotency_key"],"type":"object"}}},"description":"Expense attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created expense"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a finance expense","tags":["Meridian · Finance"]}},"/api/meridian/v1/documents/{id}/download-url":{"get":{"callbacks":{},"description":"Returns a pre-signed URL to download the original file (docx, pdf, image, etc.). Use this only when you need the original's fidelity — layout, tables, signatures, or binary content that the extracted text cannot provide. For reading text content, prefer get_document_text which is faster and avoids a round-trip download.","operationId":"MeridianWeb.Api.Meridian.DocumentsController.download_url","parameters":[{"description":"Document ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Download URL"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get a short-lived URL to download the ORIGINAL document file","tags":["Meridian · Documents"]}},"/api/meridian/v1/plans":{"get":{"callbacks":{},"description":"Returns the public Meridian price card in CAD cents. Taxes (GST/QST) are\nextra. The trial is the Équipe plan. This is the same data as GET /pricing.json.\nRead-only. Does not start a payment.\n","operationId":"MeridianWeb.Api.Meridian.PlansController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Plans"}},"security":[{"bearer_auth":[]}],"summary":"List public plans and prices","tags":["Meridian · Workspace"]}},"/api/meridian/v1/finance/transactions/{id}/reverse":{"post":{"callbacks":{},"description":"Only standalone manual rows can be reversed here; transactions linked to an expense, invoice or transfer must go through their owning flow. Idempotent when already reversed.","operationId":"MeridianWeb.Api.Meridian.Finance.TransactionsController.reverse","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Reversed transaction"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Linked transaction"}},"security":[{"bearer_auth":[]}],"summary":"Reverse a manual transaction (excluded from balances)","tags":["Meridian · Finance"]}},"/api/meridian/v1/finance/reports/income_statement":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.IncomeStatementController.show","parameters":[{"description":"ISO8601 date","in":"query","name":"period_start","required":true,"schema":{"type":"string"}},{"description":"ISO8601 date","in":"query","name":"period_end","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Income statement"}},"security":[{"bearer_auth":[]}],"summary":"Get income statement for a date range","tags":["Meridian · Finance"]}},"/api/meridian/v1/finance/tax_periods":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.TaxPeriodsController.index","parameters":[{"description":"","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Tax period list"}},"security":[{"bearer_auth":[]}],"summary":"List tax periods, most recent first","tags":["Meridian · Finance"]},"post":{"callbacks":{},"description":"Pass period_start and period_end (ISO dates). With no dates, returns the current month's period.","operationId":"MeridianWeb.Api.Meridian.Finance.TaxPeriodsController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"period_end":{"format":"date","type":"string"},"period_start":{"format":"date","type":"string"}},"type":"object"}}},"description":"Tax period attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created tax period"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create an open tax period","tags":["Meridian · Finance"]}},"/api/meridian/v1/opportunities/{id}":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.OpportunitiesController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Opportunity"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get opportunity by ID","tags":["Meridian · Opportunities"]},"patch":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.OpportunitiesController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount_cents":{"type":"integer"},"company_id":{"type":"integer"},"currency":{"type":"string"},"deal_type":{"type":"string"},"description":{"type":"string"},"expected_close_on":{"format":"date","type":"string"},"message":{"type":"string"},"monthly_amount_cents":{"type":"integer"},"name":{"type":"string"},"need":{"items":{"type":"string"},"type":"array"},"owner_user_id":{"type":"integer"},"pipeline_id":{"type":"integer"},"primary_contact_id":{"type":"integer"},"probability":{"type":"integer"},"source":{"type":"string"},"stage_id":{"type":"integer"},"status_id":{"type":"integer"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated opportunity"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update an opportunity","tags":["Meridian · Opportunities"]}},"/api/meridian/v1/finance/invoices/{id}/void":{"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.InvoicesController.void","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Voided invoice"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid status"}},"security":[{"bearer_auth":[]}],"summary":"Void a sent finance invoice","tags":["Meridian · Finance"]}},"/api/meridian/v1/contacts":{"get":{"callbacks":{},"description":"Returns contacts for the authenticated organization.","operationId":"MeridianWeb.Api.Meridian.ContactsController.index","parameters":[{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Filter by company ID","in":"query","name":"company_id","required":false,"schema":{"type":"integer"}},{"description":"ISO8601 timestamp filter","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Contact list"},"401":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"}},"security":[{"bearer_auth":[]}],"summary":"List contacts","tags":["Meridian · Contacts"]},"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ContactsController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"company_id":{"type":"integer"},"email":{"type":"string"},"full_name":{"type":"string"},"is_primary":{"type":"boolean"},"notes":{"type":"string"},"phone":{"type":"string"},"preferred_locale":{"type":"string"},"role":{"type":"string"},"role_title":{"type":"string"}},"required":["company_id","full_name"],"type":"object"}}},"description":"Contact attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created contact"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Company not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a contact","tags":["Meridian · Contacts"]}},"/api/meridian/v1/finance/expenses/{id}/void":{"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.ExpensesController.void","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Voided expense"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Void a finance expense, reversing its transaction when posted","tags":["Meridian · Finance"]}},"/api/meridian/v1/billing/agent_checkout":{"post":{"callbacks":{},"description":"Returns a Stripe Checkout URL in CAD for Solo, Équipe, or Pro. Stripe Tax\nadds GST/QST when the Stripe account has tax enabled. The human or a\npayment-capable agent completes the URL. Does not charge inside this call.\nReturns 403 when agent checkout is disabled. Requires billing_edit.\n","operationId":"MeridianWeb.Api.Meridian.AgentCheckoutController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"interval":{"description":"monthly, or annual (10 times the monthly price).","enum":["monthly","annual"],"type":"string"},"plan_id":{"description":"Public plan id. Entreprise is quote-only and is rejected.","enum":["solo","equipe","pro"],"type":"string"}},"required":["plan_id","interval"],"type":"object"}}},"description":"Plan and interval","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Checkout link"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Disabled or forbidden"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Plan or price not available"}},"security":[{"bearer_auth":[]}],"summary":"Create a Stripe Checkout link for a plan","tags":["Meridian · Workspace"]}},"/api/meridian/v1/contacts/{id}":{"delete":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ContactsController.delete","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Deleted contact"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Delete a contact","tags":["Meridian · Contacts"]},"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ContactsController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Contact"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get contact by ID","tags":["Meridian · Contacts"]},"patch":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ContactsController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"company_id":{"type":"integer"},"email":{"type":"string"},"full_name":{"type":"string"},"is_primary":{"type":"boolean"},"notes":{"type":"string"},"phone":{"type":"string"},"preferred_locale":{"type":"string"},"role":{"type":"string"},"role_title":{"type":"string"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated contact"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a contact","tags":["Meridian · Contacts"]}},"/api/meridian/v1/finance/expense_categories/{id}":{"delete":{"callbacks":{},"description":"Refused when the category is used by expenses or transactions — posted writes are immutable.","operationId":"MeridianWeb.Api.Meridian.Finance.ExpenseCategoriesController.delete","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Deleted category"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Category in use"}},"security":[{"bearer_auth":[]}],"summary":"Delete an expense category","tags":["Meridian · Finance"]},"patch":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.ExpenseCategoriesController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"code":{"type":"string"},"default_deductible_pct":{"type":"integer"},"name_en":{"type":"string"},"name_fr":{"type":"string"},"position":{"type":"integer"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated category"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update an expense category","tags":["Meridian · Finance"]}},"/api/meridian/v1/projects/{id}/tasks":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.TasksController.index","parameters":[{"description":"Project ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO8601 timestamp filter","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Filter by task status","in":"query","name":"status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Task list"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Project not found"}},"security":[{"bearer_auth":[]}],"summary":"List tasks for a project","tags":["Meridian · Tasks"]},"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.TasksController.create","parameters":[{"description":"Project ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}},"description":"Task attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created task"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Project not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a task under a project","tags":["Meridian · Tasks"]}},"/api/meridian/v1/webhooks/{id}":{"delete":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.WebhooksController.delete","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"description":{"nullable":true,"type":"string"},"event_types":{"items":{"type":"string"},"type":"array"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"is_active":{"type":"boolean"},"updated_at":{"format":"date-time","type":"string"},"url":{"type":"string"}},"type":"object"}}},"description":"Deleted"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Delete a webhook","tags":["Meridian · Webhooks"]},"patch":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.WebhooksController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"event_types":{"items":{"type":"string"},"type":"array"},"is_active":{"type":"boolean"},"url":{"type":"string"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"description":{"nullable":true,"type":"string"},"event_types":{"items":{"type":"string"},"type":"array"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"is_active":{"type":"boolean"},"updated_at":{"format":"date-time","type":"string"},"url":{"type":"string"}},"type":"object"}}},"description":"Updated"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a webhook","tags":["Meridian · Webhooks"]}},"/api/meridian/v1/knowledge/{id}":{"delete":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.KnowledgeController.delete","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Deleted"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Delete a knowledge article","tags":["Meridian · Knowledge"]},"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.KnowledgeController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Article"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get knowledge article by ID","tags":["Meridian · Knowledge"]},"patch":{"callbacks":{},"description":"Updates an article. Approved articles re-enter the approval queue (status pending_review).","operationId":"MeridianWeb.Api.Meridian.KnowledgeController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body":{"type":"string"},"scope_id":{"type":"integer"},"scope_type":{"enum":["organization","company"],"type":"string"},"title":{"type":"string"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated article"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a knowledge article","tags":["Meridian · Knowledge"]}},"/api/meridian/v1/proposals/{id}":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ProposalsController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Proposal"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get proposal by ID (full body)","tags":["Meridian · Proposals"]},"patch":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ProposalsController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"currency":{"type":"string"},"description":{"type":"string"},"discount_cents":{"type":"integer"},"name":{"type":"string"},"notes":{"type":"string"},"opportunity_id":{"type":"integer"},"pricing_type":{"type":"string"},"status":{"type":"string"},"subtotal_cents":{"type":"integer"},"total_cents":{"type":"integer"},"valid_until":{"format":"date","type":"string"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated proposal"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a proposal","tags":["Meridian · Proposals"]}},"/api/meridian/v1/issues/{id}/resolve":{"patch":{"callbacks":{},"description":"Mark issue as resolved with resolution notes. Triggers email notification to the reporter.","operationId":"MeridianWeb.Api.Meridian.IssuesController.resolve","parameters":[{"description":"Issue ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Resolved issue"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Resolve issue","tags":["Meridian · Issues"]}},"/api/meridian/v1/finance/cca_classes":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.CcaClassesController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"CCA class list"}},"security":[{"bearer_auth":[]}],"summary":"List CCA (DPA) classes with amortization rates","tags":["Meridian · Finance"]}},"/api/meridian/v1/products/{slug}/issues":{"get":{"callbacks":{},"description":"Returns issues scoped to a product. Primary endpoint for Dispatch work queue.","operationId":"MeridianWeb.Api.Meridian.ProductsController.list_issues","parameters":[{"description":"Product slug","in":"path","name":"slug","required":true,"schema":{"type":"string"}},{"description":"Filter by status","in":"query","name":"status","required":false,"schema":{"type":"string"}},{"description":"Filter by category","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Filter by priority","in":"query","name":"priority","required":false,"schema":{"type":"string"}},{"description":"Search title/description","in":"query","name":"search","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Issue list"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Product not found"}},"security":[{"bearer_auth":[]}],"summary":"List issues for a product","tags":["Meridian · Products"]},"post":{"callbacks":{},"description":"Creates a new issue against a product. Used by production apps and Dispatch.","operationId":"MeridianWeb.Api.Meridian.ProductsController.create_issue","parameters":[{"description":"Product slug","in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Issue created"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Product not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create issue for a product","tags":["Meridian · Products"]}},"/api/meridian/v1/tasks/{id}":{"patch":{"callbacks":{},"description":"Flat update — tasks do not change projects.","operationId":"MeridianWeb.Api.Meridian.TasksController.update","parameters":[{"description":"Task ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"actual_hours":{"type":"number"},"assigned_to_id":{"type":"integer"},"description":{"type":"string"},"due_date":{"format":"date","type":"string"},"estimated_hours":{"type":"number"},"name":{"type":"string"},"position":{"type":"integer"},"priority_id":{"type":"integer"},"status_id":{"type":"integer"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated task"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a task","tags":["Meridian · Tasks"]}},"/api/meridian/v1/suppliers/{id}":{"delete":{"callbacks":{},"description":"Refused with supplier_in_use when invoices or linked rows still reference it.","operationId":"MeridianWeb.Api.Meridian.SuppliersController.delete","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Deleted supplier"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Supplier in use"}},"security":[{"bearer_auth":[]}],"summary":"Delete a supplier","tags":["Meridian · Suppliers"]},"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.SuppliersController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Supplier"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get supplier by ID","tags":["Meridian · Suppliers"]},"patch":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.SuppliersController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"industry":{"type":"string"},"linkedin_url":{"type":"string"},"location":{"type":"string"},"name":{"type":"string"},"notes":{"type":"string"},"preferred_locale":{"type":"string"},"tax_exempt":{"type":"boolean"},"tax_id":{"type":"string"},"tax_id_type":{"type":"string"},"website":{"type":"string"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated supplier"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a supplier","tags":["Meridian · Suppliers"]}},"/api/meridian/v1/documents":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.DocumentsController.index","parameters":[{"description":"Entity type: company, opportunity, proposal, expense, or invoice","in":"query","name":"linkable_type","required":true,"schema":{"type":"string"}},{"description":"Entity ID","in":"query","name":"linkable_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Document list"},"401":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid linkable_type"}},"security":[{"bearer_auth":[]}],"summary":"List documents linked to an entity","tags":["Meridian · Documents"]},"post":{"callbacks":{},"description":"Upload a document inline as base64. Maximum 1 MB decoded. This is the reliable path in sandboxed clients (e.g. Cowork) that cannot make outbound uploads. For a file larger than 1 MB, ask the user to upload it directly in Meridian (Settings or the CRM record) and reference it; only attempt create_document_upload if the client can make outbound HTTP requests (e.g. Claude Desktop).","operationId":"MeridianWeb.Api.Meridian.DocumentsController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content_type":{"type":"string"},"data_base64":{"description":"Base64-encoded file content (max 1 MB decoded)","type":"string"},"filename":{"type":"string"},"linkable_id":{"type":"integer"},"linkable_type":{"description":"company, opportunity, proposal, expense, or invoice","type":"string"}},"required":["filename","content_type","data_base64","linkable_type","linkable_id"],"type":"object"}}},"description":"Document attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created document"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Upload a small document (base64)","tags":["Meridian · Documents"]}},"/api/meridian/v1/finance/cash_position":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.CashPositionController.show","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Cash position"}},"security":[{"bearer_auth":[]}],"summary":"Get cash position summary","tags":["Meridian · Finance"]}},"/api/meridian/v1/products/{slug}/ledger":{"post":{"callbacks":{},"description":"Creates (or reuses) a CRM company, issues an invoice, and records the Stripe payment. Idempotent on stripe_payment_intent_id.","operationId":"MeridianWeb.Api.Meridian.ProductsController.create_ledger","parameters":[{"description":"Product slug","in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invoice issued"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Product not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Issue a SignalOrange invoice for a product sale","tags":["Meridian · Products"]}},"/api/meridian/v1/finance/expenses/{id}":{"patch":{"callbacks":{},"description":"Updatable: description, company_id (aliases vendor_id, supplier_id), category_id, reference_number, deductible_pct, cca_class_id, document_id (receipt document ID, upload via documents tools first). Amounts, taxes, dates and payment method are immutable once written. Void expenses cannot be updated.","operationId":"MeridianWeb.Api.Meridian.Finance.ExpensesController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"category_id":{"type":"integer"},"cca_class_id":{"type":"integer"},"company_id":{"description":"Supplier (company) ID","type":"integer"},"deductible_pct":{"type":"integer"},"description":{"type":"string"},"document_id":{"description":"Receipt document ID (upload via documents tools first)","type":"integer"},"reference_number":{"type":"string"},"supplier_id":{"description":"Alias for company_id","type":"integer"},"vendor_id":{"description":"Alias for company_id","type":"integer"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated expense"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update an expense's supplier link and categorization","tags":["Meridian · Finance"]}},"/api/meridian/v1/finance/accounts":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.AccountsController.index","parameters":[{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Account list"}},"security":[{"bearer_auth":[]}],"summary":"List finance accounts","tags":["Meridian · Finance"]},"post":{"callbacks":{},"description":"Types: operating, tax_reserve, savings, credit_card, employee_expense. Use employee_expense with holder_user_id for a shareholder advance account.","operationId":"MeridianWeb.Api.Meridian.Finance.AccountsController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"currency":{"type":"string"},"holder_user_id":{"type":"integer"},"institution":{"type":"string"},"is_tax_reserve":{"type":"boolean"},"last_four":{"type":"string"},"name":{"type":"string"},"opening_balance_cents":{"type":"integer"},"opening_balance_date":{"format":"date","type":"string"},"type":{"type":"string"}},"required":["name","type"],"type":"object"}}},"description":"Account attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created account"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a finance account","tags":["Meridian · Finance"]}},"/api/meridian/v1/api_keys/{id}":{"delete":{"callbacks":{},"description":"Soft-revokes the key by setting `is_active: false`. Returns 404 if the key does not belong to the calling user in their current organization.","operationId":"MeridianWeb.Api.Meridian.ApiKeysController.delete","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Revoked"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Revoke a Meridian API key","tags":["Meridian · API Keys"]},"patch":{"callbacks":{},"description":"Only `name` and `expires_at` are mutable. Returns 404 if the key does not belong to the calling user in their current organization.","operationId":"MeridianWeb.Api.Meridian.ApiKeysController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"expires_at":{"format":"date-time","type":"string"},"name":{"type":"string"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Rename or update expiry on a Meridian key","tags":["Meridian · API Keys"]}},"/api/meridian/v1/workspace/capabilities":{"get":{"callbacks":{},"description":"Returns the plan, user cap, feature ids, trial end, and whether the\nsignup email is confirmed. agent_checkout_enabled says if create_plan_checkout\nis available. Read-only. oauth_scope is meridian:full until narrower scopes exist.\n","operationId":"MeridianWeb.Api.Meridian.WorkspaceController.capabilities","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Capabilities"}},"security":[{"bearer_auth":[]}],"summary":"Get workspace capabilities and trial state","tags":["Meridian · Workspace"]}},"/api/meridian/v1/products/{slug}":{"get":{"callbacks":{},"description":"Returns a single product with its metadata. Used by Dispatch to discover product context.","operationId":"MeridianWeb.Api.Meridian.ProductsController.show","parameters":[{"description":"Product slug","in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Product"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get product by slug","tags":["Meridian · Products"]}},"/api/meridian/v1/api_keys":{"get":{"callbacks":{},"description":"Returns all Meridian keys belonging to the calling user in their current organization. Raw secrets are never returned.","operationId":"MeridianWeb.Api.Meridian.ApiKeysController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"expires_at":{"format":"date-time","nullable":true,"type":"string"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"is_active":{"type":"boolean"},"kind":{"enum":["meridian"],"type":"string"},"last_used_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"format":"date-time","type":"string"},"user_id":{"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Meridian API keys"}},"security":[{"bearer_auth":[]}],"summary":"List caller's Meridian API keys","tags":["Meridian · API Keys"]},"post":{"callbacks":{},"description":"Creates a new `:meridian`-kind API key for the calling user in their\ncurrent organization. The response includes the **raw token** in the\n`key` field — **this is the only time it is returned.** Store it\nimmediately; subsequent requests never reveal it.\n\nReturns 422 with `error.type = \"limit_reached\"` if the organization is at\nthe per-(org, :meridian) key cap.\n","operationId":"MeridianWeb.Api.Meridian.ApiKeysController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"expires_at":{"description":"Optional ISO-8601 expiration date","format":"date-time","type":"string"},"name":{"description":"Human-friendly label for this key","example":"my-claude-skill","type":"string"}},"required":["name"],"type":"object"}}},"description":"Creation request","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"description":"Same as the standard key schema plus a one-time `key` field.","properties":{"expires_at":{"format":"date-time","nullable":true,"type":"string"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"is_active":{"type":"boolean"},"key":{"description":"Raw API key — only present on creation. Store it now.","type":"string"},"kind":{"enum":["meridian"],"type":"string"},"last_used_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"type":"string"},"updated_at":{"format":"date-time","type":"string"},"user_id":{"type":"integer"}},"type":"object"}}},"description":"Created with one-time secret"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error or cap reached"}},"security":[{"bearer_auth":[]}],"summary":"Mint a new Meridian API key","tags":["Meridian · API Keys"]}},"/api/meridian/v1/projects":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ProjectsController.index","parameters":[{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO8601 timestamp filter","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Filter by status","in":"query","name":"status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Project list"},"401":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"}},"security":[{"bearer_auth":[]}],"summary":"List projects","tags":["Meridian · Projects"]}},"/api/meridian/v1/finance/invoices/{id}/payments":{"post":{"callbacks":{},"description":"Defaults to the remaining balance on the operating account. Pass amount_cents for a partial payment and payment_account_id to choose the cash account.","operationId":"MeridianWeb.Api.Meridian.Finance.InvoicePaymentsController.create","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount_cents":{"type":"integer"},"idempotency_key":{"type":"string"},"payment_account_id":{"type":"integer"},"payment_date":{"format":"date","type":"string"},"payment_method":{"type":"string"}},"required":["idempotency_key"],"type":"object"}}},"description":"Payment attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Payment recorded"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Record invoice payment (full or partial)","tags":["Meridian · Finance"]}},"/api/meridian/v1/finance/tax_periods/{id}/close":{"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.TaxPeriodsController.close","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Closed tax period"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Close a tax period","tags":["Meridian · Finance"]}},"/api/meridian/v1/documents/upload-url":{"post":{"callbacks":{},"description":"Returns a pre-signed upload URL and token. REQUIRES the client to make an outbound HTTP PUT of the raw file bytes to upload_url, then call finalize_document_upload with the upload_token. Sandboxed clients (e.g. Cowork) usually CANNOT make this PUT — in that case use create_document for files ≤ 1 MB, or ask the user to upload larger files directly in Meridian.","operationId":"MeridianWeb.Api.Meridian.DocumentsController.upload_url","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content_type":{"type":"string"},"filename":{"type":"string"},"linkable_id":{"type":"integer"},"linkable_type":{"description":"company, opportunity, proposal, expense, or invoice","type":"string"}},"required":["filename","content_type","linkable_type","linkable_id"],"type":"object"}}},"description":"Upload request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Upload URL"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Get a signed URL to upload a large document","tags":["Meridian · Documents"]}},"/api/meridian/v1/finance/expenses/{id}/approve":{"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.ExpensesController.approve","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Approved expense"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid status"}},"security":[{"bearer_auth":[]}],"summary":"Approve a pending finance expense","tags":["Meridian · Finance"]}},"/api/meridian/v1/finance/reimbursements":{"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.ReimbursementsController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount_cents":{"type":"integer"},"beneficiary_user_id":{"type":"integer"},"idempotency_key":{"type":"string"},"notes":{"type":"string"},"period_end":{"format":"date","type":"string"},"period_start":{"format":"date","type":"string"},"reimbursement_date":{"format":"date","type":"string"},"transfer_reference":{"type":"string"}},"required":["beneficiary_user_id","reimbursement_date","amount_cents","idempotency_key"],"type":"object"}}},"description":"Reimbursement attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created reimbursement"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Record a shareholder or employee reimbursement","tags":["Meridian · Finance"]}},"/api/meridian/v1/issues/{id}":{"get":{"callbacks":{},"description":"Returns a single issue by its database ID.","operationId":"MeridianWeb.Api.Meridian.IssuesController.show","parameters":[{"description":"Issue ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"object"}},"type":"object"}}},"description":"Issue"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get issue by ID","tags":["Meridian · Issues"]},"patch":{"callbacks":{},"description":"Update status, priority, or category of an issue.","operationId":"MeridianWeb.Api.Meridian.IssuesController.update","parameters":[{"description":"Issue ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated issue"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update issue","tags":["Meridian · Issues"]}},"/api/meridian/v1/finance/tax_periods/{id}":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.TaxPeriodsController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Tax period"}},"security":[{"bearer_auth":[]}],"summary":"Get tax period with accrual totals","tags":["Meridian · Finance"]}},"/api/meridian/v1/finance/accounts/{id}":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.AccountsController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Account"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get a finance account with its current balance","tags":["Meridian · Finance"]},"patch":{"callbacks":{},"description":"Updatable: name, currency, institution, last_four, active, is_tax_reserve, holder_user_id, opening_balance_cents, opening_balance_date. Account type is immutable.","operationId":"MeridianWeb.Api.Meridian.Finance.AccountsController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"active":{"type":"boolean"},"currency":{"type":"string"},"holder_user_id":{"type":"integer"},"institution":{"type":"string"},"is_tax_reserve":{"type":"boolean"},"last_four":{"type":"string"},"name":{"type":"string"},"opening_balance_cents":{"type":"integer"},"opening_balance_date":{"format":"date","type":"string"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated account"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a finance account (opening balance, details)","tags":["Meridian · Finance"]}},"/api/meridian/v1/documents/{id}":{"get":{"callbacks":{},"description":"Prefer this tool for summarizing, Q&A, or any task where the text content is sufficient. Returns extracted text (as HTML) when extraction is completed. If extraction is not yet complete, extracted_html is nil and a note field explains the status — in that case use get_document_download_url to fetch the original file for full fidelity.","operationId":"MeridianWeb.Api.Meridian.DocumentsController.show","parameters":[{"description":"Document ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Document"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Read a document's extracted text (quick reading)","tags":["Meridian · Documents"]}},"/api/meridian/v1/products":{"get":{"callbacks":{},"description":"Returns all active products for the authenticated organization.","operationId":"MeridianWeb.Api.Meridian.ProductsController.index","parameters":[{"description":"Include inactive products","in":"query","name":"include_inactive","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"type":"object"},"type":"array"}},"type":"object"}}},"description":"Product list"}},"security":[{"bearer_auth":[]}],"summary":"List products","tags":["Meridian · Products"]}},"/api/meridian/v1/finance/settings":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.SettingsController.show","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Finance settings"}},"security":[{"bearer_auth":[]}],"summary":"Get finance settings (operating account, approvers, thresholds)","tags":["Meridian · Finance"]},"patch":{"callbacks":{},"description":"Designate the operating/tax-reserve accounts, the primary shareholder, approvers and thresholds. Account and user ids must belong to the organization.","operationId":"MeridianWeb.Api.Meridian.Finance.SettingsController.update","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"capitalization_threshold_cents":{"type":"integer"},"default_expense_approver_id":{"type":"integer"},"expense_approval_enabled":{"type":"boolean"},"operating_account_id":{"description":"Account receiving invoice payments and funding reimbursements","type":"integer"},"primary_shareholder_user_id":{"type":"integer"},"shareholder_expense_approval_enabled":{"type":"boolean"},"tax_period_frequency":{"description":"monthly, quarterly or annual","type":"string"},"tax_reserve_account_id":{"type":"integer"}},"type":"object"}}},"description":"Updatable fields","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated settings"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update finance settings","tags":["Meridian · Finance"]}},"/api/meridian/v1/documents/finalize":{"post":{"callbacks":{},"description":"After uploading a file via the upload URL, call this to save the document and link it to the entity.","operationId":"MeridianWeb.Api.Meridian.DocumentsController.finalize","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"upload_token":{"description":"The token returned by create_document_upload","type":"string"}},"required":["upload_token"],"type":"object"}}},"description":"Finalize request","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created document"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Finalize a document upload","tags":["Meridian · Documents"]}},"/api/meridian/v1/finance/transfers":{"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.TransfersController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount_cents":{"type":"integer"},"currency":{"type":"string"},"description":{"type":"string"},"from_account_id":{"type":"integer"},"idempotency_key":{"type":"string"},"to_account_id":{"type":"integer"},"transfer_date":{"format":"date","type":"string"}},"required":["from_account_id","to_account_id","transfer_date","amount_cents","description","idempotency_key"],"type":"object"}}},"description":"Transfer attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created transfer"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create an account transfer","tags":["Meridian · Finance"]}},"/api/meridian/v1/finance/export":{"get":{"callbacks":{},"description":"Exports accounts, transactions, expenses, invoices, cash position, income statement,\nand employee expense balances as a multi-sheet Excel workbook.\n","operationId":"MeridianWeb.Api.Meridian.Finance.ExportsController.show","parameters":[{"description":"ISO8601 start date (default: month start)","in":"query","name":"period_start","required":false,"schema":{"type":"string"}},{"description":"ISO8601 end date (default: month end)","in":"query","name":"period_end","required":false,"schema":{"type":"string"}},{"description":"`json` (default, base64 payload) or `binary` (raw .xlsx download)","in":"query","name":"format","required":false,"schema":{"type":"string"}},{"description":"Include Avances_actionnaire sheet (default true)","in":"query","name":"include_shareholder_balances","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Workbook export"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid period"}},"security":[{"bearer_auth":[]}],"summary":"Export finance workbook","tags":["Meridian · Finance"]}},"/api/meridian/v1/opportunities":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.OpportunitiesController.index","parameters":[{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO8601 timestamp filter","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Filter by status (open/won/lost)","in":"query","name":"status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Opportunity list"},"401":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"}},"security":[{"bearer_auth":[]}],"summary":"List opportunities","tags":["Meridian · Opportunities"]},"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.OpportunitiesController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"},"pipeline_id":{"type":"integer"},"stage_id":{"type":"integer"}},"required":["name","pipeline_id","stage_id"],"type":"object"}}},"description":"Opportunity attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created opportunity"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create an opportunity","tags":["Meridian · Opportunities"]}},"/api/meridian/v1/webhooks/{id}/deliveries":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.WebhooksController.deliveries","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Default 50, max 500","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"type":"object"},"type":"array"}},"type":"object"}}},"description":"Deliveries"}},"security":[{"bearer_auth":[]}],"summary":"List recent delivery attempts for a webhook","tags":["Meridian · Webhooks"]}},"/api/meridian/v1/suppliers":{"get":{"callbacks":{},"description":"Returns supplier companies for the authenticated organization.","operationId":"MeridianWeb.Api.Meridian.SuppliersController.index","parameters":[{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Supplier list"}},"security":[{"bearer_auth":[]}],"summary":"List suppliers","tags":["Meridian · Suppliers"]},"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.SuppliersController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"industry":{"type":"string"},"linkedin_url":{"type":"string"},"location":{"type":"string"},"name":{"type":"string"},"notes":{"type":"string"},"preferred_locale":{"type":"string"},"tax_exempt":{"type":"boolean"},"tax_id":{"type":"string"},"tax_id_type":{"type":"string"},"website":{"type":"string"}},"required":["name"],"type":"object"}}},"description":"Supplier attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created supplier"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a supplier","tags":["Meridian · Suppliers"]}},"/api/meridian/v1/finance/expense_categories":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.ExpenseCategoriesController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Category list"}},"security":[{"bearer_auth":[]}],"summary":"List expense categories with default deductible percentages","tags":["Meridian · Finance"]},"post":{"callbacks":{},"description":"Code is required and unique per organization. Position defaults to the end of the list when omitted.","operationId":"MeridianWeb.Api.Meridian.Finance.ExpenseCategoriesController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Unique code per organization","type":"string"},"default_deductible_pct":{"description":"0-100, defaults to 100","type":"integer"},"name_en":{"type":"string"},"name_fr":{"type":"string"},"position":{"type":"integer"}},"required":["code"],"type":"object"}}},"description":"Category attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created category"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create an expense category","tags":["Meridian · Finance"]}},"/api/meridian/v1/proposals":{"get":{"callbacks":{},"description":"Returns a summary of proposals. Full body (typst_source, section_layout) is available on the show endpoint.","operationId":"MeridianWeb.Api.Meridian.ProposalsController.index","parameters":[{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO8601 timestamp filter","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Filter by status","in":"query","name":"status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Proposal summary list"},"401":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"}},"security":[{"bearer_auth":[]}],"summary":"List proposals (summary projection)","tags":["Meridian · Proposals"]},"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ProposalsController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"currency":{"type":"string"},"description":{"type":"string"},"discount_cents":{"type":"integer"},"name":{"type":"string"},"notes":{"type":"string"},"opportunity_id":{"type":"integer"},"pricing_type":{"type":"string"},"status":{"type":"string"},"subtotal_cents":{"type":"integer"},"total_cents":{"type":"integer"},"valid_until":{"format":"date","type":"string"}},"required":["name","opportunity_id"],"type":"object"}}},"description":"Proposal attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created proposal"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a proposal","tags":["Meridian · Proposals"]}},"/api/meridian/v1/clients":{"get":{"callbacks":{},"description":"Returns clients for the authenticated organization.","operationId":"MeridianWeb.Api.Meridian.ClientsController.index","parameters":[{"description":"Max results (default 100, max 100)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO8601 timestamp filter","in":"query","name":"updated_since","required":false,"schema":{"type":"string"}},{"description":"Filter by qualification_status","in":"query","name":"qualification_status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Client list"},"401":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"}},"security":[{"bearer_auth":[]}],"summary":"List clients","tags":["Meridian · Clients"]},"post":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ClientsController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"client_origin":{"type":"string"},"client_status":{"type":"string"},"description":{"type":"string"},"employee_count":{"type":"integer"},"industry":{"type":"string"},"linkedin_url":{"type":"string"},"location":{"type":"string"},"manual_last_contact_kind":{"type":"string"},"manual_last_contact_on":{"format":"date","type":"string"},"manual_step_note":{"type":"string"},"name":{"type":"string"},"next_action":{"type":"string"},"notes":{"type":"string"},"preferred_locale":{"type":"string"},"qualification_status":{"type":"string"},"service_interests":{"type":"string"},"tax_exempt":{"type":"boolean"},"tax_id":{"type":"string"},"tax_id_type":{"type":"string"},"website":{"type":"string"}},"required":["name"],"type":"object"}}},"description":"Client attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created client"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a client","tags":["Meridian · Clients"]}},"/api/meridian/v1/me":{"get":{"callbacks":{},"description":"Returns the calling user's identity, organization, permissions, and the\nAPI key used for this request.\n\nSuper-admins receive `[\"*\"]` in the `permissions` field rather than an\nexhaustive list of every existing permission slug.\n","operationId":"MeridianWeb.Api.Meridian.MeController.show","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"api_key":{"allOf":[{"properties":{"expires_at":{"format":"date-time","nullable":true,"type":"string"},"id":{"type":"integer"},"kind":{"enum":["meridian"],"type":"string"},"name":{"type":"string"}},"type":"object"}],"description":"Null when authenticated via OAuth (e.g. MCP connector).","nullable":true},"auth_method":{"description":"How this request was authenticated.","enum":["api_key","oauth"],"type":"string"},"organization":{"properties":{"catalogs":{"description":"Catalogs configurable per organization.","properties":{"activity_types":{"items":{"type":"string"},"type":"array"},"client_statuses":{"items":{"type":"string"},"type":"array"},"contact_kinds":{"items":{"type":"string"},"type":"array"},"contact_roles":{"items":{"type":"string"},"type":"array"},"deal_types":{"items":{"type":"string"},"type":"array"},"payment_methods":{"items":{"type":"string"},"type":"array"},"pricing_types":{"items":{"type":"string"},"type":"array"},"product_types":{"items":{"properties":{"key":{"type":"string"},"name_en":{"nullable":true,"type":"string"},"name_fr":{"nullable":true,"type":"string"}},"type":"object"},"type":"array"},"services":{"items":{"properties":{"key":{"type":"string"},"name_en":{"nullable":true,"type":"string"},"name_fr":{"nullable":true,"type":"string"}},"type":"object"},"type":"array"},"tax_id_types":{"items":{"type":"string"},"type":"array"}},"type":"object"},"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"statuses":{"additionalProperties":{"items":{"properties":{"code":{"type":"string"},"color":{"type":"string"},"id":{"type":"integer"},"is_default":{"type":"boolean"},"label":{"type":"string"},"position":{"type":"integer"},"semantic_type":{"type":"string"}},"type":"object"},"type":"array"},"description":"Custom statuses grouped by field_kind.","type":"object"}},"type":"object"},"permissions":{"description":"Permission slugs the user holds in the current org. Returns [\"*\"] for super-admins.","items":{"type":"string"},"type":"array"},"user":{"properties":{"email":{"type":"string"},"id":{"type":"integer"},"is_super_admin":{"type":"boolean"},"name":{"type":"string"}},"type":"object"}},"type":"object"}},"type":"object"}}},"description":"Identity context"},"401":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid or missing key"}},"security":[{"bearer_auth":[]}],"summary":"Get authenticated user context","tags":["Meridian · Identity"]}},"/api/meridian/v1/finance/transactions":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.TransactionsController.index","parameters":[{"description":"","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"","in":"query","name":"account_id","required":false,"schema":{"type":"integer"}},{"description":"ISO8601 date","in":"query","name":"from_date","required":false,"schema":{"type":"string"}},{"description":"ISO8601 date","in":"query","name":"to_date","required":false,"schema":{"type":"string"}},{"description":"","in":"query","name":"type","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Transaction list"}},"security":[{"bearer_auth":[]}],"summary":"List finance transactions","tags":["Meridian · Finance"]},"post":{"callbacks":{},"description":"Direct revenue/expense/tax_remittance entry. Account-to-account moves stay on create_transfer; linked expense/invoice rows cannot be created here. Requires an idempotency_key (replays the existing row on retry).","operationId":"MeridianWeb.Api.Meridian.Finance.TransactionsController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"type":"integer"},"amount_cents":{"type":"integer"},"category_id":{"type":"integer"},"counterparty_company_id":{"description":"Supplier/client (company) ID","type":"integer"},"currency":{"type":"string"},"description":{"type":"string"},"document_id":{"type":"integer"},"gst_cents":{"type":"integer"},"idempotency_key":{"type":"string"},"qst_cents":{"type":"integer"},"subtotal_cents":{"type":"integer"},"transaction_date":{"format":"date","type":"string"},"type":{"description":"revenue, expense or tax_remittance","type":"string"}},"required":["account_id","transaction_date","description","type","amount_cents","idempotency_key"],"type":"object"}}},"description":"Transaction attributes","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Created transaction"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Post a manual transaction on an account","tags":["Meridian · Finance"]}},"/api/meridian/v1/projects/{id}":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.ProjectsController.show","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Project"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get project by ID","tags":["Meridian · Projects"]}},"/api/meridian/v1/finance/shareholder_balance":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.Finance.ShareholderController.show","parameters":[{"description":"Defaults to primary shareholder from finance settings","in":"query","name":"user_id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Shareholder balance"}},"security":[{"bearer_auth":[]}],"summary":"Get shareholder employee expense balance","tags":["Meridian · Finance"]}},"/api/meridian/v1/knowledge/{id}/reject":{"post":{"callbacks":{},"description":"Rejects an article in the approval queue. Only articles with source ai_pending can be rejected.","operationId":"MeridianWeb.Api.Meridian.KnowledgeController.reject","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"reason":{"type":"string"}},"type":"object"}}},"description":"Optional rejection note","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Rejected article"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid transition"}},"security":[{"bearer_auth":[]}],"summary":"Reject a pending knowledge article","tags":["Meridian · Knowledge"]}},"/api/meridian/v1/webhooks":{"get":{"callbacks":{},"operationId":"MeridianWeb.Api.Meridian.WebhooksController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"description":{"nullable":true,"type":"string"},"event_types":{"items":{"type":"string"},"type":"array"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"is_active":{"type":"boolean"},"updated_at":{"format":"date-time","type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Webhooks"}},"security":[{"bearer_auth":[]}],"summary":"List webhooks for the authenticated organization","tags":["Meridian · Webhooks"]},"post":{"callbacks":{},"description":"Creates a webhook. Response includes a hex-encoded `secret` used to\nverify incoming signatures — shown ONCE. The signature header on\nevery delivery is `X-Meridian-Signature: t=<unix>,sha256=<hex>` and\nthe timestamp is also mirrored in `X-Meridian-Timestamp`. Verify\nwith `HMAC-SHA256(secret, \"<unix>.<raw_body>\")` and reject deliveries\nwith a timestamp more than 5 minutes old (replay protection).\n\nRequires `admin_settings_edit` permission.\n\n## Supported event types\n\n  - `guard.halt`                — Guard policy halted a request (strict mode)\n  - `guard.detection`           — any Guard detection (verbose)\n  - `billing.low_balance`       — credit balance dropped below threshold\n  - `billing.monthly_threshold` — cumulative monthly cost crossed configured threshold\n  - `router.error_rate`         — error rate exceeded configured threshold\n","operationId":"MeridianWeb.Api.Meridian.WebhooksController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"event_types":{"items":{"enum":["guard.halt","guard.detection","billing.low_balance","billing.monthly_threshold","router.error_rate"],"type":"string"},"type":"array"},"url":{"example":"https://yourapp.com/hooks/meridian","type":"string"}},"required":["url","event_types"],"type":"object"}}},"description":"Creation request","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"allOf":[{"properties":{"description":{"nullable":true,"type":"string"},"event_types":{"items":{"type":"string"},"type":"array"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":"string"},"is_active":{"type":"boolean"},"updated_at":{"format":"date-time","type":"string"},"url":{"type":"string"}},"type":"object"},{"properties":{"secret":{"description":"Hex-encoded HMAC secret — shown ONCE","type":"string"}},"type":"object"}]}}},"description":"Created"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a webhook subscription","tags":["Meridian · Webhooks"]}},"/api/meridian/v1/issues/ref/{reference}":{"get":{"callbacks":{},"description":"Returns a single issue by its human-readable reference code.","operationId":"MeridianWeb.Api.Meridian.IssuesController.show_by_reference","parameters":[{"description":"Issue reference (e.g. ISS-001)","in":"path","name":"reference","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"object"}},"type":"object"}}},"description":"Issue"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get issue by reference","tags":["Meridian · Issues"]}}},"security":[{"bearer_auth":[]}],"servers":[{"description":"Current server","url":"/","variables":{}}],"tags":[]}