Skip to main content

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

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>
Content-TypestringYesmultipart/form-data

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
fieldIdstringYesField identifier

Request Body

Form data with a file field named file.

Form Fields

FieldTypeRequiredDescription
filefileYesFile 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