Upload Client Avatar (v1)
Method + Path
POST /v1/workspace/:workspaceId/clients/:clientId/avatar
Actual backend path: /v1/workspace/:workspaceId/clients/:clientId/avatar
Description
Upload an avatar image for a client (customer).
Authentication
Required - JWT token in Authorization header
Required Permissions:
clients.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 |
clientId | string | Yes | Client identifier |
Request Body
Form data with a file field named file.
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Image file to upload (JPEG, PNG, etc.) |
Response (201)
{
"avatar": {
"url": "https://storage.example.com/avatars/client-123.jpg",
"path": "avatars/client-123.jpg",
"width": 200,
"height": 200,
"sizeBytes": 45678,
"contentType": "image/jpeg"
}
}
Common Errors
- 400 Bad Request: Missing or invalid file
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
clients.update) - 404 Not Found: Client 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