Upload Session Attachment (v1)
Method + Path
POST /v1/workspace/:workspaceId/sessions/:sessionId/attachments
Actual backend path: /v1/workspace/:workspaceId/sessions/:sessionId/attachments
Description
Upload an attachment file to a session.
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 |
sessionId | string | Yes | Session identifier |
Request Body
Form data with a file field named file.
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | File to upload |
Response (201)
{
"attachment": {
"id": "507f1f77bcf86cd799439013",
"fileName": "document.pdf",
"fileSizeBytes": 45678,
"mediaType": "application/pdf",
"url": "https://storage.example.com/attachments/session-123-doc.pdf",
"createdAt": "2024-01-15T11:00:00Z"
}
}
Common Errors
- 400 Bad Request: Missing or invalid file
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
sessions.update) - 404 Not Found: Session or workspace not found
- 413 Payload Too Large: File size exceeds limit
- 500 Internal Server Error: Server error