> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drime.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Workspace Avatar

> Upload or update workspace avatar image

## Overview

Uploads a new avatar image for a workspace.

## Path Parameters

<ParamField path="id" type="integer" required>
  The workspace ID
</ParamField>

## Request Body

<ParamField body="avatar" type="string" required>
  Base64 encoded image data
</ParamField>

## Response

<ResponseField name="workspace" type="object">
  The updated workspace object with new avatar URL
</ResponseField>

<ResponseField name="status" type="string">
  Request status (`success`)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://app.drime.cloud/api/v1/workspace/1873/avatar \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "avatar": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
    }'
  ```

  ```javascript JavaScript theme={null}
  // Convert file to base64
  const file = document.querySelector('input[type="file"]').files[0];
  const reader = new FileReader();

  reader.onload = async () => {
    const base64 = reader.result;
    
    const response = await fetch(
      `https://app.drime.cloud/api/v1/workspace/1873/avatar`,
      {
        method: 'POST',
        headers: {
          'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({ avatar: base64 })
      }
    );
    
    const { workspace } = await response.json();
    console.log('New avatar URL:', workspace.avatar);
  };

  reader.readAsDataURL(file);
  ```

  ```python Python theme={null}
  import requests
  import base64

  # Read and encode image
  with open('avatar.png', 'rb') as f:
      image_data = base64.b64encode(f.read()).decode()

  avatar_base64 = f"data:image/png;base64,{image_data}"

  response = requests.post(
      'https://app.drime.cloud/api/v1/workspace/1873/avatar',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={'avatar': avatar_base64}
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "workspace": {
      "id": 1873,
      "name": "My Workspace",
      "avatar": "https://app.drime.cloud/storage/workspace-avatars/abc123.png",
      "updated_at": "2025-12-20T10:00:00.000000Z"
    },
    "status": "success"
  }
  ```
</ResponseExample>
