> 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

# Search notification logs

POST https://api-sandbox.payabli.com/api/v2/notificationlogs
Content-Type: application/json

Search notification logs with filtering and pagination.
  - Start date and end date cannot be more than 30 days apart
  - Either `orgId` or `paypointId` must be provided

This endpoint requires the `notifications_create` OR `notifications_read` permission.

Reference: https://docs.payabli.com/developers/api-reference/notification-logs/search-notification-logs-with-filtering-and-pagination

## Authentication

- `Authorization` header (bearer token, required)
- `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

### Query parameters

- `PageSize` (integer, optional) — Number of records on each response page.
- `Page` (integer, optional) — The page number to retrieve. Defaults to 1 if not provided.

### Body (application/json)

- `startDate` (datetime, required) — The start date for the search.
- `endDate` (datetime, required) — The end date for the search.
- `notificationEvent` (string, optional) — The type of notification event to filter by.
- `succeeded` (boolean, optional) — Indicates whether the notification was successful.
- `orgId` (long, optional) — The ID of the organization to filter by.
- `paypointId` (long, optional) — The ID of the paypoint to filter by.

## Response

### 200

Success

- `list of object`
  - `id` (string, required) — The unique identifier for the notification.
  - `orgId` (long, required, nullable) — The ID of the organization that the notification belongs to.
  - `paypointId` (long, required, nullable) — The ID of the paypoint that the notification is related to.
  - `notificationEvent` (string, required, nullable) — The event that triggered the notification.
  - `target` (string, required, nullable) — The target URL for the notification.
  - `responseStatus` (string, required, nullable) — The HTTP response status of the notification.
  - `success` (boolean, required) — Indicates whether the notification was successful.
  - `jobData` (string, required, nullable) — Contains the body of the notification.
  - `createdDate` (datetime, required) — The date and time when the notification was created.
  - `successDate` (datetime, required, nullable) — The date and time when the notification was successfully delivered.
  - `lastFailedDate` (datetime, required, nullable) — The date and time when the notification last failed.
  - `isInProgress` (boolean, required) — Indicates whether the notification is currently in progress.

## Examples

**Request**

```json
{
  "startDate": "2024-01-01T00:00:00Z",
  "endDate": "2024-01-31T23:59:59Z",
  "notificationEvent": "ActivatedMerchant",
  "succeeded": true,
  "orgId": 123
}
```

**Response**

```json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "orgId": 123,
    "paypointId": 3040,
    "notificationEvent": "ActivatedMerchant",
    "target": "https://webhook.example.com/payments",
    "responseStatus": "200",
    "success": true,
    "jobData": "{\"transactionId\":\"txn_123\"}",
    "createdDate": "2024-01-15T10:30:00Z",
    "successDate": "2024-01-15T10:30:05Z",
    "lastFailedDate": null,
    "isInProgress": false
  }
]
```

**SDK Code**

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        clientId: "YOUR_CLIENT_ID",
        clientSecret: "YOUR_CLIENT_SECRET",
    });
    await client.notificationlogs.searchNotificationLogs({
        PageSize: 20,
        startDate: "2024-01-01T00:00:00Z",
        endDate: "2024-01-31T23:59:59Z",
        notificationEvent: "ActivatedMerchant",
        succeeded: true,
        orgId: 123,
    });
}
main();

```

```python
from payabli import payabli
import datetime

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.notificationlogs.search_notification_logs(
    page_size=20,
    start_date=datetime.datetime.fromisoformat("2024-01-01T00:00:00+00:00"),
    end_date=datetime.datetime.fromisoformat("2024-01-31T23:59:59+00:00"),
    notification_event="ActivatedMerchant",
    succeeded=True,
    org_id=123,
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.notificationlogs.requests.SearchNotificationLogsRequest;
import java.time.OffsetDateTime;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.notificationlogs().searchNotificationLogs(
            SearchNotificationLogsRequest
                .builder()
                .startDate(OffsetDateTime.parse("2024-01-01T00:00:00Z"))
                .endDate(OffsetDateTime.parse("2024-01-31T23:59:59Z"))
                .pageSize(20)
                .notificationEvent("ActivatedMerchant")
                .succeeded(true)
                .orgId(123L)
                .build()
        );
    }
}
```

```ruby
require "payabli"

client = Payabli::Client.new(api_key: "YOUR_API_KEY_HERE")

client.notificationlogs.search_notification_logs(
  page_size: 20,
  start_date: "2024-01-01T00:00:00Z",
  end_date: "2024-01-31T23:59:59Z",
  notification_event: "ActivatedMerchant",
  succeeded: true,
  org_id: 123
)

```

```csharp
using PayabliApi;
using System.Threading.Tasks;
using System;
using System.Globalization;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.Notificationlogs.SearchNotificationLogsAsync(
            new SearchNotificationLogsRequest {
                PageSize = 20,
                StartDate = DateTime.Parse("2024-01-01T00:00:00Z", null, DateTimeStyles.AdjustToUniversal),
                EndDate = DateTime.Parse("2024-01-31T23:59:59Z", null, DateTimeStyles.AdjustToUniversal),
                NotificationEvent = "ActivatedMerchant",
                Succeeded = true,
                OrgId = 123L
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    request := &payabli.SearchNotificationLogsRequest{
        PageSize: payabli.Int(
            20,
        ),
        StartDate: payabli.MustParseDateTime(
            "2024-01-01T00:00:00Z",
        ),
        EndDate: payabli.MustParseDateTime(
            "2024-01-31T23:59:59Z",
        ),
        NotificationEvent: payabli.String(
            "ActivatedMerchant",
        ),
        Succeeded: payabli.Bool(
            true,
        ),
        OrgId: payabli.Int64(
            int64(123),
        ),
    }
    client.Notificationlogs.SearchNotificationLogs(
        context.TODO(),
        request,
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\Notificationlogs\Requests\SearchNotificationLogsRequest;
use DateTime;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->notificationlogs->searchNotificationLogs(
    new SearchNotificationLogsRequest([
        'pageSize' => 20,
        'startDate' => new DateTime('2024-01-01T00:00:00Z'),
        'endDate' => new DateTime('2024-01-31T23:59:59Z'),
        'notificationEvent' => 'ActivatedMerchant',
        'succeeded' => true,
        'orgId' => 123,
    ]),
);

```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "startDate": "2024-01-01T00:00:00Z",
  "endDate": "2024-01-31T23:59:59Z",
  "notificationEvent": "ActivatedMerchant",
  "succeeded": true,
  "orgId": 123
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/v2/notificationlogs?PageSize=20")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```