Assignment History Repository
API Contract
REST
/api/v1/assignments
9 endpoints
GET
/api/v1/assignments/api/v1/assignments
List assignments with optional filtering
Public
Response Example
{
"data": [
{
"assignment_id": "assign_001aa",
"mentor_id": "mentor_a1b2c3",
"contact_id": "contact_xyz123",
"contact_name": "Per Olsen",
"status": "open",
"assigned_date": "2025-11-01T00:00:00Z",
"last_contact_date": "2026-03-20T00:00:00Z",
"created_at": "2025-11-01T08:00:00Z"
},
{
"assignment_id": "assign_002bb",
"mentor_id": "mentor_a1b2c3",
"contact_id": "contact_abc456",
"contact_name": "Liv Svendsen",
"status": "open",
"assigned_date": "2026-01-15T00:00:00Z",
"last_contact_date": "2026-03-18T00:00:00Z",
"created_at": "2026-01-15T09:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 5
}
}
GET
/api/v1/assignments/api/v1/assignments/:id
Get a single assignment by ID
Public
Response Example
{
"assignment_id": "assign_001aa",
"mentor_id": "mentor_a1b2c3",
"contact_id": "contact_xyz123",
"contact_name": "Per Olsen",
"status": "open",
"notes": "Initial assessment completed. Weekly meetings ongoing.",
"assigned_date": "2025-11-01T00:00:00Z",
"last_contact_date": "2026-03-20T00:00:00Z",
"created_at": "2025-11-01T08:00:00Z",
"updated_at": "2026-03-20T15:00:00Z"
}
POST
/api/v1/assignments/api/v1/assignments
Create a new mentor-contact assignment
Public
Request Example
{
"mentor_id": "mentor_a1b2c3",
"contact_id": "contact_def789",
"notes": "Referred by case worker. First meeting scheduled.",
"assigned_date": "2026-03-26T00:00:00Z"
}
Response Example
{
"assignment_id": "assign_003cc",
"mentor_id": "mentor_a1b2c3",
"contact_id": "contact_def789",
"status": "open",
"assigned_date": "2026-03-26T00:00:00Z",
"created_at": "2026-03-26T10:00:00Z"
}
PUT
/api/v1/assignments/api/v1/assignments/:id
Update assignment details
Public
Request Example
{
"notes": "Escalated — contact requires specialist referral",
"last_contact_date": "2026-03-25T00:00:00Z"
}
Response Example
{
"assignment_id": "assign_001aa",
"notes": "Escalated — contact requires specialist referral",
"last_contact_date": "2026-03-25T00:00:00Z",
"updated_at": "2026-03-26T10:10:00Z"
}
DELETE
/api/v1/assignments/api/v1/assignments/:id
Delete an assignment record
Public
Response Example
{
"deleted": true,
"assignment_id": "assign_001aa"
}
GET
/api/v1/assignments/api/v1/assignments/mentor/:mentor_id/active
Get all active (open) assignments for a mentor
Public
Response Example
{
"data": [
{
"assignment_id": "assign_001aa",
"contact_id": "contact_xyz123",
"contact_name": "Per Olsen",
"status": "open",
"assigned_date": "2025-11-01T00:00:00Z",
"last_contact_date": "2026-03-20T00:00:00Z"
},
{
"assignment_id": "assign_002bb",
"contact_id": "contact_abc456",
"contact_name": "Liv Svendsen",
"status": "open",
"assigned_date": "2026-01-15T00:00:00Z",
"last_contact_date": "2026-03-18T00:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/assignments/api/v1/assignments/mentor/:mentor_id/history
Get full assignment history for a mentor
Public
Response Example
{
"data": [
{
"assignment_id": "assign_000zz",
"contact_id": "contact_old001",
"contact_name": "Anna Pettersen",
"status": "closed",
"assigned_date": "2024-06-01T00:00:00Z",
"closed_date": "2024-12-15T00:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 7
}
}
GET
/api/v1/assignments/api/v1/assignments/mentor/:mentor_id/open-count
Count open assignments for a mentor
Public
Response Example
{
"mentor_id": "mentor_a1b2c3",
"open_assignment_count": 2
}
PATCH
/api/v1/assignments/api/v1/assignments/:id/status
Update assignment status
Public
Request Example
{
"status": "closed",
"reason": "Contact successfully integrated into community support network"
}
Response Example
{
"assignment_id": "assign_001aa",
"status": "closed",
"closed_date": "2026-03-26T10:00:00Z",
"updated_at": "2026-03-26T10:00:00Z"
}