# Upload the customer portal favicon

```http
POST https://secure.yoprint.com/v1/api/store/{team_slug}/setting/customer_portal_favicon
```

- API version: v1
- Operation ID: `v1_public_setting_customer_portal_favicon_update`
- Section: Team settings › [Company settings](https://developer.yoprint.com/reference/company-settings.md)
- Web page: https://developer.yoprint.com/reference/company-settings/v1-setting-customer-portal-favicon-update/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Uploads the favicon of your customer portal, the small icon in the browser tab, as `multipart/form-data` in the field `media`. It replaces the current one.

YoPrint checks the file's content, not its name: it must really be an ICO, PNG or JPEG file. A renamed file of another kind is refused, and SVG is not accepted. The file is saved with the type YoPrint found (`image/vnd.microsoft.icon` for an ICO).

The file is checked first, so a refused upload leaves the current favicon in place. Once the new one is saved, the old one is removed. The response has no data; read the company details for `favicon_url`.

## Permission

Needs the Manage Settings permission. The team owner always has it.

## Side effects

- Customers see the new icon the next time they open the portal.

## Path parameters

- `team_slug` (string, required): Your team slug, shown as Team ID next to your API key in Profile. Example `your-team`.

## Request body

Content type `multipart/form-data`, required.

Fields:

- `media` (string (binary), required): An ICO, PNG or JPEG file, at most 4096 KiB (4 MB). An ICO must be well formed, with 1 to 256 images, each a PNG or a bitmap.

### Example request

```bash
curl -X POST 'https://secure.yoprint.com/v1/api/store/your-team/setting/customer_portal_favicon' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1' \
  -H 'Content-Type: application/json' \
  -d '{
    "media": "string"
  }'
```

This example is built from the field types: replace each value with a real one.

## Response

`200` Successful response.

Fields:

- `data` (null, required)
- `status` (integer, required)
- `success` (boolean, required)

Example response:

```json
{
  "data": null,
  "status": 200,
  "success": true
}
```

## Errors

- `401` The API key is missing or wrong (`unauthenticated`).
- `403` You are not allowed to do this. `api_access_not_in_plan`: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only `{"message": "Insufficient Permission"}`. Other refusals use the error envelope, with `unauthorized` or `user_is_not_authorized`.
  - When: Your role lacks Manage Settings. The body is `{"message": "Insufficient Permission"}`, without the error envelope. Fix: Use the key of a member whose role has Manage Settings, or the owner's.
- `404` Not found. `page_not_found`: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. `code: null`, with a message that starts "No query results for": there is no record with that id.
- `422` Validation failed, or the image was refused by the media rules: a mockup that is not an image a preview can be made of (`mockup_type_not_allowed`), or an image over a size limit (`image_not_allowed`), or a file that is a web page, a script or a program (`validation_failed` on `media`, or `upload_not_allowed`: "This type of file cannot be uploaded."); `error.message` is one sentence naming the limit.
  - When: `media` is missing, larger than 4096 KiB, or not a valid ICO, PNG or JPEG file (`validation_failed`; `error.fields.media` says, for example, "The media must be a valid ICO, PNG, or JPEG file."). The current favicon stays. Fix: Upload one ICO, PNG or JPEG file.

## Related

- [Remove the customer portal favicon](https://developer.yoprint.com/reference/company-settings/v1-setting-customer-portal-favicon-delete.md): `DELETE /v1/api/store/{team_slug}/setting/customer_portal_favicon`
- [Get your company details](https://developer.yoprint.com/reference/company-settings/v1-setting-detail-show.md): `GET /v1/api/store/{team_slug}/setting/detail`
