{"openapi":"3.1.0","info":{"title":"HDX Humanitarian API (BYOK) API","version":"0.1.0","description":"HDX Humanitarian API (BYOK) lets an AI assistant read your own HDX Humanitarian API data through the HDX Humanitarian API API with a key you supply (HDX HAPI app identifier). Read-only: 6 tools (get_operational_presence, get_operational_presence_by_sector, get_population, get_population_by_age_and_gender, list_sectors, get_resource_metadata). The BYOK key travels with each request, is used for...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-hdx-hapi.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-hdx-hapi/docs"},"termsOfService":"https://connectorbay.com/byok-hdx-hapi/terms"},"servers":[{"url":"https://byok-hdx-hapi.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-hdx-hapi/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/get_operational_presence":{"post":{"operationId":"get_operational_presence","summary":"List which humanitarian organizations work in which sectors and administrative areas (the 3W operational presence data) ","description":"List which humanitarian organizations work in which sectors and administrative areas (the 3W operational presence data) for a country. Use for \"Which humanitarian organizations operate in Mali\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"location_code":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"ISO 3166 alpha-3 country code, for example 'MLI' or 'AFG'.","title":"Location Code"},"admin1_name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Filter on first-level administrative area name, for example 'Gao'.","title":"Admin1 Name"},"admin2_code":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Filter on second-level administrative area p-code, for example 'ML0702'.","title":"Admin2 Code"},"output_format":{"anyOf":[{"const":"json","type":"string"},{"type":"null"}],"default":"json","description":"Answer format; only json is useful here.","title":"Output Format"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many rows to return (1 to 1000).","title":"Limit"},"offset":{"anyOf":[{"maximum":10000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Rows to skip before the first returned row, for paging.","title":"Offset"}},"title":"get_operational_presenceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_operational_presence_by_sector":{"post":{"operationId":"get_operational_presence_by_sector","summary":"List operational presence rows of one humanitarian sector (for example Nutrition or Water Sanitation Hygiene) in a count","description":"List operational presence rows of one humanitarian sector (for example Nutrition or Water Sanitation Hygiene) in a country, optionally for one organization. Use for \"Which organizations do water and sanitation work in Yobe, Nigeria\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"sector_name":{"description":"Sector name, for example 'Nutrition' or 'Water Sanitation Hygiene' (see list_sectors).","maxLength":100,"title":"Sector Name","type":"string"},"location_name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Country name, for example 'Nigeria'.","title":"Location Name"},"admin1_name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Filter on first-level administrative area name, for example 'Yobe'.","title":"Admin1 Name"},"org_name":{"anyOf":[{"maxLength":150,"type":"string"},{"type":"null"}],"default":null,"description":"Filter on organization name.","title":"Org Name"},"output_format":{"anyOf":[{"const":"json","type":"string"},{"type":"null"}],"default":"json","description":"Answer format; only json is useful here.","title":"Output Format"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many rows to return (1 to 1000).","title":"Limit"},"offset":{"anyOf":[{"maximum":10000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Rows to skip before the first returned row, for paging.","title":"Offset"}},"required":["sector_name"],"title":"get_operational_presence_by_sectorArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_population":{"post":{"operationId":"get_population","summary":"Get baseline population figures for a country by subnational area, with gender and age-range breakdowns. Set admin_level","description":"Get baseline population figures for a country by subnational area, with gender and age-range breakdowns. Set admin_level to choose national (0), first (1) or second (2) level. Use for \"What is the population of Afghanistan by province\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"location_code":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"ISO 3166 alpha-3 country code, for example 'MLI' or 'AFG'.","title":"Location Code"},"admin_level":{"anyOf":[{"maximum":2,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Administrative level: 0 national, 1 first level, 2 second level.","title":"Admin Level"},"output_format":{"anyOf":[{"const":"json","type":"string"},{"type":"null"}],"default":"json","description":"Answer format; only json is useful here.","title":"Output Format"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many rows to return (1 to 1000).","title":"Limit"},"offset":{"anyOf":[{"maximum":10000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Rows to skip before the first returned row, for paging.","title":"Offset"}},"title":"get_populationArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_population_by_age_and_gender":{"post":{"operationId":"get_population_by_age_and_gender","summary":"Get baseline population for one age range and gender in a country, for example males aged 0-4 at province level. Use for","description":"Get baseline population for one age range and gender in a country, for example males aged 0-4 at province level. Use for \"How many boys under five live in each Afghan province\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"location_code":{"description":"ISO 3166 alpha-3 country code, for example 'AFG'.","maxLength":10,"title":"Location Code","type":"string"},"age_range_code":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Age range, for example '0-4' or '65+'.","title":"Age Range Code"},"gender_code":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Gender code, for example 'm' or 'f'.","title":"Gender Code"},"admin_level":{"anyOf":[{"maximum":2,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Administrative level: 0 national, 1 first level, 2 second level.","title":"Admin Level"},"output_format":{"anyOf":[{"const":"json","type":"string"},{"type":"null"}],"default":"json","description":"Answer format; only json is useful here.","title":"Output Format"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many rows to return (1 to 1000).","title":"Limit"},"offset":{"anyOf":[{"maximum":10000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Rows to skip before the first returned row, for paging.","title":"Offset"}},"required":["location_code"],"title":"get_population_by_age_and_genderArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_sectors":{"post":{"operationId":"list_sectors","summary":"List the humanitarian sectors (code and name) used by the operational presence data, to use as sector filters. Use for \"","description":"List the humanitarian sectors (code and name) used by the operational presence data, to use as sector filters. Use for \"Which humanitarian sectors does HAPI know\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"output_format":{"anyOf":[{"const":"json","type":"string"},{"type":"null"}],"default":"json","description":"Answer format; only json is useful here.","title":"Output Format"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many rows to return (1 to 1000).","title":"Limit"},"offset":{"anyOf":[{"maximum":10000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Rows to skip before the first returned row, for paging.","title":"Offset"}},"title":"list_sectorsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_resource_metadata":{"post":{"operationId":"get_resource_metadata","summary":"Get the source resource record behind HAPI rows: file name, format, update date, download link and the HDX dataset and p","description":"Get the source resource record behind HAPI rows: file name, format, update date, download link and the HDX dataset and provider it comes from. Use for \"Where does HAPI resource b28928be-1847-408f-b3cd-9b87b596c710 come from\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"resource_hdx_id":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Resource UUID, taken from the resource_hdx_id of another HAPI row.","title":"Resource Hdx Id"},"update_date_min":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Only resources updated on or after this date, YYYY-MM-DD.","title":"Update Date Min"},"update_date_max":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Only resources updated on or before this date, YYYY-MM-DD.","title":"Update Date Max"},"output_format":{"anyOf":[{"const":"json","type":"string"},{"type":"null"}],"default":"json","description":"Answer format; only json is useful here.","title":"Output Format"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many rows to return (1 to 1000).","title":"Limit"},"offset":{"anyOf":[{"maximum":10000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Rows to skip before the first returned row, for paging.","title":"Offset"}},"title":"get_resource_metadataArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}