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

# Create notification

> Create Calendar notifications, either one or multiple. All notification settings must be for single calendar only

Create Calendar notifications, either one or multiple. All notification settings must be for single calendar only

```http theme={null}
POST https://services.leadconnectorhq.com/calendars/{calendarId}/notifications
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="calendarId" type="string" required />

## Body

Body type: `array`

## Respuestas

<Accordion title="200 - Successful response">
  ```json theme={null}
  [
    {
      "_id": "string",
      "receiverType": "contact",
      "additionalEmailIds": [
        "example1@email.com",
        "example2@email.com"
      ],
      "additionalPhoneNumbers": [
        "+919876744444",
        "+919876744445"
      ],
      "channel": "email",
      "notificationType": "confirmation",
      "isActive": true,
      "additionalWhatsappNumbers": [
        "+919876744444",
        "+919876744445"
      ],
      "templateId": "0as9d8as0d",
      "body": "This is a test notification",
      "subject": "Test Notification",
      "afterTime": [
        {
          "timeOffset": 1,
          "unit": "hours"
        }
      ],
      "beforeTime": [
        {
          "timeOffset": 1,
          "unit": "hours"
        }
      ],
      "selectedUsers": [
        "user1",
        "user2"
      ],
      "deleted": false
    // truncado: 2 lineas mas
  ]
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://services.leadconnectorhq.com/calendars/YOUR_calendarId/notifications' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '[
    {
      "receiverType": "contact",
      "channel": "email",
      "notificationType": "booked",
      "isActive": true,
      "templateId": "string",
      "body": "string",
      "subject": "string",
      "afterTime": [
        {
          "timeOffset": 1,
          "unit": "hours"
        }
      ],
      "beforeTime": [
        {
          "timeOffset": 1,
          "unit": "hours"
        }
      ],
      "additionalEmailIds": [
        "example1@email.com",
        "example2@email.com"
      ],
      "additionalPhoneNumbers": [
        "+919876744444",
        "+919876744445"
      ],
      "selectedUsers": [
        "userId1",
        "userId2",
        "sub_account_admin"
      ],
      "fromAddress": "string",
      "fromName": "string",
      "fromNumber": "string"
    }
  ]'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/calendars/YOUR_calendarId/notifications', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify([{"receiverType": "contact", "channel": "email", "notificationType": "booked", "isActive": true, "templateId": "string", "body": "string", "subject": "string", "afterTime": [{"timeOffset": 1, "unit": "hours"}], "beforeTime": [{"timeOffset": 1, "unit": "hours"}], "additionalEmailIds": ["example1@email.com", "example2@email.com"], "additionalPhoneNumbers": ["+919876744444", "+919876744445"], "selectedUsers": ["userId1", "userId2", "sub_account_admin"], "fromAddress": "string", "fromName": "string", "fromNumber": "string"}]),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'POST',
      'https://services.leadconnectorhq.com/calendars/YOUR_calendarId/notifications',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json=[{"receiverType": "contact", "channel": "email", "notificationType": "booked", "isActive": true, "templateId": "string", "body": "string", "subject": "string", "afterTime": [{"timeOffset": 1, "unit": "hours"}], "beforeTime": [{"timeOffset": 1, "unit": "hours"}], "additionalEmailIds": ["example1@email.com", "example2@email.com"], "additionalPhoneNumbers": ["+919876744444", "+919876744445"], "selectedUsers": ["userId1", "userId2", "sub_account_admin"], "fromAddress": "string", "fromName": "string", "fromNumber": "string"}],
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/calendars/YOUR_calendarId/notifications');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode([{'receiverType': 'contact', 'channel': 'email', 'notificationType': 'booked', 'isActive': true, 'templateId': 'string', 'body': 'string', 'subject': 'string', 'afterTime': [{'timeOffset': 1, 'unit': 'hours'}], 'beforeTime': [{'timeOffset': 1, 'unit': 'hours'}], 'additionalEmailIds': ['example1@email.com', 'example2@email.com'], 'additionalPhoneNumbers': ['+919876744444', '+919876744445'], 'selectedUsers': ['userId1', 'userId2', 'sub_account_admin'], 'fromAddress': 'string', 'fromName': 'string', 'fromNumber': 'string'}]),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
