Takazudo Modular Docs

Type to search...

to open search from anywhere

Admin Notify Archives List

Admin Notify Archives List

List archived notify subscriptions with pagination support.

Endpoint

POST /api/admin/notify/archives/list

Authentication

Requires Bearer token authentication.

Authorization: Bearer <ADMIN_API_TOKEN>

Request

Headers

HeaderRequiredValue
Content-TypeYesapplication/json
AuthorizationYesBearer <token>

Body

interface AdminArchiveListRequest {
  page?: number;        // Page number (1-based, default: 1)
  pageSize?: number;    // Items per page (default: 20, max: 100)
  productSlug?: string; // Filter by product slug
  status?: string;      // Filter by original status
}

Parameters

FieldTypeRequiredDefaultDescription
pagenumberNo1Page number (1-based)
pageSizenumberNo20Items per page (max: 100)
productSlugstringNo-Filter by product slug
statusstringNo-Filter by original status

Example Request

# Get first page of archives
curl -X POST https://preview--takazudomodular.netlify.app/api/admin/notify/archives/list \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ADMIN_API_TOKEN" \
  -d '{}'

# Get page 2 with 10 items per page
curl -X POST https://preview--takazudomodular.netlify.app/api/admin/notify/archives/list \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ADMIN_API_TOKEN" \
  -d '{ "page": 2, "pageSize": 10 }'

# Filter by product
curl -X POST https://preview--takazudomodular.netlify.app/api/admin/notify/archives/list \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ADMIN_API_TOKEN" \
  -d '{ "productSlug": "n32b-slim" }'

Response

Success Response (200)

interface AdminArchiveListResponse {
  success: true;
  subscriptions: NotifySubscription[];  // Array of archived subscriptions
  total: number;                        // Total count of archived subscriptions
  page: number;                         // Current page number
  pageSize: number;                     // Items per page
  totalPages: number;                   // Total number of pages
}

Example Success Response

{
  "success": true,
  "subscriptions": [
    {
      "id": "mock-sub-001",
      "email": "user1@example.com",
      "productSlug": "n32b-slim",
      "createdAt": "2024-01-15T10:30:00Z",
      "status": "notified",
      "notifiedAt": "2024-01-20T12:00:00Z",
      "isArchived": true,
      "archivedAt": "2024-02-01T09:00:00Z"
    },
    {
      "id": "mock-sub-002",
      "email": "user2@example.com",
      "productSlug": "module-x",
      "createdAt": "2024-01-10T09:00:00Z",
      "status": "pending",
      "isArchived": true,
      "archivedAt": "2024-02-01T09:00:00Z"
    }
  ],
  "total": 15,
  "page": 1,
  "pageSize": 20,
  "totalPages": 1
}

Empty Result

{
  "success": true,
  "subscriptions": [],
  "total": 0,
  "page": 1,
  "pageSize": 20,
  "totalPages": 0
}

Error Responses

Validation Error (400)

{
  "success": false,
  "error": "pageSize must be between 1 and 100"
}

Authentication Error (401)

{
  "success": false,
  "error": "Unauthorized"
}

Behavior

  1. Fetches all notify subscriptions where isArchived === true
  2. Applies optional filters (productSlug, status)
  3. Sorts by archivedAt descending (most recently archived first)
  4. Paginates results based on page and pageSize parameters
  5. Returns paginated list with metadata

Subscription Object

FieldTypeDescription
idstringUnique subscription ID
emailstringSubscriber’s email address
productSlugstringProduct identifier
statusstringOriginal status when archived
createdAtstringISO 8601 timestamp of subscription creation
notifiedAtstring | nullISO 8601 timestamp when notified
isArchivedbooleanAlways true for archived subscriptions
archivedAtstringISO 8601 timestamp when archived

Sorting

Results are sorted by archivedAt in descending order (most recently archived first).