{"openapi":"3.0.3","info":{"title":"HIVE Government Intelligence API","version":"3.0.0","description":"Invitation-only read-only intelligence. Public discovery; restricted data. Billing disabled."},"servers":[{"url":"https://hive.jtimphony.workers.dev"}],"paths":{"/v1/capabilities/match":{"get":{"summary":"Find a matching HIVE capability by task keywords","parameters":[{"name":"task","in":"query","required":true,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Capability match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"Invalid task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"v1_capabilities_match"}},"/health":{"get":{"summary":"Basic service health","responses":{"200":{"description":"Service is running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}}},"operationId":"health"}},"/v1/pilot/usage":{"get":{"summary":"Read current pilot daily usage (pilot API key required; no quota consumed)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Daily usage balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Pilot access unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"v1_pilot_usage"}},"/v1/grants/match":{"get":{"summary":"Rank relevant opportunities in limited Grants.gov cache using an explainable text heuristic; NOT an eligibility or award probability assessment","security":[{"bearerAuth":[]}],"parameters":[{"name":"focus","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":120}},{"name":"organization_type","in":"query","schema":{"type":"string","enum":["nonprofit","university","school","local_government","business","individual","other"],"default":"other"}},{"name":"state","in":"query","schema":{"type":"string","maxLength":2}},{"name":"status","in":"query","schema":{"type":"string","enum":["posted","forecasted","both"],"default":"both"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":10,"default":5}},{"name":"organization_subtype","in":"query","schema":{"type":"string","enum":["nonprofit_501c3","nonprofit_other","public_university","private_university","school_district","city_government","county_government","small_business","for_profit_other","individual"]},"description":"Self-reported precise applicant category; never independently verified"},{"name":"has_cost_share","in":"query","schema":{"type":"string","enum":["yes","no","unknown"]}}],"responses":{"200":{"description":"Scored text relevance with evidence, explicit unknown eligibility and sampled coverage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantMatches"}}}},"400":{"description":"Invalid filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Pilot quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Cache stale or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"v1_grants_match"}},"/v1/grants/search":{"get":{"summary":"Search official Grants.gov opportunities via bounded cache or live fallback; results disclose cache age and coverage","security":[{"bearerAuth":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100}},{"name":"agency","in":"query","schema":{"type":"string","maxLength":30}},{"name":"status","in":"query","schema":{"type":"string","enum":["posted","forecasted","both"],"default":"posted"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":20,"default":10}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":100,"default":0}}],"responses":{"200":{"description":"Live Grants.gov opportunities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantsSearch"}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Grants.gov unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"v1_grants_search"}},"/v1/grants/opportunity":{"get":{"summary":"Get official Grants.gov details for a numeric opportunity ID, restricted","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Grants.gov opportunity detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantDetail"}}}},"400":{"description":"Invalid ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Grants.gov unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"v1_grants_opportunity"}},"/v1/documents":{"get":{"summary":"Search cached Federal Register grant-related documents (restricted, sampled)","security":[{"bearerAuth":[]}],"parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":100}},{"name":"agency","in":"query","schema":{"type":"string","maxLength":100}},{"name":"type","in":"query","schema":{"type":"string","maxLength":60}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25,"default":20}}],"responses":{"200":{"description":"Cached documents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Documents"}}}},"400":{"description":"Invalid filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Metadata store not ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"v1_documents"}},"/v1/signals":{"get":{"summary":"Search stored government signal events by type, record ID and observation date (restricted)","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"kind","in":"query","schema":{"type":"string","enum":["new","changed"]}},{"name":"record_id","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Filtered stored signal events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Events"}}}},"400":{"description":"Invalid filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"v1_signals"}},"/v1/events":{"get":{"summary":"Read stored signal events (restricted)","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Stored events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Events"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"v1_events"}},"/v3/sources":{"get":{"operationId":"source_registry","summary":"Source authority, coverage and reliability scoring method","security":[],"responses":{"200":{"description":"Sources and explicit heuristic","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sources"}}}}}}},"/api/public/demo":{"get":{"operationId":"public_demo","summary":"Bounded, fixed-use-case cached demonstration; shared daily allowance","security":[],"parameters":[{"name":"example","in":"query","required":true,"schema":{"type":"string","enum":["college","nonprofit","business","agent"]}}],"responses":{"200":{"description":"Up to three source-linked cached summaries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicDemo"}}}},"400":{"description":"Invalid example","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Shared daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Demo disabled, stale or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/pilot-requests":{"post":{"operationId":"request_pilot_review","summary":"Consented manual review request; never creates an account or key","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PilotRequestInput"}}}},"responses":{"202":{"description":"Received for manual review","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Accepted"}}}},"400":{"description":"Invalid bounded request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Same-origin required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Daily allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Requests disabled or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public/events":{"post":{"operationId":"opt_in_event","summary":"Optional consented aggregate event; no identifying fields accepted","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["event","variant","consent"],"properties":{"event":{"type":"string","enum":["exposure","demo_started","demo_completed","pilot_form_opened"]},"variant":{"type":"string","enum":["a","b"]},"consent":{"type":"boolean","enum":[true]}}}}}},"responses":{"202":{"description":"Aggregate accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Accepted"}}}},"400":{"description":"Invalid event or consent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Same-origin required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Daily cap reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Events disabled or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":true},"Opportunity":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]{0,11}$"},"title":{"type":"string"},"source_url":{"type":"string","format":"uri"},"status":{"type":"string"}},"required":["id","source_url"],"additionalProperties":true},"GrantsSearch":{"type":"object","properties":{"source":{"type":"string"},"retrieved_at":{"type":"string","format":"date-time"},"opportunities":{"type":"array","items":{"$ref":"#/components/schemas/Opportunity"}},"limitations":{"type":"string"}},"required":["source","retrieved_at","opportunities"],"additionalProperties":true},"RequirementCriterion":{"type":"object","properties":{"criterion":{"type":"string"},"status":{"type":"string","enum":["supported_by_source","contradicted_by_source","unknown"]}},"required":["criterion","status"],"additionalProperties":true},"EligibilityAssessment":{"type":"object","properties":{"engine":{"type":"string"},"screening_result":{"type":"string","enum":["explicit_conflict","needs_official_review"]},"criteria":{"type":"array","items":{"$ref":"#/components/schemas/RequirementCriterion"}},"eligibility":{"type":"string","enum":["unknown_requires_official_verification"]}},"required":["engine","screening_result","criteria","eligibility"],"additionalProperties":true},"GrantMatch":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number","minimum":0,"maximum":100},"score_type":{"type":"string","enum":["text_relevance_only"]},"eligibility_assessment":{"$ref":"#/components/schemas/EligibilityAssessment"},"provenance":{"type":"object"}},"required":["id","score","eligibility_assessment","provenance"],"additionalProperties":true},"GrantMatches":{"type":"object","properties":{"source":{"type":"string"},"algorithm":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GrantMatch"}},"billing":{"type":"string","enum":["disabled"]}},"required":["source","results","billing"],"additionalProperties":true},"Sources":{"type":"object","properties":{"schema_version":{"type":"string"},"sources":{"type":"array","items":{"type":"object"}},"scoring_notice":{"type":"string"}},"required":["schema_version","sources","scoring_notice"],"additionalProperties":true},"Events":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object"}}},"required":["events"],"additionalProperties":true},"PublicDemo":{"type":"object","properties":{"schema_version":{"type":"string"},"example":{"type":"string","enum":["college","nonprofit","business","agent"]},"mode":{"type":"string","enum":["bounded_public_cached_demo"]},"results":{"type":"array","maxItems":3,"items":{"$ref":"#/components/schemas/Opportunity"}},"snapshot_at":{"type":"string","format":"date-time"},"coverage":{"type":"string"},"limitation":{"type":"string"},"billing":{"type":"string","enum":["disabled"]}},"required":["schema_version","example","mode","results","snapshot_at","billing"],"additionalProperties":true},"PilotRequestInput":{"type":"object","additionalProperties":false,"required":["email","organization","use_case","consent"],"properties":{"email":{"type":"string","format":"email","maxLength":254},"organization":{"type":"string","minLength":2,"maxLength":100},"use_case":{"type":"string","enum":["grant_research","education","business","developer"]},"consent":{"type":"boolean","enum":[true]},"website":{"type":"string","maxLength":0}}},"Accepted":{"type":"object","properties":{"accepted":{"type":"boolean"},"status":{"type":"string"},"billing":{"type":"string","enum":["disabled"]}},"required":["accepted"],"additionalProperties":true},"Documents":{"type":"object","properties":{"source":{"type":"string"},"coverage":{"type":"string"},"documents":{"type":"array","maxItems":25,"items":{"type":"object","properties":{"record_id":{"type":"string"},"title":{"type":"string"},"last_seen":{"type":"string"}},"required":["record_id","title","last_seen"],"additionalProperties":true}}},"required":["source","coverage","documents"],"additionalProperties":true},"GrantDetail":{"type":"object","properties":{"source":{"type":"string"},"retrieved_at":{"type":"string","format":"date-time"},"opportunity":{"type":"object","properties":{"id":{"type":"string"},"source_url":{"type":"string","format":"uri"},"eligible_applicant_types":{"type":"array","items":{"type":"string"}}},"required":["id","source_url"],"additionalProperties":true}},"required":["source","retrieved_at","opportunity"],"additionalProperties":true},"Object":{"type":"object","additionalProperties":true}}},"x-hive-v4-openapi":"https://hive.jtimphony.workers.dev/v4/openapi.json"}