> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Get notification

GET https://api-sandbox.payabli.com/api/Notification/{nId}

Retrieves a single notification or autogenerated report's details.

Reference: https://docs.payabli.com/developers/api-reference/notification/get-notification

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.
- `requestToken` header (required) — Long-lived API token sent in the `requestToken` header. See [API token authentication](/developers/api-tokens).

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Path parameters

- `nId` (string, required) — Notification ID.

## Response

### 200

Success

- `content` (NotificationContent, optional) — Notification content.
- `createdAt` (datetime, optional) — Timestamp of when notification was created.
- `frequency` (enum, optional) — Frequency for notifications.
  - Allowed values: `one-time`, `daily`, `weekly`, `biweekly`, `monthly`, `quarterly`, `semiannually`, `annually`, `untilcancelled`
- `lastUpdated` (datetime, optional) — Timestamp of when notification was last updated.
- `method` (enum, optional) — Method to use to send the notification to the target.
  - Allowed values: `email`, `sms`, `web`, `report-email`, `report-web`
- `notificationId` (long, optional) — The notification's Payabli identifier. This is the ID used to manage the notification.
- `ownerId` (integer, optional) — ID for the paypoint or organization that owns the notification. If the `ownerType` field is `0`, this field is the same as the `orgId` for the organization that owns this notification. If the `ownerType` field is `2`, this field is the same as the `paypointId` for the paypoint that owns this notification.
- `ownerName` (string, optional) — Name of entity owner of notification.
- `ownerType` (integer, optional) — Entity owner type. Accepted values: - `0`: Organization/partner - `2`: Paypoint
- `source` (string, optional) — Custom descriptor of source of notification.
- `status` (integer, optional) — Status of notification: - `0`: Inactive - `1`: Active
- `target` (string, optional) — Specify the notification target. For `method`=`email` the expected value is a list of email addresses separated by semicolon. For `method`=`sms` the expected value is a list of phone numbers separated by semicolon. For `method`=`web` the expected value is a valid and complete URL. Webhooks support only standard HTTP ports: 80, 443, 8080, or 4443.

## Errors

### 400 Bad Request Error

Bad request / invalid data.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 401 Unauthorized Error

Unauthorized request.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 500 Internal Server Error

Internal server error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 503 Service Unavailable Error

Database connection error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

## Types

### NotificationContent

- `eventType` (string, optional) — The notification's event name.
- `fileFormat` (enum, optional) — Indicate the format of report file to be generated by the engine. Used for `method` = *report-email* and *report-web*.
  - Allowed values: `json`, `csv`, `xlsx`
- `internalData` (list of KeyValueDuo, optional) — Array of pairs key:value to insert in request body to target in **method** = *web* or *report-web*.
- `reportName` (enum, optional) — The kind report to generate. For [automated reports](/developers/developer-guides/notifications-and-webhooks-overview#automated-reports) only.
  - Allowed values: `Transaction`, `Settlement`, `Boarding`, `Returned`
- `timeZone` (integer, optional) — Timezone, in UTC offset. For example, -5 is Eastern time.
- `transactionId` (string, optional, default: 0) — Used internally to reference the entity or object generating the event.
- `webHeaderParameters` (list of KeyValueDuo, optional) — Array of pairs key:value to insert in header of request to target in **method** = *web* or *report-web*.

### PayabliErrorBodyResponseData

Object with detailed error context.

- `explanation` (string, optional) — Human-readable explanation of what happened.
- `todoAction` (string, optional) — Suggested resolution.

### KeyValueDuo

- `key` (string, optional) — Key name.
- `value` (string, optional) — Key value.

## Examples

**Response**

```json
{
  "content": {
    "fileFormat": "csv",
    "reportName": "Returned"
  },
  "createdAt": "2024-02-21T09:16:31Z",
  "frequency": "weekly",
  "lastUpdated": "2024-02-21T09:16:31Z",
  "method": "report-email",
  "notificationId": 1717,
  "ownerId": 123,
  "ownerName": "The Pilgrim Planner",
  "ownerType": 0,
  "status": 1,
  "target": "admin@business.com"
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.payabli.com/api/Notification/1717"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/Notification/1717';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/Notification/1717"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/Notification/1717")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-sandbox.payabli.com/api/Notification/1717")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-sandbox.payabli.com/api/Notification/1717', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/Notification/1717");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Notification/1717")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```