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

# Send broadcast notifications with the Python SDK

> Use the SuprSend Python SDK to send broadcast notifications to a list of subscribers, with code examples for setting up the broadcast request and payload.

## Pre-requisites

[Create a list of users](/docs/python-lists)

## Trigger broadcast

You can trigger broadcast using `supr_client.subscriber_lists.broadcast()` method.

<CodeGroup>
  ```python Request theme={"system"}
  from suprsend import Suprsend,  SuprsendAPIException, SubscriberListBroadcast

  supr_client = Suprsend(
    "_workspace_key_",
    "_workspace_secret_"
  )

  broadcast_body = {
  "list_id": "_list_id_",
  "template": "_template_slug_",
  "notification_category": "promotional",

  ## ---- Optional Parameters ------
  "data": {
    "key1": "value1",
    "key2": "value2"
  },
  "channels": [], # Channel keys - email, sms, whatsapp, androidpush, iospush, ms_teams, slack, webpush
  "delay": "xxdxxhxxmxxs",
  "trigger_at": "ISO 8601 timestamp"
  }

  inst = SubscriberListBroadcast(body=broadcast_body)
  resp = supr_client.subscriber_lists.broadcast(inst)
  print(resp)
  ```

  ```python Sample theme={"system"}
  from suprsend import Suprsend,  SuprsendAPIException, SubscriberListBroadcast

  supr_client = Suprsend(
    "_workspace_key_",
    "_workspace_secret_"
  )

  broadcast_body = {
  "list_id": "application_abandoned",
  "template": "complete_application",
  "notification_category": "promotional",
  # "channels": ["iospush"],
  # "delay": "30m",
  # "trigger_at": "2022-12-27T11:14:51.643Z",
  "data": {
    	"page_no": "2"
  	}
  }

  inst = SubscriberListBroadcast(body=broadcast_body)
  resp = supr_client.subscriber_lists.broadcast(inst)
  print(resp)
  ```

  ```python Response theme={"system"}
  {
    'success': True,
    'status': 'success',
    'status_code': 202,
    'message': 'OK'
  }
  ```
</CodeGroup>

Broadcast body field description:

| Parameter              | Description                                                                                                                                                                                  |   |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| list\_id               | list of users that you want to send broadcast messages to.                                                                                                                                   |   |
| template               | Add template slug here. You can get this slug by selecting the clipboard icon next to the Template name on SuprSend templates page. It is the same for all channels                          |   |
| notification\_category | Preference Category to apply user preference settings while sending. Root categories- system / transactional / promotional                                                                   |   |
| data                   | variable data defined in templates or workflow                                                                                                                                               |   |
| channels               | Specify channels if you don't want to send notification of all live channels in the template. Available channel keys - email, SMS, WhatsApp, androidpush, iospush, ms\_teams, slack, webpush |   |
| delay                  | Broadcast will be halted for the time mentioned in delay, and become active once the delay period is over. Example: 1d2h3m4s / 60                                                            |   |
| trigger\_at            | Trigger broadcast on a specific date-time. Pass in ISO 8601 timestamp (for example "2021-08-27T20:14:51.643Z")                                                                               |   |

***
