DELETE /api/v1/role-assignments
Remove exactly the responsibility identified by subject, role and scope.
Send x-api-key. The school and actor come from the verified key; body identities cannot override them. School OWNER or organization program_director. Organization ADMIN alone is read-only; a MEMBER needs the program_director responsibility.
Idempotency-Key is required. Reuse it only for the identical target and payload. X-Correlation-Id is optional.
subjectUserId (UUID) and role are required. Roles: program_director, coach, reviewer, head_of_sales, setter, closer. head_of_sales is assigned and removed by the school OWNER only (a program_director is refused with 403). scopeType defaults to organization; scopeId is null for organization and a UUID for program/enrollment. Only coach accepts enrollment scope; coach and reviewer accept program scope. Optional effectiveAt is an ISO date-time no later than the current day; reason is at most 500 characters.
curl -X DELETE "https://www.cohorte.io/api/v1/role-assignments" \
-H "x-api-key: $COHORTE_API_KEY" \
-H "Idempotency-Key: pedagogy-example-001" \
-H "Content-Type: application/json" \
-d '{"subjectUserId": "11111111-1111-4111-8111-111111111111", "role": "coach", "scopeType": "organization"}'200 returns the result. 400: invalid input or forbidden state transition. 401: invalid key. 403: insufficient current permission.
removed: whether a responsibility was removed; assignment: removed responsibility or null. Dates are ISO date-time strings or null.
{
"success": true,
"data": {
"removed": false,
"assignment": null
},
"correlationId": "22222222-2222-4222-8222-222222222222"
}Removal is convergent, not a replay of the original response: a second removal returns removed:false. No second removal event is emitted.