{"openapi":"3.1.0","info":{"title":"Outvexa API","version":"1.4.0","description":"Error codes:\n- VALIDATION_FAILED: Request body, query or params failed validation (400)\n- UNAUTHENTICATED: Missing or expired session / API key (401)\n- CSRF_FAILED: Missing or wrong X-CSRF-Token header (403)\n- FORBIDDEN: Role does not allow this action (403)\n- NOT_FOUND: Resource does not exist in this workspace (404)\n- RATE_LIMITED: Too many requests (429)\n- CONFLICT: Unique constraint or state conflict (409)\n- CAMPAIGN_INVALID: Campaign failed validation and cannot be approved/started (400)\n- CAMPAIGN_STATE: Action not allowed in the campaign current status (409)\n- PROVIDER_NOT_CONFIGURED: Integration / AI provider / OAuth app not configured (400)\n- PROVIDER_ERROR: External provider returned an error (502)\n- AI_BUDGET_EXCEEDED: Monthly AI budget for this task is used up (402)\n- AI_COST_LIMIT: Per-lead AI cost limit would be exceeded (402)\n- QUALITY_CHECK_FAILED: Personalization has failing quality checks and cannot be approved (400)\n- AI_OUTPUT_INVALID: AI response failed schema validation (502)\n- WEAK_PASSWORD: Password does not meet the strength policy (400)\n- INVALID_PASSWORD: Current password is wrong (400)\n- REGISTRATION_CLOSED: Public registration is disabled; use an invitation (403)\n- LOGIN_REQUIRED: Invitation belongs to an existing account; log in first (400)\n- INVITATION_INVALID: Invitation token invalid, used or expired (400)\n- INVITATION_EMAIL_MISMATCH: Logged-in user is not the invited email (400)\n- LAST_OWNER: Cannot remove/demote the last workspace owner (400)\n- OAUTH_STATE_INVALID: OAuth state expired, reused or for another provider (400)\n- OAUTH_DENIED: User or tenant admin denied consent (400)\n- OAUTH_NO_REFRESH: Provider returned no refresh token (400)\n- ACCOUNT_NOT_CONNECTED: Mailbox is disconnected / needs re-authentication (400/409)\n- UNRESOLVED_VARIABLES: Template still contains unresolved {{variables}} (400)\n- FACT_CHECK_FAILED: Independent fact-check found unsupported claims (400)\n- ICP_REQUIRED: Scoring needs an ICP first (400)\n- NOT_ELIGIBLE: Lead fails a compliance/suppression/verification gate (400)\n- REVIEW_REQUIRED: Country rule needs explicit review before enabling (400)\n- INVALID_TOKEN: Unsubscribe/booking token invalid (400)\n- MFA_REQUIRED: Workspace requires two-factor authentication (403)\n- INVALID_CODE: Two-factor code invalid (400)\n- QUOTA_EXCEEDED: Plan limit reached for this resource (402)\n- SUBSCRIPTION_INACTIVE: Subscription inactive; feature unavailable (402)\n- INVALID_SIGNATURE: Webhook signature verification failed (400)\n- TENANT_INACTIVE: Organization is suspended, cancelled or being deleted; writes are blocked (403)\n- EMAIL_NOT_VERIFIED: Confirm your email address before this action (403)\n- INVALID_TRANSITION: Organization status change not allowed from the current status (409)\n- SUPPRESSED: Recipient is on the suppression list (400)\n- INTERNAL: Unexpected server error (500)"},"servers":[{"url":"https://outvexa.com"}],"components":{"securitySchemes":{"sessionCookie":{"type":"apiKey","in":"cookie","name":"emn_session"},"csrfHeader":{"type":"apiKey","in":"header","name":"X-CSRF-Token","description":"Required with cookie auth on POST/PUT/PATCH/DELETE"},"apiKey":{"type":"http","scheme":"bearer","description":"Workspace API key: emn_<prefix>_<secret>"}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_FAILED","UNAUTHENTICATED","CSRF_FAILED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","CONFLICT","CAMPAIGN_INVALID","CAMPAIGN_STATE","PROVIDER_NOT_CONFIGURED","PROVIDER_ERROR","AI_BUDGET_EXCEEDED","AI_COST_LIMIT","QUALITY_CHECK_FAILED","AI_OUTPUT_INVALID","WEAK_PASSWORD","INVALID_PASSWORD","REGISTRATION_CLOSED","LOGIN_REQUIRED","INVITATION_INVALID","INVITATION_EMAIL_MISMATCH","LAST_OWNER","OAUTH_STATE_INVALID","OAUTH_DENIED","OAUTH_NO_REFRESH","ACCOUNT_NOT_CONNECTED","UNRESOLVED_VARIABLES","FACT_CHECK_FAILED","ICP_REQUIRED","NOT_ELIGIBLE","REVIEW_REQUIRED","INVALID_TOKEN","MFA_REQUIRED","INVALID_CODE","QUOTA_EXCEEDED","SUBSCRIPTION_INACTIVE","INVALID_SIGNATURE","TENANT_INACTIVE","EMAIL_NOT_VERIFIED","INVALID_TRANSITION","SUPPRESSED","INTERNAL"]},"message":{"type":"string"},"details":{},"requestId":{"type":"string"}}}}}}}}}},"paths":{"/api/v1/auth/bootstrap":{"get":{"tags":["Auth"],"summary":"Whether the first admin account still needs to be created","description":"Authentication: none (public)\n\nRate limit: global Nginx limit","parameters":[],"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/register":{"post":{"tags":["Auth"],"summary":"Create the first admin account (or register when public registration is enabled)","description":"Authentication: none (public)\n\nRate limit: 5 requests / 3600s per ip","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":100},"password":{"type":"string","minLength":8,"maxLength":200},"workspaceName":{"type":"string","minLength":2,"maxLength":80}},"required":["email","name","password","workspaceName"]}}}},"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":5,"windowSec":3600},"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Log in with email + password (sets session cookie)","description":"Authentication: none (public)\n\nRate limit: 10 requests / 300s per ip","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1,"maxLength":200}},"required":["email","password"]}}}},"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":300},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/mfa/verify":{"post":{"tags":["Auth"],"summary":"Second login step: TOTP or recovery code for an MFA challenge","description":"Authentication: none (public)\n\nRate limit: 10 requests / 300s per ip","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string","minLength":20,"maxLength":200},"code":{"type":"string","minLength":6,"maxLength":20}},"required":["challenge","code"]}}}},"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":300},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/password/forgot":{"post":{"tags":["Auth"],"summary":"Email a single-use password reset link (same answer whether or not the account exists)","description":"Authentication: none (public)\n\nRate limit: 5 requests / 900s per ip","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]}}}},"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":5,"windowSec":900},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/password/reset":{"post":{"tags":["Auth"],"summary":"Set a new password with a reset token (signs out all sessions)","description":"Authentication: none (public)\n\nRate limit: 10 requests / 900s per ip","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":200},"password":{"type":"string","minLength":8,"maxLength":200}},"required":["token","password"]}}}},"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":900},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/mfa":{"get":{"tags":["Auth"],"summary":"My two-factor status","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/mfa/setup":{"post":{"tags":["Auth"],"summary":"Start TOTP setup (secret + QR, not active until confirmed)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: 10 requests / 900s per user","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":900,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/mfa/enable":{"post":{"tags":["Auth"],"summary":"Confirm TOTP setup with a code; returns recovery codes once","description":"Authentication: signed-in user (session cookie)\n\nRate limit: 10 requests / 900s per user","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":6,"maxLength":6}},"required":["code"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":900,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/mfa/disable":{"post":{"tags":["Auth"],"summary":"Turn off two-factor (password + current code or recovery code)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: 5 requests / 900s per user","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","minLength":1},"code":{"type":"string","minLength":6,"maxLength":20}},"required":["password","code"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":5,"windowSec":900,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/logout":{"post":{"tags":["Auth"],"summary":"Log out (revokes session). In a \"log in as\" session this returns the super admin to their own account.","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/me":{"get":{"tags":["Auth"],"summary":"Current user, CSRF token and workspaces","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/password":{"post":{"tags":["Auth"],"summary":"Change password (revokes other sessions)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: 5 requests / 900s per user","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"currentPassword":{"type":"string"},"newPassword":{"type":"string","minLength":8,"maxLength":200}},"required":["currentPassword","newPassword"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":5,"windowSec":900,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/sessions":{"get":{"tags":["Auth"],"summary":"List my active sessions","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/sessions/{id}":{"delete":{"tags":["Auth"],"summary":"Revoke one of my sessions","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/invitations/{token}/accept":{"post":{"tags":["Auth"],"summary":"Accept a workspace invitation (creates account if needed)","description":"Authentication: none (public)\n\nRate limit: 10 requests / 600s per ip","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"password":{"type":"string","maxLength":200}}}}}},"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":600},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/workspaces":{"post":{"tags":["Workspaces"],"summary":"Create a workspace","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80}},"required":["name"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}":{"get":{"tags":["Workspaces"],"summary":"Workspace details & settings","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Workspaces"],"summary":"Update workspace settings (sender identity, postal address, retention, providers)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"timezone":{"type":"string"},"senderLegalName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"postalAddress":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"settings":{"type":"object","properties":{"bookingLink":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"offerFacts":{"default":"","type":"string","maxLength":4000},"retentionDays":{"default":{"aiOutputs":90,"importFiles":30,"domainChecks":90,"auditLogs":730},"type":"object","properties":{"aiOutputs":{"default":90,"type":"integer","minimum":7,"maximum":3650},"importFiles":{"default":30,"type":"integer","minimum":1,"maximum":365},"domainChecks":{"default":90,"type":"integer","minimum":7,"maximum":3650},"auditLogs":{"default":730,"type":"integer","minimum":90,"maximum":3650}}},"searchProvider":{"default":"none","type":"string","enum":["none","brave","serper"]},"leadProvider":{"default":"none","type":"string","enum":["none","apollo"]},"verifierProvider":{"default":"none","type":"string","enum":["none","millionverifier"]},"emailVerificationMode":{"default":"custom","type":"string","enum":["custom","external","disabled"]},"verificationFreshnessDays":{"default":90,"type":"integer","minimum":1,"maximum":365},"verificationUnknownPolicy":{"default":"hold","type":"string","enum":["hold","allow"]},"verificationDisposablePolicy":{"default":"block","type":"string","enum":["block","allow"]},"verificationRolePolicy":{"default":"review","type":"string","enum":["allow","review","block"]},"verificationSmtpProbeEnabled":{"default":false,"type":"boolean"},"verificationSmtpMailFrom":{"default":null,"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"emergencyPause":{"default":false,"type":"boolean"},"automaticCampaignSending":{"default":true,"type":"boolean"},"automaticFollowups":{"default":true,"type":"boolean"},"aiReplyClassification":{"default":true,"type":"boolean"},"aiFollowupGeneration":{"default":true,"type":"boolean"},"mailboxReadinessManagement":{"default":false,"type":"boolean"},"dailyDomainSendLimit":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"trackingBaseUrl":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"aiMonthlyBudgetUsd":{"default":null,"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]},"aiMaxCostPerLeadUsd":{"default":null,"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"dailyEmailSendLimit":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"mailboxAutoPauseBounceRatePct":{"default":5,"anyOf":[{"type":"number","minimum":0.5,"maximum":50},{"type":"null"}]},"mailboxReadinessSoftBounceRatePct":{"default":10,"anyOf":[{"type":"number","minimum":0.5,"maximum":50},{"type":"null"}]},"mailboxAutoPauseMinSends":{"default":20,"type":"integer","minimum":5,"maximum":10000},"requireMfa":{"default":false,"type":"boolean"},"replyMode":{"default":"draft","type":"string","enum":["suggest","draft","auto_narrow"]},"autoReplyCategories":{"default":[],"type":"array","items":{"type":"string"}},"verifierOrder":{"default":["millionverifier"],"type":"array","items":{"type":"string","enum":["millionverifier","zerobounce","neverbounce"]}},"finderOrder":{"default":[],"type":"array","items":{"type":"string","enum":["hunter"]}},"stageProbabilities":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["NEW","QUALIFIED","MEETING","PROPOSAL"]},"additionalProperties":{"type":"number","minimum":0,"maximum":1}}}}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/dashboard":{"get":{"tags":["Workspaces"],"summary":"Overview dashboard counters","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/members":{"get":{"tags":["Team"],"summary":"Members and pending invitations","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/members/{memberId}":{"patch":{"tags":["Team"],"summary":"Change a member role","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","MANAGER","MEMBER","VIEWER"]}},"required":["role"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Team"],"summary":"Remove a member","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"memberId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/invitations":{"post":{"tags":["Team"],"summary":"Invite a member (returns a link to share)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["OWNER","ADMIN","MANAGER","MEMBER","VIEWER"]}},"required":["email","role"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/invitations/{id}":{"delete":{"tags":["Team"],"summary":"Revoke an invitation","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/api-keys":{"get":{"tags":["API keys"],"summary":"List API keys (secrets never returned)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["API keys"],"summary":"Create an API key (shown once)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"role":{"default":"MEMBER","type":"string","enum":["OWNER","ADMIN","MANAGER","MEMBER","VIEWER"]},"expiresInDays":{"type":"integer","minimum":1,"maximum":730},"scopes":{"maxItems":50,"type":"array","items":{"type":"string","pattern":"^(\\*|[a-z0-9-]+):(read|write|\\*)$|^\\*$"}}},"required":["name"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/api-keys/{id}":{"delete":{"tags":["API keys"],"summary":"Revoke an API key","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/notifications":{"get":{"tags":["Notifications"],"summary":"My notifications","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/notifications/read":{"post":{"tags":["Notifications"],"summary":"Mark notifications read (all if ids omitted)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/audit-logs":{"get":{"tags":["Logs"],"summary":"Audit log","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"action","in":"query","required":false,"schema":{"type":"string"}},{"name":"actorUserId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"entityType","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/error-logs":{"get":{"tags":["Logs"],"summary":"Error log (API + worker)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["api","worker"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/jobs/queues":{"get":{"tags":["Jobs"],"summary":"Queue counts (all workspaces on this server)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/jobs/failed":{"get":{"tags":["Jobs"],"summary":"Failed jobs for a queue (this workspace)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"queue","in":"query","required":true,"schema":{"type":"string","enum":["scheduler","outbound-prepare","send","reply-send","mailbox-sync","ai","research","import","verify","domain-health","maintenance","automation","webhooks","privacy","personalize","ai-sub-claude","ai-sub-codex","ai-workflow-api"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/jobs/retry":{"post":{"tags":["Jobs"],"summary":"Retry a failed job","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queue":{"type":"string","enum":["scheduler","outbound-prepare","send","reply-send","mailbox-sync","ai","research","import","verify","domain-health","maintenance","automation","webhooks","privacy","personalize","ai-sub-claude","ai-sub-codex","ai-workflow-api"]},"jobId":{"type":"string"}},"required":["queue","jobId"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/jobs/history":{"get":{"tags":["Jobs"],"summary":"Recorded job runs","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"queue","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/privacy/requests":{"get":{"tags":["Privacy"],"summary":"Data export / erasure requests","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Privacy"],"summary":"Create an export or erasure request for one email address","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["EXPORT","ERASURE"]},"subjectEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["type","subjectEmail"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/privacy/requests/{id}/download":{"get":{"tags":["Privacy"],"summary":"Download a completed export (JSON)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/export":{"get":{"tags":["Privacy"],"summary":"Full workspace data export (JSON)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: OWNER\n\nRate limit: 3 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"OWNER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":3,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads":{"get":{"tags":["Leads"],"summary":"Search / filter leads","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["NEW","RESEARCHED","QUALIFIED","DISQUALIFIED","CONTACTED","REPLIED","INTERESTED","MEETING_BOOKED","NOT_INTERESTED","CUSTOMER","UNSUBSCRIBED","BOUNCED"]}},{"name":"listId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"companyId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"verification","in":"query","required":false,"schema":{"type":"string","enum":["UNVERIFIED","VALID","INVALID","RISKY","CATCH_ALL","UNKNOWN"]}},{"name":"minScore","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"default":"createdAt","type":"string","enum":["createdAt","score","lastRepliedAt","email"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Leads"],"summary":"Create a lead","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"linkedinUrl":{"anyOf":[{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},{"type":"string","const":""}]},"website":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"country":{"anyOf":[{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},{"type":"string","const":""}]},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"companyDomain":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"lawfulBasis":{"type":"string","enum":["UNKNOWN","CONSENT","LEGITIMATE_INTEREST","EXISTING_RELATIONSHIP","NOT_REQUIRED"]},"lawfulBasisNote":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"tags":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":50}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"ownerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["email"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/export":{"get":{"tags":["Leads"],"summary":"Export leads as CSV (same filters as list)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["NEW","RESEARCHED","QUALIFIED","DISQUALIFIED","CONTACTED","REPLIED","INTERESTED","MEETING_BOOKED","NOT_INTERESTED","CUSTOMER","UNSUBSCRIBED","BOUNCED"]}},{"name":"listId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"companyId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"verification","in":"query","required":false,"schema":{"type":"string","enum":["UNVERIFIED","VALID","INVALID","RISKY","CATCH_ALL","UNKNOWN"]}},{"name":"minScore","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"default":"createdAt","type":"string","enum":["createdAt","score","lastRepliedAt","email"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/bulk":{"post":{"tags":["Leads"],"summary":"Bulk action on leads","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"action":{"type":"string","enum":["add_to_list","remove_from_list","add_tag","set_status","set_lawful_basis","research","score","verify","delete"]},"listId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"tag":{"type":"string","maxLength":50},"status":{"type":"string","enum":["NEW","RESEARCHED","QUALIFIED","DISQUALIFIED","CONTACTED","REPLIED","INTERESTED","MEETING_BOOKED","NOT_INTERESTED","CUSTOMER","UNSUBSCRIBED","BOUNCED"]},"lawfulBasis":{"type":"string","enum":["UNKNOWN","CONSENT","LEGITIMATE_INTEREST","EXISTING_RELATIONSHIP","NOT_REQUIRED"]},"icpId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["ids","action"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/{id}":{"get":{"tags":["Leads"],"summary":"Lead profile with history, research, scores, conversations","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Leads"],"summary":"Update a lead (status changes are recorded)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"linkedinUrl":{"anyOf":[{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},{"type":"string","const":""}]},"website":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"country":{"anyOf":[{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},{"type":"string","const":""}]},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"companyDomain":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"lawfulBasis":{"type":"string","enum":["UNKNOWN","CONSENT","LEGITIMATE_INTEREST","EXISTING_RELATIONSHIP","NOT_REQUIRED"]},"lawfulBasisNote":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"tags":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":50}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"ownerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"status":{"type":"string","enum":["NEW","RESEARCHED","QUALIFIED","DISQUALIFIED","CONTACTED","REPLIED","INTERESTED","MEETING_BOOKED","NOT_INTERESTED","CUSTOMER","UNSUBSCRIBED","BOUNCED"]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Leads"],"summary":"Delete a lead","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/{id}/notes":{"post":{"tags":["CRM"],"summary":"Add a note to a lead","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["body"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/notes/{id}":{"delete":{"tags":["CRM"],"summary":"Delete a note","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/{id}/verify":{"post":{"tags":["Leads"],"summary":"Verify the lead email now (uses configured verifier)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/{id}/research":{"post":{"tags":["Research"],"summary":"Queue research for a lead","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"thenScore":{"default":false,"type":"boolean"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/{id}/score":{"post":{"tags":["Qualification"],"summary":"Score a lead against an ICP now","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"icpId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/companies":{"get":{"tags":["Companies"],"summary":"List companies","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/companies/{id}":{"get":{"tags":["Companies"],"summary":"Company profile","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Companies"],"summary":"Update a company","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"website":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"industry":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"employeeCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"country":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/companies/{id}/notes":{"post":{"tags":["CRM"],"summary":"Add a note to a company","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["body"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/companies/{id}/research":{"post":{"tags":["Research"],"summary":"Queue research for a company","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/lists":{"get":{"tags":["Lists"],"summary":"Lead lists","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Lists"],"summary":"Create a list","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["name"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/lists/{id}":{"patch":{"tags":["Lists"],"summary":"Rename a list","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Lists"],"summary":"Delete a list (leads are kept)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/imports":{"get":{"tags":["Imports"],"summary":"Recent CSV imports","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Imports"],"summary":"Upload a CSV (multipart field \"file\"); returns headers, sample rows and suggested mapping","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 30 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":3600,"key":"workspace"},"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/imports/{id}/start":{"post":{"tags":["Imports"],"summary":"Start an uploaded import with a column mapping","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","enum":["email","firstName","lastName","title","companyName","companyDomain","website","linkedinUrl","phone","country","city","timezone","tags","ignore"]},{"type":"string","pattern":"^custom\\.[a-zA-Z0-9_]+$"}]}},"dedupeMode":{"default":"skip","type":"string","enum":["skip","update"]},"targetListId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"newListName":{"type":"string","maxLength":100},"sourceName":{"default":"CSV import","type":"string","minLength":1,"maxLength":100},"lawfulBasis":{"default":"UNKNOWN","type":"string","enum":["UNKNOWN","CONSENT","LEGITIMATE_INTEREST","EXISTING_RELATIONSHIP","NOT_REQUIRED"]},"lawfulBasisNote":{"type":"string","maxLength":500},"defaultCountry":{"type":"string","minLength":2,"maxLength":2}},"required":["mapping"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/imports/{id}":{"get":{"tags":["Imports"],"summary":"Import progress and row errors","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/suppressions":{"get":{"tags":["Suppression"],"summary":"Suppression / unsubscribe list","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"reason","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Suppression"],"summary":"Add an email or domain to the suppression list","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["EMAIL","DOMAIN"]},"value":{"type":"string","minLength":3,"maxLength":320},"reason":{"default":"MANUAL","type":"string","enum":["UNSUBSCRIBED","DO_NOT_CONTACT_REQUEST","MANUAL","LEGAL","COMPLAINT"]},"note":{"type":"string","maxLength":500}},"required":["type","value"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/suppressions/import":{"post":{"tags":["Suppression"],"summary":"Bulk import suppressions from CSV (first column = email or @domain)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/suppressions/export":{"get":{"tags":["Suppression"],"summary":"Export suppression list as CSV","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/suppressions/{id}":{"delete":{"tags":["Suppression"],"summary":"Remove a suppression entry (opt-outs need a documented reason)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"reason","in":"query","required":false,"schema":{"default":"","type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/pipeline":{"get":{"tags":["CRM"],"summary":"Opportunity pipeline by stage","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/opportunities":{"post":{"tags":["CRM"],"summary":"Create an opportunity","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":200},"stage":{"default":"NEW","type":"string","enum":["NEW","QUALIFIED","MEETING","PROPOSAL","WON","LOST"]},"valueCents":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"default":"USD","type":"string","minLength":3,"maxLength":3},"expectedCloseAt":{"anyOf":[{},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["leadId","title"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/opportunities/{id}":{"patch":{"tags":["CRM"],"summary":"Update an opportunity (stage, value…)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":200},"stage":{"default":"NEW","type":"string","enum":["NEW","QUALIFIED","MEETING","PROPOSAL","WON","LOST"]},"valueCents":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"default":"USD","type":"string","minLength":3,"maxLength":3},"expectedCloseAt":{"anyOf":[{},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["CRM"],"summary":"Delete an opportunity","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/tasks":{"get":{"tags":["CRM"],"summary":"Tasks / follow-up reminders","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["OPEN","DONE","CANCELLED"]}},{"name":"assigneeId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"due","in":"query","required":false,"schema":{"type":"string","enum":["overdue","today","upcoming"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["CRM"],"summary":"Create a task","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"priority":{"default":"MEDIUM","type":"string","enum":["LOW","MEDIUM","HIGH"]},"dueAt":{"anyOf":[{},{"type":"null"}]},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"leadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"conversationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["title"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/tasks/{id}":{"patch":{"tags":["CRM"],"summary":"Update / complete a task","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"priority":{"default":"MEDIUM","type":"string","enum":["LOW","MEDIUM","HIGH"]},"dueAt":{"anyOf":[{},{"type":"null"}]},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"leadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"conversationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"status":{"type":"string","enum":["OPEN","DONE","CANCELLED"]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["CRM"],"summary":"Delete a task","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/icps":{"get":{"tags":["ICP"],"summary":"Ideal customer profiles","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["ICP"],"summary":"Create an ICP","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"criteria":{"type":"object","properties":{"titles":{"default":[],"type":"array","items":{"type":"string"}},"seniorities":{"default":[],"type":"array","items":{"type":"string"}},"industries":{"default":[],"type":"array","items":{"type":"string"}},"keywords":{"default":[],"type":"array","items":{"type":"string"}},"countries":{"default":[],"type":"array","items":{"type":"string"}},"employeeMin":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"employeeMax":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"mustHave":{"default":[],"type":"array","items":{"type":"string"}},"disqualifiers":{"default":[],"type":"array","items":{"type":"string"}}}},"minScore":{"default":60,"type":"integer","minimum":0,"maximum":100},"isActive":{"default":true,"type":"boolean"}},"required":["name","criteria"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/icps/{id}":{"put":{"tags":["ICP"],"summary":"Update an ICP","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"criteria":{"type":"object","properties":{"titles":{"default":[],"type":"array","items":{"type":"string"}},"seniorities":{"default":[],"type":"array","items":{"type":"string"}},"industries":{"default":[],"type":"array","items":{"type":"string"}},"keywords":{"default":[],"type":"array","items":{"type":"string"}},"countries":{"default":[],"type":"array","items":{"type":"string"}},"employeeMin":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"employeeMax":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"mustHave":{"default":[],"type":"array","items":{"type":"string"}},"disqualifiers":{"default":[],"type":"array","items":{"type":"string"}}}},"minScore":{"default":60,"type":"integer","minimum":0,"maximum":100},"isActive":{"default":true,"type":"boolean"}},"required":["name","criteria"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["ICP"],"summary":"Delete an ICP","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/icps/from-text":{"post":{"tags":["ICP"],"summary":"Convert a natural-language description into structured ICP filters (AI draft)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 30 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":10,"maxLength":4000}},"required":["description"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/prospecting/search":{"post":{"tags":["Prospecting"],"summary":"Search the configured licensed data provider","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 60 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"icpId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"query":{"default":"","type":"string","maxLength":4000},"criteria":{"type":"object","properties":{"titles":{"default":[],"type":"array","items":{"type":"string"}},"seniorities":{"default":[],"type":"array","items":{"type":"string"}},"industries":{"default":[],"type":"array","items":{"type":"string"}},"keywords":{"default":[],"type":"array","items":{"type":"string"}},"countries":{"default":[],"type":"array","items":{"type":"string"}},"employeeMin":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"employeeMax":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"mustHave":{"default":[],"type":"array","items":{"type":"string"}},"disqualifiers":{"default":[],"type":"array","items":{"type":"string"}}}},"page":{"default":1,"type":"integer","minimum":1,"maximum":100},"perPage":{"default":25,"type":"integer","minimum":1,"maximum":100}},"required":["criteria"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":60,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/prospecting/import":{"post":{"tags":["Prospecting"],"summary":"Import selected search results (enrich, dedupe, verify, research, score)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"searchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"}},"listId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"lawfulBasis":{"type":"string","enum":["UNKNOWN","CONSENT","LEGITIMATE_INTEREST","EXISTING_RELATIONSHIP","NOT_REQUIRED"]},"lawfulBasisNote":{"type":"string","maxLength":500},"enrich":{"default":true,"type":"boolean"},"autoVerify":{"default":true,"type":"boolean"},"autoResearch":{"default":true,"type":"boolean"},"autoScore":{"default":true,"type":"boolean"}},"required":["searchId","externalIds","lawfulBasis"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/prospecting/searches":{"get":{"tags":["Prospecting"],"summary":"Recent searches","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/prospecting/searches/{id}":{"get":{"tags":["Prospecting"],"summary":"Search results","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/research":{"get":{"tags":["Research"],"summary":"Research reports","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/research/{id}":{"get":{"tags":["Research"],"summary":"Report with claims and evidence URLs","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/research/claims/{id}":{"patch":{"tags":["Research"],"summary":"Reject / restore a claim (rejected claims are never used in emails)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["SUPPORTED","REJECTED"]}},"required":["status"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/writing/generate":{"post":{"tags":["Writing"],"summary":"Generate an evidence-backed email draft + fact-check","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 120 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mode":{"default":"full","type":"string","enum":["first_line","full","followup"]},"templateSubject":{"default":"","type":"string","maxLength":300},"templateBody":{"default":"","type":"string","maxLength":8000},"previousEmails":{"default":"","type":"string","maxLength":8000},"instructions":{"default":"","type":"string","maxLength":2000}},"required":["leadId"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":120,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/writing/subjects":{"post":{"tags":["Writing"],"summary":"Subject line suggestions","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string","minLength":1,"maxLength":8000},"count":{"default":5,"type":"integer","minimum":1,"maximum":10}},"required":["leadId","body"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/writing/fact-check":{"post":{"tags":["Writing"],"summary":"Fact-check any draft against the lead’s supported claims","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":10000}},"required":["leadId","text"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/providers":{"get":{"tags":["AI"],"summary":"Configured AI providers (key shown as last 4 only)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["AI"],"summary":"Add/update an AI provider key and default model","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["OPENAI","ANTHROPIC","GOOGLE","OPENROUTER","GROQ","TOGETHER","DEEPSEEK","MISTRAL","OLLAMA","CUSTOM_OPENAI"]},"apiKey":{"type":"string","minLength":1,"maxLength":500},"defaultModel":{"type":"string","minLength":1,"maxLength":150},"baseUrl":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"isEnabled":{"type":"boolean"}},"required":["provider","defaultModel"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/providers/{provider}":{"delete":{"tags":["AI"],"summary":"Remove an AI provider","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/providers/{provider}/test":{"post":{"tags":["AI"],"summary":"Test an AI provider connection","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 20 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":20,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/providers/{provider}/models":{"get":{"tags":["AI"],"summary":"List models available to a configured provider","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 30 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/routes":{"get":{"tags":["AI"],"summary":"Model routing per task","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["AI"],"summary":"Set model, fallback and budget for a task","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"string","enum":["PERSONALIZATION","COPILOT","ICP_FROM_TEXT","FACT_EXTRACTION","LEAD_QUALIFICATION","EMAIL_WRITING","SUBJECT_LINES","FOLLOWUP_WRITING","FACT_CHECK","REPLY_CLASSIFICATION","CONVERSATION_SUMMARY","REPLY_DRAFT"]},"provider":{"type":"string","enum":["OPENAI","ANTHROPIC","GOOGLE","OPENROUTER","GROQ","TOGETHER","DEEPSEEK","MISTRAL","OLLAMA","CUSTOM_OPENAI"]},"model":{"type":"string","minLength":1},"fallbackProvider":{"anyOf":[{"type":"string","enum":["OPENAI","ANTHROPIC","GOOGLE","OPENROUTER","GROQ","TOGETHER","DEEPSEEK","MISTRAL","OLLAMA","CUSTOM_OPENAI"]},{"type":"null"}]},"fallbackModel":{"type":["string","null"]},"temperature":{"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"maxOutputTokens":{"type":"integer","minimum":100,"maximum":16000},"maxInputTokens":{"anyOf":[{"type":"integer","minimum":500,"maximum":200000},{"type":"null"}]},"monthlyBudgetUsd":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["task","provider","model"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/prompts":{"get":{"tags":["AI"],"summary":"Prompt versions","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"task","in":"query","required":false,"schema":{"type":"string","enum":["PERSONALIZATION","COPILOT","ICP_FROM_TEXT","FACT_EXTRACTION","LEAD_QUALIFICATION","EMAIL_WRITING","SUBJECT_LINES","FOLLOWUP_WRITING","FACT_CHECK","REPLY_CLASSIFICATION","CONVERSATION_SUMMARY","REPLY_DRAFT"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["AI"],"summary":"Create a new prompt version (immutable history)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"string","enum":["PERSONALIZATION","COPILOT","ICP_FROM_TEXT","FACT_EXTRACTION","LEAD_QUALIFICATION","EMAIL_WRITING","SUBJECT_LINES","FOLLOWUP_WRITING","FACT_CHECK","REPLY_CLASSIFICATION","CONVERSATION_SUMMARY","REPLY_DRAFT"]},"systemPrompt":{"type":"string","minLength":20,"maxLength":20000},"userPromptTemplate":{"type":"string","minLength":5,"maxLength":20000},"changeNote":{"type":"string","maxLength":300},"activate":{"default":false,"type":"boolean"}},"required":["task","systemPrompt","userPromptTemplate"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/prompts/{id}/activate":{"post":{"tags":["AI"],"summary":"Activate a prompt version","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/usage":{"get":{"tags":["AI"],"summary":"Token usage and estimated cost","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":365}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/executions":{"get":{"tags":["AI"],"summary":"AI response logs","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"task","in":"query","required":false,"schema":{"type":"string","enum":["PERSONALIZATION","COPILOT","ICP_FROM_TEXT","FACT_EXTRACTION","LEAD_QUALIFICATION","EMAIL_WRITING","SUBJECT_LINES","FOLLOWUP_WRITING","FACT_CHECK","REPLY_CLASSIFICATION","CONVERSATION_SUMMARY","REPLY_DRAFT"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai/prices":{"get":{"tags":["AI"],"summary":"Model price table (USD per million tokens)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["AI"],"summary":"Add a model price (owner only; applies to cost estimates)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: OWNER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["OPENAI","ANTHROPIC","GOOGLE","OPENROUTER","GROQ","TOGETHER","DEEPSEEK","MISTRAL","OLLAMA","CUSTOM_OPENAI"]},"model":{"type":"string","minLength":1,"maxLength":150},"inputPerMTokUsd":{"type":"number","minimum":0},"outputPerMTokUsd":{"type":"number","minimum":0},"cachedInputPerMTokUsd":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["provider","model","inputPerMTokUsd","outputPerMTokUsd"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"OWNER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/integrations":{"get":{"tags":["Integrations"],"summary":"Provider integrations (secrets never returned)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["Integrations"],"summary":"Set provider key / config","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["apollo","millionverifier","zerobounce","neverbounce","hunter","brave","serper","smartlead","booking","cloudflare"]},"secret":{"type":"string","minLength":4,"maxLength":500},"publicConfig":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"isEnabled":{"type":"boolean"}},"required":["type"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/integrations/{type}":{"delete":{"tags":["Integrations"],"summary":"Remove a provider integration","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/integrations/{type}/test":{"post":{"tags":["Integrations"],"summary":"Test a provider integration","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 20 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":20,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns":{"get":{"tags":["Campaigns"],"summary":"Campaigns with headline stats","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Campaigns"],"summary":"Create a campaign (DRAFT)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":150},"timezone":{"default":"UTC","type":"string"},"useLeadTimezone":{"default":true,"type":"boolean"},"sendingWindow":{"default":{"days":[1,2,3,4,5],"start":"09:00","end":"17:00"},"type":"object","properties":{"days":{"minItems":1,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"end":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"timezone":{"type":"string"}},"required":["days","start","end"]},"dailyNewLeadLimit":{"default":25,"type":"integer","minimum":1,"maximum":1000},"dailySendLimit":{"default":100,"type":"integer","minimum":1,"maximum":5000},"stopOnReply":{"default":true,"type":"boolean"},"stopOnAutoReply":{"default":false,"type":"boolean"},"reviewMode":{"default":"AI_CONTENT_ONLY","type":"string","enum":["NONE","AI_CONTENT_ONLY","ALL"]},"requireFactCheck":{"default":true,"type":"boolean"},"trackOpens":{"default":false,"type":"boolean"},"trackClicks":{"default":false,"type":"boolean"},"requireVerifiedEmail":{"default":true,"type":"boolean"},"minLeadScore":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"maxBounceRatePct":{"default":5,"type":"number","minimum":0.5,"maximum":50},"maxComplaints":{"default":1,"type":"integer","minimum":1,"maximum":100},"usePregeneratedAi":{"default":true,"type":"boolean"},"scheduledStartAt":{"default":null,"anyOf":[{},{"type":"null"}]}},"required":["name"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}":{"get":{"tags":["Campaigns"],"summary":"Campaign with sequence, lists and mailboxes","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Campaigns"],"summary":"Update settings (invalidates approval)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":150},"timezone":{"default":"UTC","type":"string"},"useLeadTimezone":{"default":true,"type":"boolean"},"sendingWindow":{"default":{"days":[1,2,3,4,5],"start":"09:00","end":"17:00"},"type":"object","properties":{"days":{"minItems":1,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"end":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"timezone":{"type":"string"}},"required":["days","start","end"]},"dailyNewLeadLimit":{"default":25,"type":"integer","minimum":1,"maximum":1000},"dailySendLimit":{"default":100,"type":"integer","minimum":1,"maximum":5000},"stopOnReply":{"default":true,"type":"boolean"},"stopOnAutoReply":{"default":false,"type":"boolean"},"reviewMode":{"default":"AI_CONTENT_ONLY","type":"string","enum":["NONE","AI_CONTENT_ONLY","ALL"]},"requireFactCheck":{"default":true,"type":"boolean"},"trackOpens":{"default":false,"type":"boolean"},"trackClicks":{"default":false,"type":"boolean"},"requireVerifiedEmail":{"default":true,"type":"boolean"},"minLeadScore":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"maxBounceRatePct":{"default":5,"type":"number","minimum":0.5,"maximum":50},"maxComplaints":{"default":1,"type":"integer","minimum":1,"maximum":100},"usePregeneratedAi":{"default":true,"type":"boolean"},"scheduledStartAt":{"default":null,"anyOf":[{},{"type":"null"}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Campaigns"],"summary":"Delete a never-sent draft","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/sequence":{"put":{"tags":["Campaigns"],"summary":"Save the email sequence (steps, delays, conditions, A/B variants)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"steps":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"delayDays":{"type":"integer","minimum":0,"maximum":90},"threadMode":{"default":"REPLY_IN_THREAD","type":"string","enum":["NEW_THREAD","REPLY_IN_THREAD"]},"personalizationMode":{"default":"TEMPLATE_ONLY","type":"string","enum":["TEMPLATE_ONLY","AI_FIRST_LINE","AI_FULL"]},"condition":{"default":"ALWAYS","type":"string","enum":["ALWAYS","IF_OPENED","IF_NOT_OPENED"]},"aiInstructions":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"variants":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":5},"subject":{"type":"string","maxLength":300},"body":{"type":"string","minLength":1,"maxLength":10000},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"aiInstructions":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]}},"required":["label","subject","body"]}}},"required":["delayDays","variants"]}}},"required":["steps"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/lists":{"put":{"tags":["Campaigns"],"summary":"Set target lead lists","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"listIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["listIds"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/accounts":{"put":{"tags":["Campaigns"],"summary":"Set sending mailboxes (each prospect gets one fixed sender)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["accountIds"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/validate":{"post":{"tags":["Campaigns"],"summary":"Validate and preview eligible recipients","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/submit":{"post":{"tags":["Campaigns"],"summary":"Submit for approval","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/approve":{"post":{"tags":["Campaigns"],"summary":"Approve (freezes a content hash; nothing unapproved is ever sent)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/start":{"post":{"tags":["Campaigns"],"summary":"Start or resume an approved campaign","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/pause":{"post":{"tags":["Campaigns"],"summary":"Pause a running campaign","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"default":"Paused by user","type":"string","maxLength":300}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/archive":{"post":{"tags":["Campaigns"],"summary":"Archive (stops all sequences)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/recipients":{"get":{"tags":["Campaigns"],"summary":"Enrollments","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/enroll":{"post":{"tags":["Campaigns"],"summary":"Manually enroll one lead","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["leadId"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/enrollments/{id}/stop":{"post":{"tags":["Campaigns"],"summary":"Stop one prospect’s sequence","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/steps":{"get":{"tags":["Analytics"],"summary":"Per-step / per-variant (A/B) performance","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/export-smartlead":{"post":{"tags":["Campaigns"],"summary":"Optional: push this campaign’s eligible leads to a Smartlead campaign","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"smartleadCampaignId":{"type":"string","minLength":1}},"required":["smartleadCampaignId"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/outbound":{"get":{"tags":["Sending"],"summary":"Send history and message status","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"campaignId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"awaitingApproval","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/outbound/{id}":{"get":{"tags":["Sending"],"summary":"One outbound email with fact-check report and evidence","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/outbound/{id}/review":{"post":{"tags":["Sending"],"summary":"Approve (optionally edited) or reject an email awaiting review","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]},"subject":{"type":"string","maxLength":300},"bodyText":{"type":"string","maxLength":20000},"reason":{"type":"string","maxLength":300}},"required":["decision"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts":{"get":{"tags":["Mailboxes"],"summary":"Connected mailboxes with today’s usage and health","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts/oauth/{provider}":{"post":{"tags":["Mailboxes"],"summary":"Start Google / Microsoft OAuth (returns the consent URL)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"loginHint":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts/smtp":{"post":{"tags":["Mailboxes"],"summary":"Connect an SMTP/IMAP mailbox (only where the provider permits it)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emailAddress":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"displayName":{"type":"string","maxLength":100},"password":{"type":"string","minLength":1,"maxLength":500},"smtpPassword":{"type":"string","minLength":1,"maxLength":500},"imapPassword":{"type":"string","minLength":1,"maxLength":500},"smtpHost":{"type":"string","minLength":1},"smtpPort":{"type":"integer","minimum":1,"maximum":65535},"smtpSecure":{"type":"boolean"},"imapHost":{"type":"string","minLength":1},"imapPort":{"type":"integer","minimum":1,"maximum":65535},"imapSecure":{"type":"boolean"},"username":{"type":"string","minLength":1},"smtpUsername":{"type":"string","minLength":1},"imapUsername":{"type":"string","minLength":1},"sentFolder":{"default":"Sent","type":"string"},"appendToSent":{"default":false,"type":"boolean"}},"required":["emailAddress","smtpHost","smtpPort","smtpSecure","imapHost","imapPort","imapSecure"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts/{id}":{"patch":{"tags":["Mailboxes"],"summary":"Sender identity, limits and sending window","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"signatureText":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"dailySendLimit":{"type":"integer","minimum":1,"maximum":2000},"minSecondsBetweenSends":{"type":"integer","minimum":30,"maximum":3600},"sendingWindow":{"type":"object","properties":{"days":{"minItems":1,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"end":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"timezone":{"default":"UTC","type":"string"},"enabled":{"default":false,"type":"boolean"}},"required":["days","start","end"]},"readiness":{"type":"object","properties":{"enabled":{"type":"boolean"},"initialDailyCap":{"default":5,"type":"integer","minimum":1,"maximum":500},"dailyIncrease":{"default":5,"type":"integer","minimum":1,"maximum":500},"reviewIntervalDays":{"default":7,"type":"integer","minimum":3,"maximum":30}},"required":["enabled"]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Mailboxes"],"summary":"Disconnect (revokes tokens, pauses its sequences)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts/{id}/test":{"post":{"tags":["Mailboxes"],"summary":"Test mailbox connection","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts/{id}/delivery-diagnostic":{"post":{"tags":["Mailboxes"],"summary":"Send one clearly labeled diagnostic message from an authorized mailbox to itself","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 1 requests / 900s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":1,"windowSec":900,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts/{id}/pause":{"post":{"tags":["Mailboxes"],"summary":"Pause sending from a mailbox","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts/{id}/resume":{"post":{"tags":["Mailboxes"],"summary":"Resume a paused mailbox","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-accounts/{id}/resync":{"post":{"tags":["Mailboxes"],"summary":"Full resync of the mailbox","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains":{"get":{"tags":["Deliverability"],"summary":"Sending domains with latest SPF/DKIM/DMARC/MX status","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Deliverability"],"summary":"Add a domain (queues a DNS check)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":253},"dkimSelectors":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z0-9._-]+$"}}},"required":["name"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}":{"get":{"tags":["Deliverability"],"summary":"Domain check history and guidance","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Deliverability"],"summary":"Remove a domain","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/check":{"post":{"tags":["Deliverability"],"summary":"Run a DNS check now","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 30 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/conversations":{"get":{"tags":["Inbox"],"summary":"Unified inbox (search, filters, labels)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["OPEN","WAITING","CLOSED"]}},{"name":"unread","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"campaignId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"label","in":"query","required":false,"schema":{"type":"string"}},{"name":"assigneeId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"hasReply","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"starred","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false","all"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/conversations/{id}":{"get":{"tags":["Inbox"],"summary":"Conversation thread, notes and lead","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Inbox"],"summary":"Read state, status, labels, assignee, category override","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"isUnread":{"type":"boolean"},"labels":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"isStarred":{"type":"boolean"},"isArchived":{"type":"boolean"},"category":{"type":"string","enum":["INTERESTED","WANTS_PRICING","WANTS_MEETING","NEEDS_INFO","NOT_INTERESTED","HAS_PROVIDER","WRONG_PERSON","OUT_OF_OFFICE","UNSUBSCRIBE","COMPLAINT","OTHER"]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/conversations/{id}/reply":{"post":{"tags":["Inbox"],"summary":"Send a reply from the original mailbox (queued, idempotent)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 120 requests / 3600s per user","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bodyText":{"type":"string","minLength":1,"maxLength":20000},"idempotencyKey":{"type":"string","minLength":8,"maxLength":100}},"required":["bodyText"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":120,"windowSec":3600,"key":"user"},"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/conversations/{id}/notes":{"post":{"tags":["Inbox"],"summary":"Internal note on a conversation","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["body"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/conversations/{id}/summary":{"post":{"tags":["Inbox"],"summary":"AI summary of the conversation","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/conversations/{id}/draft":{"post":{"tags":["Inbox"],"summary":"AI reply draft (never sent automatically)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/messages/{id}/classify":{"post":{"tags":["Inbox"],"summary":"Re-run AI classification for a message","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/attachments/{id}":{"get":{"tags":["Inbox"],"summary":"Download an attachment","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/analytics/overview":{"get":{"tags":["Analytics"],"summary":"Measured totals, rates and clearly-labelled estimates","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":365}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/analytics/daily":{"get":{"tags":["Analytics"],"summary":"Daily activity series","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":365}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/analytics/monthly":{"get":{"tags":["Analytics"],"summary":"Monthly activity","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/analytics/campaigns":{"get":{"tags":["Analytics"],"summary":"Campaign performance & attribution","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/analytics/mailboxes":{"get":{"tags":["Analytics"],"summary":"Mailbox performance","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":365}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/analytics/providers":{"get":{"tags":["Analytics"],"summary":"Data provider usage","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":365}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/compliance/rules":{"get":{"tags":["Compliance"],"summary":"Country sending rules (technical safeguards, not legal advice)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["Compliance"],"summary":"Create/update a country rule","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"countryCode":{"type":"string","minLength":1,"maxLength":3},"label":{"type":"string","minLength":1,"maxLength":80},"sendingAllowed":{"type":"boolean"},"allowedLawfulBases":{"type":"array","items":{"type":"string","enum":["UNKNOWN","CONSENT","LEGITIMATE_INTEREST","EXISTING_RELATIONSHIP","NOT_REQUIRED"]}},"requirePostalAddress":{"type":"boolean"},"requireUnsubscribeLink":{"type":"boolean"},"reviewedByOwner":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["countryCode","label","sendingAllowed","allowedLawfulBases","requirePostalAddress","requireUnsubscribeLink","reviewedByOwner"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/compliance/rules/{id}":{"delete":{"tags":["Compliance"],"summary":"Delete a country rule","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/compliance/check/{leadId}":{"get":{"tags":["Compliance"],"summary":"Explain whether a lead can be contacted now","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"leadId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/automations":{"get":{"tags":["Automation"],"summary":"Automation rules","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Automation"],"summary":"Create an automation rule","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"isEnabled":{"default":true,"type":"boolean"},"trigger":{"type":"string","enum":["reply.categorized","lead.scored","lead.status_changed"]},"conditions":{"default":{},"type":"object","properties":{"categories":{"type":"array","items":{"type":"string","enum":["INTERESTED","WANTS_PRICING","WANTS_MEETING","NEEDS_INFO","NOT_INTERESTED","HAS_PROVIDER","WRONG_PERSON","OUT_OF_OFFICE","UNSUBSCRIBE","COMPLAINT","OTHER"]}},"minScore":{"type":"integer","minimum":0,"maximum":100},"maxScore":{"type":"integer","minimum":0,"maximum":100},"toStatuses":{"type":"array","items":{"type":"string","enum":["NEW","RESEARCHED","QUALIFIED","DISQUALIFIED","CONTACTED","REPLIED","INTERESTED","MEETING_BOOKED","NOT_INTERESTED","CUSTOMER","UNSUBSCRIBED","BOUNCED"]}}}},"actions":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"set_status"},"status":{"type":"string","enum":["NEW","RESEARCHED","QUALIFIED","DISQUALIFIED","CONTACTED","REPLIED","INTERESTED","MEETING_BOOKED","NOT_INTERESTED","CUSTOMER","UNSUBSCRIBED","BOUNCED"]}},"required":["type","status"]},{"type":"object","properties":{"type":{"type":"string","const":"add_to_list"},"listId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","listId"]},{"type":"object","properties":{"type":{"type":"string","const":"create_task"},"title":{"type":"string","minLength":1,"maxLength":200},"dueInDays":{"default":1,"type":"integer","minimum":0,"maximum":90}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"create_opportunity"},"title":{"type":"string","minLength":1,"maxLength":200},"valueCents":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"notify"},"title":{"type":"string","minLength":1,"maxLength":200}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"enroll_campaign"},"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","campaignId"]}]}}},"required":["name","trigger","actions"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/automations/{id}":{"put":{"tags":["Automation"],"summary":"Update an automation rule","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"isEnabled":{"default":true,"type":"boolean"},"trigger":{"type":"string","enum":["reply.categorized","lead.scored","lead.status_changed"]},"conditions":{"default":{},"type":"object","properties":{"categories":{"type":"array","items":{"type":"string","enum":["INTERESTED","WANTS_PRICING","WANTS_MEETING","NEEDS_INFO","NOT_INTERESTED","HAS_PROVIDER","WRONG_PERSON","OUT_OF_OFFICE","UNSUBSCRIBE","COMPLAINT","OTHER"]}},"minScore":{"type":"integer","minimum":0,"maximum":100},"maxScore":{"type":"integer","minimum":0,"maximum":100},"toStatuses":{"type":"array","items":{"type":"string","enum":["NEW","RESEARCHED","QUALIFIED","DISQUALIFIED","CONTACTED","REPLIED","INTERESTED","MEETING_BOOKED","NOT_INTERESTED","CUSTOMER","UNSUBSCRIBED","BOUNCED"]}}}},"actions":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"set_status"},"status":{"type":"string","enum":["NEW","RESEARCHED","QUALIFIED","DISQUALIFIED","CONTACTED","REPLIED","INTERESTED","MEETING_BOOKED","NOT_INTERESTED","CUSTOMER","UNSUBSCRIBED","BOUNCED"]}},"required":["type","status"]},{"type":"object","properties":{"type":{"type":"string","const":"add_to_list"},"listId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","listId"]},{"type":"object","properties":{"type":{"type":"string","const":"create_task"},"title":{"type":"string","minLength":1,"maxLength":200},"dueInDays":{"default":1,"type":"integer","minimum":0,"maximum":90}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"create_opportunity"},"title":{"type":"string","minLength":1,"maxLength":200},"valueCents":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"notify"},"title":{"type":"string","minLength":1,"maxLength":200}},"required":["type","title"]},{"type":"object","properties":{"type":{"type":"string","const":"enroll_campaign"},"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","campaignId"]}]}}},"required":["name","trigger","actions"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Automation"],"summary":"Delete an automation rule","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/automations/runs":{"get":{"tags":["Automation"],"summary":"Automation run history","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"ruleId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/webhooks":{"get":{"tags":["Webhooks"],"summary":"Outbound webhooks","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook (signing secret shown once)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["reply.categorized","lead.scored","lead.status_changed","email.sent","email.bounced","lead.unsubscribed","meeting.booked","campaign.paused","opportunity.stage_changed"]}},"isEnabled":{"default":true,"type":"boolean"}},"required":["name","url","events"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/webhooks/{id}":{"put":{"tags":["Webhooks"],"summary":"Update a webhook","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["reply.categorized","lead.scored","lead.status_changed","email.sent","email.bounced","lead.unsubscribed","meeting.booked","campaign.paused","opportunity.stage_changed"]}},"isEnabled":{"default":true,"type":"boolean"}},"required":["name","url","events"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test delivery","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Recent deliveries","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-outreach-brain/overview":{"get":{"tags":["AI Outreach Brain"],"summary":"Training status, rules, examples, draft decisions and pending learning suggestions","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-outreach-brain/rules":{"get":{"tags":["AI Outreach Brain"],"summary":"List workspace rules with conflict warnings","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["AI Outreach Brain"],"summary":"Create an outreach rule","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":2,"maxLength":120},"description":{"type":"string","minLength":3,"maxLength":3000},"category":{"type":"string","enum":["PROSPECT_RESEARCH","PROSPECT_QUALIFICATION","OPPORTUNITY_IDENTIFICATION","PERSONALIZATION","EMAIL_OPENING","VALUE_PROPOSITION","PITCHING","CLOSING","FOLLOW_UPS","DELIVERABILITY_COMPLIANCE"]},"priority":{"type":"string","enum":["MANDATORY","PREFERRED","AVOID","CONDITIONAL"]},"condition":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"status":{"default":"ACTIVE","type":"string","enum":["ACTIVE","INACTIVE"]},"triggerTerms":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["title","description","category","priority"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-outreach-brain/rules/{id}":{"patch":{"tags":["AI Outreach Brain"],"summary":"Update an outreach rule","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":2,"maxLength":120},"description":{"type":"string","minLength":3,"maxLength":3000},"category":{"type":"string","enum":["PROSPECT_RESEARCH","PROSPECT_QUALIFICATION","OPPORTUNITY_IDENTIFICATION","PERSONALIZATION","EMAIL_OPENING","VALUE_PROPOSITION","PITCHING","CLOSING","FOLLOW_UPS","DELIVERABILITY_COMPLIANCE"]},"priority":{"type":"string","enum":["MANDATORY","PREFERRED","AVOID","CONDITIONAL"]},"condition":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"status":{"default":"ACTIVE","type":"string","enum":["ACTIVE","INACTIVE"]},"triggerTerms":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["title","description","category","priority"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["AI Outreach Brain"],"summary":"Delete an outreach rule","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-outreach-brain/examples":{"get":{"tags":["AI Outreach Brain"],"summary":"List workspace examples","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["AI Outreach Brain"],"summary":"Add a positive or negative text example","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"content":{"type":"string","minLength":10,"maxLength":20000},"correctedContent":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"category":{"type":"string","enum":["EMAIL","RESEARCH","CONVERSATION"]},"polarity":{"type":"string","enum":["POSITIVE","NEGATIVE"]},"explanation":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"tags":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"isActive":{"default":true,"type":"boolean"}},"required":["name","content","category","polarity"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-outreach-brain/examples/{id}":{"patch":{"tags":["AI Outreach Brain"],"summary":"Update a workspace example","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"content":{"type":"string","minLength":10,"maxLength":20000},"correctedContent":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"category":{"type":"string","enum":["EMAIL","RESEARCH","CONVERSATION"]},"polarity":{"type":"string","enum":["POSITIVE","NEGATIVE"]},"explanation":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"tags":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"isActive":{"default":true,"type":"boolean"}},"required":["name","content","category","polarity"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["AI Outreach Brain"],"summary":"Delete a workspace example","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-outreach-brain/suggestions":{"get":{"tags":["AI Outreach Brain"],"summary":"Learning suggestions from repeated customer edits","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-outreach-brain/suggestions/{id}/decision":{"post":{"tags":["AI Outreach Brain"],"summary":"Accept or reject a learning suggestion","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["ACCEPT","REJECT"]}},"required":["decision"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/overview":{"get":{"tags":["AI Studio"],"summary":"Active configuration versions, documents, profiles and AI spend this month","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/config/{kind}":{"get":{"tags":["AI Studio"],"summary":"Active business knowledge / writing / research configuration","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["AI Studio"],"summary":"Save a new version (validated; becomes active)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{},"changeNote":{"type":"string","maxLength":500}},"required":["data"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/config/{kind}/versions":{"get":{"tags":["AI Studio"],"summary":"Version history","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/config-versions/{id}/activate":{"post":{"tags":["AI Studio"],"summary":"Re-activate an earlier version","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/schemas":{"get":{"tags":["AI Studio"],"summary":"Defaults and JSON schemas for the configuration forms","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/documents":{"get":{"tags":["AI Studio"],"summary":"Knowledge documents","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["AI Studio"],"summary":"Add a document (multipart \"file\" .txt/.md/.csv/.json/.html ≤5 MB, or fields title+text)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 60 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":60,"windowSec":3600,"key":"workspace"},"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/documents/{id}":{"get":{"tags":["AI Studio"],"summary":"One knowledge document with its extracted text","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["AI Studio"],"summary":"Rename, (de)activate or replace document text","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"isActive":{"type":"boolean"},"text":{"type":"string","maxLength":100000}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["AI Studio"],"summary":"Delete a document","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles":{"get":{"tags":["Prompt library"],"summary":"Prompt profiles (folders, tags, approval)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"archived","in":"query","required":false,"schema":{"default":false,"type":"boolean"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Prompt library"],"summary":"Create a prompt profile (version 1)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":1000},"instructions":{"default":"Research this prospect's company and public content. Identify ONE relevant business observation that is backed by the evidence list.\n{{#if research.hasClaims}}Use that observation in the opening line and connect it to how our service could help {{company.name|their company}}.{{else}}No research is available: do not reference anything specific about the prospect. Write a short, honest note based only on their role ({{lead.title|their role}}) and our offer.{{/if}}\n{{#if step.isFollowUp}}This is a follow-up: do not repeat the previous opening or offer; add one new, useful angle.{{/if}}\nWrite a short, conversational email. Do not use generic compliments. Do not invent problems. End with one natural question.","type":"string","minLength":1,"maxLength":20000},"settings":{"default":{},"type":"object","properties":{"tone":{"type":"string","enum":["friendly","professional","direct","consultative","casual"]},"style":{"type":"string","maxLength":1000},"minWords":{"type":"integer","minimum":10,"maximum":500},"maxWords":{"type":"integer","minimum":20,"maximum":800},"sentenceComplexity":{"type":"string","enum":["simple","moderate","advanced"]},"personalizationIntensity":{"type":"string","enum":["light","medium","deep"]},"ctaStyle":{"type":"string","enum":["soft_question","interest_check","meeting_request","resource_offer","booking_link"]},"formality":{"type":"string","enum":["informal","neutral","formal"]},"language":{"type":"string","maxLength":60},"avoidPhrases":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"forbiddenClaims":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"goodExamples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000}},"badExamples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000}},"customInstructions":{"type":"string","maxLength":20000}}},"folder":{"type":"string","maxLength":100},"tags":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}}},"required":["name"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles/{id}":{"get":{"tags":["Prompt library"],"summary":"Profile with all versions and campaigns using it","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Prompt library"],"summary":"Rename, move to folder, tag, approve for team use or archive","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"folder":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}},"isArchived":{"type":"boolean"},"isApproved":{"type":"boolean"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles/{id}/versions":{"post":{"tags":["Prompt library"],"summary":"Save a new version (approved campaigns keep their frozen version)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instructions":{"type":"string","minLength":1,"maxLength":20000},"settings":{"default":{},"type":"object","properties":{"tone":{"type":"string","enum":["friendly","professional","direct","consultative","casual"]},"style":{"type":"string","maxLength":1000},"minWords":{"type":"integer","minimum":10,"maximum":500},"maxWords":{"type":"integer","minimum":20,"maximum":800},"sentenceComplexity":{"type":"string","enum":["simple","moderate","advanced"]},"personalizationIntensity":{"type":"string","enum":["light","medium","deep"]},"ctaStyle":{"type":"string","enum":["soft_question","interest_check","meeting_request","resource_offer","booking_link"]},"formality":{"type":"string","enum":["informal","neutral","formal"]},"language":{"type":"string","maxLength":60},"avoidPhrases":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"forbiddenClaims":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"goodExamples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000}},"badExamples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000}},"customInstructions":{"type":"string","maxLength":20000}}},"changeNote":{"type":"string","maxLength":500},"activate":{"default":true,"type":"boolean"}},"required":["instructions"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles/{id}/versions/{versionId}/activate":{"post":{"tags":["Prompt library"],"summary":"Activate an earlier version","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles/{id}/compare":{"get":{"tags":["Prompt library"],"summary":"Compare two versions (line diff + settings)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"a","in":"query","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"b","in":"query","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles/{id}/duplicate":{"post":{"tags":["Prompt library"],"summary":"Duplicate a profile","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"required":["name"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles/lint":{"post":{"tags":["Prompt library"],"summary":"Check prompt syntax and variables","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instructions":{"type":"string","maxLength":20000}},"required":["instructions"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles-export":{"get":{"tags":["Prompt library"],"summary":"Export profiles as JSON","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"ids","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles-import":{"post":{"tags":["Prompt library"],"summary":"Import profiles from an export file","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","const":"emn-prompt-profiles/v1"},"profiles":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"instructions":{"type":"string","minLength":1,"maxLength":20000},"settings":{"default":{},"type":"object","properties":{"tone":{"type":"string","enum":["friendly","professional","direct","consultative","casual"]},"style":{"type":"string","maxLength":1000},"minWords":{"type":"integer","minimum":10,"maximum":500},"maxWords":{"type":"integer","minimum":20,"maximum":800},"sentenceComplexity":{"type":"string","enum":["simple","moderate","advanced"]},"personalizationIntensity":{"type":"string","enum":["light","medium","deep"]},"ctaStyle":{"type":"string","enum":["soft_question","interest_check","meeting_request","resource_offer","booking_link"]},"formality":{"type":"string","enum":["informal","neutral","formal"]},"language":{"type":"string","maxLength":60},"avoidPhrases":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"forbiddenClaims":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"goodExamples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000}},"badExamples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000}},"customInstructions":{"type":"string","maxLength":20000}}}},"required":["name","instructions"]}}},"required":["format","profiles"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-studio/profiles/{id}/test":{"post":{"tags":["Prompt library"],"summary":"Test the profile on a sample lead (real AI call, costs recorded; nothing is saved to campaigns)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 60 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stepOrder":{"default":1,"type":"integer","minimum":1,"maximum":10}},"required":["leadId","campaignId"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":60,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/{id}/ai-instructions":{"put":{"tags":["Personalization"],"summary":"Set instructions for this individual prospect (applied last in the hierarchy)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"aiInstructions":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]}},"required":["aiInstructions"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/ai":{"put":{"tags":["Personalization"],"summary":"Campaign AI profile, ICP, overrides and cost limit (requires re-approval)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"aiProfileId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"icpId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"aiOverrides":{"type":"object","properties":{"writing":{"default":{},"type":"object","properties":{"tone":{"type":"string","enum":["friendly","professional","direct","consultative","casual"]},"style":{"type":"string","maxLength":1000},"minWords":{"type":"integer","minimum":10,"maximum":500},"maxWords":{"type":"integer","minimum":20,"maximum":800},"sentenceComplexity":{"type":"string","enum":["simple","moderate","advanced"]},"personalizationIntensity":{"type":"string","enum":["light","medium","deep"]},"ctaStyle":{"type":"string","enum":["soft_question","interest_check","meeting_request","resource_offer","booking_link"]},"formality":{"type":"string","enum":["informal","neutral","formal"]},"language":{"type":"string","maxLength":60},"avoidPhrases":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"forbiddenClaims":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"goodExamples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000}},"badExamples":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000}},"customInstructions":{"type":"string","maxLength":20000}}},"research":{"default":{},"type":"object","properties":{"personTopics":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"companyTopics":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"signals":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"minClaims":{"type":"integer","minimum":0,"maximum":10},"mustNotInfer":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"onMissing":{"type":"string","enum":["hold_for_research","use_role_and_company_only","skip_lead"]},"customInstructions":{"type":"string","maxLength":10000}}},"audienceContext":{"default":"","type":"string","maxLength":5000},"offerContext":{"default":"","type":"string","maxLength":5000},"customInstructions":{"default":"","type":"string","maxLength":20000}}},"maxAiCostPerLeadUsd":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"usePregeneratedAi":{"type":"boolean"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/personalizations":{"get":{"tags":["Personalization"],"summary":"Per-lead generated content, status, score, warnings and cost","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["QUEUED","GENERATING","NEEDS_RESEARCH","GENERATED","BLOCKED","APPROVED","REJECTED","FAILED","SKIPPED"]}},{"name":"stepId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/personalizations/lead/{leadId}":{"get":{"tags":["Personalization"],"summary":"Review one recipient: research, evidence, every step, warnings, cost","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"leadId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/personalizations/prompt-preview":{"get":{"tags":["Personalization"],"summary":"Resolved instructions and prompt for one lead/step (no AI call)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"leadId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"stepId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/personalizations/generate":{"post":{"tags":["Personalization"],"summary":"Generate (or regenerate with force) one lead/step now","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 300 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stepId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"force":{"default":false,"type":"boolean"},"note":{"type":"string","maxLength":1000}},"required":["leadId","stepId"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":300,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/personalizations/estimate":{"post":{"tags":["Personalization"],"summary":"Estimate cost of bulk generation","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stepIds":{"maxItems":10,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"leadIds":{"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"force":{"default":false,"type":"boolean"},"onlyMissing":{"default":true,"type":"boolean"},"maxCostUsd":{"anyOf":[{"type":"number","minimum":0,"maximum":10000},{"type":"null"}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/personalizations/batches":{"post":{"tags":["Personalization"],"summary":"Start bulk generation (queued; approved and manually edited content is preserved unless force)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: 30 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stepIds":{"maxItems":10,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"leadIds":{"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"force":{"default":false,"type":"boolean"},"onlyMissing":{"default":true,"type":"boolean"},"maxCostUsd":{"anyOf":[{"type":"number","minimum":0,"maximum":10000},{"type":"null"}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":3600,"key":"workspace"},"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"get":{"tags":["Personalization"],"summary":"Bulk generation runs","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/personalization-batches/{batchId}/cancel":{"post":{"tags":["Personalization"],"summary":"Cancel a running batch","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"batchId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/personalizations/retry-failed":{"post":{"tags":["Personalization"],"summary":"Re-queue failed generations","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/personalizations/research-missing":{"post":{"tags":["Personalization"],"summary":"Queue research for recipients without recent research","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"maxAgeDays":{"default":90,"type":"integer","minimum":1,"maximum":3650}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/personalizations/{pid}":{"get":{"tags":["Personalization"],"summary":"One generated email with revisions, evidence and quality report","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Personalization"],"summary":"Manually edit (preserved; re-checked; needs approval again)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"openingLine":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"body":{"type":"string","minLength":1,"maxLength":10000},"cta":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"rerunFactCheck":{"default":true,"type":"boolean"},"feedbackNote":{"type":"string","maxLength":1000},"feedbackScope":{"default":"CAMPAIGN","type":"string","enum":["GLOBAL","CAMPAIGN","PROSPECT","FACTUAL"]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/personalizations/approve":{"post":{"tags":["Personalization"],"summary":"Approve one or many (only when quality checks pass)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/personalizations/{pid}/reject":{"post":{"tags":["Personalization"],"summary":"Reject","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/preview":{"get":{"tags":["Campaigns"],"summary":"Exact rendered email for one lead and step (no AI call)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"leadId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"stepOrder","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":10}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/test-email":{"post":{"tags":["Campaigns"],"summary":"Send a rendered step to a workspace member’s own address","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 20 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stepOrder":{"type":"integer","minimum":1,"maximum":10},"to":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"emailAccountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["leadId","stepOrder","to"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":20,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/versions":{"get":{"tags":["Campaigns"],"summary":"Sequence version history (one per approval)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/versions/{version}/restore":{"post":{"tags":["Campaigns"],"summary":"Restore an approved version into the editor (needs re-approval)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/duplicate":{"post":{"tags":["Campaigns"],"summary":"Clone a campaign (no recipients, sends or approvals)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":150}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reply-suggestions":{"get":{"tags":["Reply assistant"],"summary":"AI reply drafts / suggestions / auto-reply log","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","APPROVED","SENT","DISMISSED","FAILED"]}},{"name":"conversationId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reply-suggestions/{id}/approve":{"post":{"tags":["Reply assistant"],"summary":"Approve (optionally edited) and send from the original mailbox","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 300 requests / 3600s per user","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":20000}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":300,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reply-suggestions/{id}/dismiss":{"post":{"tags":["Reply assistant"],"summary":"Dismiss a suggestion","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/conversations/{id}/suggest":{"post":{"tags":["Reply assistant"],"summary":"Generate an AI suggestion for the latest inbound message now","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 120 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":120,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reply-templates":{"get":{"tags":["Reply assistant"],"summary":"Reply templates (only approved ones can be auto-sent)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Reply assistant"],"summary":"Create a reply template","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":5000},"categories":{"maxItems":4,"type":"array","items":{"type":"string","enum":["INTERESTED","WANTS_MEETING","NEEDS_INFO","WRONG_PERSON"]}}},"required":["name","body","categories"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reply-templates/{id}":{"put":{"tags":["Reply assistant"],"summary":"Edit a template (resets approval)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":5000},"categories":{"maxItems":4,"type":"array","items":{"type":"string","enum":["INTERESTED","WANTS_MEETING","NEEDS_INFO","WRONG_PERSON"]}}},"required":["name","body","categories"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Reply assistant"],"summary":"Delete a template","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reply-templates/{id}/approve":{"post":{"tags":["Reply assistant"],"summary":"Approve / withdraw a template for auto-reply use","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approve":{"type":"boolean"}},"required":["approve"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/copilot/threads":{"get":{"tags":["Copilot"],"summary":"My Copilot conversations","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/copilot/threads/{id}":{"get":{"tags":["Copilot"],"summary":"Conversation with messages and proposed actions","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/copilot/ask":{"post":{"tags":["Copilot"],"summary":"Ask the Copilot (answers + recommendations + proposed actions; nothing is executed)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: 120 requests / 3600s per user","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"threadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"question":{"type":"string","minLength":1,"maxLength":4000}},"required":["question"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":120,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/copilot/actions/{id}/execute":{"post":{"tags":["Copilot"],"summary":"Confirm and run a proposed action (role-checked, runs once)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/copilot/actions/{id}/reject":{"post":{"tags":["Copilot"],"summary":"Reject a proposed action","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/copilot/repetition":{"get":{"tags":["Copilot"],"summary":"Find repetitive wording across generated emails","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"campaignId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/copilot/memory":{"get":{"tags":["Copilot"],"summary":"Business memory","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Copilot"],"summary":"Add business memory","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":2000}},"required":["content"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/copilot/memory/{id}":{"delete":{"tags":["Copilot"],"summary":"Delete business memory","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/provider-registry":{"get":{"tags":["Deliverability"],"summary":"Registrar / DNS / mailbox-provider capability registry (what is automated vs manual)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/verification":{"post":{"tags":["Deliverability"],"summary":"Start ownership verification (returns the TXT record to add)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/verification/check":{"post":{"tags":["Deliverability"],"summary":"Check the ownership TXT record","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 30 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/propagation":{"post":{"tags":["Deliverability"],"summary":"Compare SPF/DMARC/verification across Cloudflare, Google and Quad9 resolvers","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 30 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/recommended-records":{"get":{"tags":["Deliverability"],"summary":"DNS guidance for the mailbox providers on this domain","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/dns-records":{"post":{"tags":["Deliverability"],"summary":"Create one DNS record via the connected DNS provider (Cloudflare) — explicit action only","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["TXT","CNAME"]},"name":{"type":"string","minLength":3,"maxLength":253},"content":{"type":"string","minLength":1,"maxLength":2000}},"required":["type","name","content"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/zone-records":{"get":{"tags":["Deliverability"],"summary":"Live DNS records of the domain from the connected DNS provider","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/zone-records/{recordId}":{"put":{"tags":["Deliverability"],"summary":"Change one record’s value (refused if it changed since you loaded it; NS/SOA protected); audited","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 30 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":2000},"ttl":{"type":"integer","minimum":1,"maximum":86400},"expectedContent":{"type":"string","maxLength":2000}},"required":["content","expectedContent"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Deliverability"],"summary":"Delete one record after typing its name (NS/SOA protected); audited","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 30 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmName":{"type":"string","minLength":1,"maxLength":253},"expectedContent":{"type":"string","maxLength":2000}},"required":["confirmName","expectedContent"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":30,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/domains/{id}/renewal":{"patch":{"tags":["Deliverability"],"summary":"Registrar, expiry date and auto-renew (for renewal reminders)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"registrar":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"expiresAt":{"anyOf":[{},{"type":"null"}]},"autoRenew":{"type":["boolean","null"]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/mailbox-health":{"get":{"tags":["Mailboxes"],"summary":"Connection, auth, sync, send/receive, errors, bounces, complaints and DNS per mailbox","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/{id}/verify-waterfall":{"post":{"tags":["Enrichment"],"summary":"Verify one lead using the workspace-selected custom or external mode","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 300 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"default":false,"type":"boolean"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":300,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/enrichment/verify-bulk":{"post":{"tags":["Enrichment"],"summary":"Queue lead verification using the workspace-selected custom or external mode","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"force":{"default":false,"type":"boolean"}},"required":["leadIds"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/enrichment/find-email":{"post":{"tags":["Enrichment"],"summary":"Email discovery waterfall (name + company domain)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 300 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","minLength":1,"maxLength":100},"domain":{"type":"string","minLength":3,"maxLength":253}},"required":["firstName","lastName","domain"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":300,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/enrichment/stats":{"get":{"tags":["Enrichment"],"summary":"Provider comparison: checks, definitive rate, credits","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"default":90,"type":"integer","minimum":1,"maximum":365}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/leads/{id}/verifications":{"get":{"tags":["Enrichment"],"summary":"Verification / enrichment history for a lead","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/verify":{"post":{"tags":["Enrichment"],"summary":"Queue first-party syntax, disposable, role, free-provider and DNS checks; optional SMTP RCPT probing when enabled (never sends email)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 60 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":254},"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["email"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":60,"windowSec":3600,"key":"workspace"},"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/bulk":{"post":{"tags":["Enrichment"],"summary":"Queue deduplicated first-party verification for an email list; optional SMTP RCPT probing when enabled (never sends email)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 10 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":3,"maxLength":254}}},"required":["emails"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":3600,"key":"workspace"},"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/bulk.csv":{"post":{"tags":["Enrichment"],"summary":"Upload a bounded CSV for streaming background verification; maximum 10 MB","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: 5 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emailColumn":{"type":"string","maxLength":100},"hasHeader":{"default":"true","type":"string","enum":["true","false"]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":5,"windowSec":3600,"key":"workspace"},"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/batches":{"get":{"tags":["Enrichment"],"summary":"List first-party verification batches","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/batches/{id}":{"get":{"tags":["Enrichment"],"summary":"Get tenant-scoped paginated verification batch results","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/batches/{id}/export.csv":{"get":{"tags":["Enrichment"],"summary":"Stream a tenant-scoped CSV export with verification columns and spreadsheet formula protection","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/batches/{id}/pause":{"post":{"tags":["Enrichment"],"summary":"Pause a processing batch; active checks may finish","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/batches/{id}/resume":{"post":{"tags":["Enrichment"],"summary":"Resume queued rows of a paused verification batch","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/batches/{id}/retry":{"post":{"tags":["Enrichment"],"summary":"Retry failed rows in a verification batch","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/batches/{id}/cancel":{"post":{"tags":["Enrichment"],"summary":"Cancel pending rows in a verification batch","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/datasets":{"get":{"tags":["Enrichment"],"summary":"List shared disposable dataset metadata and workspace overrides","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/datasets/refresh":{"post":{"tags":["Enrichment"],"summary":"Queue refresh from the pinned public disposable-domain source","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 1 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":1,"windowSec":3600,"key":"workspace"},"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/domain-overrides":{"post":{"tags":["Enrichment"],"summary":"Add or exclude a domain from this workspace disposable-domain classification","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":253},"disposable":{"type":"boolean"}},"required":["domain","disposable"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/domain-overrides/{id}":{"delete":{"tags":["Enrichment"],"summary":"Remove a workspace disposable-domain override","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/role-patterns":{"post":{"tags":["Enrichment"],"summary":"Add or disable a workspace role-based local-part pattern","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"localPart":{"type":"string","minLength":1,"maxLength":64},"enabled":{"default":true,"type":"boolean"}},"required":["localPart"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/history":{"get":{"tags":["Enrichment"],"summary":"Search tenant-scoped first-party verification history","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":254}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["UNVERIFIED","VALID","INVALID","RISKY","CATCH_ALL","UNKNOWN"]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/{id}":{"get":{"tags":["Enrichment"],"summary":"Get tenant-scoped first-party verification result","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/email-verification/diagnostics":{"post":{"tags":["Enrichment"],"summary":"Admin-only outbound SMTP port 25 diagnostic to the configured verification sender domain MX; sends no recipient commands or email","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 1 requests / 3600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":1,"windowSec":3600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/workflows":{"get":{"tags":["Workflows"],"summary":"List workflows","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Workflows"],"summary":"Create a workflow (version 1)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"trigger":{"type":"string","enum":["lead.created","lead.enriched","lead.scored","lead.status_changed","reply.categorized","email.bounced","lead.unsubscribed","meeting.booked","campaign.paused","opportunity.stage_changed","manual","schedule.daily","webhook.received"]},"graph":{"type":"object","properties":{"blocks":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["blocks"]},"maxRunsPerDay":{"default":1000,"type":"integer","minimum":1,"maximum":100000},"changeNote":{"type":"string","maxLength":300}},"required":["name","trigger","graph"],"$defs":{"__schema0":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"condition"},"all":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"anyOf":[{"type":"string","enum":["lead.country","lead.status","lead.currentScore","lead.title","lead.tags","company.industry","company.employeeCount","event.category","event.campaignId","event.to","time.weekday","time.hour"]},{"type":"string","pattern":"^lead\\.custom\\.[a-zA-Z0-9_]{1,40}$"}]},"op":{"type":"string","enum":["eq","neq","in","not_in","gte","lte","contains","exists"]},"value":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":100}}]}},"required":["field","op"]}},"then":{"maxItems":20,"type":"array","items":{"$ref":"#/$defs/__schema0"}},"else":{"maxItems":20,"type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["id","kind","all","then","else"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"action"},"action":{"type":"string","enum":["add_tag","update_lead_status","create_task","assign_user","create_opportunity","notify_team","research_lead","generate_reply_draft","pause_campaign","resume_campaign","trigger_webhook","export_leads"]},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":2000}}},"required":["id","kind","action","params"]}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/workflows/{id}":{"get":{"tags":["Workflows"],"summary":"Workflow with all versions","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["Workflows"],"summary":"Save a new version (becomes active version)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"trigger":{"type":"string","enum":["lead.created","lead.enriched","lead.scored","lead.status_changed","reply.categorized","email.bounced","lead.unsubscribed","meeting.booked","campaign.paused","opportunity.stage_changed","manual","schedule.daily","webhook.received"]},"graph":{"type":"object","properties":{"blocks":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["blocks"]},"maxRunsPerDay":{"default":1000,"type":"integer","minimum":1,"maximum":100000},"changeNote":{"type":"string","maxLength":300}},"required":["name","trigger","graph"],"$defs":{"__schema0":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"condition"},"all":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"anyOf":[{"type":"string","enum":["lead.country","lead.status","lead.currentScore","lead.title","lead.tags","company.industry","company.employeeCount","event.category","event.campaignId","event.to","time.weekday","time.hour"]},{"type":"string","pattern":"^lead\\.custom\\.[a-zA-Z0-9_]{1,40}$"}]},"op":{"type":"string","enum":["eq","neq","in","not_in","gte","lte","contains","exists"]},"value":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":100}}]}},"required":["field","op"]}},"then":{"maxItems":20,"type":"array","items":{"$ref":"#/$defs/__schema0"}},"else":{"maxItems":20,"type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["id","kind","all","then","else"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"action"},"action":{"type":"string","enum":["add_tag","update_lead_status","create_task","assign_user","create_opportunity","notify_team","research_lead","generate_reply_draft","pause_campaign","resume_campaign","trigger_webhook","export_leads"]},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":2000}}},"required":["id","kind","action","params"]}]}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Workflows"],"summary":"Delete a workflow","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":204,"allowWhenInactive":false},"responses":{"204":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/workflows/{id}/active":{"post":{"tags":["Workflows"],"summary":"Activate / deactivate","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/workflows/{id}/versions/{versionId}/restore":{"post":{"tags":["Workflows"],"summary":"Make an older version active","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/workflows/{id}/run":{"post":{"tags":["Workflows"],"summary":"Run now (testMode=true is a dry run that changes nothing)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: 60 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"testMode":{"default":true,"type":"boolean"},"payload":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":60,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/workflows/{id}/runs":{"get":{"tags":["Workflows"],"summary":"Execution history with per-block log","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/workflows/{id}/webhook-token":{"post":{"tags":["Workflows"],"summary":"Rotate the inbound webhook token (shown once)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/billing":{"get":{"tags":["Billing"],"summary":"Plan, status, usage and (for owners/billing managers) invoices of this workspace's organization","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/crm/forecast":{"get":{"tags":["CRM"],"summary":"Weighted pipeline forecast, expected close by month, won revenue by month, win rate","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/crm/opportunities/export":{"get":{"tags":["CRM"],"summary":"Export opportunities as CSV","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/analytics/campaigns/export":{"get":{"tags":["Analytics"],"summary":"Export campaign performance as CSV","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/saved-filters":{"get":{"tags":["Saved filters"],"summary":"My saved filters plus shared ones","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Saved filters"],"summary":"Save a filter (optionally shared with the workspace)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity":{"type":"string","enum":["leads","conversations","campaigns","opportunities"]},"name":{"type":"string","minLength":1,"maxLength":80},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":100}}]}},"isShared":{"default":false,"type":"boolean"}},"required":["entity","name","query"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/saved-filters/{id}":{"delete":{"tags":["Saved filters"],"summary":"Delete my filter (managers can delete shared filters)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":204,"allowWhenInactive":false},"responses":{"204":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reports":{"get":{"tags":["Reports"],"summary":"Scheduled email reports","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Reports"],"summary":"Create a scheduled report (recipients must be members)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["campaign_summary","pipeline","ai_cost"]},"frequency":{"type":"string","enum":["DAILY","WEEKLY"]},"recipients":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"isActive":{"default":true,"type":"boolean"}},"required":["name","kind","frequency","recipients"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reports/{id}":{"put":{"tags":["Reports"],"summary":"Update a scheduled report","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["campaign_summary","pipeline","ai_cost"]},"frequency":{"type":"string","enum":["DAILY","WEEKLY"]},"recipients":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"isActive":{"default":true,"type":"boolean"}},"required":["name","kind","frequency","recipients"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Reports"],"summary":"Delete a scheduled report","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MANAGER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MANAGER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":204,"allowWhenInactive":false},"responses":{"204":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/reports/preview/{kind}":{"get":{"tags":["Reports"],"summary":"Preview report text","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: VIEWER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"VIEWER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/notification-channels":{"get":{"tags":["Notifications"],"summary":"Slack / email notification channels (secrets never returned)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Notifications"],"summary":"Add a Slack incoming webhook or email channel","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"SLACK"},"name":{"type":"string","minLength":1,"maxLength":80},"webhookUrl":{"type":"string","format":"uri"},"events":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","maxLength":60}},"isActive":{"default":true,"type":"boolean"}},"required":["type","name","webhookUrl","events"]},{"type":"object","properties":{"type":{"type":"string","const":"EMAIL"},"name":{"type":"string","minLength":1,"maxLength":80},"to":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"events":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","maxLength":60}},"isActive":{"default":true,"type":"boolean"}},"required":["type","name","to","events"]}]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/notification-channels/{id}":{"delete":{"tags":["Notifications"],"summary":"Remove a channel","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":204,"allowWhenInactive":false},"responses":{"204":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/notification-channels/test":{"post":{"tags":["Notifications"],"summary":"Send a test notification to all channels","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: ADMIN\n\nRate limit: 10 requests / 600s per workspace","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"ADMIN","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":600,"key":"workspace"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/campaigns/{id}/organize":{"patch":{"tags":["Campaigns"],"summary":"Folder and tags (does not affect approval)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/conversations/{id}/forward":{"post":{"tags":["Inbox"],"summary":"Forward a conversation from its mailbox (human action)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 60 requests / 3600s per user","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"note":{"default":"","type":"string","maxLength":5000},"idempotencyKey":{"type":"string","minLength":8,"maxLength":100}},"required":["to"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":60,"windowSec":3600,"key":"user"},"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/public/plans":{"get":{"tags":["Public"],"summary":"Public plan catalogue (prices, limits, features) for the pricing page","description":"Authentication: none (public)\n\nRate limit: 120 requests / 60s per ip","parameters":[],"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":120,"windowSec":60},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/signup":{"post":{"tags":["Auth"],"summary":"Create an account and a new organization (tenant) with its first workspace and trial","description":"Authentication: none (public)\n\nRate limit: 10 requests / 3600s per ip","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":8,"maxLength":200},"organizationName":{"type":"string","minLength":2,"maxLength":80},"planCode":{"type":"string","maxLength":40},"acceptTerms":{"type":"boolean","const":true},"termsVersion":{"default":"2026-11","type":"string","maxLength":40},"timezone":{"type":"string","maxLength":60},"idempotencyKey":{"type":"string","minLength":8,"maxLength":100}},"required":["name","email","password","organizationName","acceptTerms"]}}}},"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":3600},"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/verify-email":{"post":{"tags":["Auth"],"summary":"Confirm an email address with the token from the verification email","description":"Authentication: none (public)\n\nRate limit: 20 requests / 900s per ip","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":200}},"required":["token"]}}}},"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":20,"windowSec":900},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/verify-email/resend":{"post":{"tags":["Auth"],"summary":"Send the verification email again","description":"Authentication: signed-in user (session cookie)\n\nRate limit: 3 requests / 900s per user","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":3,"windowSec":900,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs":{"get":{"tags":["Organizations"],"summary":"Organizations I belong to, with the workspaces I can open","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}":{"get":{"tags":["Organizations"],"summary":"Organization profile, status, plan, entitlements and usage","description":"Authentication: organization member (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Organizations"],"summary":"Update name, time zone, locale, currency, branding, billing owner","description":"Authentication: organization member (session cookie)\n\nOrganization permission: manage\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"timezone":{"type":"string","maxLength":60},"locale":{"type":"string","maxLength":10},"currency":{"type":"string","minLength":3,"maxLength":3},"branding":{"type":"object","properties":{"displayName":{"type":"string","maxLength":80},"primaryColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"logoUrl":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"string","const":""}]},"website":{"anyOf":[{"type":"string","maxLength":300,"format":"uri"},{"type":"string","const":""}]}}},"billingOwnerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"manage","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/members":{"get":{"tags":["Organizations"],"summary":"Organization members, roles and workspace access","description":"Authentication: organization member (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/members/{userId}":{"patch":{"tags":["Organizations"],"summary":"Change a member's organization role","description":"Authentication: organization member (session cookie)\n\nOrganization permission: manage\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","BILLING","MEMBER"]}},"required":["role"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"manage","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Organizations"],"summary":"Remove a member from the organization (and all its workspaces)","description":"Authentication: organization member (session cookie)\n\nOrganization permission: manage\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"manage","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/workspaces":{"get":{"tags":["Organizations"],"summary":"Workspaces I can open in this organization","description":"Authentication: organization member (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Organizations"],"summary":"Create a workspace (team, client or brand) — counts against the plan","description":"Authentication: organization member (session cookie)\n\nOrganization permission: manage\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"timezone":{"type":"string","maxLength":60}},"required":["name"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"manage","platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/workspaces/{workspaceId}/archive":{"post":{"tags":["Organizations"],"summary":"Archive a workspace (data kept; hidden from members)","description":"Authentication: organization member (session cookie)\n\nOrganization permission: manage\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"manage","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/onboarding":{"get":{"tags":["Organizations"],"summary":"Setup checklist computed from real configuration","description":"Authentication: organization member (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/onboarding/{step}/skip":{"post":{"tags":["Organizations"],"summary":"Skip (or un-skip) an optional setup step","description":"Authentication: organization member (session cookie)\n\nOrganization permission: manage\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"step","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"skip":{"default":true,"type":"boolean"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"manage","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/support-access":{"get":{"tags":["Organizations"],"summary":"When Outvexa support accessed this organization, why, and how many pages they viewed","description":"Authentication: organization member (session cookie)\n\nOrganization permission: manage\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"manage","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/access":{"get":{"tags":["Workspaces"],"summary":"How the caller is accessing this workspace (member, organization admin, or audited support access) and the tenant status","description":"Authentication: workspace member (session cookie or workspace API key)\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/usage":{"get":{"tags":["Organizations"],"summary":"Usage this period and the last 6 months","description":"Authentication: organization member (session cookie)\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/billing":{"get":{"tags":["Billing"],"summary":"Plan, subscription, usage, invoices and available plans","description":"Authentication: organization member (session cookie)\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/billing/checkout":{"post":{"tags":["Billing"],"summary":"Start hosted checkout for a plan (Stripe or Razorpay); activation only via verified webhook","description":"Authentication: organization member (session cookie)\n\nOrganization permission: billing\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: 20 requests / 600s per user","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planCode":{"type":"string","minLength":1,"maxLength":40},"interval":{"default":"month","type":"string","enum":["month","year"]},"provider":{"type":"string","enum":["stripe","razorpay"]}},"required":["planCode","provider"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"billing","platformPermission":null,"rateLimit":{"limit":20,"windowSec":600,"key":"user"},"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/billing/portal":{"post":{"tags":["Billing"],"summary":"Open the Stripe customer portal (payment method, invoices)","description":"Authentication: organization member (session cookie)\n\nOrganization permission: billing\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"billing","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/billing/cancel":{"post":{"tags":["Billing"],"summary":"Cancel the subscription (default: at the end of the period)","description":"Authentication: organization member (session cookie)\n\nOrganization permission: billing\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"atPeriodEnd":{"default":true,"type":"boolean"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"billing","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/billing/resume":{"post":{"tags":["Billing"],"summary":"Undo a scheduled cancellation (Stripe)","description":"Authentication: organization member (session cookie)\n\nOrganization permission: billing\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"billing","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/export":{"post":{"tags":["Organizations"],"summary":"Download a JSON export of the organization and all its workspaces (secrets excluded)","description":"Authentication: organization member (session cookie)\n\nOrganization permission: manage\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: 3 requests / 3600s per user","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"manage","platformPermission":null,"rateLimit":{"limit":3,"windowSec":3600,"key":"user"},"status":201,"allowWhenInactive":true},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/orgs/{organizationId}/deletion":{"post":{"tags":["Organizations"],"summary":"Schedule permanent deletion of the organization (grace period, then erased)","description":"Authentication: organization member (session cookie)\n\nOrganization permission: own\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmName":{"type":"string","minLength":1,"maxLength":80}},"required":["confirmName"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"own","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Organizations"],"summary":"Cancel a scheduled deletion","description":"Authentication: organization member (session cookie)\n\nOrganization permission: own\n\nAvailable while the organization is suspended or cancelled\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"org","role":null,"orgPermission":"own","platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":true},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/me":{"get":{"tags":["Platform"],"summary":"My platform role, permissions, whether 2FA is on and whether this install requires it for staff","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/users":{"get":{"tags":["Platform"],"summary":"Find user accounts by email or name","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/users/{id}/status":{"post":{"tags":["Platform"],"summary":"Disable (signs out everywhere) or re-enable a user account; reason required","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","DISABLED"]},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["status","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/metrics":{"get":{"tags":["Platform"],"summary":"SaaS metrics: tenants by status, MRR/ARR, churn, plan and usage distribution, operations","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: metrics:read\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"metrics:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants":{"get":{"tags":["Platform"],"summary":"Search and filter tenants","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING_SETUP","TRIAL","ACTIVE","PAST_DUE","SUSPENDED","CANCELLED","DELETION_PENDING","DELETED"]}},{"name":"plan","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"sort","in":"query","required":false,"schema":{"default":"createdAt","type":"string","enum":["createdAt","name"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Platform"],"summary":"Create a tenant: organization, first workspace and owner (new owners get a set-password link)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: 60 requests / 3600s per user","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationName":{"type":"string","minLength":2,"maxLength":120},"ownerEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"ownerName":{"type":"string","maxLength":120},"planCode":{"type":"string","maxLength":40},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["organizationName","ownerEmail","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":{"limit":60,"windowSec":3600,"key":"user"},"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}":{"get":{"tags":["Platform"],"summary":"Tenant detail: subscription, usage, workspaces, users, integration status (no secrets), audit","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/lifecycle":{"post":{"tags":["Platform"],"summary":"Suspend, reactivate, cancel, schedule deletion, restore or purge (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["suspend","reactivate","cancel","schedule_deletion","restore","purge_now"]},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["action","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/subscription":{"post":{"tags":["Platform"],"summary":"Override plan, status, trial, grace or entitlements (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planCode":{"type":"string","maxLength":40},"status":{"type":"string","enum":["TRIALING","ACTIVE","PAST_DUE","CANCELED","INCOMPLETE"]},"trialEndsAt":{"anyOf":[{},{"type":"null"}]},"graceUntil":{"anyOf":[{},{"type":"null"}]},"overrides":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/refunds":{"post":{"tags":["Platform"],"summary":"Refund all or part of a paid invoice (optionally cancelling the subscription); idempotent on requestKey","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: billing:refund\n\nRate limit: 20 requests / 3600s per user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountCents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string","minLength":5,"maxLength":500},"cancelSubscription":{"default":false,"type":"boolean"},"requestKey":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["invoiceId","reason","requestKey"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"billing:refund","rateLimit":{"limit":20,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/billing":{"get":{"tags":["Platform"],"summary":"Invoices, refunds and disputes of a tenant (no payment secrets)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: billing:read\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"billing:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/plans":{"get":{"tags":["Platform"],"summary":"All plans including archived, with subscriber counts","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Platform"],"summary":"Create a plan","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: plans:write\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z0-9-]{2,40}$"},"name":{"type":"string","minLength":2,"maxLength":60},"description":{"default":"","type":"string","maxLength":500},"priceMonthlyCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"priceYearlyCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"default":"USD","type":"string","minLength":3,"maxLength":3},"trialDays":{"default":14,"type":"integer","minimum":0,"maximum":90},"isPublic":{"default":true,"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"sortOrder":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerPriceIds":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^(stripe|razorpay)_(month|year)$"},"additionalProperties":{"type":"string","maxLength":100}},"entitlements":{"type":"object","properties":{"maxUsers":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxWorkspaces":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxMailboxes":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxActiveCampaigns":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxLeads":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyEmailSends":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyAiUsd":{"type":"number","minimum":0},"monthlyEnrichments":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyApiCalls":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyWorkflowRuns":{"type":"integer","minimum":0,"maximum":9007199254740991},"storageMb":{"type":"integer","minimum":0,"maximum":9007199254740991},"apiRequestsPerMinute":{"type":"integer","minimum":1,"maximum":9007199254740991},"features":{"type":"object","properties":{"copilot":{"type":"boolean"},"workflows":{"type":"boolean"},"autoReply":{"type":"boolean"},"waterfall":{"type":"boolean"},"apiAccess":{"type":"boolean"},"agencyWorkspaces":{"type":"boolean"}},"required":["copilot","workflows","autoReply","waterfall","apiAccess","agencyWorkspaces"]},"integrations":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":40}},"allowancePeriod":{"default":"monthly","type":"string","enum":["monthly","annual_pooled"]}},"required":["maxUsers","maxWorkspaces","maxMailboxes","maxActiveCampaigns","maxLeads","monthlyEmailSends","monthlyAiUsd","monthlyEnrichments","monthlyApiCalls","monthlyWorkflowRuns","storageMb","apiRequestsPerMinute","features","integrations"]}},"required":["code","name","priceMonthlyCents","priceYearlyCents","entitlements"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"plans:write","rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/plans/{id}":{"put":{"tags":["Platform"],"summary":"Update a plan (prices, limits, features, provider price ids)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: plans:write\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z0-9-]{2,40}$"},"name":{"type":"string","minLength":2,"maxLength":60},"description":{"default":"","type":"string","maxLength":500},"priceMonthlyCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"priceYearlyCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"default":"USD","type":"string","minLength":3,"maxLength":3},"trialDays":{"default":14,"type":"integer","minimum":0,"maximum":90},"isPublic":{"default":true,"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"sortOrder":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerPriceIds":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^(stripe|razorpay)_(month|year)$"},"additionalProperties":{"type":"string","maxLength":100}},"entitlements":{"type":"object","properties":{"maxUsers":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxWorkspaces":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxMailboxes":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxActiveCampaigns":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxLeads":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyEmailSends":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyAiUsd":{"type":"number","minimum":0},"monthlyEnrichments":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyApiCalls":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyWorkflowRuns":{"type":"integer","minimum":0,"maximum":9007199254740991},"storageMb":{"type":"integer","minimum":0,"maximum":9007199254740991},"apiRequestsPerMinute":{"type":"integer","minimum":1,"maximum":9007199254740991},"features":{"type":"object","properties":{"copilot":{"type":"boolean"},"workflows":{"type":"boolean"},"autoReply":{"type":"boolean"},"waterfall":{"type":"boolean"},"apiAccess":{"type":"boolean"},"agencyWorkspaces":{"type":"boolean"}},"required":["copilot","workflows","autoReply","waterfall","apiAccess","agencyWorkspaces"]},"integrations":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":40}},"allowancePeriod":{"default":"monthly","type":"string","enum":["monthly","annual_pooled"]}},"required":["maxUsers","maxWorkspaces","maxMailboxes","maxActiveCampaigns","maxLeads","monthlyEmailSends","monthlyAiUsd","monthlyEnrichments","monthlyApiCalls","monthlyWorkflowRuns","storageMb","apiRequestsPerMinute","features","integrations"]}},"required":["code","name","priceMonthlyCents","priceYearlyCents","entitlements"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"plans:write","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/plans/{id}/archive":{"post":{"tags":["Platform"],"summary":"Archive / unarchive a plan","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: plans:write\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"boolean"}},"required":["archived"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"plans:write","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/operations":{"get":{"tags":["Platform"],"summary":"Queue depths, dead-lettered jobs and failure counters (last 24 h)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: metrics:read\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"metrics:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/operations/retry":{"post":{"tags":["Platform"],"summary":"Retry one dead-lettered job (reason required, audited)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queue":{"type":"string","maxLength":40},"jobId":{"type":"string","maxLength":200},"reason":{"type":"string","minLength":5,"maxLength":300}},"required":["queue","jobId","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/support/grants":{"get":{"tags":["Platform"],"summary":"My active support-access grants","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: support:access\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"support:access","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Platform"],"summary":"Open time-limited, read-only, audited access to one tenant (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: support:access\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":10,"maxLength":500},"minutes":{"default":60,"type":"integer","minimum":5,"maximum":240}},"required":["organizationId","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"support:access","rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/support/grants/{id}":{"delete":{"tags":["Platform"],"summary":"End a support-access grant","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: support:access\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"support:access","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/audit":{"get":{"tags":["Platform"],"summary":"Platform audit trail (append-only)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: audit:read\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"action","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"audit:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-subscriptions/access":{"get":{"tags":["AI subscriptions"],"summary":"Whether the signed-in user may use personal AI subscriptions","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-subscriptions/connections":{"get":{"tags":["AI subscriptions"],"summary":"Subscription connection status (no credentials are returned)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-subscriptions/claude/connect":{"post":{"tags":["AI subscriptions"],"summary":"Connect Claude with a token from `claude setup-token`","description":"Authentication: signed-in user (session cookie)\n\nRate limit: 10 requests / 3600s per user","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":500}},"required":["token"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-subscriptions/codex/login":{"post":{"tags":["AI subscriptions"],"summary":"Start Codex ChatGPT sign-in (device code)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: 10 requests / 3600s per user","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":10,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"get":{"tags":["AI subscriptions"],"summary":"Codex sign-in progress","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["AI subscriptions"],"summary":"Cancel a pending Codex sign-in","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-subscriptions/{provider}/test":{"post":{"tags":["AI subscriptions"],"summary":"Test a subscription connection with a minimal real request","description":"Authentication: signed-in user (session cookie)\n\nRate limit: 20 requests / 3600s per user","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":20,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-subscriptions/{provider}/settings":{"put":{"tags":["AI subscriptions"],"summary":"Model, concurrency, delay and pause for a subscription","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"concurrency":{"type":"integer","minimum":1,"maximum":4},"delayMs":{"type":"integer","minimum":0,"maximum":600000},"paused":{"type":"boolean"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-subscriptions/{provider}":{"delete":{"tags":["AI subscriptions"],"summary":"Disconnect a subscription (removes the stored credential / signs Codex out)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-workflows":{"get":{"tags":["AI subscriptions"],"summary":"List AI workflows (presets are created on first use)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["AI subscriptions"],"summary":"Create a workflow","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"stages":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9-]{4,40}$"},"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"default":true,"type":"boolean"},"provider":{"type":"string","enum":["CLAUDE_SUBSCRIPTION","CODEX_SUBSCRIPTION","API:OPENAI","API:ANTHROPIC","API:GOOGLE","API:OPENROUTER","API:GROQ","API:TOGETHER","API:DEEPSEEK","API:MISTRAL","API:OLLAMA","API:CUSTOM_OPENAI"]},"model":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"taskType":{"type":"string","enum":["PROSPECT_RESEARCH","WEBSITE_ANALYSIS","SOCIAL_MEDIA_ANALYSIS","BUSINESS_ANALYSIS","PAIN_POINT_IDENTIFICATION","EMAIL_ANGLE_SELECTION","COLD_EMAIL_GENERATION","EMAIL_HUMANIZATION","GRAMMAR_REVIEW","PERSONALIZATION_REVIEW","FINAL_QUALITY_CHECK","CUSTOM"]},"instructions":{"default":"","type":"string","maxLength":8000},"inputs":{"default":["prospect","research_evidence","playbook","previous"],"maxItems":10,"type":"array","items":{"type":"string","pattern":"^(prospect|research_evidence|playbook|previous|all|stage:[a-z0-9-]{4,40})$"}},"outputFormat":{"type":"string","enum":["RESEARCH_JSON","ANGLES_JSON","EMAIL_VARIANTS_JSON","QUALITY_REVIEW_JSON","TEXT"]},"variants":{"default":3,"type":"integer","minimum":1,"maximum":5},"temperature":{"default":null,"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"reasoningEffort":{"default":null,"anyOf":[{"type":"string","enum":["minimal","low","medium","high"]},{"type":"null"}]},"allowWebResearch":{"default":false,"type":"boolean"},"retry":{"default":{"maxAttempts":2,"backoffSec":30},"type":"object","properties":{"maxAttempts":{"default":2,"type":"integer","minimum":1,"maximum":5},"backoffSec":{"default":30,"type":"integer","minimum":1,"maximum":3600}}},"timeoutSec":{"default":300,"type":"integer","minimum":30,"maximum":1800},"continueOnError":{"default":false,"type":"boolean"},"condition":{"default":"always","type":"string","enum":["always","if_previous_succeeded","skip_if_provider_unavailable"]}},"required":["id","name","provider","taskType","outputFormat"]}}},"required":["name","stages"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-workflows/{id}":{"get":{"tags":["AI subscriptions"],"summary":"Get a workflow","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["AI subscriptions"],"summary":"Update a workflow (stages, order, providers, instructions)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"stages":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9-]{4,40}$"},"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"default":true,"type":"boolean"},"provider":{"type":"string","enum":["CLAUDE_SUBSCRIPTION","CODEX_SUBSCRIPTION","API:OPENAI","API:ANTHROPIC","API:GOOGLE","API:OPENROUTER","API:GROQ","API:TOGETHER","API:DEEPSEEK","API:MISTRAL","API:OLLAMA","API:CUSTOM_OPENAI"]},"model":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"taskType":{"type":"string","enum":["PROSPECT_RESEARCH","WEBSITE_ANALYSIS","SOCIAL_MEDIA_ANALYSIS","BUSINESS_ANALYSIS","PAIN_POINT_IDENTIFICATION","EMAIL_ANGLE_SELECTION","COLD_EMAIL_GENERATION","EMAIL_HUMANIZATION","GRAMMAR_REVIEW","PERSONALIZATION_REVIEW","FINAL_QUALITY_CHECK","CUSTOM"]},"instructions":{"default":"","type":"string","maxLength":8000},"inputs":{"default":["prospect","research_evidence","playbook","previous"],"maxItems":10,"type":"array","items":{"type":"string","pattern":"^(prospect|research_evidence|playbook|previous|all|stage:[a-z0-9-]{4,40})$"}},"outputFormat":{"type":"string","enum":["RESEARCH_JSON","ANGLES_JSON","EMAIL_VARIANTS_JSON","QUALITY_REVIEW_JSON","TEXT"]},"variants":{"default":3,"type":"integer","minimum":1,"maximum":5},"temperature":{"default":null,"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"reasoningEffort":{"default":null,"anyOf":[{"type":"string","enum":["minimal","low","medium","high"]},{"type":"null"}]},"allowWebResearch":{"default":false,"type":"boolean"},"retry":{"default":{"maxAttempts":2,"backoffSec":30},"type":"object","properties":{"maxAttempts":{"default":2,"type":"integer","minimum":1,"maximum":5},"backoffSec":{"default":30,"type":"integer","minimum":1,"maximum":3600}}},"timeoutSec":{"default":300,"type":"integer","minimum":30,"maximum":1800},"continueOnError":{"default":false,"type":"boolean"},"condition":{"default":"always","type":"string","enum":["always","if_previous_succeeded","skip_if_provider_unavailable"]}},"required":["id","name","provider","taskType","outputFormat"]}}},"required":["name","stages"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["AI subscriptions"],"summary":"Delete a workflow","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-workflows/{id}/duplicate":{"post":{"tags":["AI subscriptions"],"summary":"Duplicate a workflow","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-workflows/{id}/activate":{"post":{"tags":["AI subscriptions"],"summary":"Make this the workflow used by \"Generate with selected workflow\"","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-stage-templates":{"get":{"tags":["AI subscriptions"],"summary":"Saved stage templates","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["AI subscriptions"],"summary":"Save a stage as a reusable template","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"stage":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9-]{4,40}$"},"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"default":true,"type":"boolean"},"provider":{"type":"string","enum":["CLAUDE_SUBSCRIPTION","CODEX_SUBSCRIPTION","API:OPENAI","API:ANTHROPIC","API:GOOGLE","API:OPENROUTER","API:GROQ","API:TOGETHER","API:DEEPSEEK","API:MISTRAL","API:OLLAMA","API:CUSTOM_OPENAI"]},"model":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"taskType":{"type":"string","enum":["PROSPECT_RESEARCH","WEBSITE_ANALYSIS","SOCIAL_MEDIA_ANALYSIS","BUSINESS_ANALYSIS","PAIN_POINT_IDENTIFICATION","EMAIL_ANGLE_SELECTION","COLD_EMAIL_GENERATION","EMAIL_HUMANIZATION","GRAMMAR_REVIEW","PERSONALIZATION_REVIEW","FINAL_QUALITY_CHECK","CUSTOM"]},"instructions":{"default":"","type":"string","maxLength":8000},"inputs":{"default":["prospect","research_evidence","playbook","previous"],"maxItems":10,"type":"array","items":{"type":"string","pattern":"^(prospect|research_evidence|playbook|previous|all|stage:[a-z0-9-]{4,40})$"}},"outputFormat":{"type":"string","enum":["RESEARCH_JSON","ANGLES_JSON","EMAIL_VARIANTS_JSON","QUALITY_REVIEW_JSON","TEXT"]},"variants":{"default":3,"type":"integer","minimum":1,"maximum":5},"temperature":{"default":null,"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"reasoningEffort":{"default":null,"anyOf":[{"type":"string","enum":["minimal","low","medium","high"]},{"type":"null"}]},"allowWebResearch":{"default":false,"type":"boolean"},"retry":{"default":{"maxAttempts":2,"backoffSec":30},"type":"object","properties":{"maxAttempts":{"default":2,"type":"integer","minimum":1,"maximum":5},"backoffSec":{"default":30,"type":"integer","minimum":1,"maximum":3600}}},"timeoutSec":{"default":300,"type":"integer","minimum":30,"maximum":1800},"continueOnError":{"default":false,"type":"boolean"},"condition":{"default":"always","type":"string","enum":["always","if_previous_succeeded","skip_if_provider_unavailable"]}},"required":["id","name","provider","taskType","outputFormat"]}},"required":["name","stage"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-stage-templates/{id}":{"delete":{"tags":["AI subscriptions"],"summary":"Delete a stage template","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-playbook":{"get":{"tags":["AI subscriptions"],"summary":"Current writing playbook and version history","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["AI subscriptions"],"summary":"Save the playbook as a new version","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":20,"maxLength":50000},"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["content"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-playbook/versions/{id}":{"get":{"tags":["AI subscriptions"],"summary":"One playbook version","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-playbook/versions/{id}/restore":{"post":{"tags":["AI subscriptions"],"summary":"Restore a previous playbook version (creates a new version)","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-queue/pause":{"post":{"tags":["AI subscriptions"],"summary":"Pause all AI workflow queues","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai-queue/resume":{"post":{"tags":["AI subscriptions"],"summary":"Resume all AI workflow queues","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs":{"post":{"tags":["AI subscriptions"],"summary":"Generate emails for a prospect with a workflow, Claude or Codex (queued; never sends)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nMinimum workspace role: MEMBER\n\nRate limit: 120 requests / 3600s per user","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"campaignId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"mode":{"default":"workflow","type":"string","enum":["workflow","claude","codex"]},"workflowId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"instructions":{"type":"string","maxLength":2000}},"required":["leadId"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":"MEMBER","orgPermission":null,"platformPermission":null,"rateLimit":{"limit":120,"windowSec":3600,"key":"user"},"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"get":{"tags":["AI subscriptions"],"summary":"Generation history","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"leadId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["QUEUED","RUNNING","SUCCEEDED","FAILED","PAUSED","PAUSED_LIMIT","CANCELLED"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs/{id}":{"get":{"tags":["AI subscriptions"],"summary":"Run detail: research, variants, stages and execution log","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs/{id}/pause":{"post":{"tags":["AI subscriptions"],"summary":"Pause a run","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs/{id}/resume":{"post":{"tags":["AI subscriptions"],"summary":"Resume / retry a run, optionally choosing another provider for the paused stage","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stageProvider":{"type":"string","enum":["CLAUDE_SUBSCRIPTION","CODEX_SUBSCRIPTION","API:OPENAI","API:ANTHROPIC","API:GOOGLE","API:OPENROUTER","API:GROQ","API:TOGETHER","API:DEEPSEEK","API:MISTRAL","API:OLLAMA","API:CUSTOM_OPENAI"]},"autoResume":{"type":"boolean"}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs/{id}/cancel":{"post":{"tags":["AI subscriptions"],"summary":"Cancel a run","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}":{"put":{"tags":["AI subscriptions"],"summary":"Edit a variant subject/body","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"index","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":300},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["subject","body"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}/select":{"post":{"tags":["AI subscriptions"],"summary":"Select the preferred variant","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"index","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}/regenerate":{"post":{"tags":["AI subscriptions"],"summary":"Regenerate one variant (queued)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"index","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":202,"allowWhenInactive":false},"responses":{"202":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-runs/{id}/draft":{"post":{"tags":["AI subscriptions"],"summary":"Save the selected variant as a draft (nothing is sent)","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9}}}}}},"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/w/{workspaceId}/ai-queue":{"get":{"tags":["AI subscriptions"],"summary":"AI generation queue dashboard","description":"Authentication: workspace member (session cookie or workspace API key)\n\nRate limit: global Nginx limit","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]},{"apiKey":[]}],"x-emn":{"auth":"workspace","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/staff":{"get":{"tags":["Platform"],"summary":"Platform staff and what each staff role may do","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: staff:manage\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"staff:manage","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Platform"],"summary":"Give an existing account a platform role (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: staff:manage\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["SUPER_ADMIN","SUPPORT","FINANCE"]},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["email","role","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"staff:manage","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/staff/{userId}":{"put":{"tags":["Platform"],"summary":"Change or remove a platform role (not your own; the last super admin stays)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: staff:manage\n\nRate limit: global Nginx limit","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"anyOf":[{"type":"string","enum":["SUPER_ADMIN","SUPPORT","FINANCE"]},{"type":"null"}]},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["role","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"staff:manage","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/members":{"get":{"tags":["Platform"],"summary":"Members of a tenant with organization and workspace roles","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Platform"],"summary":"Add a person to a tenant (creates the account if needed)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","maxLength":120},"role":{"type":"string","enum":["OWNER","ADMIN","BILLING","MEMBER"]},"workspaceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"workspaceRole":{"default":"MEMBER","type":"string","enum":["OWNER","ADMIN","MANAGER","MEMBER","VIEWER"]},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["email","role","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":201,"allowWhenInactive":false},"responses":{"201":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/members/{userId}":{"put":{"tags":["Platform"],"summary":"Change a member's organization role, including ownership transfer","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","BILLING","MEMBER"]},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["role","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/members/{userId}/remove":{"post":{"tags":["Platform"],"summary":"Remove a member from a tenant","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/modules":{"get":{"tags":["Platform"],"summary":"Plan entitlements, overrides and effective modules/limits of a tenant","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["Platform"],"summary":"Turn modules on/off and override limits for one tenant (null = inherit plan)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"features":{"type":"object","properties":{"copilot":{"type":["boolean","null"]},"workflows":{"type":["boolean","null"]},"autoReply":{"type":["boolean","null"]},"waterfall":{"type":["boolean","null"]},"apiAccess":{"type":["boolean","null"]},"agencyWorkspaces":{"type":["boolean","null"]}},"required":["copilot","workflows","autoReply","waterfall","apiAccess","agencyWorkspaces"]},"limits":{"type":"object","properties":{"maxUsers":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"maxWorkspaces":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"maxMailboxes":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"maxActiveCampaigns":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"maxLeads":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"monthlyEmailSends":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"monthlyAiUsd":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"monthlyEnrichments":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"monthlyApiCalls":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"monthlyWorkflowRuns":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"storageMb":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"apiRequestsPerMinute":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]}},"required":["maxUsers","maxWorkspaces","maxMailboxes","maxActiveCampaigns","maxLeads","monthlyEmailSends","monthlyAiUsd","monthlyEnrichments","monthlyApiCalls","monthlyWorkflowRuns","storageMb","apiRequestsPerMinute"]},"integrations":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","maxLength":40}},{"type":"null"}]},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["features","limits","integrations","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/users/{id}/password-reset":{"post":{"tags":["Platform"],"summary":"Issue a password reset link for a user (mailed, or returned once when system mail is off)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: 30 requests / 3600s per user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":{"limit":30,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/permissions":{"get":{"tags":["Platform"],"summary":"Permission matrix: workspace roles per module (from the route rules), organization roles, staff roles","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/settings":{"get":{"tags":["Platform"],"summary":"Global settings: sign-up mode and announcement banner","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["Platform"],"summary":"Save global settings (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: settings:write\n\nRate limit: global Nginx limit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"signupMode":{"type":"string","enum":["env","open","closed"]},"announcement":{"type":"object","properties":{"enabled":{"type":"boolean"},"level":{"type":"string","enum":["info","warning","danger"]},"message":{"type":"string","maxLength":500}},"required":["enabled","level","message"]},"maintenance":{"type":"object","properties":{"enabled":{"type":"boolean"},"message":{"type":"string","maxLength":500}},"required":["enabled","message"]},"security":{"type":"object","properties":{"passwordMinLength":{"type":"integer","minimum":8,"maximum":128},"sessionIdleDays":{"type":"integer","minimum":1,"maximum":90},"requireMfaForAllUsers":{"type":"boolean"},"impersonationMaxMinutes":{"type":"integer","minimum":5,"maximum":480}},"required":["passwordMinLength","sessionIdleDays","requireMfaForAllUsers","impersonationMaxMinutes"]},"signups":{"type":"object","properties":{"defaultPlanCode":{"type":"string","maxLength":40},"maxOrgsPerUser":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]}},"required":["defaultPlanCode","maxOrgsPerUser"]},"branding":{"type":"object","properties":{"appName":{"type":"string","minLength":2,"maxLength":60},"supportEmail":{"anyOf":[{"type":"string","const":""},{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}]}},"required":["appName","supportEmail"]},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"settings:write","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/announcement":{"get":{"tags":["Account"],"summary":"Platform-wide announcement to show to signed-in users, if any","description":"Authentication: signed-in user (session cookie)\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"user","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/public/config":{"get":{"tags":["Account"],"summary":"Product name, support email, password rule and maintenance notice (public)","description":"Authentication: none (public)\n\nRate limit: global Nginx limit","parameters":[],"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/users/{id}":{"get":{"tags":["Platform"],"summary":"Everything about one account: memberships, sessions, API keys, activity and staff actions","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:read\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"put":{"tags":["Platform"],"summary":"Edit name, email, language or email-verified flag (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: users:manage\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"locale":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"emailVerified":{"type":"boolean"},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"users:manage","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/users/{id}/mfa-reset":{"post":{"tags":["Platform"],"summary":"Turn off two-factor for a person who lost their device (signs them out)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: users:manage\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"users:manage","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/users/{id}/sessions/revoke":{"post":{"tags":["Platform"],"summary":"Sign a person out of every browser","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: users:manage\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"users:manage","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/sessions/{id}/revoke":{"post":{"tags":["Platform"],"summary":"End one session of any user","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: users:manage\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"users:manage","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/profile":{"put":{"tags":["Platform"],"summary":"Rename an organization or change its time zone (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":60},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/workspaces/{workspaceId}":{"put":{"tags":["Platform"],"summary":"Rename, archive or restore a workspace of a tenant (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: tenants:lifecycle\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"archived":{"type":"boolean"},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"tenants:lifecycle","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/users/{id}/impersonate":{"post":{"tags":["Platform"],"summary":"Log in as this user: a time-limited session with full access, every change audited (reason required)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: impersonate\n\nRate limit: 60 requests / 3600s per user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500},"minutes":{"type":"integer","minimum":5,"maximum":480},"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"impersonate","rateLimit":{"limit":60,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/tenants/{id}/impersonate":{"post":{"tags":["Platform"],"summary":"Log in to a tenant as its owner (or the member given in userId)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: impersonate\n\nRate limit: 60 requests / 3600s per user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500},"minutes":{"type":"integer","minimum":5,"maximum":480},"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"impersonate","rateLimit":{"limit":60,"windowSec":3600,"key":"user"},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/impersonations":{"get":{"tags":["Platform"],"summary":"Open \"log in as\" sessions","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: impersonate\n\nRate limit: global Nginx limit","parameters":[],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"impersonate","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/impersonations/{id}":{"delete":{"tags":["Platform"],"summary":"End a \"log in as\" session","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: impersonate\n\nRate limit: global Nginx limit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"impersonate","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/auth/impersonation/stop":{"post":{"tags":["Auth"],"summary":"Leave a \"log in as\" session and return to your own account","description":"Authentication: none (public)\n\nRate limit: 60 requests / 300s per ip","parameters":[],"security":[],"x-emn":{"auth":"public","role":null,"orgPermission":null,"platformPermission":null,"rateLimit":{"limit":60,"windowSec":300},"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/data":{"get":{"tags":["Platform"],"summary":"Every table with record counts, optionally for one tenant or workspace","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: data:read\n\nRate limit: global Nginx limit","parameters":[{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"workspaceId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"counts","in":"query","required":false,"schema":{"default":"true","type":"string","enum":["true","false"]}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"data:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/data/{model}":{"get":{"tags":["Platform"],"summary":"Records of one table: search, filter by column, sort, page (secrets hidden)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: data:read\n\nRate limit: global Nginx limit","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"workspaceId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"q","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":200}},{"name":"field","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"value","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"dir","in":"query","required":false,"schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"data:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/platform/data/{model}/{recordId}":{"get":{"tags":["Platform"],"summary":"One record with links to related records (viewing is audited)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: data:read\n\nRate limit: global Nginx limit","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"data:read","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Platform"],"summary":"Change fields of a record (reason required; before/after audited)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: data:write\n\nRate limit: global Nginx limit","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["changes","reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"data:write","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Platform"],"summary":"Delete a record (reason required; the record is kept in the audit trail)","description":"Authentication: platform staff only (session cookie); returns 404 to everyone else\n\nPlatform permission: data:write\n\nRate limit: global Nginx limit","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"security":[{"sessionCookie":[],"csrfHeader":[]}],"x-emn":{"auth":"platform","role":null,"orgPermission":null,"platformPermission":"data:write","rateLimit":null,"status":200,"allowWhenInactive":false},"responses":{"200":{"description":"Success (JSON). List endpoints return { data, page, pageSize, total, totalPages }."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}}}