files
Files
Signed upload/download URLs for object storage.
4 endpoints
DELETE /api/v1/files/{id}
Delete a file: removes the storage object and the row. Audited.
Path & query parameters
| Name | In | Type | Constraints |
|---|---|---|---|
idrequired | path | string | — |
curl example
curl -X DELETE "https://api.yourdomain.com/api/v1/files/37386ae0-3738-7738-8386-37386ae03738" \
-H "Authorization: Bearer $INSTITFLOW_API_KEY"Responses
The API's OpenAPI spec doesn't declare a typed schema for this response yet — it's still JSON, just not documented here.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
GET /api/v1/files/{id}
Get file metadata plus a short-lived (5 min) signed download URL.
Path & query parameters
| Name | In | Type | Constraints |
|---|---|---|---|
idrequired | path | string | — |
curl example
curl -X GET "https://api.yourdomain.com/api/v1/files/37386ae0-3738-7738-8386-37386ae03738" \
-H "Authorization: Bearer $INSTITFLOW_API_KEY"Responses
| Name | Type | Constraints |
|---|---|---|
idrequired | string (uuid) | — |
kindrequired | enum: "avatar" | "document" | "report" | "attachment" | — |
originalNamerequired | string | — |
mimeTyperequired | string | — |
sizeBytesrequired | integer | -9007199254740991–9007199254740991 |
sha256required | string | — |
entityTyperequired | string | null | ≥1 chars |
entityIdrequired | string (uuid) | null | — |
createdAtrequired | string (date-time) | — |
downloadUrlrequired | string | — |
downloadUrlExpiresAtrequired | string (date-time) | — |
{
"id": "37386ae0-3738-7738-8386-37386ae03738",
"kind": "avatar",
"originalName": "string",
"mimeType": "string",
"sizeBytes": -9007199254740991,
"sha256": "string",
"entityType": "string",
"entityId": "81693677-8169-7169-8693-816936778169",
"createdAt": "2026-03-02T09:00:00.000Z",
"downloadUrl": "string",
"downloadUrlExpiresAt": "2026-03-02T09:00:00.000Z"
}Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
POST /api/v1/files/complete
Finalize an upload after the client has PUT the object to its signed URL.
Request body
| Name | Type | Constraints |
|---|---|---|
fileId | string (uuid) | — |
storageKeyrequired | string | 1–1024 chars |
sha256required | string | — |
kindrequired | enum: "avatar" | "document" | "report" | "attachment" | — |
originalNamerequired | string | 1–255 chars |
mimeTyperequired | enum: "image/jpeg" | "image/png" | "image/webp" | "image/gif" | "application/pdf" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/csv" | — |
sizeBytesrequired | integer | 1–20971520 |
entityType | string | 1–100 chars |
entityId | string (uuid) | — |
Example
{
"fileId": "0daca32e-0dac-7dac-8aca-0daca32e0dac",
"storageKey": "string",
"sha256": "string",
"kind": "avatar",
"originalName": "string",
"mimeType": "image/jpeg",
"sizeBytes": 1,
"entityType": "string",
"entityId": "81693677-8169-7169-8693-816936778169"
}curl example
curl -X POST "https://api.yourdomain.com/api/v1/files/complete" \
-H "Authorization: Bearer $INSTITFLOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"fileId": "0daca32e-0dac-7dac-8aca-0daca32e0dac",
"storageKey": "string",
"sha256": "string",
"kind": "avatar",
"originalName": "string",
"mimeType": "image/jpeg",
"sizeBytes": 1,
"entityType": "string",
"entityId": "81693677-8169-7169-8693-816936778169"
}'Responses
| Name | Type | Constraints |
|---|---|---|
idrequired | string (uuid) | — |
kindrequired | enum: "avatar" | "document" | "report" | "attachment" | — |
originalNamerequired | string | — |
mimeTyperequired | string | — |
sizeBytesrequired | integer | -9007199254740991–9007199254740991 |
sha256required | string | — |
entityTyperequired | string | null | ≥1 chars |
entityIdrequired | string (uuid) | null | — |
createdAtrequired | string (date-time) | — |
downloadUrlrequired | string | — |
downloadUrlExpiresAtrequired | string (date-time) | — |
{
"id": "37386ae0-3738-7738-8386-37386ae03738",
"kind": "avatar",
"originalName": "string",
"mimeType": "string",
"sizeBytes": -9007199254740991,
"sha256": "string",
"entityType": "string",
"entityId": "81693677-8169-7169-8693-816936778169",
"createdAt": "2026-03-02T09:00:00.000Z",
"downloadUrl": "string",
"downloadUrlExpiresAt": "2026-03-02T09:00:00.000Z"
}Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
POST /api/v1/files/upload-url
Get a signed URL to upload a new file directly to storage (PUT the object to `uploadUrl`).
Request body
| Name | Type | Constraints |
|---|---|---|
kindrequired | enum: "avatar" | "document" | "report" | "attachment" | — |
originalNamerequired | string | 1–255 chars |
mimeTyperequired | enum: "image/jpeg" | "image/png" | "image/webp" | "image/gif" | "application/pdf" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/csv" | — |
sizeBytesrequired | integer | 1–20971520 |
Example
{
"kind": "avatar",
"originalName": "string",
"mimeType": "image/jpeg",
"sizeBytes": 1
}curl example
curl -X POST "https://api.yourdomain.com/api/v1/files/upload-url" \
-H "Authorization: Bearer $INSTITFLOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"kind": "avatar",
"originalName": "string",
"mimeType": "image/jpeg",
"sizeBytes": 1
}'Responses
| Name | Type | Constraints |
|---|---|---|
storageKeyrequired | string | — |
uploadUrlrequired | string | — |
expiresAtrequired | string (date-time) | — |
{
"storageKey": "string",
"uploadUrl": "string",
"expiresAt": "2026-03-02T09:00:00.000Z"
}Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.
Returns the shared `ErrorEnvelope` — `{ error: { code, message, requestId, details? } }`. Every code is listed in the Conventions guide.