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

# Get Notifications

Use this API to retrieve notifications.

<Warning>
  Use this for SDK v3 or prior versions.
</Warning>

# Endpoint

`POST https://api.velt.dev/v1/notifications/get`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="organizationId" type="string" required>
      Organization ID
    </ParamField>

    <ParamField body="documentId" type="string">
      Document ID
    </ParamField>

    <ParamField body="locationId" type="string">
      Location ID
    </ParamField>

    <ParamField body="userId" type="string">
      User ID
    </ParamField>

    <ParamField body="notificationIds" type="string[]">
      Array of Notification IDs. Limit: Only 30 items can be passed at a time.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### 1. Get by organizationId, documentId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId"
  }
}
```

#### 2. Get by organizationId, documentId and notificationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "notificationIds": [
      "yourNotificationId"
    ]
  }
}
```

#### 3. Get by organizationId, documentId and locationId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationId": "yourLocationId"
  }
}
```

#### 4. Get by organizationId, documentId, locationId and notificationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "locationId": "yourLocationId",
    "notificationIds": [
      "yourNotificationId"
    ]
  }
}
```

#### 5. Get by organizationId and userId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "userId": "yourUserId"
  }
}
```

#### 6. Get by organizationId, userId and notificationIds

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "userId": "yourUserId",
    "notificationIds": [
      "yourNotificationId"
    ]
  }
}
```

#### 7. Get by organizationId, documentId and userId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "userId": "yourUserId"
  }
}
```

#### 8. Get by organizationId, locationId and userId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "userId": "yourUserId",
    "locationId": "yourLocationId"
  }
}
```

#### 9. Get by organizationId, documentId, locationId, and userId

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "userId": "yourUserId",
    "locationId": "yourLocationId"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Notification(s) retrieved successfully.",
    "data": [
      {
        "id": "notificationId",
        "notificationSource": "custom",
        "notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation
        "actionUser": {
          "email": "user@example.com",
          "name": "User Name",
          "userId": "yourUserId"
        },
        "displayBodyMessage": "This is body message (Secondary message)",
        "displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
        "displayHeadlineMessageTemplateData": {
          "actionUser": {
            "email": "user@example.com",
            "name": "User Name",
            "userId": "yourUserId"
          },
          "recipientUser": {
            "email": "recipient@example.com",
            "name": "Recipient Name",
            "userId": "recipientUserId"
          },
          "yourCustomVariableWithStringValue": "Variable will be replaced with this text"
        },
        "metadata": {
          "apiKey": "yourApiKey",
          "documentId": "yourDocumentId",
          "organizationId": "yourOrganizationId"
        },
        "notifyUsers": {
          "yourNotifyUserId": true
        },
        "notifyUsersByUserId": {
          "yourNotifyUserById": true
        },
        "timestamp": 1722409519944
      }
    ]
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Notification(s) retrieved successfully.",
      "data": [
        {
          "id": "notificationId",
          "notificationSource": "custom",
          "notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation
          "actionUser": {
            "email": "user@example.com",
            "name": "User Name",
            "userId": "yourUserId"
          },
          "displayBodyMessage": "This is body message (Secondary message)",
          "displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
          "displayHeadlineMessageTemplateData": {
            "actionUser": {
              "email": "user@example.com",
              "name": "User Name",
              "userId": "yourUserId"
            },
            "recipientUser": {
              "email": "recipient@example.com",
              "name": "Recipient Name",
              "userId": "recipientUserId"
            },
            "yourCustomVariableWithStringValue": "Variable will be replaced with this text"
          },
          "metadata": {
            "apiKey": "yourApiKey",
            "documentId": "yourDocumentId",
            "organizationId": "yourOrganizationId"
          },
          "notifyUsers": {
            "yourNotifyUserId": true
          },
          "notifyUsersByUserId": {
            "yourNotifyUserById": true
          },
          "timestamp": 1722409519944
        }
      ]
    }
  }
  ```
</ResponseExample>
