---
title: "Assign a Cassetta resource to patients"
method: POST
path: "/api/storage/materials/assign"
tags: ["storage"]
---

# Assign a Cassetta resource to patients

`POST /api/storage/materials/assign`

## Request

- Base URL: `https://api.corabea.it` (the document declares no server; this is the origin it was published from)
- URL: `https://api.corabea.it/api/storage/materials/assign`
- Auth: HTTP bearer

Copies a file under materials/resources/{area}/… into each patient's kit, where the patient app lists it, and sends them a push. An operator's copy goes into their own kit for that patient (kit_psi as psychologist, kit_nutri as nutritionist) whatever the area; admin, customer care and the coordinator use the area's kit — kit_psi for psicologo, kit_nutri for nutrizionista. A patient who already has a file of that name keeps it and is reported as skipped. Operators may assign to their own patients only; admin and customer care to anyone — one patient outside that scope rejects the whole request before any copy.

## Request body

- AssignMaterialRequest: Copy a Cassetta resource into the kits of one or more patients.
  - `file_path` string, required: A key under materials/resources/{psicologo|nutrizionista}/…
  - `patient_ids` string[], required: The patients whose kits receive a copy

## Response `201`

Successful Response

- AssignMaterialResponse: Who got the copy. A patient already holding a file of that name keeps it untouched.
  - `assigned` string[]: Patients whose kit received the copy
  - `skipped` string[]: Patients who already had it
  - `failed` string[]: Patients whose copy failed
  - `message` string, required: Success message

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-18** `2af59bd2c0e6`: 2 breaking, 2 warning, 5 info
  - added the new required request property `patient_ids`
  - removed the required property `file_path` from the response with the `201` status
  - removed the request property `patient_id`
  - removed the optional property `title` from the response with the `201` status
  - …5 more
- **2026-09-11** `6afa01417695`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/corabea/apis/corabea-api/changes/api/storage/materials/assign/post.md)

---

[API](https://skmtc.dev/corabea/apis/corabea-api.md) · [All operations](https://skmtc.dev/corabea/apis/corabea-api/llms.txt) · [OpenAPI document](https://skmtc.dev/corabea/apis/corabea-api/revisions/4a8dd89893b8?raw)
