cURL
curl --request PUT \ --url https://api.example.com/api/unions/:id \ --header 'Content-Type: application/json' \ --data ' { "name": "<string>", "location": "<string>", "address": "<string>", "creditOfficerId": "<string>" } '
{ "success": true, "message": "<string>", "data": { "id": "<string>", "name": "<string>", "location": "<string>", "address": "<string>", "creditOfficerId": "<string>", "createdAt": "<string>", "updatedAt": "<string>", "deletedAt": "<string>" } }
Authorization: Bearer <token>
Show Union properties
curl --request PUT \ --url https://api.example.com/api/unions/clx9876543210 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Central Farmers Union - Updated", "location": "Abuja", "address": "456 New Avenue, Wuse, Abuja" }'
{ "success": true, "message": "Union updated successfully", "data": { "id": "clx9876543210", "name": "Central Farmers Union - Updated", "location": "Abuja", "address": "456 New Avenue, Wuse, Abuja", "creditOfficerId": "clx1234567890", "createdAt": "2024-03-15T10:30:00.000Z", "updatedAt": "2024-03-16T14:20:00.000Z", "deletedAt": null } }
curl --request PUT \ --url https://api.example.com/api/unions/clx9876543210 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "creditOfficerId": "clx0987654321" }'
{ "success": false, "message": "Unauthorized" }
{ "success": false, "message": "Access denied. Admin privileges required." }
{ "success": false, "message": "Union not found" }
{ "success": false, "message": "Failed to update union" }
UNION_UPDATED