Upload and manage lab report files tied to one or more sample points from a sample plan.
This page covers only what's specific to sample-point reports. For the base URL, authentication, and response envelope, see SatMRV Overview.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | stratification/sample-plan/sample-point-reports/ | List reports |
| POST | stratification/sample-plan/sample-point-reports/ | Create a report (multipart upload) |
| GET | stratification/sample-plan/sample-point-reports/{id}/ | Retrieve a report |
| PUT/PATCH | stratification/sample-plan/sample-point-reports/{id}/ | Update a report |
| DELETE | stratification/sample-plan/sample-point-reports/{id}/ | Delete a report |
| GET | stratification/sample-plan/sample-point-reports/{id}/download/ | Download the report file |
Auth
Send your access token as a bearer token, as described in SatMRV Overview.
Required permission per action:
| Action | Required permission |
|---|---|
| List / Retrieve / Download | sample_point_report.view |
| Create | sample_point_report.create |
| Update / Partial update | sample_point_report.edit |
| Destroy | sample_point_report.delete |
A request lacking the required permission gets HTTP 403 with a structured body:
{
"code": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": {
"required_permission": "sample_point_report.create",
"action": "create",
"resource": "sample_point_report"
}
}Filters (list)
file_name (icontains), company, submitted_by, created_at (date range), sample_points, latitude, longitude, order, sample_plan.
Create — multipart, not JSON
Create is a multipart/form-data request, not JSON. POST
files(one or more file uploads) plussample_pointsas a comma-separated string of sample IDs (e.g."12,13,14"), not a JSON array. There's a per-file size limit documented as roughly 5MB — treat that as the safe target to stay under, since the actual enforced limit in the current implementation is considerably larger due to a units mismatch in the code, not something to rely on as a hard ceiling.
A successful create returns
201with{"message": "Sample Point Report Created Successfully"}and nodatapayload — you won't get the new report's ID back directly in the response. List or filter for it afterward (e.g. bysample_planor recency) if you need its ID.
400 if any file exceeds the size limit, or if any sample_points value doesn't resolve to a sample belonging to your own company. 500 on other upload failures.
Response fields
List/retrieve responses include file_name, a nested sample_points list, and standard metadata. The internal storage-location field is deliberately excluded from every response — don't expect a raw file path or URL in the JSON; use the download action instead.
Download
GET .../{id}/download/ returns 200 with:
{
"file_name": "lab-results.pdf",
"content": "JVBERi0xLjQKJcOkw7zDtsO..."
}content is always base64-encoded, regardless of any format option you might pass. 500 on storage/S3 errors.
Status codes
| Status | Trigger |
|---|---|
| 200 | List, retrieve, update, download. |
| 201 | Report created. |
| 204 | Report deleted. |
| 400 | Validation failure — bad body, oversized file, or a sample_points value outside your company. |
| 403 | Missing required permission. |
| 404 | Not found. |
| 500 | Upload or storage error. |
Examples
Create (multipart)
curl -X POST https://backend.spacenus.de/api/v1.2/sat-mrv/stratification/sample-plan/sample-point-reports/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "[email protected]" \
-F "sample_points=101,102,103"Response:
{
"status": "success",
"message": "Sample Point Report Created Successfully",
"data": null
}Download
curl https://backend.spacenus.de/api/v1.2/sat-mrv/stratification/sample-plan/sample-point-reports/REPORT_ID/download/ \
-H "Authorization: Bearer YOUR_TOKEN"Response:
{
"status": "success",
"message": "Success",
"data": {
"file_name": "lab-results.pdf",
"content": "JVBERi0xLjQKJcOkw7zDtsO..."
}
}