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

# Atualizar insell

> Atualiza um insell da ação, incluindo troca de tipo

Atualização parcial: envie apenas os campos que deseja alterar. Aceita os mesmos campos do [criar insell](/api-reference/insells/criar-insell), todos opcionais.

<Warning>
  **Regras de tipo e configuração** (idênticas a upsells/presells):

  * Os objetos `custom`/`iframe` são **substituição total** — envie o objeto completo.
  * **Trocar o `type` exige a configuração do novo tipo na mesma requisição.** Mudar para `simple` exige o objeto `simple: { button_text, button_url }`.
  * Objeto de configuração que não corresponde ao tipo retorna `INSELL_CONFIG_TYPE_MISMATCH`.
</Warning>

## Path params

<ParamField path="id" type="string" required>ID da ação (UUID).</ParamField>
<ParamField path="insell_id" type="string" required>ID do insell (UUID).</ParamField>

## Erros

| HTTP  | Código                    | Quando ocorre                                       |
| ----- | ------------------------- | --------------------------------------------------- |
| `404` | `INSELL_NOT_FOUND`        | Insell inexistente, de outra ação ou de outra conta |
| `400` | `NO_FIELDS_TO_UPDATE`     | Nenhum campo enviado                                |
| `400` | demais códigos `INSELL_*` | Mesmas regras de validação do criar                 |

<RequestExample>
  ```bash trocar para iframe theme={null}
  curl -u "pb_xxx:sk_xxx" -X PUT \
    -H "Content-Type: application/json" \
    -d '{
      "type": "iframe",
      "iframe": { "type": "fullscreen", "url": "https://insell.cliente.digital/" }
    }' \
    "https://api.sortify.com.br/v1/raffles/{id}/insells/{insell_id}"
  ```

  ```bash desativar theme={null}
  curl -u "pb_xxx:sk_xxx" -X PUT \
    -H "Content-Type: application/json" \
    -d '{ "is_active": false }' \
    "https://api.sortify.com.br/v1/raffles/{id}/insells/{insell_id}"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Insell atualizado com sucesso",
    "data": {
      "id": "4b3a2c1d-0e9f-8a7b-6c5d-e4f3a2b1c0d9",
      "type": "iframe",
      "title": "Oferta parceira",
      "description": null,
      "display_order": 0,
      "iframe": { "type": "fullscreen", "url": "https://insell.cliente.digital/" },
      "is_active": true,
      "created_at": "2026-07-06T12:00:00.000Z",
      "updated_at": "2026-07-06T12:10:00.000Z"
    }
  }
  ```
</ResponseExample>
