Skip to main content

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

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

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
sessionIdstringYesSession identifier

Request Body

Form data with a file field named file.

Form Fields

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