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

# Replace Integration Icon

> Upload a new icon for an integration

Replaces the icon for an integration. Send the image as `multipart/form-data` in an `icon` file field.

## Base URL

```
https://api.langdock.com/integrations/v1/{integrationId}/icon
```

<Warning>
  **Dedicated deployments**

  Replace `api.langdock.com` with `<your-deployment-url>/api/public` in all requests.
</Warning>

## Required Scopes

This endpoint requires the `INTEGRATION_API` scope.

## Parameters

| Parameter       | Type   | Required | Description             |
| --------------- | ------ | -------- | ----------------------- |
| `integrationId` | string | Yes      | UUID of the integration |

The request body is `multipart/form-data` with an `icon` file field. Upload an image such as PNG, JPEG, or WebP. The resized icon must stay within 20 MB.

## Example

```javascript theme={null}
const axios = require("axios");
const FormData = require("form-data");
const fs = require("fs");

async function replaceIcon(integrationId) {
  const form = new FormData();
  form.append("icon", fs.createReadStream("icon.png"));

  const response = await axios.put(
    `https://api.langdock.com/integrations/v1/${integrationId}/icon`,
    form,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        ...form.getHeaders()
      }
    }
  );

  console.log("Icon URL:", response.data.iconUrl);
}

replaceIcon("550e8400-e29b-41d4-a716-446655440000");
```

## Response Format

### Success Response (200 OK)

```typescript theme={null}
{
  iconUrl: string;
}
```

## Error Handling

| Status Code | Description                                                                            |
| ----------- | -------------------------------------------------------------------------------------- |
| 400         | Invalid integration ID, missing `icon` file, unsupported image type, or file too large |
| 401         | Invalid or missing API key                                                             |
| 403         | No access to this integration                                                          |
| 404         | Integration not found                                                                  |
| 429         | Rate limit exceeded                                                                    |

<Info>
  Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on [API Key Best Practices](/en/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices).
</Info>
