CropSense

Search documentation

Search for a command to run...

API Reference

Auth

Log in and exchange credentials for a bearer access token, and refresh it.

post/auth/api-key

Authenticate using an organisation API key

Exchange an organisation API key for a JWT with organization_id embedded.

Parameters

api_keystringqueryrequired

Response 200

access_tokenstringrequired
token_typestringrequired
expirystring<date-time>optional
POST /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/refresh

Refresh access token

Requires an Authorization: Bearer header.

Response 200

access_tokenstringrequired
token_typestringrequired
expirystring<date-time>optional
POST /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"
}