API Reference
Auth
Log in and exchange credentials for a bearer access token, and refresh it.
post
/auth/api-keyAuthenticate using an organisation API key
Exchange an organisation API key for a JWT with organization_id embedded.
Parameters
api_keystringqueryrequiredResponse 200
access_tokenstringrequiredtoken_typestringrequiredexpirystring<date-time>optionalPOST /auth/api-key
curl -X POST "https://api.cropsense.africa/auth/api-key?api_key=sk_live_51H8x...redacted"Example response · 200
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expiry": "2026-06-15T09:30:00Z"
}post
/auth/token/refreshRefresh access token
Requires an
Authorization: Bearer header.Response 200
access_tokenstringrequiredtoken_typestringrequiredexpirystring<date-time>optionalPOST /auth/token/refresh
curl -X POST "https://api.cropsense.africa/auth/token/refresh" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Example response · 200
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expiry": "2026-06-15T09:30:00Z"
}