List Members by Center
GET /api/collection-centers/:centerId/members
Retrieve all members for a specific collection center, sorted by name.
Path Parameters
Response
Returns an array of member objects sorted by full_name.
Collection center ID this member belongs to
National ID number (cédula)
Role at the collection center (e.g., “Recolector”, “Coordinador”)
Whether the member is currently active
Timestamp when member was created
Example Request
curl http://localhost:4000/api/collection-centers/center-1/members
Example Response
[
{
"id" : "member-1" ,
"center_id" : "center-1" ,
"full_name" : "Juan Pérez" ,
"cedula" : "V-12345678" ,
"phone" : "+58 414 1234567" ,
"role" : "Recolector" ,
"is_active" : true ,
"created_at" : "2026-01-05T09:00:00Z"
},
{
"id" : "member-2" ,
"center_id" : "center-1" ,
"full_name" : "María González" ,
"cedula" : "V-87654321" ,
"phone" : "+58 424 7654321" ,
"role" : "Coordinador" ,
"is_active" : true ,
"created_at" : "2026-01-10T10:30:00Z"
}
]
Create Member
POST /api/collection-center-members
Create a new collection center member.
Request Body
Unique member identifier (UUID)
Collection center ID this member belongs to
National ID number (cédula)
role
string
default: "Recolector"
Role at the collection center (e.g., “Recolector”, “Coordinador”, “Supervisor”)
Whether the member is currently active
Response
Returns the created member object with created_at timestamp.
Example Request
curl -X POST http://localhost:4000/api/collection-center-members \
-H "Content-Type: application/json" \
-d '{
"id": "member-new-1",
"centerId": "center-1",
"fullName": "Carlos Rodríguez",
"cedula": "V-11223344",
"phone": "+58 412 3344556",
"role": "Recolector",
"isActive": true
}'
Example Response
{
"id" : "member-new-1" ,
"center_id" : "center-1" ,
"full_name" : "Carlos Rodríguez" ,
"cedula" : "V-11223344" ,
"phone" : "+58 412 3344556" ,
"role" : "Recolector" ,
"is_active" : true ,
"created_at" : "2026-03-09T12:00:00Z"
}
Update Member
PUT /api/collection-center-members/:id
Update an existing collection center member.
Path Parameters
Request Body
Role at the collection center
Whether the member is active
Response
Returns the updated member object.
Example Request
curl -X PUT http://localhost:4000/api/collection-center-members/member-1 \
-H "Content-Type: application/json" \
-d '{
"centerId": "center-1",
"fullName": "Juan Pérez Martínez",
"cedula": "V-12345678",
"phone": "+58 414 1234567",
"role": "Supervisor",
"isActive": true
}'
Example Response
{
"id" : "member-1" ,
"center_id" : "center-1" ,
"full_name" : "Juan Pérez Martínez" ,
"cedula" : "V-12345678" ,
"phone" : "+58 414 1234567" ,
"role" : "Supervisor" ,
"is_active" : true ,
"created_at" : "2026-01-05T09:00:00Z"
}
Delete Member
DELETE /api/collection-center-members/:id
Delete a collection center member by their ID.
Deleting a member will set the collector_member_id to NULL in related tickets due to ON DELETE SET NULL foreign key constraint. The collector name is cached in tickets, so historical data is preserved.
Path Parameters
Response
Returns true if deletion was successful
Example Request
curl -X DELETE http://localhost:4000/api/collection-center-members/member-2
Example Response
Error Response
{
"error" : "DB delete error"
}