Update Session (v1)
Method + Path
PATCH /v1/workspace/:workspaceId/sessions/:sessionId
Actual backend path: /v1/workspace/:workspaceId/sessions/:sessionId
Description
Update an existing session. All fields are optional - only provided fields will be updated.
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 | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
sessionId | string | Yes | Session identifier |
Request Body
{
"name": "Updated Session Name",
"scheduledAt": "2024-01-21T10:00:00Z",
"duration": 90,
"status": "in-progress",
"notes": "Updated notes"
}
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Session name (minimum 1 character if provided) |
scheduledAt | string | No | Scheduled date/time in ISO 8601 format |
duration | number | No | Session duration in minutes |
status | string | No | Session status. Valid values: scheduled, in-progress, completed, cancelled |
notes | string | No | Session notes |
customFields | array | No | Array of custom field values |
Note: At least one field must be provided for update.
Response (200)
{
"session": {
"id": "507f1f77bcf86cd799439011",
"name": "Updated Session Name",
"scheduledAt": "2024-01-21T10:00:00Z",
"duration": 90,
"status": "in-progress",
"updatedAt": "2024-01-15T11:00:00Z"
}
}
Common Errors
- 400 Bad Request: Invalid request body or no fields provided
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
sessions.update) - 404 Not Found: Session or workspace not found
- 422 Unprocessable Entity: Validation errors
- 500 Internal Server Error: Server error