Upload Session Field Asset (v1)
Method + Path
POST /v1/workspace/:workspaceId/sessions/fields/:fieldId/assets
Actual backend path: /v1/workspace/:workspaceId/sessions/fields/:fieldId/assets
Description
Upload an asset file for a session custom field. Only supported for field types: image, file, or signature.
Authentication
Required - JWT token in Authorization header
Required Permissions:
sessions.update
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token: Bearer <token> |
Content-Type | string | Yes | multipart/form-data |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
fieldId | string | Yes | Field identifier |
Request Body
Form data with a file field named file.
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | File to upload (must match field type: image, file, or signature) |
Response (201)
{
"asset": {
"fieldId": "507f1f77bcf86cd799439011",
"fieldKey": "signature",
"fileName": "signature.png",
"url": "https://storage.example.com/assets/signature-123.png",
"mediaType": "image/png",
"sizeBytes": 45678
}
}
Common Errors
- 400 Bad Request: Missing file, invalid field type (not image/file/signature), or field not found
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
sessions.update) - 404 Not Found: Field or workspace not found
- 413 Payload Too Large: File size exceeds limit
- 415 Unsupported Media Type: Invalid file type
- 500 Internal Server Error: Server error