DELETE /api/v1/media/{mediaId}
Deletes a media. A media still used by a lesson, a resource or a course cover
is refused with 409: detach it first. An uploaded file or video is deleted
from its host too; a link only leaves the library — the video stays online at
its provider.
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
| Requirement | Rule for this endpoint |
|---|---|
| Business role | None — the permission is that of the lessons |
| Resource scope | The media belongs to the key's organization |
| Participation | None |
| Resource state | No lesson, resource or course cover uses it |
| Parameter | Type | Required | Description |
|---|---|---|---|
mediaId | UUID | yes | Media of the key's organization |
| Header | Required | Description |
|---|---|---|
x-api-key | yes | API key created for this organization |
Idempotency-Key | no | Accepted and ignored: a second delete answers 404 |
X-Correlation-Id | no | Caller correlation id, returned or generated |
curl -X DELETE "$COHORTE_API_BASE_URL/api/v1/media/$MEDIA_ID" \
-H "x-api-key: $COHORTE_API_KEY"200 OK — the media is gone.401 Unauthorized — missing, unknown or expired key.403 Forbidden — the bearer is not OWNER or ADMIN.404 Not Found — the media is unknown, already deleted, or belongs to another school.409 Conflict — the media is still used; details says in how many places.| Field | Type | Description |
|---|---|---|
data.id | UUID | The deleted media |
data.deleted | boolean | Always true |
{
"success": true,
"data": {"id": "8c9d0e1f-2a3b-4c4d-8e5f-6a7b8c9d0e1f", "deleted": true},
"correlationId": "c0ffee00-1111-4222-8333-444455556666"
}usage[] of List media, then detach it — a lesson resource with Detach a resource, a lesson video with Update a lesson.