# ai.newnal.mydata.interactionPreferencesNotifications

> Notification preferences and service settings from the user's point of view: the time window in which the user wants to receive notifications, and the notification preferences by purpose, each of which is one item of this section. Actually sending notifications and applying these preferences is up to each service; this is not a security or access control policy enforced on every service.

- Kind: record
- Record key: any
- Authority: mydata.newnal.ai
- Lexicon: 1
- Published by [newnal-platform.newnal.id](https://lexicon.garden/identity/did:plc:vciktevzoffubdvdaajz2yp3), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.mydata.interactionPreferencesNotifications)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.mydata.interactionPreferencesNotifications/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:vciktevzoffubdvdaajz2yp3/ai.newnal.mydata.interactionPreferencesNotifications/analytics)

## Record (`ai.newnal.mydata.interactionPreferencesNotifications`)

Type: record · key any

### Properties

- `_meta` (ref, required)
  - Reference: `ai.newnal.mydata.defs#recordMeta`
- `data` (union, required)
  - One of (closed): `#section`, `#entry`

## #entry (`ai.newnal.mydata.interactionPreferencesNotifications#entry`)

Type: object

The notification preference for one purpose.

### Properties

- `allowedChannels` (array): List of the channels on which the user wants to receive notifications for this purpose.
  - Constraints: maxLength: 100
  - `items` (string): One item of the list of the channels on which the user wants to receive notifications for this purpose.
    - Constraints: maxLength: 640, maxGraphemes: 64, knownValues: push | sms | email
- `notes` (string): An additional note.
  - Constraints: maxLength: 30000, maxGraphemes: 3000
- `purpose` (string): The purpose or use this notification preference applies to.
  - Constraints: maxLength: 640, maxGraphemes: 64, knownValues: marketing | security | reminder | system_alert | billing | delivery
- `unavailableTimePolicy` (string): How the user wants notifications for this purpose handled outside the time window in which they want to receive notifications (allow: receive them, urgent_only: only urgent ones, block: do not receive them). Enforcement is up to each service.
  - Constraints: enum: allow | urgent_only | block

## #section (`ai.newnal.mydata.interactionPreferencesNotifications#section`)

Type: object

Notification preferences and service settings from the user's point of view: the time window in which the user wants to receive notifications, and the notification preferences by purpose, each of which is one item of this section. Actually sending notifications and applying these preferences is up to each service; this is not a security or access control policy enforced on every service.

### Properties

- `availableTime` (ref)
  - Reference: `#sectionAvailableTime`

## #sectionAvailableTime (`ai.newnal.mydata.interactionPreferencesNotifications#sectionAvailableTime`)

Type: object

The time window in which the user wants to receive notifications.

### Properties

- `days` (array): List of the weekdays the time window applies to.
  - Constraints: maxLength: 7
  - `items` (ref): One item of the list of the weekdays the time window applies to.
    - Reference: `ai.newnal.mydata.defs#weekday`
- `end` (ref): The end time of the time window.
  - Reference: `ai.newnal.mydata.defs#localTime`
- `start` (ref): The start time of the time window.
  - Reference: `ai.newnal.mydata.defs#localTime`
- `timezone` (string): The IANA time zone in which times are read (for example Asia/Seoul).
  - Constraints: maxLength: 640, maxGraphemes: 64

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "entry": {
      "description": "The notification preference for one purpose.",
      "properties": {
        "allowedChannels": {
          "description": "List of the channels on which the user wants to receive notifications for this purpose.",
          "items": {
            "description": "One item of the list of the channels on which the user wants to receive notifications for this purpose.",
            "knownValues": [
              "push",
              "sms",
              "email"
            ],
            "maxGraphemes": 64,
            "maxLength": 640,
            "type": "string"
          },
          "maxLength": 100,
          "type": "array"
        },
        "notes": {
          "description": "An additional note.",
          "maxGraphemes": 3000,
          "maxLength": 30000,
          "type": "string"
        },
        "purpose": {
          "description": "The purpose or use this notification preference applies to.",
          "knownValues": [
            "marketing",
            "security",
            "reminder",
            "system_alert",
            "billing",
            "delivery"
          ],
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "unavailableTimePolicy": {
          "description": "How the user wants notifications for this purpose handled outside the time window in which they want to receive notifications (allow: receive them, urgent_only: only urgent ones, block: do not receive them). Enforcement is up to each service.",
          "enum": [
            "allow",
            "urgent_only",
            "block"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "Notification preferences and service settings from the user's point of view: the time window in which the user wants to receive notifications, and the notification preferences by purpose, each of which is one item of this section. Actually sending notifications and applying these preferences is up to each service; this is not a security or access control policy enforced on every service.",
      "key": "any",
      "record": {
        "properties": {
          "_meta": {
            "ref": "ai.newnal.mydata.defs#recordMeta",
            "type": "ref"
          },
          "data": {
            "closed": true,
            "refs": [
              "#section",
              "#entry"
            ],
            "type": "union"
          }
        },
        "required": [
          "data",
          "_meta"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "section": {
      "description": "Notification preferences and service settings from the user's point of view: the time window in which the user wants to receive notifications, and the notification preferences by purpose, each of which is one item of this section. Actually sending notifications and applying these preferences is up to each service; this is not a security or access control policy enforced on every service.",
      "properties": {
        "availableTime": {
          "ref": "#sectionAvailableTime",
          "type": "ref"
        }
      },
      "type": "object"
    },
    "sectionAvailableTime": {
      "description": "The time window in which the user wants to receive notifications.",
      "properties": {
        "days": {
          "description": "List of the weekdays the time window applies to.",
          "items": {
            "description": "One item of the list of the weekdays the time window applies to.",
            "ref": "ai.newnal.mydata.defs#weekday",
            "type": "ref"
          },
          "maxLength": 7,
          "type": "array"
        },
        "end": {
          "description": "The end time of the time window.",
          "ref": "ai.newnal.mydata.defs#localTime",
          "type": "ref"
        },
        "start": {
          "description": "The start time of the time window.",
          "ref": "ai.newnal.mydata.defs#localTime",
          "type": "ref"
        },
        "timezone": {
          "description": "The IANA time zone in which times are read (for example Asia/Seoul).",
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "id": "ai.newnal.mydata.interactionPreferencesNotifications",
  "lexicon": 1
}
```
