{"openapi":"3.1.0","info":{"title":"AfriSecMaster / AfriTreasury Fixed Income Security Master API","version":"1.2.0","summary":"Canonical Fixed Income Security Master covering 55 sovereign markets (all 54 African countries + U.S. Treasuries).","description":"API-first Fixed Income Security Master covering 55 sovereign markets (54 African sovereigns + U.S. Treasuries) across Treasury Bills, Fixed Coupon Bonds, Sovereign Eurobonds, FRNs, Inflation-Linked Bonds, Sukuk, and Zero-Coupon Notes.\n\n### Authentication\nPass a registered API key on all protected `/api/v1/*` routes via any of:\n- `X-API-Key: ak_free_...` (recommended)\n- `Authorization: Bearer ak_free_...`\n- `?api_key=ak_free_...` (query parameter fallback)\n\n### Free Sandbox Access\nCall `POST https://afrisecmaster.io/api/v1/auth/request-access` with `requestedPlan: \"FREE\"` (or register in the web portal at `https://afrisecmaster.io`). When automatic sandbox provisioning is enabled, an active `ak_free_...` API key is returned immediately in `rawApiKey`.\n\n### Rate Limits & Quotas (UTC Daily Reset)\n- **FREE (Free Developer Sandbox)**: $0/mo · 30 req/min · 1,000 req/day · 1 active key · Scopes: `markets:read, securities:read, isin_lookup:read`\n- **PRO (Pro Desk & Fintech)**: $199/mo · 300 req/min · 50,000 req/day · 5 active keys · Scopes: `markets:read, securities:read, isin_lookup:read, eurobonds:read, export:bulk`\n- **INSTITUTIONAL (Institutional Treasury)**: $950/mo · 2000 req/min · 1,000,000 req/day · 25 active keys · Scopes: `markets:read, securities:read, isin_lookup:read, eurobonds:read, export:bulk, securities:write, ingestion:trigger, webhooks:alerts`\n\nAuthenticated responses include `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-Plan-Tier` headers (`Retry-After` on HTTP `429`)."},"externalDocs":{"description":"Human-readable API Documentation & Sandbox Guide","url":"https://afrisecmaster.io/docs"},"servers":[{"url":"https://afrisecmaster.io/api/v1","description":"Active Environment Security Master v1 API"},{"url":"https://api.afrisecmaster.io/api/v1","description":"AfriSecMaster Dedicated API Domain"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Registered developer or institutional API key (prefix ak_free_... or ak_live_...)."},"BearerAuth":{"type":"http","scheme":"bearer","description":"Accepts either an API key (Bearer ak_...) or signed console session token (Bearer sess_...)."}},"schemas":{"SecurityStatus":{"type":"string","enum":["DRAFT","PENDING_APPROVAL","ACTIVE","REJECTED","MATURED"]},"InstrumentType":{"type":"string","enum":["T_BILL","FIXED_BOND","FRN","INFLATION_LINKED","SUKUK","ZERO_COUPON"]},"DayCountConvention":{"type":"string","enum":["ACT/ACT_ICMA","ACT/365","ACT/360","30/360","ACT/ACT_ISDA"]},"CouponFrequency":{"type":"string","enum":["ZERO","ANNUAL","SEMI_ANNUAL","QUARTERLY"]},"MarketConvention":{"type":"object","required":["iso2","iso3","countryName","region","currency","defaultDayCount","defaultFrequency"],"properties":{"iso2":{"type":"string","example":"KE"},"iso3":{"type":"string","example":"KEN"},"countryName":{"type":"string","example":"Kenya"},"region":{"type":"string","example":"East Africa"},"monetaryBloc":{"type":"string","example":"EAC"},"currency":{"type":"string","example":"KES"},"isinPrefix":{"type":"string","example":"KE"},"centralBank":{"type":"string","example":"Central Bank of Kenya"},"csdDepository":{"type":"string","example":"CBK DhowCSD / CDSC"},"defaultDayCount":{"$ref":"#/components/schemas/DayCountConvention"},"billDayCount":{"$ref":"#/components/schemas/DayCountConvention"},"defaultFrequency":{"$ref":"#/components/schemas/CouponFrequency"},"settlementCycleDays":{"type":"integer","example":2},"exDividendDays":{"type":"integer","example":30},"withholdingTaxPct":{"type":"number","example":15},"auctionMechanism":{"type":"string","enum":["Multiple Price","Uniform Price","Tap / Syndication"]},"businessCalendar":{"type":"string","example":"KE_NAIROBI"},"bloombergCurveCode":{"type":"string","example":"BVSK"}}},"SecurityTranche":{"type":"object","required":["id","securityId","trancheNumber","trancheType","auctionDate","issuedAmount"],"properties":{"id":{"type":"string","format":"uuid"},"securityId":{"type":"string","format":"uuid"},"trancheNumber":{"type":"integer","example":1},"trancheType":{"type":"string","enum":["ORIGINAL","TAP","REOPENING"]},"auctionDate":{"type":"string","format":"date","example":"2026-11-16"},"settlementDate":{"type":"string","format":"date","example":"2026-11-16"},"issuedAmount":{"type":"number","example":7500000000},"awardedYieldPct":{"type":["number","null"],"example":7.45},"stopOutPrice":{"type":["number","null"],"example":96.412},"bidToCover":{"type":["number","null"],"example":1.85},"sourceFeed":{"type":"string","example":"CBK_DHOWCSD"},"externalRef":{"type":"string","example":"CBK-TBILL-2653-182D-2026-11-16"},"createdAt":{"type":"string","format":"date-time"}}},"MakerCheckerAuditEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"securityId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["CREATED","SUBMITTED","APPROVED","REJECTED","TAP_MERGED","UPDATED"]},"actorId":{"type":"string"},"actorRole":{"type":"string","enum":["MAKER","CHECKER","INGESTION_ENGINE"]},"fromStatus":{"oneOf":[{"$ref":"#/components/schemas/SecurityStatus"},{"type":"null"}]},"toStatus":{"$ref":"#/components/schemas/SecurityStatus"},"comment":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}},"SecurityMasterRecord":{"type":"object","required":["id","isin","ticker","issuerName","marketCode","instrumentType","currency","issueDate","maturityDate","couponRatePct","dayCount","couponFrequency","authorizedAmount","outstandingAmount","status"],"properties":{"id":{"type":"string","format":"uuid"},"isin":{"type":"string","minLength":12,"maxLength":12,"example":"KE9910008433"},"cusip":{"type":["string","null"],"example":"912828ZT0"},"localCode":{"type":["string","null"],"example":"TB-2653-182D"},"ticker":{"type":"string","example":"KETB 182D 05/27"},"issuerName":{"type":"string","example":"Republic of Kenya — Central Bank of Kenya (DhowCSD)"},"marketCode":{"type":"string","minLength":2,"maxLength":2,"example":"KE"},"instrumentType":{"$ref":"#/components/schemas/InstrumentType"},"currency":{"type":"string","example":"KES"},"issueDate":{"type":"string","format":"date","example":"2026-11-16"},"datedDate":{"type":"string","format":"date","example":"2026-11-16"},"firstCouponDate":{"type":["string","null"],"format":"date"},"maturityDate":{"type":"string","format":"date","example":"2027-05-17"},"couponRatePct":{"type":"number","example":0},"spreadBps":{"type":["number","null"]},"benchmarkIndex":{"type":["string","null"]},"dayCount":{"$ref":"#/components/schemas/DayCountConvention"},"couponFrequency":{"$ref":"#/components/schemas/CouponFrequency"},"settlementDays":{"type":"integer","example":2},"minDenomination":{"type":"number","example":50000},"authorizedAmount":{"type":"number","example":7500000000},"outstandingAmount":{"type":"number","example":7500000000},"indicativeYieldPct":{"type":["number","null"],"example":7.45},"cleanPrice":{"type":["number","null"],"example":96.412},"status":{"$ref":"#/components/schemas/SecurityStatus"},"makerId":{"type":"string"},"checkerId":{"type":["string","null"]},"rejectionReason":{"type":["string","null"]},"sourceSystem":{"type":"string","enum":["MANUAL_UI","US_TREASURY_FISCAL_DATA","AFRICAN_CSD_FEED","PAN_AFRICAN_EUROBONDS","API_DIRECT"]},"hydratedFromMarket":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"tranches":{"type":"array","items":{"$ref":"#/components/schemas/SecurityTranche"}},"auditLog":{"type":"array","items":{"$ref":"#/components/schemas/MakerCheckerAuditEntry"}}}},"SecuritiesListResponse":{"type":"object","required":["count","securities"],"properties":{"count":{"type":"integer","example":163},"securities":{"type":"array","items":{"$ref":"#/components/schemas/SecurityMasterRecord"}}}},"SecurityDetailResponse":{"type":"object","required":["security","market"],"properties":{"security":{"$ref":"#/components/schemas/SecurityMasterRecord"},"market":{"oneOf":[{"$ref":"#/components/schemas/MarketConvention"},{"type":"null"}]}}},"MarketsListResponse":{"type":"object","required":["count","markets"],"properties":{"count":{"type":"integer","example":55},"markets":{"type":"array","items":{"$ref":"#/components/schemas/MarketConvention"}}}},"AccessRequestInput":{"type":"object","required":["email","fullName","organization","password"],"properties":{"email":{"type":"string","format":"email","example":"dev@institution.com"},"fullName":{"type":"string","example":"Jane Doe"},"organization":{"type":"string","example":"Pan-African Treasury Desk"},"password":{"type":"string","minLength":8,"example":"StrongPass2026!"},"useCase":{"type":"string","example":"OMS sovereign bond & T-Bill reference sync"},"requestedPlan":{"type":"string","enum":["FREE","PRO","INSTITUTIONAL"],"default":"FREE"}}},"AccessRequestResponse":{"type":"object","properties":{"status":{"type":"string","enum":["APPROVED","PENDING_APPROVAL"]},"message":{"type":"string"},"sessionToken":{"type":"string"},"rawApiKey":{"type":"string","description":"Returned immediately once when auto-approved on FREE tier"}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"requestAccessEndpoint":{"type":"string"}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"paths":{"/health":{"get":{"summary":"Production liveness, total securities, market coverage & storage probe (unauthenticated)","tags":["Operations"],"security":[],"responses":{"200":{"description":"Service healthy with live counts across 55 markets"}}}},"/public/stats":{"get":{"summary":"Public coverage counts, region totals, plan tiers, and sandbox auto-approval status (unauthenticated)","tags":["Operations"],"security":[],"responses":{"200":{"description":"Coverage metrics and plan catalog"}}}},"/auth/request-access":{"post":{"summary":"Register and request Free Sandbox (instant key) or commercial API access (unauthenticated)","tags":["Auth & Sandbox"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequestInput"}}}},"responses":{"201":{"description":"Access request registered (returns rawApiKey immediately when FREE auto-approval is active)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequestResponse"}}}},"409":{"description":"Email already registered"},"422":{"description":"Validation error"}}}},"/auth/login":{"post":{"summary":"Sign in with registered credentials to retrieve session token & key metadata (unauthenticated)","tags":["Auth & Sandbox"],"security":[],"responses":{"200":{"description":"Authenticated session payload"},"401":{"description":"Invalid credentials"}}}},"/account/keys":{"post":{"summary":"Mint a new API key (respects plan key ceiling)","tags":["Auth & Sandbox"],"responses":{"201":{"description":"API key minted (plaintext returned once)"}}}},"/markets":{"get":{"summary":"List 55 sovereign market conventions (54 African countries + U.S. Treasury)","tags":["Markets"],"parameters":[{"name":"region","in":"query","description":"Filter by region (e.g. East Africa, West Africa (UEMOA), Southern Africa, U.S. Treasury)","schema":{"type":"string"}},{"name":"q","in":"query","description":"Search by country, ISO2/ISO3, currency, central bank, or CSD","schema":{"type":"string"}}],"responses":{"200":{"description":"Array of MarketConvention records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketsListResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Daily quota or per-minute rate limit exceeded"}}}},"/markets/{iso2}":{"get":{"summary":"Retrieve convention profile for a single sovereign market (e.g. KE, NG, CI, ZA, US)","tags":["Markets"],"parameters":[{"name":"iso2","in":"path","required":true,"schema":{"type":"string","example":"KE"}}],"responses":{"200":{"description":"MarketConvention object for convention auto-hydration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketConvention"}}}},"404":{"description":"Market not found"}}}},"/securities":{"get":{"summary":"Search & filter Fixed Income Security Master by country, region, ISIN, type, or status","tags":["Securities"],"parameters":[{"name":"marketCode","in":"query","description":"2-letter ISO market code (e.g. KE, NG, CI, ZA, US)","schema":{"type":"string"}},{"name":"country","in":"query","description":"Country name or ISO2/ISO3 (e.g. Kenya, KEN, KE)","schema":{"type":"string"}},{"name":"isin","in":"query","description":"Full or partial 12-character ISIN substring","schema":{"type":"string"}},{"name":"region","in":"query","description":"Sovereign region filter","schema":{"type":"string"}},{"name":"instrumentType","in":"query","schema":{"$ref":"#/components/schemas/InstrumentType"}},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/SecurityStatus"}},{"name":"q","in":"query","description":"Free-text search across ISIN, CUSIP, ticker, issuer, country, localCode","schema":{"type":"string"}}],"responses":{"200":{"description":"Filtered list of securities with tranches & audit trail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecuritiesListResponse"}}}},"401":{"description":"Missing or invalid API key"},"429":{"description":"Rate limit or daily quota exceeded"}}},"post":{"summary":"Create security (requires INSTITUTIONAL securities:write scope)","tags":["Securities"],"responses":{"201":{"description":"Created in DRAFT or PENDING_APPROVAL"},"403":{"description":"Plan upgrade required (securities:write)"},"409":{"description":"Duplicate ISIN"},"422":{"description":"Financial validation error (ISO 6166 ISIN, CUSIP, coupon/tenor)"}}}},"/securities/by-isin/{isin}":{"get":{"summary":"Direct golden-source lookup by 12-character ISO 6166 ISIN (requires isin_lookup:read)","tags":["Securities"],"parameters":[{"name":"isin","in":"path","required":true,"schema":{"type":"string","example":"KE9910008433"}}],"responses":{"200":{"description":"SecurityMasterRecord + MarketConvention","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityDetailResponse"}}}},"404":{"description":"ISIN not found"}}}},"/securities/{id}":{"get":{"summary":"Retrieve single security by internal UUID","tags":["Securities"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"SecurityMasterRecord + MarketConvention","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityDetailResponse"}}}},"404":{"description":"Security not found"}}}},"/securities/export":{"get":{"summary":"Bulk JSON export across 55 markets (requires PRO or INSTITUTIONAL export:bulk scope)","tags":["Securities"],"parameters":[{"name":"marketCode","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Bulk security export payload"},"403":{"description":"Plan upgrade required (PRO+)"}}}},"/securities/{id}/approve":{"post":{"summary":"Checker approval (enforces checkerId !== makerId & securities:write scope)","tags":["Maker-Checker"],"responses":{"200":{"description":"Security promoted to ACTIVE"},"403":{"description":"Four-eyes segregation-of-duties or scope violation"}}}},"/securities/{id}/reject":{"post":{"summary":"Checker rejection with mandatory audit reason","tags":["Maker-Checker"],"responses":{"200":{"description":"Security marked REJECTED"},"403":{"description":"Four-eyes segregation-of-duties or scope violation"}}}},"/securities/{id}/tranches":{"post":{"summary":"Record tap or re-opening tranche and update outstanding notional","tags":["Tranches"],"responses":{"201":{"description":"Tranche appended"}}}},"/ingestion/run":{"post":{"summary":"Trigger U.S. / UMOA / BEAC / CBK / Eurobond ingestion run (requires INSTITUTIONAL)","tags":["Ingestion"],"responses":{"200":{"description":"Completed IngestionRun summary and event payloads"}}}}}}