# Alert block

Displays an alert, warning or informational message with a level-coloured icon.

| | |
|---|---|
| **Type** | `alert` |
| **Available in** | Messages, Modals, Home tab |

## Fields

| Field | Type | Description | Required? |
|---|---|---|---|
| `type` | String | The type of block. For an alert block, `type` is always `alert`. | Required |
| `text` | [Text object](https://workstation.repzo.com/docs/developers/block-kit/objects/text-object) | The alert message, using `plain_text` or `mrkdwn` formatting. Maximum 200 characters. | Required |
| `level` | String | One of `default`, `info`, `warning`, `error` or `success`. Defaults to `default`. | Optional |
| `block_id` | String | A unique identifier for the block. Maximum length is 255 characters. It must be unique within the message or view — a duplicate is replaced and reported as a warning. | Optional |

> **How Repzo Chat differs from Slack**
>
> - Slack shows alert blocks in modals only. Repzo shows them in messages and the Home tab too.
> - `text` may also be a plain string.

## Examples

### An info alert

```json
{
  "blocks": [
    {
      "type": "alert",
      "level": "info",
      "text": {
        "type": "mrkdwn",
        "text": "Prices on this quote are valid until *31 October*."
      }
    }
  ]
}
```

### Every level

```json
{
  "blocks": [
    {
      "type": "alert",
      "level": "success",
      "text": {
        "type": "plain_text",
        "text": "Invoice INV-7731 was paid in full."
      }
    },
    {
      "type": "alert",
      "level": "warning",
      "text": {
        "type": "plain_text",
        "text": "Stock for SKU-2210 is below the reorder point."
      }
    },
    {
      "type": "alert",
      "level": "error",
      "text": {
        "type": "plain_text",
        "text": "The sync with the ERP failed. Retrying in 5 minutes."
      }
    },
    {
      "type": "alert",
      "text": {
        "type": "plain_text",
        "text": "This channel is archived on 1 November."
      }
    }
  ]
}
```

## Related

- [Blocks](https://workstation.repzo.com/docs/developers/block-kit/blocks)
- [Block Kit overview](https://workstation.repzo.com/docs/developers/block-kit)
