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

# Update Team Profile Images

> Uploads, replaces, or deletes team profile images (logo and up to 3 additional images).

# Update Team Profile Images

Uploads, replaces, or deletes team profile images, including the team logo and up to 3 additional images. Only team administrators can call this endpoint.

## Authentication

Requires a valid customer bearer token. The customer must be a team administrator of the specified team.

## Path Parameters

<ParamField path="teamId" type="number" required>
  Numeric identifier of the team. Returned as `Id` in the `Records` array from [`GET /api/public/teams/my`](/api/endpoints/teams/list-teams).
</ParamField>

## Request Body

The request body can include **either** Base64-encoded images to upload/replace **or** delete flags to remove existing images. You can combine both in a single request.

### Upload or Replace Images

Provide the full Base64-encoded image data (including the data URI prefix, e.g. `data:image/png;base64,...`) for any image you want to upload or replace.

<ParamField body="Base64TeamLogo" type="string">
  Full Base64-encoded string for the team logo, including the data URI prefix (e.g. `data:image/png;base64,iVBORw0KGgo...`). Omit or set to `null` to leave unchanged.
</ParamField>

<ParamField body="Base64TeamImage1" type="string">
  Full Base64-encoded string for the first team image. Omit or set to `null` to leave unchanged.
</ParamField>

<ParamField body="Base64TeamImage2" type="string">
  Full Base64-encoded string for the second team image. Omit or set to `null` to leave unchanged.
</ParamField>

<ParamField body="Base64TeamImage3" type="string">
  Full Base64-encoded string for the third team image. Omit or set to `null` to leave unchanged.
</ParamField>

### Delete Images

Set the corresponding delete flag to `true` to remove an existing image.

<ParamField body="DeleteTeamLogo" type="boolean">
  Set to `true` to delete the current team logo. Default is `false`.
</ParamField>

<ParamField body="DeleteTeamImage1" type="boolean">
  Set to `true` to delete the current first team image. Default is `false`.
</ParamField>

<ParamField body="DeleteTeamImage2" type="boolean">
  Set to `true` to delete the current second team image. Default is `false`.
</ParamField>

<ParamField body="DeleteTeamImage3" type="boolean">
  Set to `true` to delete the current third team image. Default is `false`.
</ParamField>

## Response

Returns HTTP `200 OK` with an empty body on success.

## Examples

### Upload a new team logo

```http theme={null}
PATCH /api/public/teams/55/profile/images
Authorization: Bearer {token}
Content-Type: application/json
```

```json theme={null}
{
  "Base64TeamLogo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
}
```

```
Status: 200 OK
Body: (empty)
```

### Delete an existing team image

```http theme={null}
PATCH /api/public/teams/55/profile/images
Authorization: Bearer {token}
Content-Type: application/json
```

```json theme={null}
{
  "DeleteTeamImage1": true
}
```

```
Status: 200 OK
Body: (empty)
```

### Replace logo and delete an old image in one request

```http theme={null}
PATCH /api/public/teams/55/profile/images
Authorization: Bearer {token}
Content-Type: application/json
```

```json theme={null}
{
  "Base64TeamLogo": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
  "DeleteTeamImage2": true
}
```

```
Status: 200 OK
Body: (empty)
```

## TypeScript Integration

```typescript theme={null}
import { endpoints } from '@/api/endpoints'

const updateTeamImages = async (
  teamId: number,
  imagePayload: {
    base64TeamLogo?: string | null
    base64TeamImage1?: string | null
    base64TeamImage2?: string | null
    base64TeamImage3?: string | null
    deleteTeamLogo?: boolean
    deleteTeamImage1?: boolean
    deleteTeamImage2?: boolean
    deleteTeamImage3?: boolean
  }
) => {
  await httpClient.patch(
    endpoints.teams.patchImages(teamId),
    imagePayload
  )
}
```

## Usage in Portal

| Context                                                        | Source file                                                          |
| -------------------------------------------------------------- | -------------------------------------------------------------------- |
| Team Professional Profile Page (`/team/profile/{teamId}`)      | `src/views/user/team/profile/TeamProfessionalProfilePage.tsx`        |
| Team Professional Profile form component (image upload fields) | `src/views/user/team/profile/components/TeamProfessionalProfile.tsx` |

## Error Responses

<ResponseField name="401 Unauthorized" type="error">
  The customer is not authenticated or the session has expired.
</ResponseField>

<ResponseField name="403 Forbidden" type="error">
  The customer is not an administrator of the specified team.
</ResponseField>

<ResponseField name="400 Bad Request" type="error">
  Invalid request data — for example, malformed Base64 encoding.
</ResponseField>

<ResponseField name="404 Not Found" type="error">
  Team with the specified ID does not exist.
</ResponseField>

## Related Endpoints

| Method | Endpoint                             | Description                |
| ------ | ------------------------------------ | -------------------------- |
| `PUT`  | `/api/public/teams/{teamId}/profile` | Update team profile fields |
| `GET`  | `/api/public/teams/{teamId}/profile` | Get current team profile   |
| `GET`  | `/api/public/teams/my`               | List the customer's teams  |
| `GET`  | `/api/public/teams/{teamId}/kpi`     | Team KPI metrics           |
