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

# Send Event Bulk

### Parameters

<Param path="app_id" type="string" required>
  The `id` of the app
</Param>

### Body

<Param body="event" type="string" required>
  The name of the event
</Param>

<Param body="batch" type="object[]" required>
  Batch of messages to be triggered

  <Expandable>
    <Param body="data" type="object">
      Example: `{ "param1" : "value1", "param2" : "value2", "param3" : "object or array" }`
    </Param>

    <Param body="user" type="object">
      <Expandable>
        <Param body="user_id" type="string">
          User's id to send the notifications to. This is your own user identifier which
          you have used to [create user on Raven](/api-reference/create-user)
        </Param>

        <Param body="email" type="string">
          User's email
        </Param>

        <Param body="mobile" type="string">
          Mobile with country code prefix (e.g +91)
        </Param>

        <Param body="whatsapp_mobile" type="string">
          Mobile with country code prefix (e.g +91)
        </Param>

        <Param body="onesignal_external_id" type="string">
          [OneSignal External User
          Ids](https://documentation.onesignal.com/docs/external-user-ids)
        </Param>

        <Param body="fcm_tokens" type="string[]">
          List of fcm tokens.

          eg. `["<fcmtoken1", "<fcmtoken2>"]`
        </Param>
      </Expandable>
    </Param>

    ### Additional Body Parameters

    <Param body="override" type="object">
      Overriding messages / integration configurations

      <Expandable>
        <Param body="email" type="object">
          <Expandable>
            <Param body="from" type="object">
              <Expandable>
                <Param body="name" type="string">
                  Sender's name
                </Param>

                <Param body="address" type="string">
                  Sender's email address
                </Param>
              </Expandable>
            </Param>

            <Param body="cc" type="object[]">
              <Expandable>
                <Param body="name" type="string">
                  Sender's name
                </Param>

                <Param body="address" type="string">
                  Sender's email address
                </Param>
              </Expandable>
            </Param>

            <Param body="bcc" type="object[]">
              <Expandable>
                <Param body="name" type="string">
                  Sender's name
                </Param>

                <Param body="address" type="string">
                  Sender's email address
                </Param>
              </Expandable>
            </Param>

            <Param body="attachments" type="object[]">
              <Expandable>
                <Param body="file_name" type="string">
                  Attachment file name
                </Param>

                <Param body="content" type="string">
                  base64 encoded value of the attachment
                </Param>

                <Param body="url" type="string">
                  Public URL of the file
                </Param>
              </Expandable>
            </Param>

            <Param body="message" type="object">
              <Expandable>
                <Param body="text" type="string">
                  Email Text Body
                </Param>

                <Param body="html_body" type="string">
                  Email HTML Body
                </Param>

                <Param body="subject" type="string">
                  Email Subject
                </Param>
              </Expandable>
            </Param>
          </Expandable>
        </Param>

        <Param body="sms" type="object">
          <Expandable>
            <Param body="message" type="object">
              Message

              <Param body="sender" type="string">
                Sender
              </Param>

              <Param body="text" type="string">
                SMS text
              </Param>
            </Param>
          </Expandable>
        </Param>

        <Param body="whatsapp" type="object">
          <Expandable>
            <Param body="message" type="object">
              Message

              <Param body="text" type="string">
                Whatsapp text
              </Param>
            </Param>
          </Expandable>
        </Param>

        <Param body="slack" type="object">
          <Expandable>
            <Param body="message" type="object">
              Message

              <Param body="text" type="string">
                Sender
              </Param>

              <Param body="blocks" type="object">
                Slack blocks object
              </Param>
            </Param>
          </Expandable>
        </Param>
      </Expandable>
    </Param>
  </Expandable>
</Param>

<RequestExample>
  ```json curl theme={null}
  curl 'https://api.ravenapp.dev/v1/apps/{{APP_ID}}/events/bulk_send' \
  -H 'Authorization: AuthKey {{API_KEY}}' \
  -H 'Content-Type: application/json' \
  -d '{
      "event": "sample_event_1",
      "batch": [
          {
              "user": {
                  "mobile": "+919876543210",
                  "email": "x@ravenapp.dev",
                  "whatsapp_mobile": "+919876543210", // if empty, `mobile` is considered for whatsapp
              },
              "data": {
                  "name": "John Doe",
  	              "date": "01 December 2020"
              }
          },
          {
              "user": {
                  "mobile": "+919876543210",
                  "email": "x@ravenapp.dev",
                  "whatsapp_mobile": "+919876543210", // if empty, `mobile` is considered for whatsapp
              },
              "data": {
                  "name": "John Doe",
  	              "date": "01 December 2020"
              }
          }
      ]
  }'
  ```

  ```java java  theme={null}
  RavenApiClient client = new RavenApiClient(Authorization.of("AuthKey <API_KEY>"));
        try {
            var response = ravenApiClient.sendBulk(SendBulk.Request.builder()
                          .appId("<APP_ID>")
                          .body(BulkSendEventRequest.builder()
                                  .event("event_1")
                                  .batch(BatchEvent.builder()
                                          .data(Map.of("name", "Sriyansh"))
                                          .user(User.builder().mobile("+918718181818").build())
                                          .build())
                                  .batch(BatchEvent.builder()
                                          .data(Map.of("name", "Priyansh"))
                                          .user(User.builder().mobile("+918718181818").build())
                                          .build())
                                  .build()
                          )
                          .build());
            System.out.println("Successfully sent a bulk request " + response.getId());
        } catch (SendBulkException e) {
            System.out.println("Failed to send bulk request" + e.getMessage());
        }
  }
  ```

  ```javascript node theme={null}
  const client = new RavenApi.Client({
    authorization: `AuthKey ${API_KEY}`,
  });

  const sendEventResponse = await raven.sendBulk({
    appId: "<APP_ID>",
    _body: {
      event: "sample_event_1",
      batch : [
        user: {
          mobile: "+919876543210",
          email: "x@ravenapp.dev",
          whatsapp_mobile: "+919876543210"
        },
        data: {
          name: "John Doe",
          date: "01 December 2020",
        },
        {
          mobile: "+919876543210",
          email: "x@ravenapp.dev",
          whatsapp_mobile: "+919876543210"
        },
        data: {
          name: "John Doe",
          date: "01 December 2020",
        }
      ]
    },
  });

  if (sendEventResponse.ok) {
    console.log(`The id of the event is ${sendEventResponse.body.id}`);
  } else {
    console.error("Failed to send event", sendEventResponse.error);
  }
  ```
</RequestExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.