# Update a banner

`PATCH https://api.cademi.com.br/api/v3/banners/{banner_id}`

Operation ID: `banners.update` · API v3

Updates an existing content banner. Only the fields included in the request are changed.

Updating `status` requires the `banners.publish` permission in addition to `banners.update`. Setting `deleted` to `false` restores a banner from the trash. Changing the banner `type` is subject to the same layout availability rule as creation.

Send the `ETag` returned by the retrieve operation in the `If-Match` header to prevent overwriting changes made since the banner was retrieved.

Replicated banners accept only `status` updates. Including any other field returns `403` with the `replica_readonly` error code.

Required permissions: `banners.update`, `banners.publish`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `banner_id` | path | string | yes |  |
| `If-Match` | header | string | no |  |

## Request body

Content type: `application/json`.

Schema: object.

## Responses

### 200

Returns the updated banner.

Body: `data`: Banner.

Fields of Banner:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string (date-time) | yes |  |
| `deleted` | boolean | yes |  |
| `html` | string or null | no |  |
| `id` | string | yes | Public ID of the banner, prefixed with ban_. |
| `images` | object | yes |  |
| `link` | object | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `banner` | yes |  |
| `position` | integer | yes |  |
| `revision` | string | yes |  |
| `showcases` | array of string | yes |  |
| `status` | string, one of `active`, `inactive` | yes |  |
| `type` | string, one of `netflix`, `simple`, `html` | yes |  |
| `updated_at` | string (date-time) | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The banner was not found or is not accessible with the current credentials.

Body: Error.

### 412

The banner has changed since the supplied revision was retrieved.

Body: Error.

### 422

The request contains invalid data, or the selected banner type is not available for the account's current layout.

Body: Error.

Full schema: https://cademi.dev/openapi/v3.json
