The Farmers API managesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/OluwagbeminiyiA/agro_pulse-API/llms.txt
Use this file to discover all available pages before exploring further.
FarmerProfile records for users with the SELLER role on the AgroPulse platform. A farmer profile extends a base User account with farm-specific details — the name and location of the farm, and a platform-calculated trust_score that reflects the farmer’s reliability over time. All endpoints require a valid JWT Bearer token. Non-admin users can only access their own farmer profile; staff accounts see all profiles.
Base path
Authentication
All endpoints require a JWT Bearer token in theAuthorization header.
The
user field on a farmer profile is automatically set to the authenticated user when creating a record. You do not need to supply it in the request body.Endpoints
| Method | Path | Description | Auth required |
|---|---|---|---|
GET | /api/farmers/ | List farmer profiles | Yes |
POST | /api/farmers/ | Create a new farmer profile | Yes |
GET | /api/farmers/{id}/ | Retrieve a single farmer profile by UUID | Yes |
PUT | /api/farmers/{id}/ | Full update of a farmer profile | Yes |
PATCH | /api/farmers/{id}/ | Partial update of a farmer profile | Yes |
DELETE | /api/farmers/{id}/ | Delete a farmer profile | Yes |
Create a farmer profile
POST /api/farmers/
Creates a FarmerProfile linked to the authenticated user. The user field is set automatically from the Bearer token — it is read-only and must not be included in the request body. The trust_score is platform-managed and always starts at 0.00.
Name of the farm (max 255 characters).
Physical location or address of the farm (max 255 characters).
Example request
Example response
trust_score is a decimal value in the range 0.00–1.00. It is calculated and updated by the platform and is always read-only.List farmers
GET /api/farmers/
Returns an array of farmer profiles ordered by created_at descending. Non-admin users receive only their own profile. Staff users receive all profiles.
Query parameters
Filter results by a search term matched against farmer profile fields.
Sort results by a field name. Prefix with
- for descending order (e.g., -created_at).Example request
FarmerProfile object
UUID primary key. Auto-generated on creation, never editable.
UUID of the linked
User account. Set automatically from the authenticated user. Read-only.Email address of the linked user. Read-only, derived from the
User record.Full name of the linked user. Read-only, derived from the
User record.Name of the farm.
Physical location or address of the farm.
Platform-calculated reliability score in the range
0.00–1.00. Read-only. Defaults to 0.00 on creation.ISO 8601 timestamp of profile creation. Read-only.
ISO 8601 timestamp of the last update. Read-only.