{"openapi":"3.1.0","info":{"title":"Connectivity Credits API","description":"Independent implementation of the published consultancy scope. Service credentials are programme-scoped. All business mutations require Idempotency-Key. Policy values are administrator supplied; no UNICEF policy is implied.","version":"0.1.0"},"paths":{"/health/live":{"get":{"tags":["Operations"],"summary":"Live","operationId":"live_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/ready":{"get":{"tags":["Operations"],"summary":"Ready","operationId":"ready_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/accounts":{"post":{"tags":["Registry"],"summary":"Add Account","operationId":"add_account_v1_accounts_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/institutions":{"post":{"tags":["Registry"],"summary":"Add Institution","operationId":"add_institution_v1_institutions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Institution"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/policies":{"post":{"tags":["Rules"],"summary":"Add Policy","operationId":"add_policy_v1_policies_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/measurements":{"post":{"tags":["Measurements"],"summary":"Add Measurement","operationId":"add_measurement_v1_measurements_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Measurement"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/measurements/{measurement_id}/verification":{"post":{"tags":["Measurements"],"summary":"Verify","operationId":"verify_v1_measurements__measurement_id__verification_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"measurement_id","in":"path","required":true,"schema":{"type":"string","title":"Measurement Id"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/evaluations":{"post":{"tags":["Rules"],"summary":"Evaluate","operationId":"evaluate_v1_evaluations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/issue":{"post":{"tags":["Credits"],"summary":"Issue","operationId":"issue_v1_credits_issue_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Issue"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/transfers":{"post":{"tags":["Credits"],"summary":"Transfer","operationId":"transfer_v1_transfers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transfer"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/redemptions":{"post":{"tags":["Credits"],"summary":"Redeem","operationId":"redeem_v1_redemptions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Redemption"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/redemptions/{redemption_id}/cancel":{"post":{"tags":["Credits"],"summary":"Cancel","operationId":"cancel_v1_redemptions__redemption_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"redemption_id","in":"path","required":true,"schema":{"type":"string","title":"Redemption Id"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":150,"title":"Idempotency-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/records/{collection}":{"get":{"tags":["Reporting"],"summary":"Records","operationId":"records_v1_records__collection__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"collection","in":"path","required":true,"schema":{"type":"string","title":"Collection"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reconciliation":{"get":{"tags":["Reporting"],"summary":"Reconciliation","operationId":"reconciliation_v1_reconciliation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/events/{event_id}/replay":{"post":{"tags":["Operations"],"summary":"Replay Event","operationId":"replay_event_v1_events__event_id__replay_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/metrics":{"get":{"tags":["Operations"],"summary":"Metrics","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/webhooks/giga-meter":{"post":{"tags":["Integrations"],"summary":"Giga","operationId":"giga_v1_webhooks_giga_meter_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Account":{"properties":{"id":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"}},"additionalProperties":false,"type":"object","required":["id","name"],"title":"Account"},"Evaluation":{"properties":{"institution":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Institution"},"day":{"type":"string","format":"date","title":"Day"},"policy":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Policy"}},"additionalProperties":false,"type":"object","required":["institution","day","policy"],"title":"Evaluation"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Institution":{"properties":{"id":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"country":{"type":"string","pattern":"^[A-Z]{2}$","title":"Country"},"timezone":{"type":"string","title":"Timezone"},"provider":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Provider"}},"additionalProperties":false,"type":"object","required":["id","name","country","timezone","provider"],"title":"Institution"},"Issue":{"properties":{"evaluation":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Evaluation"}},"additionalProperties":false,"type":"object","required":["evaluation"],"title":"Issue"},"Measurement":{"properties":{"institution":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Institution"},"source":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Source"},"source_id":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Source Id"},"observed_at":{"type":"string","format":"date-time","title":"Observed At"},"download_mbps":{"anyOf":[{"type":"number","maximum":100000.0,"minimum":0.0},{"type":"string"}],"title":"Download Mbps"},"upload_mbps":{"anyOf":[{"type":"number","maximum":100000.0,"minimum":0.0},{"type":"string"}],"title":"Upload Mbps"},"latency_ms":{"anyOf":[{"type":"number","maximum":60000.0,"minimum":0.0},{"type":"string"}],"title":"Latency Ms"},"evidence_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","title":"Evidence Sha256"}},"additionalProperties":false,"type":"object","required":["institution","source","source_id","observed_at","download_mbps","upload_mbps","latency_ms","evidence_sha256"],"title":"Measurement"},"Policy":{"properties":{"id":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"effective_from":{"type":"string","format":"date","title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective Until"},"min_download_mbps":{"anyOf":[{"type":"number","maximum":100000.0,"exclusiveMinimum":0.0},{"type":"string"}],"title":"Min Download Mbps"},"min_upload_mbps":{"anyOf":[{"type":"number","maximum":100000.0,"exclusiveMinimum":0.0},{"type":"string"}],"title":"Min Upload Mbps"},"max_latency_ms":{"anyOf":[{"type":"number","maximum":60000.0,"exclusiveMinimum":0.0},{"type":"string"}],"title":"Max Latency Ms"},"min_samples":{"type":"integer","maximum":96.0,"minimum":2.0,"title":"Min Samples"},"min_span_hours":{"type":"integer","maximum":23.0,"minimum":1.0,"title":"Min Span Hours"},"min_pass_basis_points":{"type":"integer","maximum":10000.0,"minimum":1.0,"title":"Min Pass Basis Points"},"description":{"type":"string","maxLength":2000,"minLength":1,"title":"Description"}},"additionalProperties":false,"type":"object","required":["id","name","effective_from","min_download_mbps","min_upload_mbps","max_latency_ms","min_samples","min_span_hours","min_pass_basis_points","description"],"title":"Policy"},"Redemption":{"properties":{"account":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Account"},"units":{"type":"integer","maximum":1000000000.0,"exclusiveMinimum":0.0,"title":"Units"},"beneficiary":{"type":"string","maxLength":300,"minLength":1,"title":"Beneficiary"}},"additionalProperties":false,"type":"object","required":["account","units","beneficiary"],"title":"Redemption"},"Transfer":{"properties":{"source":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Source"},"destination":{"type":"string","maxLength":100,"minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$","title":"Destination"},"units":{"type":"integer","maximum":1000000000.0,"exclusiveMinimum":0.0,"title":"Units"},"memo":{"type":"string","maxLength":500,"title":"Memo","default":""}},"additionalProperties":false,"type":"object","required":["source","destination","units"],"title":"Transfer"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Verification":{"properties":{"accepted":{"type":"boolean","title":"Accepted"},"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"},"evidence_uri":{"type":"string","maxLength":1000,"minLength":1,"pattern":"^(https://|urn:)","title":"Evidence Uri"}},"additionalProperties":false,"type":"object","required":["accepted","reason","evidence_uri"],"title":"Verification"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}