{"openapi":"3.0.3","info":{"title":"Eli API","version":"2.0.0","description":"Read AI-search evidence and execute reviewed own-site changes through Eli's guarded decision core. Shipping writes require literal JSON confirmation, plan and protocol caps, an owner/admin principal, and an audit receipt. Third-party sends and autonomy switches are not exposed.","contact":{"name":"Eli","url":"https://hireeli.io"}},"servers":[{"url":"https://hireeli.io"}],"tags":[{"name":"Public","description":"Anonymous, public-tenant-scoped resources."},{"name":"Workspace reads","description":"Tenant-pinned evidence and pending work."},{"name":"Buyer Agent","description":"Privacy-safe answer-to-pipeline reads and bounded writes."},{"name":"Own-site execution","description":"Confirmed, capped and audited decisions."},{"name":"Legacy","description":"Deprecated read-only REST v1."}],"components":{"securitySchemes":{"eliApiKey":{"type":"http","scheme":"bearer","bearerFormat":"ELI_API_KEY","description":"A scoped key in the eli_live_<key_id>_<secret> format. The plaintext is shown only when the key is created. The validated key row pins the workspace."},"eliUserToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"A current Eli/Supabase user access token. Row-level security and current owner/admin membership govern writes."}},"parameters":{"WorkspaceHeader":{"name":"x-eli-tenant","in":"header","required":false,"description":"Workspace UUID. Required for user tokens with multiple memberships. For API keys it is only an equality assertion against the key-pinned workspace.","schema":{"type":"string","format":"uuid"}},"ResourceId":{"name":"id","in":"path","required":true,"description":"Tenant-scoped resource UUID.","schema":{"type":"string","format":"uuid"}}},"responses":{"Unauthorized":{"description":"Credential missing, invalid, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Workspace, role, scope, plan or feature does not permit this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"The resource is not visible in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Current lifecycle state conflicts with the requested decision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Request or durable protocol cap reached.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds before the in-memory request window resets, when applicable."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"A required security, billing, cap, audit, evidence or storage check is unavailable. Writes fail closed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"code":{"type":"string","nullable":true},"details":{"type":"object","additionalProperties":true,"nullable":true}},"additionalProperties":true},"WorkspaceData":{"type":"object","required":["data"],"properties":{"data":{"type":"object","description":"Resource-specific data, always pinned to the resolved workspace.","additionalProperties":true},"workspaceId":{"type":"string","format":"uuid"}},"additionalProperties":true},"CompanyIntelligenceFact":{"type":"object","required":["key","value","status","confidence","freshness","sources","alternatives","explanation"],"properties":{"key":{"type":"string"},"value":{"nullable":true,"description":"Typed fact value. Null means the fact is explicitly missing."},"status":{"type":"string","enum":["verified","reported","observed","missing","conflict","stale"]},"confidence":{"type":"number","minimum":0,"maximum":1},"freshness":{"type":"string","enum":["current","stale","unknown"]},"sources":{"type":"array","items":{"type":"object","required":["kind","ref","observedAt"],"additionalProperties":true}},"alternatives":{"type":"array","items":{}},"explanation":{"type":"string"}},"additionalProperties":false},"CompanyIntelligence":{"type":"object","required":["version","available","generatedAt","workspaceId","revision","readiness","coverageScore","facts","gaps","conflicts","unavailableSources","agentContext","cost","truth"],"properties":{"version":{"type":"string","enum":["company-intelligence-v1"]},"available":{"type":"boolean"},"generatedAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"revision":{"type":"object","required":["memoryVersion"],"properties":{"memoryVersion":{"type":"integer","minimum":0}},"additionalProperties":false},"readiness":{"type":"string","enum":["ready","needs_input","conflict","unavailable"]},"coverageScore":{"type":"integer","minimum":0,"maximum":100,"description":"Coverage of required personalized context, not a business-quality score."},"facts":{"type":"object","description":"Grouped CompanyIntelligenceFact objects for identity, market, positioning, audience, offer, competition, demand, proof, conversion and constraints.","additionalProperties":true},"gaps":{"type":"array","items":{"type":"object","required":["key","severity","question","reason"],"properties":{"key":{"type":"string"},"severity":{"type":"string","enum":["blocking","important","optional"]},"question":{"type":"string"},"reason":{"type":"string"}},"additionalProperties":false}},"conflicts":{"type":"array","items":{"type":"object","required":["key","values","sources","resolution"],"additionalProperties":true}},"unavailableSources":{"type":"array","items":{"type":"string"}},"agentContext":{"type":"object","required":["useForPersonalization","instruction","known","unknown","forbiddenInferences"],"additionalProperties":true},"cost":{"type":"object","required":["modelCalls","paidProviderCalls"],"properties":{"modelCalls":{"type":"integer","enum":[0]},"paidProviderCalls":{"type":"integer","enum":[0]}},"additionalProperties":false},"truth":{"type":"object","additionalProperties":true}},"additionalProperties":false},"CompanyIntelligenceResponse":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CompanyIntelligence"}},"additionalProperties":false},"DistributionPlan":{"type":"object","required":["version","available","generatedAt","workspaceId","status","headline","summary","coverage","messageFrame","plays","nextAction","blockers","unsupportedChannels","sourceRevisions","truth","cost"],"properties":{"version":{"type":"string","enum":["distribution-plan-v1"]},"available":{"type":"boolean"},"generatedAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["ready","needs_context","needs_asset","blocked","unavailable"]},"headline":{"type":"string"},"summary":{"type":"string"},"coverage":{"type":"object","additionalProperties":false,"required":["companyIntelligence","measuredDistribution","readyPlays","totalPlays"],"properties":{"companyIntelligence":{"type":"integer","minimum":0,"maximum":100},"measuredDistribution":{"type":"integer","minimum":0,"maximum":100},"readyPlays":{"type":"integer","minimum":0},"totalPlays":{"type":"integer","minimum":0}}},"messageFrame":{"type":"object","nullable":true,"additionalProperties":true},"plays":{"type":"array","items":{"type":"object","required":["id","rank","kind","stage","channel","state","title","objective","whyNow","audience","messageFrame","prerequisites","evidenceRefs","authority","operation","successMetric","receiptRequired","failureRecovery","cost"],"additionalProperties":true}},"nextAction":{"type":"object","required":["type","title","reason","mcp","rest","dashboard","playId"],"additionalProperties":true},"blockers":{"type":"array","items":{"type":"string"}},"unsupportedChannels":{"type":"array","items":{"type":"object","required":["channel","reason"],"additionalProperties":false}},"sourceRevisions":{"type":"object","additionalProperties":false,"required":["companyIntelligenceMemoryVersion","growthGeneratedAt"],"properties":{"companyIntelligenceMemoryVersion":{"type":"integer","minimum":0},"growthGeneratedAt":{"type":"string","format":"date-time"}}},"truth":{"type":"object","additionalProperties":true},"cost":{"type":"object","required":["modelCalls","paidProviderCalls"],"properties":{"modelCalls":{"type":"integer","enum":[0]},"paidProviderCalls":{"type":"integer","enum":[0]}},"additionalProperties":false}},"additionalProperties":false},"DistributionPlanResponse":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/DistributionPlan"}},"additionalProperties":false},"RevenueTwinResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["version","generatedAt","workspaceId","available","evidenceHash","lifecycle","company","buyers","offer","demand","conversion","memory","connections","blockers","truth"],"properties":{"version":{"type":"string","enum":["revenue-twin-v1"]},"generatedAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"available":{"type":"boolean"},"evidenceHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"lifecycle":{"type":"object","additionalProperties":true},"company":{"type":"object","additionalProperties":true},"buyers":{"type":"object","additionalProperties":true},"offer":{"type":"object","additionalProperties":true},"demand":{"type":"object","additionalProperties":true},"conversion":{"type":"object","additionalProperties":true},"memory":{"type":"object","additionalProperties":true},"connections":{"type":"object","additionalProperties":true},"blockers":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","reason","href"],"properties":{"key":{"type":"string"},"reason":{"type":"string"},"href":{"type":"string"}}}},"truth":{"type":"object","additionalProperties":true}},"additionalProperties":false}},"additionalProperties":false},"DemandRadarResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["version","generatedAt","workspaceId","available","mode","headline","reason","traffic","demand","conversion","nextAction","truth"],"properties":{"version":{"type":"string","enum":["demand-radar-v1"]},"generatedAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"available":{"type":"boolean"},"mode":{"type":"string","enum":["unavailable","needs_measurement","create_demand","capture_demand","compound_growth"]},"headline":{"type":"string"},"reason":{"type":"string"},"traffic":{"type":"object","additionalProperties":false,"required":["windowDays","websitePageViews","measured","source"],"properties":{"windowDays":{"type":"integer","enum":[28]},"websitePageViews":{"type":"integer","minimum":0,"nullable":true},"measured":{"type":"boolean"},"source":{"type":"string","enum":["first_party_page_events"]}}},"demand":{"type":"object","additionalProperties":true},"conversion":{"type":"object","additionalProperties":true},"nextAction":{"type":"object","additionalProperties":false,"required":["kind","title","reason","dashboard","mcp","rest","playId"],"properties":{"kind":{"type":"string"},"title":{"type":"string"},"reason":{"type":"string"},"dashboard":{"type":"string"},"mcp":{"type":"string"},"rest":{"type":"string"},"playId":{"type":"string","nullable":true}}},"truth":{"type":"object","additionalProperties":true}},"additionalProperties":false}},"additionalProperties":false},"DecisionSurfaceCatalogResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["version","workspaceId","available","surfaces","blockers","truth"],"properties":{"version":{"type":"string","enum":["decision-surface-v1"]},"workspaceId":{"type":"string","format":"uuid"},"available":{"type":"boolean"},"surfaces":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["version","key","intent","paths","slots","evidence","constraints"],"properties":{"version":{"type":"string","enum":["decision-surface-v1"]},"key":{"type":"string"},"intent":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"slots":{"type":"object","additionalProperties":true},"evidence":{"type":"object","additionalProperties":true},"constraints":{"type":"object","additionalProperties":true}}}},"blockers":{"type":"array","items":{"type":"string"}},"truth":{"type":"object","additionalProperties":true}},"additionalProperties":false}},"additionalProperties":false},"CompanyIntelligenceUpdateRequest":{"type":"object","required":["tenantId","expectedVersion","facts"],"properties":{"tenantId":{"type":"string","format":"uuid"},"expectedVersion":{"type":"integer","minimum":0,"maximum":1000000},"facts":{"type":"object","minProperties":1,"maxProperties":12,"additionalProperties":false,"properties":{"idealCustomerProfile":{"type":"string","minLength":10,"maxLength":2000,"nullable":true},"primaryOffer":{"type":"string","minLength":10,"maxLength":2000,"nullable":true},"buyerRoles":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"customerPains":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"buyingTriggers":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"desiredOutcomes":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"purchaseCriteria":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"objections":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"differentiation":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"proof":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"claimConstraints":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true},"exclusions":{"type":"array","maxItems":50,"items":{"type":"string","minLength":2,"maxLength":500},"nullable":true}}}},"additionalProperties":false},"ProtocolReceipt":{"type":"object","required":["decision","resourceId","status","url","revertible","revert_hint","caps","audit_id"],"properties":{"decision":{"type":"string","description":"The exact accepted operation.","example":"apply"},"resourceId":{"type":"string","description":"The decided resource ID."},"status":{"type":"string","description":"The state Eli verified after the decision.","example":"applied"},"url":{"type":"string","format":"uri","nullable":true},"revertible":{"type":"boolean","description":"Whether Eli exposes a guarded machine revert for this completed action."},"revert_hint":{"type":"string","nullable":true,"description":"The exact safe next step for a revert or immutable follow-up."},"caps":{"type":"object","nullable":true,"required":["used","limit","window"],"properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0},"window":{"type":"string","enum":["day"]}},"additionalProperties":false,"description":"Durable protocol write counter returned by the shared execution core."},"audit_id":{"type":"string","format":"uuid","nullable":true,"description":"Durable protocol-decision audit row for this machine write."},"change_id":{"type":"string","format":"uuid","nullable":true,"description":"Exact owned-site change reconciled by a content rollback, when applicable."},"publication_receipt_id":{"type":"string","format":"uuid","nullable":true,"description":"Immutable publication receipt preserved across rollback."},"reversal_receipt_id":{"type":"string","format":"uuid","nullable":true,"description":"Immutable verified rollback receipt, when rollback completed."}},"additionalProperties":true},"ConfirmationRequired":{"type":"object","required":["error","message","required","preview_hash","preview"],"properties":{"error":{"type":"string","enum":["confirmation_required"]},"message":{"type":"string","description":"Plain instruction to show the preview and re-call only after human approval."},"required":{"type":"object","required":["confirm","confirmed_preview_hash"],"properties":{"confirm":{"$ref":"#/components/schemas/LiteralConfirmation"},"confirmed_preview_hash":{"$ref":"#/components/schemas/PreviewHash"}},"additionalProperties":false},"preview_hash":{"$ref":"#/components/schemas/PreviewHash"},"preview":{"type":"object","additionalProperties":true,"description":"The current before/after diff, draft or layer evidence. No write occurred."}},"additionalProperties":true},"LiteralConfirmation":{"type":"boolean","enum":[true],"description":"Must be the JSON boolean true. Strings, numbers and free-text phrases are rejected."},"PreviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"SHA-256 confirmation binding for the exact tool, workspace, resource and preview returned by the immediately preceding preview response."},"OnsiteDecisionRequest":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["approve","apply","revert","dismiss"]},"confirm":{"$ref":"#/components/schemas/LiteralConfirmation"},"confirmed_preview_hash":{"$ref":"#/components/schemas/PreviewHash"}},"additionalProperties":false},"OnsiteProposalResponse":{"type":"object","required":["decision","resourceId","status","prepared","selected","approvalRequired","nextAction","changedByThisRequest"],"properties":{"decision":{"type":"string","enum":["prepare"]},"resourceId":{"type":"string"},"status":{"type":"string","enum":["ready","no_match","connection_required"]},"prepared":{"type":"boolean"},"selected":{"type":"object","required":["changeId","promptId","pageUrl","reused","workflowStatus","applicationMode"],"properties":{"changeId":{"type":"string","format":"uuid","nullable":true},"promptId":{"type":"string","format":"uuid","nullable":true},"pageUrl":{"type":"string","format":"uri","nullable":true},"reused":{"type":"boolean"},"workflowStatus":{"type":"string","enum":["draft","approved","applying","reverting"],"nullable":true},"applicationMode":{"type":"string","enum":["native_wordpress","manual_cms_handoff"],"nullable":true}},"additionalProperties":false},"previewEndpoint":{"type":"string","nullable":true},"decisionEndpoint":{"type":"string","nullable":true},"approvalRequired":{"type":"boolean"},"nextAction":{"type":"string","enum":["approve","apply","publish_handoff_then_verify","wait"],"nullable":true},"nextActionHint":{"type":"string","nullable":true},"changedByThisRequest":{"type":"boolean","enum":[false]},"caps":{"type":"object","nullable":true,"additionalProperties":true},"audit_id":{"type":"string","format":"uuid","nullable":true}},"additionalProperties":false},"ContentDecisionRequest":{"type":"object","required":["action"],"description":"approve_publish and revert require write:drafts and write:own-site for an API key. dismiss requires write:drafts. Revert is limited to exact Eli-created native WordPress posts and remains available after downgrade.","properties":{"action":{"type":"string","enum":["approve_publish","revert","dismiss"]},"confirm":{"$ref":"#/components/schemas/LiteralConfirmation"},"confirmed_preview_hash":{"$ref":"#/components/schemas/PreviewHash"},"provider":{"type":"string","enum":["wordpress","webflow","shopify","contentful","sanity","strapi","generic_api","manual_url"],"description":"Optional connected CMS choice. Use manual_url only with publication_url after the page is publicly live."},"publication_url":{"type":"string","format":"uri","maxLength":2000,"description":"Exact public URL used only with provider manual_url so Eli can verify a human publication handoff."}},"additionalProperties":false},"CorrectionDecisionRequest":{"type":"object","required":["action"],"description":"Requires write:own-site for an API key.","properties":{"action":{"type":"string","enum":["approve","dismiss"]},"confirm":{"$ref":"#/components/schemas/LiteralConfirmation"},"confirmed_preview_hash":{"$ref":"#/components/schemas/PreviewHash"}},"additionalProperties":false},"LayerDecisionRequest":{"type":"object","description":"Requires write:own-site for an API key.","properties":{"confirm":{"$ref":"#/components/schemas/LiteralConfirmation"},"confirmed_preview_hash":{"$ref":"#/components/schemas/PreviewHash"}},"additionalProperties":false},"ScanRequest":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}},"additionalProperties":false},"ScanResult":{"type":"object","required":["domain","score","readability","usability","scannedAt"],"properties":{"domain":{"type":"string"},"score":{"type":"integer","minimum":0,"maximum":100},"visibility":{"type":"integer","minimum":0,"maximum":100,"nullable":true},"readability":{"type":"integer","minimum":0,"maximum":100},"usability":{"type":"integer","minimum":0,"maximum":100},"quotes":{"type":"array","items":{"type":"object","additionalProperties":true}},"gaps":{"type":"array","items":{"type":"object","additionalProperties":true}},"scannedAt":{"type":"string","format":"date-time"}},"additionalProperties":true}}},"paths":{"/api/scan":{"post":{"tags":["Public"],"operationId":"runPublicScan","summary":"Run or read the cached public visibility scan for a domain","description":"Anonymous and public-tenant isolated. The seven-day cache, domain lease and public request/cost caps are reused; callers cannot request a fresh-cache bypass.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"}}}},"responses":{"200":{"description":"Public scan result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResult"}}}},"400":{"description":"Invalid domain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyers":{"get":{"tags":["Buyer Agent"],"operationId":"listAiBuyerContexts","summary":"List privacy-safe AI Buyer Contexts","description":"Ranks tenant-pinned contexts by a transparent intent score. Probable and visitor-confirmed intent remain distinct; PII is excluded.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"},{"name":"minimum_score","in":"query","schema":{"type":"integer","minimum":0,"maximum":100}},{"name":"source","in":"query","schema":{"type":"string"}},{"name":"intent","in":"query","schema":{"type":"string"}},{"name":"stage","in":"query","schema":{"type":"string"}},{"name":"variant","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Paginated non-PII Buyer Context projections."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyers/{id}":{"get":{"tags":["Buyer Agent"],"operationId":"readAiBuyerContext","summary":"Read one answer-to-pipeline journey","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"},{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Inference, confirmation, evidence pack, action, timeline and outcomes without contact PII."},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyer-agent/state":{"get":{"tags":["Buyer Agent"],"operationId":"readBuyerAgentState","summary":"Read readiness and configuration","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"State, readiness, configuration and counts."},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyer-agent/report":{"get":{"tags":["Buyer Agent"],"operationId":"readAnswerToPipelineReport","summary":"Read funnel and experiment evidence","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Treatment/control counts, evidence grades, funnel, gaps and completeness."},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyer-agent/actions":{"get":{"tags":["Buyer Agent"],"operationId":"listBuyerActions","summary":"List prepared conversion actions","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Tenant-pinned action registry and verification state."},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyer-agent/actions/prepare":{"post":{"tags":["Buyer Agent"],"operationId":"prepareBuyerActions","summary":"Prepare evidence packs and actions without activating public behavior","description":"Requires write:drafts. Reuses already published evidence, makes no model call, leaves ambiguous external hosts in draft and never launches the Buyer Agent.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Preparation receipt with blockers and zero-provider cost."},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyer-agent/context-handoff":{"post":{"tags":["Buyer Agent"],"operationId":"createBuyerContextHandoff","summary":"Create an exact one-question Buyer Context deep link","description":"Requires write:own-site. The destination must be a clean HTTPS URL on an exact verified workspace domain. The five-minute URL contains only an opaque signed token, never question text or a transcript. Company Intelligence must allow personalization.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question_id","destination_url"],"properties":{"question_id":{"type":"string","format":"uuid"},"destination_url":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Short-lived transcript-free handoff link."},"400":{"description":"Invalid or unverified destination."},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Active tracked question not found."},"409":{"description":"Company Intelligence or site installation is not ready."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyer-agent/experiment":{"post":{"tags":["Buyer Agent"],"operationId":"configureBuyerAgentExperiment","summary":"Preview, then launch or pause the measured Buyer Agent test","description":"First call returns the complete behavior and preview hash. Mutation requires literal user_confirmed true and that exact current hash; readiness, billing, owner/admin role and caps are rechecked atomically.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Configuration receipt."},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Confirmation required, stale or not ready."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/buyer-outcomes":{"post":{"tags":["Buyer Agent"],"operationId":"recordBuyerOutcome","summary":"Append a member-attested pipeline outcome","description":"Requires write:own-site. REST assertions are member-attested and can never become CRM-verified; signed CRM ingestion is the only CRM evidence path.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["context_id","stage","occurred_at","idempotency_key"],"properties":{"context_id":{"type":"string","format":"uuid"},"stage":{"type":"string","enum":["lead","qualified","meeting_booked","meeting_held","opportunity_created","closed_won","closed_lost","disqualified"]},"occurred_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string"},"value_cents":{"type":"integer","minimum":0},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}}}}},"responses":{"200":{"description":"Append-only member-attested outcome receipt."},"400":{"description":"Invalid outcome; nothing changed."},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/company-intelligence":{"get":{"tags":["Workspace reads"],"operationId":"readCompanyIntelligence","summary":"Read Eli's source-linked understanding of the company","description":"Returns verified, reported, observed, missing, conflicting and stale facts separately. No model or paid provider call occurs. Personalized activation must remain off unless agentContext.useForPersonalization is true.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Tenant-pinned Company Intelligence document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyIntelligenceResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/distribution-plan":{"get":{"tags":["Workspace reads"],"operationId":"readDistributionPlan","summary":"Read the evidence-backed distribution control plane","description":"Compiles approved Company Intelligence and measured Growth OS opportunities into ranked plays with exact existing MCP, REST and dashboard routes. The read makes no model or paid-provider call and never expands execution authority.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Tenant-pinned distribution plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DistributionPlanResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/revenue-twin":{"get":{"tags":["Workspace reads"],"operationId":"readRevenueTwin","summary":"Read the shared human-and-agent Revenue Twin","description":"Returns the tenant-pinned, evidence-hashed business, demand, conversion, revenue and memory read model. Current public tag verification is included; configured state alone never produces a live claim.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Tenant-pinned Revenue Twin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevenueTwinResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/demand-radar":{"get":{"tags":["Workspace reads"],"operationId":"readDemandRadar","summary":"Read the measured demand-versus-conversion decision","description":"Returns one evidence-backed operating mode and next action. Missing website traffic remains unknown; first-party page views are never conflated with eligible experiment sessions.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Tenant-pinned Demand Radar.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemandRadarResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/decision-surfaces":{"get":{"tags":["Workspace reads"],"operationId":"readDecisionSurfaces","summary":"Preview the native decision surfaces","description":"Returns the exact approved headline, answer, proof and action available to the browser runtime for each intent. This read never activates treatment or expands execution authority.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Tenant-pinned decision surface catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionSurfaceCatalogResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/reddit-intelligence":{"get":{"tags":["Workspace reads"],"operationId":"readRedditIntelligence","summary":"Read Reddit threads returned in saved AI answers","description":"Returns exact provider-saved Reddit source aggregates, measured model coverage and explainable opportunity priority. It does not call Reddit, infer engagement or brand mentions, or post content. Any contribution remains human-final.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"},{"name":"model","in":"query","required":false,"schema":{"type":"string","enum":["all","chatgpt","perplexity","claude","gemini"],"default":"all"}},{"name":"range","in":"query","required":false,"schema":{"type":"integer","enum":[7,30,90],"default":30}}],"responses":{"200":{"description":"Tenant-pinned Reddit intelligence evidence.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceData"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/company-intelligence":{"post":{"tags":["Workspace reads"],"operationId":"updateCompanyIntelligence","summary":"Version owner-approved distribution context","description":"Owner/admin user tokens only. Uses optimistic concurrency and allowlisted facts. The update does not execute, publish or contact anyone; MCP callers should use run_workspace_operation for exact preview confirmation.","security":[{"eliUserToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyIntelligenceUpdateRequest"}}}},"responses":{"200":{"description":"A new workspace.profile memory version was stored.","content":{"application/json":{"schema":{"type":"object","required":["ok","version","changedFields"],"properties":{"ok":{"type":"boolean","enum":[true]},"version":{"type":"integer","minimum":1},"changedFields":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}}}},"400":{"description":"Invalid or unsupported fact patch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/{resource}":{"get":{"tags":["Workspace reads"],"operationId":"readWorkspaceResourceV2","summary":"Read an Eli workspace resource","description":"Uses an API key pinned to one workspace or a current user token resolved through RLS. Add ?id=<uuid> to onsite-changes, content-drafts or commits for one exact receipt or resource.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"name":"resource","in":"path","required":true,"schema":{"type":"string","enum":["overview","competitors","traffic","revenue","actions","prompts","monitoring-health","work-log","commits","onsite-changes","content-drafts","learning","growth","company-intelligence","distribution-plan","reddit-intelligence","capabilities"]}},{"$ref":"#/components/parameters/WorkspaceHeader"},{"name":"id","in":"query","required":false,"description":"Optional resource UUID; supported by onsite-changes, content-drafts and commits for detail.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Workspace-pinned resource data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceData"}}}},"400":{"description":"Invalid workspace or detail selector.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/crawler-events":{"get":{"tags":["Workspace reads"],"operationId":"readCrawlerAnalytics","summary":"Read privacy-safe customer-site AI crawler analytics","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Thirty-day crawler totals, sources and page aggregates."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"503":{"$ref":"#/components/responses/Unavailable"}}},"post":{"tags":["Own-site execution"],"operationId":"ingestCrawlerEvents","summary":"Ingest a batch of customer server or CDN request events","description":"Requires an Eli API key with write:own-site and a fresh verified domain. Eli classifies known AI crawlers before storage and discards IP addresses, query strings, referrers and full user agents.","security":[{"eliApiKey":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","minItems":1,"maxItems":5000,"items":{"type":"object","required":["timestamp","hostname","request_path","request_method","status_code","user_agent"],"properties":{"timestamp":{"type":"string","format":"date-time"},"hostname":{"type":"string"},"request_path":{"type":"string"},"request_method":{"type":"string","enum":["GET","HEAD"]},"status_code":{"type":"integer","minimum":100,"maximum":599},"user_agent":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"The accepted AI crawler events were aggregated. No raw personal data was stored."},"400":{"description":"Invalid batch."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"A fresh verified website domain is required."},"413":{"description":"The request, event count or aggregate count exceeds the bounded limit."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/onsite-changes/{id}":{"post":{"tags":["Own-site execution"],"operationId":"decideOnsiteChange","summary":"Approve, apply, revert or dismiss an on-site change","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"},{"$ref":"#/components/parameters/WorkspaceHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnsiteDecisionRequest"}}}},"responses":{"200":{"description":"The decision completed. The response is a machine-readable receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolReceipt"}}}},"400":{"description":"Invalid JSON body, action, resource ID or publication target. No write occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Literal confirmation or the exact current preview hash is missing/stale, or the resource lifecycle conflicts with the decision. No unverified write should be assumed.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ConfirmationRequired"},{"$ref":"#/components/schemas/Error"}]}}}},"422":{"description":"Stored content failed the mandatory safety or evidence gate. Nothing was published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/onsite-proposals":{"post":{"tags":["Own-site execution"],"operationId":"prepareHighestPriorityOnsiteProposal","summary":"Prepare the highest-priority existing-page proposal","description":"Selects a measured losing buyer question and matching verified owned page, or reuses unfinished work. It creates a reviewable proposal only and never approves or applies it.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"A proposal was prepared/reused, or no safe match was available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnsiteProposalResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/content-drafts/{id}":{"post":{"tags":["Own-site execution"],"operationId":"decideContentDraft","summary":"Approve, publish, revert, or dismiss a content draft","description":"Publication uses the connected CMS and its verified target. Revert moves only an exact Eli-created native WordPress post to trash, verifies that state, preserves the historical publication receipt and returns an immutable reversal receipt.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"},{"$ref":"#/components/parameters/WorkspaceHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentDecisionRequest"}}}},"responses":{"200":{"description":"The decision completed. The response is a machine-readable receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolReceipt"}}}},"400":{"description":"Invalid JSON body, action, resource ID or publication target. No write occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Literal confirmation or the exact current preview hash is missing/stale, or the resource lifecycle conflicts with the decision. No unverified write should be assumed.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ConfirmationRequired"},{"$ref":"#/components/schemas/Error"}]}}}},"422":{"description":"Stored content failed the mandatory safety or evidence gate. Nothing was published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/corrections/{id}":{"post":{"tags":["Own-site execution"],"operationId":"decideCorrection","summary":"Approve or dismiss a tenant-scoped correction","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"},{"$ref":"#/components/parameters/WorkspaceHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrectionDecisionRequest"}}}},"responses":{"200":{"description":"The decision completed. The response is a machine-readable receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolReceipt"}}}},"400":{"description":"Invalid JSON body, action, resource ID or publication target. No write occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Literal confirmation or the exact current preview hash is missing/stale, or the resource lifecycle conflicts with the decision. No unverified write should be assumed.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ConfirmationRequired"},{"$ref":"#/components/schemas/Error"}]}}}},"422":{"description":"Stored content failed the mandatory safety or evidence gate. Nothing was published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v2/layer/publish":{"post":{"tags":["Own-site execution"],"operationId":"publishAiLayer","summary":"Publish the reviewed AI-readable layer","description":"Publishes the current draft through the tenant-scoped RPC and requests discovery refresh. It does not enable autonomy or send to third parties.","security":[{"eliApiKey":[]},{"eliUserToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LayerDecisionRequest"}}}},"responses":{"200":{"description":"The decision completed. The response is a machine-readable receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolReceipt"}}}},"400":{"description":"Invalid JSON body, action, resource ID or publication target. No write occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Literal confirmation or the exact current preview hash is missing/stale, or the resource lifecycle conflicts with the decision. No unverified write should be assumed.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ConfirmationRequired"},{"$ref":"#/components/schemas/Error"}]}}}},"422":{"description":"Stored content failed the mandatory safety or evidence gate. Nothing was published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/v1/{resource}":{"get":{"tags":["Legacy"],"operationId":"readWorkspaceResourceV1","summary":"Read a legacy workspace resource","deprecated":true,"description":"Read-only compatibility endpoint for raw Eli user access tokens. New integrations should use REST v2 and scoped API keys.","security":[{"eliUserToken":[]}],"parameters":[{"name":"resource","in":"path","required":true,"schema":{"type":"string","enum":["overview","competitors","traffic","revenue"]}},{"$ref":"#/components/parameters/WorkspaceHeader"}],"responses":{"200":{"description":"Legacy workspace resource."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/llms.txt":{"get":{"tags":["Public"],"operationId":"getOwnLlmsTxt","summary":"Read Eli's published AI-readable summary","responses":{"200":{"description":"Plain-text llms.txt.","content":{"text/plain":{}}}}}},"/capabilities.json":{"get":{"tags":["Public"],"operationId":"getOwnCapabilities","summary":"Read Eli's published capabilities and public action URLs","responses":{"200":{"description":"Published capabilities.","content":{"application/json":{}}}}}},"/l/{slug}/llms.txt":{"get":{"tags":["Public"],"operationId":"getPublishedClientLlmsTxt","summary":"Read a customer's published AI-readable layer","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Published plain text.","content":{"text/plain":{}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/l/{slug}/capabilities.json":{"get":{"tags":["Public"],"operationId":"getPublishedClientCapabilities","summary":"Read a customer's published capabilities","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Published capabilities.","content":{"application/json":{}}},"404":{"$ref":"#/components/responses/NotFound"}}}}}}