The Users API is the entry point for all account management in AgroPulse. Every participant on the platform — whether a farmer, buyer, or transporter — begins as aDocumentation 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.
User record. Registration is open without authentication, while all other operations (listing, retrieval, update, deletion) require a valid JWT Bearer token. Each user is assigned one of three roles (BUYER, SELLER, or TRANSPORTER) which controls access to the corresponding profile resources across the rest of the API.
Base path
Authentication
All endpoints exceptPOST /api/users/ (registration) require a JWT Bearer token in the Authorization header.
Obtain a token by calling
POST /api/users/login/ with your email and password. The response includes both access and refresh tokens.Endpoints
| Method | Path | Description | Auth required |
|---|---|---|---|
GET | /api/users/ | List all user accounts | Yes |
POST | /api/users/ | Create / register a new user | No |
GET | /api/users/{id}/ | Retrieve a single user by UUID | Yes |
PUT | /api/users/{id}/ | Full update of a user record | Yes |
PATCH | /api/users/{id}/ | Partial update of a user record | Yes |
DELETE | /api/users/{id}/ | Delete a user account | Yes |
Register a user
POST /api/users/
Creates a new user account. No token is required. The password and password_confirm fields must match; the API returns a 400 validation error if they do not. The password and password_confirm fields are write-only and are never included in any response.
Unique email address for the account. Used as the login identifier.
Account password. Write-only — never returned in responses.
Must exactly match the
password field. Write-only — never returned in responses.Full display name of the user (max 255 characters).
Contact phone number for the user (max 20 characters).
Platform role assigned to this account. One of:
BUYER, SELLER, TRANSPORTER.Example request
Example response
Registration returns a
UserDetailSerializer response that includes nested farmer_profile, buyer_profile, and transporter_profile objects. These are null until the respective profile is created.List users
GET /api/users/
Returns an array of all user accounts ordered by created_at descending. Requires authentication.
Query parameters
Filter results by a search term matched against user fields.
Sort results by a field name. Prefix with
- for descending order (e.g., -created_at).Example request
User object
The fields returned on a standard user response.UUID primary key. Auto-generated on creation, never editable.
Unique email address. Used as the login username.
Full display name of the user.
Contact phone number.
Platform role. One of:
BUYER, SELLER, TRANSPORTER.Whether the account is active. Defaults to
true.ISO 8601 timestamp of when the account was created. Read-only.
ISO 8601 timestamp of the last update to the account. Read-only.