{"openapi":"3.0.0","info":{"title":"Mentio API","version":"0.0.1","description":"Keyword and brand mention tracking across dev platforms."},"servers":[{"url":"https://api.mentio.dev"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key minted via POST /v1/api-keys (format mk_live_...)"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}},"parameters":{}},"paths":{"/v1/health":{"get":{"operationId":"getHealth","tags":["System"],"responses":{"200":{"description":"API is up","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/v1/keywords":{"post":{"operationId":"createKeyword","tags":["Keywords"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"term":{"type":"string","minLength":2,"maxLength":80},"kind":{"type":"string","enum":["brand","competitor","topic"],"default":"brand"}},"required":["term"]}}}},"responses":{"201":{"description":"The created keyword","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"term":{"type":"string"},"kind":{"type":"string","enum":["brand","competitor","topic"]},"muted":{"type":"boolean"},"createdAt":{"type":"number"}},"required":["id","term","kind","muted","createdAt"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Keyword limit reached for the current plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"A keyword with the same normalized term already exists for this org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listKeywords","tags":["Keywords"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"All keywords for the org","content":{"application/json":{"schema":{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"term":{"type":"string"},"kind":{"type":"string","enum":["brand","competitor","topic"]},"muted":{"type":"boolean"},"createdAt":{"type":"number"}},"required":["id","term","kind","muted","createdAt"]}}},"required":["keywords"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/keywords/{keywordId}":{"delete":{"operationId":"deleteKeyword","tags":["Keywords"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"kw_abc123"},"required":true,"name":"keywordId","in":"path"}],"responses":{"200":{"description":"Keyword and its matches deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Keyword not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"setKeywordMuted","tags":["Keywords"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"kw_abc123"},"required":true,"name":"keywordId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"muted":{"type":"boolean"}},"required":["muted"]}}}},"responses":{"200":{"description":"Mute state updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"muted":{"type":"boolean"}},"required":["id","muted"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Unmuting would exceed the keyword limit for the current plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Keyword not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/mentions":{"get":{"operationId":"searchMentions","tags":["Mentions"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"keywordId","in":"query"},{"schema":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]},"required":false,"name":"source","in":"query"},{"schema":{"type":"string","enum":["matched","classified","filtered","delivered","ignored","done"]},"required":false,"name":"state","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"required":false,"name":"minRelevance","in":"query"},{"schema":{"type":"string","enum":["positive","neutral","negative"]},"required":false,"name":"sentiment","in":"query"},{"schema":{"type":"string"},"required":false,"name":"intent","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"integer","nullable":true},"required":false,"name":"since","in":"query"},{"schema":{"type":"integer","nullable":true},"required":false,"name":"until","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Mentions matching the filters, newest first, keyset-paginated","content":{"application/json":{"schema":{"type":"object","properties":{"mentions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]},"url":{"type":"string"},"author":{"type":"string","nullable":true},"authorUrl":{"type":"string","nullable":true},"text":{"type":"string"},"publishedAt":{"type":"number"},"keywordId":{"type":"string"},"keywordTerm":{"type":"string"},"state":{"type":"string","enum":["matched","classified","filtered","delivered","ignored","done"]},"relevance":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"sentiment":{"type":"string","nullable":true,"enum":["positive","neutral","negative"]},"intents":{"type":"array","items":{"type":"string"}},"aiNote":{"type":"string","nullable":true},"createdAt":{"type":"number"}},"required":["id","source","url","author","authorUrl","text","publishedAt","keywordId","keywordTerm","state","relevance","sentiment","intents","aiNote","createdAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["mentions","nextCursor"]}}}},"400":{"description":"Invalid query or pagination cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/mentions/{id}":{"get":{"operationId":"getMention","tags":["Mentions"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"mm_abc123"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The mention","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]},"url":{"type":"string"},"author":{"type":"string","nullable":true},"authorUrl":{"type":"string","nullable":true},"text":{"type":"string"},"publishedAt":{"type":"number"},"keywordId":{"type":"string"},"keywordTerm":{"type":"string"},"state":{"type":"string","enum":["matched","classified","filtered","delivered","ignored","done"]},"relevance":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"sentiment":{"type":"string","nullable":true,"enum":["positive","neutral","negative"]},"intents":{"type":"array","items":{"type":"string"}},"aiNote":{"type":"string","nullable":true},"createdAt":{"type":"number"}},"required":["id","source","url","author","authorUrl","text","publishedAt","keywordId","keywordTerm","state","relevance","sentiment","intents","aiNote","createdAt"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Mention not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/mentions/{id}/state":{"post":{"operationId":"setMentionState","tags":["Mentions"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"mm_abc123"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["ignored","done"]}},"required":["state"]}}}},"responses":{"200":{"description":"State updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["matched","classified","filtered","delivered","ignored","done"]}},"required":["id","state"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Mention not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/company":{"get":{"operationId":"getCompanyContext","tags":["Company"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Free-text company context fed to the classifier","content":{"application/json":{"schema":{"type":"object","properties":{"context":{"type":"string","maxLength":4000}},"required":["context"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"setCompanyContext","tags":["Company"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"context":{"type":"string","maxLength":4000}},"required":["context"]}}}},"responses":{"200":{"description":"The saved company context","content":{"application/json":{"schema":{"type":"object","properties":{"context":{"type":"string","maxLength":4000}},"required":["context"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/company/profile":{"get":{"operationId":"getCompanyProfile","tags":["Company"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Structured company profile (classifier context is composed from it)","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":2000},"useCases":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":10},"xAccount":{"type":"string","nullable":true,"maxLength":50},"linkedinAccount":{"type":"string","nullable":true,"maxLength":100}},"required":["name","description","useCases","xAccount","linkedinAccount"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Org not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"setCompanyProfile","tags":["Company"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":2000},"useCases":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":10},"xAccount":{"type":"string","nullable":true,"maxLength":50},"linkedinAccount":{"type":"string","nullable":true,"maxLength":100}},"required":["name","description","useCases","xAccount","linkedinAccount"]}}}},"responses":{"200":{"description":"The saved company profile","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":2000},"useCases":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":10},"xAccount":{"type":"string","nullable":true,"maxLength":50},"linkedinAccount":{"type":"string","nullable":true,"maxLength":100}},"required":["name","description","useCases","xAccount","linkedinAccount"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/api-keys":{"post":{"operationId":"createApiKey","tags":["API keys"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}}}}}},"responses":{"201":{"description":"The minted key. Shown once; only its hash is stored.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"prefix":{"type":"string"}},"required":["id","key","prefix"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listApiKeys","tags":["API keys"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"All API keys for the org (prefixes only, never full keys)","content":{"application/json":{"schema":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"type":"number"},"lastUsedAt":{"type":"number","nullable":true}},"required":["id","name","prefix","createdAt","lastUsedAt"]}}},"required":["apiKeys"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/api-keys/{apiKeyId}":{"delete":{"operationId":"revokeApiKey","tags":["API keys"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"key_abc123"},"required":true,"name":"apiKeyId","in":"path"}],"responses":{"200":{"description":"Key revoked and its verify cache evicted","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API key not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/me":{"get":{"operationId":"getMe","tags":["Auth"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The authenticated user and their workspaces","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"number"}},"required":["id","email","name","createdAt"]},"orgs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]},"website":{"type":"string","nullable":true},"brandName":{"type":"string","nullable":true},"logoUrl":{"type":"string","nullable":true},"onboarded":{"type":"boolean"}},"required":["id","name","role","website","brandName","logoUrl","onboarded"]}},"activeOrgId":{"type":"string"}},"required":["user","orgs","activeOrgId"]}}}},"401":{"description":"Session required (API keys carry no user identity)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/onboarding/analyze":{"post":{"operationId":"analyzeWebsite","tags":["Onboarding"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"website":{"type":"string","format":"uri"}},"required":["website"]}}}},"responses":{"200":{"description":"Suggested brand profile and starter keywords (nothing is persisted yet)","content":{"application/json":{"schema":{"type":"object","properties":{"brandName":{"type":"string","minLength":1,"maxLength":80},"context":{"type":"string","maxLength":4000},"topics":{"type":"array","items":{"type":"string","minLength":2,"maxLength":80},"minItems":1,"maxItems":2},"competitors":{"type":"array","items":{"type":"string","minLength":2,"maxLength":80},"minItems":1,"maxItems":2},"website":{"type":"string"},"logoUrl":{"type":"string","nullable":true}},"required":["brandName","context","topics","competitors","website","logoUrl"]}}}},"400":{"description":"URL invalid, not publicly reachable, or no readable content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Analysis failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/onboarding/complete":{"post":{"operationId":"completeOnboarding","tags":["Onboarding"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"website":{"type":"string","format":"uri"},"brandName":{"type":"string","minLength":1,"maxLength":80},"logoUrl":{"type":"string","nullable":true,"format":"uri"},"context":{"type":"string","maxLength":4000,"default":""},"keywords":{"type":"array","items":{"type":"object","properties":{"term":{"type":"string","minLength":2,"maxLength":80},"kind":{"type":"string","enum":["brand","competitor","topic"],"default":"brand"}},"required":["term"]},"maxItems":10,"default":[]}},"required":["website","brandName"]}}}},"responses":{"200":{"description":"Brand profile saved and starter keywords created","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"keywordsCreated":{"type":"integer","minimum":0}},"required":["ok","keywordsCreated"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/stats":{"get":{"operationId":"getMentionStats","tags":["Mentions"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90,"default":14},"required":false,"name":"sinceDays","in":"query"},{"schema":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]},"required":false,"name":"source","in":"query"},{"schema":{"type":"string"},"required":false,"name":"keywordId","in":"query"}],"responses":{"200":{"description":"Mention aggregates for the window: daily series, sentiment, sources, keywords","content":{"application/json":{"schema":{"type":"object","properties":{"sinceDays":{"type":"integer"},"total":{"type":"integer","minimum":0},"bySentiment":{"type":"object","properties":{"positive":{"type":"integer","minimum":0},"neutral":{"type":"integer","minimum":0},"negative":{"type":"integer","minimum":0},"unclassified":{"type":"integer","minimum":0}},"required":["positive","neutral","negative","unclassified"]},"bySource":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]},"count":{"type":"integer","minimum":0}},"required":["source","count"]}},"byKeyword":{"type":"array","items":{"type":"object","properties":{"keywordId":{"type":"string"},"term":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["keywordId","term","count"]}},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"positive":{"type":"integer","minimum":0},"neutral":{"type":"integer","minimum":0},"negative":{"type":"integer","minimum":0},"unclassified":{"type":"integer","minimum":0}},"required":["day","positive","neutral","negative","unclassified"]}}},"required":["sinceDays","total","bySentiment","bySource","byKeyword","daily"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/billing/checkout":{"post":{"operationId":"createBillingCheckout","tags":["Billing"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"successUrl":{"type":"string","maxLength":2000,"format":"uri"}},"required":["successUrl"]}}}},"responses":{"200":{"description":"Hosted checkout URL for the subscription","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"400":{"description":"Invalid or disallowed successUrl","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Billing is not configured on this deployment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/billing/portal":{"post":{"operationId":"createBillingPortalSession","tags":["Billing"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Customer portal URL (manage subscription, view usage)","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No billing account yet; start a checkout first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Billing is not configured on this deployment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/billing/usage":{"get":{"operationId":"getBillingUsage","tags":["Billing"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current-cycle usage and plan status","content":{"application/json":{"schema":{"type":"object","properties":{"cycle":{"type":"string"},"status":{"type":"string","enum":["none","active","past_due","canceled"]},"activeKeywords":{"type":"integer","minimum":0},"keywordMax":{"type":"integer","minimum":0},"matchedMentions":{"type":"integer","minimum":0},"includedMentions":{"type":"integer","minimum":0},"overageMentions":{"type":"integer","minimum":0},"billableMentions":{"type":"integer","minimum":0},"billedMentions":{"type":"integer","minimum":0},"trial":{"type":"object","nullable":true,"properties":{"endsAt":{"type":"integer"},"mentionsUsed":{"type":"integer","minimum":0},"mentionsLimit":{"type":"integer","minimum":0},"expired":{"type":"boolean"}},"required":["endsAt","mentionsUsed","mentionsLimit","expired"]}},"required":["cycle","status","activeKeywords","keywordMax","matchedMentions","includedMentions","overageMentions","billableMentions","billedMentions","trial"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/slack/install":{"post":{"operationId":"startSlackInstall","tags":["Slack"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Slack authorize URL to navigate the user to","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Slack integration is not configured on this deployment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/slack/status":{"get":{"operationId":"getSlackStatus","tags":["Slack"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Connection state, workspace name, and notification config","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"connected":{"type":"boolean"},"teamName":{"type":"string","nullable":true},"notifications":{"type":"object","nullable":true,"properties":{"channelId":{"type":"string"},"channelName":{"type":"string"},"minRelevance":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"sources":{"type":"array","nullable":true,"items":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]}}},"required":["channelId","channelName","minRelevance","sources"]}},"required":["configured","connected","teamName","notifications"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/slack/channels":{"get":{"operationId":"listSlackChannels","tags":["Slack"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Public channels in the connected workspace, name-sorted","content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["channels"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No Slack workspace connected (or the token was revoked)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Slack API failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/slack/notifications":{"put":{"operationId":"setSlackNotifications","tags":["Slack"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channelId":{"type":"string","minLength":1,"maxLength":40},"channelName":{"type":"string","minLength":1,"maxLength":90},"minRelevance":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"sources":{"type":"array","items":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]},"maxItems":9}},"required":["channelId","channelName"]}}}},"responses":{"200":{"description":"Updated status after pointing notifications at the channel","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"connected":{"type":"boolean"},"teamName":{"type":"string","nullable":true},"notifications":{"type":"object","nullable":true,"properties":{"channelId":{"type":"string"},"channelName":{"type":"string"},"minRelevance":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"sources":{"type":"array","nullable":true,"items":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]}}},"required":["channelId","channelName","minRelevance","sources"]}},"required":["configured","connected","teamName","notifications"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No Slack workspace connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteSlackNotifications","tags":["Slack"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Notifications disabled; the workspace stays connected","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"connected":{"type":"boolean"},"teamName":{"type":"string","nullable":true},"notifications":{"type":"object","nullable":true,"properties":{"channelId":{"type":"string"},"channelName":{"type":"string"},"minRelevance":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"sources":{"type":"array","nullable":true,"items":{"type":"string","enum":["bluesky","hackernews","github","stackoverflow","devto","reddit","x","youtube","news"]}}},"required":["channelId","channelName","minRelevance","sources"]}},"required":["configured","connected","teamName","notifications"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/slack":{"delete":{"operationId":"disconnectSlack","tags":["Slack"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Install removed and token revoked best-effort","content":{"application/json":{"schema":{"type":"object","properties":{"disconnected":{"type":"boolean"}},"required":["disconnected"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/sources/x/token":{"get":{"operationId":"getXSourceToken","tags":["Sources"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Whether this org has a custom X bearer token configured","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"}},"required":["configured"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"setXSourceToken","tags":["Sources"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":500}},"required":["token"]}}}},"responses":{"200":{"description":"Token stored; X polling for this org's terms uses it from the next poll","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"}},"required":["configured"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteXSourceToken","tags":["Sources"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Token removed","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"}},"required":["configured"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/enterprise/inquiries":{"post":{"operationId":"createEnterpriseInquiry","tags":["Enterprise"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"company":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":200,"format":"email"},"keywordsEstimate":{"type":"string","maxLength":120},"message":{"type":"string","maxLength":2000},"website":{"type":"string","maxLength":200}},"required":["company","name","email"]}}}},"responses":{"200":{"description":"Inquiry received","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Invalid inquiry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}