This resource represents a notification that is received by an internal or a client user.

Note that List Notifications is available for all workspaces. Create Notification, Delete Notification, and Mark as Notification as Read/Unread are actions only available for [Custom Apps](https://docs.assembly.com/docs/custom-apps-overview).

## Properties

**id**`string`  
The unique identifier for this item.

**createdAt**`string`  
The date this item was created in RFC3339 format.

**object**`string`  
The object type of this resource.

**senderId**`string`  
The ID of the entity sending the notification. This can be an internal user / client user or a company. The type of the id is represented by `senderType`.

**senderType**`client / internalUser / company`  
The type of entity the `senderId` refers to.

~~**recipientId**`string`~~  
Deprecated in favor of recipientClientId, recipientCompanyId, and recipientInternalUserId.

**recipientClientId**`string`  
The ID of the client that this notification is intended for. This will be empty if the recipient is not a client.

**recipientCompanyId**`string`  
The ID of the company that this notification is intended for. This is paired with `recipientClientId` and represents which of the client's companies this notification is associated with.

**recipientInternalUserId**`string`  
The ID of the internal user that this notification is intended for. This will be empty if the recipient is not an internal user.

**event**`string`  
This represents the event the notification was issued for. Below is the set of events and the possible recipients.

| Event                      | Recipient/s    |
|---------------------------|----------------|
| files.created             | Internal users  |
| invoice.paid              | Internal users  |
| formResponse.completed     | Internal users  |
| contract.signed           | Internal users  |
| customApp.action          | Internal users  |
| invoice.requested         | Clients         |
| formResponse.requested    | Clients         |
| contract.requested        | Clients         |

**appId**`string` (optional)  
This is populated when the notification is created via a custom app. This contains the `appId` of the custom app that was used to create the notification.

**resourceId**`string`  
Contains the id of the resource associated with the notification. This refers to different entities based on the notification event:

| Notification             | Resource ID          |
|--------------------------|----------------------|
| invoice.paid             | invoice.id           |
| formResponse.<requested\|completed> | form.id             |
| contract.<requested\|signed>        | contract.id         |

**deliveryTargets**`object`  
This will have the following keys:

- `inProduct` - relevant to the notification delivered in the web app

◦ `title` _string_  
    Label used in the notification title in the web app

◦ `body` _string_  
    Used for custom app notifications. This contains the details of the notifications showed in the notifications page

◦ `isRead` _string_  
    Indicates if the notification has been read

◦ `ctaParams` _object_  
    Key/value pairs that will be included in the search parameters when clicking on the notification’s call to action in product. This call to action is shown in the Notification Center for internal users.

- `email` - relevant to the notification delivered via email (if applicable)

◦ `body` _string_  
    Body of the email sent

◦ `subject` _string_  
    Subject of the email sent

◦ `header` _string_  
    Header in the email body sent

◦ `title` _string_  
    CTA title shown in the email

◦ `ctaParams` _object_  
    Key/value pairs that will be included in the search parameters when clicking on an email notification’s call to action.

### Example Client Notification Object
```json
{
  "appId": "5b58089c-1e81-439c-b511-01e3e599c23d",
  "createdAt": "2024-02-22T18:17:01.577287641+05:30",
  "deliveryTargets": {
    "inProduct": {
      "title": "Task was completed",
      "body": "John Doe completed the Upload Logo task.",
      "isRead": false,
      "ctaParams": { "foo": "bar" }
    },
     "email": {
       "subject": "1 task was completed",
       "header": "A task was completed by John Doe",
       "body": "John Doe completed the Upload Logo task.",
       "title": "View Task",
       "ctaParams": { "foo": "bar" }
     }
  },
  "event": "customApp.action",
  "id": "bb9405f0-8644-4bb8-bbc8-84a1a05dcc01",
  "object": "notification",
  "recipientId": "5d686cec-6ef8-4394-a62c-0c2fde950669",
  "recipientClientId": "5d686cec-6ef8-4394-a62c-0c2fde950669",
  "recipientCompanyId": "d15b1422-2e57-42f3-a0ac-0a726d6e1b42",
  "resourceId": "3a5981d8-6619-4dc6-b9b9-a791d275bd5c",
  "senderId": "33da2a16-f525-4d4b-99c8-a273f6260f43",
  "senderType": "client"
}
```

### Example Internal User Notification Object
```json
{
  "appId": "5b58089c-1e81-439c-b511-01e3e599c23d",
  "createdAt": "2024-02-22T18:17:01.577287641+05:30",
  "deliveryTargets": {
    "inProduct": {
      "title": "Task was completed",
      "body": "John Doe completed the Upload Logo task.",
      "isRead": false,
      "ctaParams": { "foo": "bar" }
    },
     "email": {
       "subject": "1 task was completed",
       "header": "A task was completed by John Doe",
       "body": "John Doe completed the Upload Logo task.",
       "title": "View Task",
       "ctaParams": { "foo": "bar" }
     }
  },
  "event": "customApp.action",
  "id": "bb9405f0-8644-4bb8-bbc8-84a1a05dcc01",
  "object": "notification",
  "recipientId": "5d686cec-6ef8-4394-a62c-0c2fde950669",
  "recipientInternalUserId": "5d686cec-6ef8-4394-a62c-0c2fde950669",
  "resourceId": "3a5981d8-6619-4dc6-b9b9-a791d275bd5c",
  "senderId": "33da2a16-f525-4d4b-99c8-a273f6260f43",
  "senderType": "client"
}
```
