API Reference
YieldSecure
Parametric agricultural insurance — quote and issue multi-peril policies, check live trigger status, and subscribe to payout-triggering webhook events.
/yieldsecure/quoteGenerate a premium quote
Authorization: Bearer header.Request body
farm_idstringrequiredfield_idstringrequiredperilsenum<string>[]requiredsum_insurednumberrequiredMaximum payout, in `currency`
currencystringoptionalISO 4217 code for sum_insured/premium
Response 200
farm_idstringrequiredfield_idstringrequiredperilsstring[]requiredsum_insurednumberrequiredcurrencystringrequiredratenumberrequiredCombined premium rate as a fraction of sum_insured
premiumnumberrequiredbreakdownobjectrequiredPer-peril premium contribution
platform_versionstringrequiredcurl -X POST "https://api.cropsense.africa/yieldsecure/quote" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"perils": [
"drought"
],
"sum_insured": 1.5,
"currency": "USD"
}'{
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"perils": [
"perils"
],
"sum_insured": 1.5,
"currency": "USD",
"rate": 1.5,
"premium": 1.5,
"breakdown": {},
"platform_version": "platform_version"
}/yieldsecure/policiesList policies
Authorization: Bearer header.Parameters
statusstringqueryactive | expired | claimed | lapsed
farm_idstringqueryperilenum<string>querydroughtfloodvegetation_stressstorm
pageintegerquerypage_sizeintegerqueryResponse 200
itemsPolicyListItem[]requiredtotalintegerrequiredpageintegerrequiredpage_sizeintegerrequiredcurl -X GET "https://api.cropsense.africa/yieldsecure/policies?status=status&farm_id=3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a&peril=drought&page=1&page_size=20" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"items": [
{
"policy_id": "policy_id",
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"crop_type": "crop_type",
"sum_insured": 1.5,
"currency": "USD",
"premium": 1.5,
"perils": [
"perils"
],
"status": "status",
"issued_at": "2026-06-15T09:30:00Z",
"term_start": "2026-06-15",
"term_end": "2026-06-15",
"next_monitoring_date": "2026-06-15"
}
],
"total": 1,
"page": 1,
"page_size": 1
}/yieldsecure/policiesIssue a parametric insurance policy
Authorization: Bearer header.Request body
farm_idstringrequiredfield_idstringrequiredcrop_typestringoptionalperilsenum<string>[]requiredsum_insurednumberrequiredcurrencystringoptionalISO 4217 code for sum_insured/premium
term_startstring<date>requiredterm_endstring<date>requiredResponse 201
policy_idstringrequiredorganization_idstringrequiredenvironmentstringrequiredfarm_idstringrequiredfield_idstringrequiredfarm_namestringoptionalfield_namestringoptionalfield_area_hanumberoptionalfield_locationstringoptionalcrop_typestringoptionalsum_insurednumberrequiredcurrencystringrequiredpremiumnumberrequiredperilsstring[]requiredtriggersTriggerStatus[]requiredCurrent status of every peril on this policy
statusstringrequiredissued_atstring<date-time>requiredterm_startstring<date>requiredterm_endstring<date>requiredplatform_versionstringrequirednext_monitoring_datestring<date>optionalcurl -X POST "https://api.cropsense.africa/yieldsecure/policies" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"crop_type": "crop_type",
"perils": [
"drought"
],
"sum_insured": 1.5,
"currency": "USD",
"term_start": "2026-06-15",
"term_end": "2026-06-15"
}'{
"policy_id": "policy_id",
"organization_id": "organization_id",
"environment": "environment",
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"farm_name": "farm_name",
"field_name": "field_name",
"field_area_ha": 1.5,
"field_location": "field_location",
"crop_type": "crop_type",
"sum_insured": 1.5,
"currency": "USD",
"premium": 1.5,
"perils": [
"perils"
],
"triggers": [
{
"peril": "peril",
"trigger_index": "trigger_index",
"current_index_reading": 1.5,
"trigger_threshold": 1.5,
"comparison": "comparison",
"data_available": true
}
],
"status": "status",
"issued_at": "2026-06-15T09:30:00Z",
"term_start": "2026-06-15",
"term_end": "2026-06-15",
"platform_version": "platform_version",
"next_monitoring_date": "2026-06-15"
}/yieldsecure/policies/{policy_id}Retrieve a policy
Authorization: Bearer header.Parameters
policy_idstringpathrequiredResponse 200
policy_idstringrequiredorganization_idstringrequiredenvironmentstringrequiredfarm_idstringrequiredfield_idstringrequiredfarm_namestringoptionalfield_namestringoptionalfield_area_hanumberoptionalfield_locationstringoptionalcrop_typestringoptionalsum_insurednumberrequiredcurrencystringrequiredpremiumnumberrequiredperilsstring[]requiredtriggersTriggerStatus[]requiredCurrent status of every peril on this policy
statusstringrequiredissued_atstring<date-time>requiredterm_startstring<date>requiredterm_endstring<date>requiredplatform_versionstringrequirednext_monitoring_datestring<date>optionalcurl -X GET "https://api.cropsense.africa/yieldsecure/policies/policy_id" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"policy_id": "policy_id",
"organization_id": "organization_id",
"environment": "environment",
"farm_id": "3fa2c9e1-6b3a-4d2e-9c11-4a8e5f9d2b7a",
"field_id": "8b6e1a2f-2d4c-4e9a-9b0f-1c7d3e5a6f42",
"farm_name": "farm_name",
"field_name": "field_name",
"field_area_ha": 1.5,
"field_location": "field_location",
"crop_type": "crop_type",
"sum_insured": 1.5,
"currency": "USD",
"premium": 1.5,
"perils": [
"perils"
],
"triggers": [
{
"peril": "peril",
"trigger_index": "trigger_index",
"current_index_reading": 1.5,
"trigger_threshold": 1.5,
"comparison": "comparison",
"data_available": true
}
],
"status": "status",
"issued_at": "2026-06-15T09:30:00Z",
"term_start": "2026-06-15",
"term_end": "2026-06-15",
"platform_version": "platform_version",
"next_monitoring_date": "2026-06-15"
}/yieldsecure/policies/{policy_id}/evaluateEvaluate a policy's triggers now, or as of a historical date for a backtest
Authorization: Bearer header.Parameters
policy_idstringpathrequiredRequest body
as_ofstring<date>optionalResponse 200
policy_idstringrequiredas_ofstring<date>requiredeventsTriggerEventResponse[]requiredOnly perils with a reading in their window this evaluation — see skipped_perils for the rest
total_payoutnumberrequiredcurrencystringrequiredis_backtestbooleanrequiredpayout_countintegeroptionalpolicy_statusstringoptionaltriggers_evaluatedintegerrequiredCount of perils with a reading in their window this evaluation
triggers_totalintegerrequiredTotal perils on this policy
skipped_perilsstring[]optionalPerils with no reading in their window — could not be checked for breach, not the same as 'not breached'
curl -X POST "https://api.cropsense.africa/yieldsecure/policies/policy_id/evaluate" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"as_of": "2026-06-15"
}'{
"policy_id": "policy_id",
"as_of": "2026-06-15",
"events": [
{
"peril": "peril",
"index": "index",
"observed_value": 1.5,
"threshold": 1.5,
"breached": true,
"severity": 1.5
}
],
"total_payout": 1.5,
"currency": "USD",
"is_backtest": true,
"payout_count": 1,
"policy_status": "policy_status",
"triggers_evaluated": 1,
"triggers_total": 1,
"skipped_perils": [
"skipped_perils"
]
}/yieldsecure/webhooks/trigger-eventsSubscribe to trigger-breach notifications
Authorization: Bearer header.Request body
urlstringrequiredHTTPS endpoint to receive trigger.breached webhook events
descriptionstringoptionalResponse 201
webhook_idstringrequiredorganization_idstringrequiredevent_typestringrequiredurlstringrequireddescriptionstringoptionalis_activebooleanrequiredcreated_atstring<date-time>requiredraw_secretstringrequiredcurl -X POST "https://api.cropsense.africa/yieldsecure/webhooks/trigger-events" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "url",
"description": "Notes about this record."
}'{
"webhook_id": "webhook_id",
"organization_id": "organization_id",
"event_type": "event_type",
"url": "url",
"description": "Notes about this record.",
"is_active": true,
"created_at": "2026-06-15T09:30:00Z",
"raw_secret": "raw_secret"
}/yieldsecure/policies/{policy_id}/evaluationsTrigger evaluation history for a policy, with any resulting payout
Authorization: Bearer header.Parameters
policy_idstringpathrequiredpageintegerquerypage_sizeintegerqueryResponse 200
policy_idstringrequireditemsTriggerEvaluationHistoryItem[]requiredtotalintegerrequiredpageintegerrequiredpage_sizeintegerrequiredcurl -X GET "https://api.cropsense.africa/yieldsecure/policies/policy_id/evaluations?page=1&page_size=20" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"policy_id": "policy_id",
"items": [
{
"evaluation_id": "evaluation_id",
"peril": "peril",
"trigger_index": "trigger_index",
"observed_value": 1.5,
"threshold": 1.5,
"breached": true,
"severity": 1.5,
"as_of": "2026-06-15",
"window_start": "2026-06-15",
"window_end": "2026-06-15",
"evaluated_at": "2026-06-15T09:30:00Z",
"payout": {
"payout_id": "payout_id",
"amount": 1.5,
"currency": "USD",
"status": "status",
"settled_at": "2026-06-15T09:30:00Z"
}
}
],
"total": 1,
"page": 1,
"page_size": 1
}