Skip to content

[I-019] [Improvement]: Normalize pagination responses across all list endpoints #375

Closed

Description

@indpurvesh

Priority: Low
Phase: Phase 4 (API Polish)
Dependencies: #372


📝 User Story

As an API consumer,
I want to receive consistent pagination metadata from all list endpoints,
So that I can build generic pagination UI components.


🎯 Scope & Requirements

  • Ensure all paginated endpoints (/api/collection, /api/entities, /api/email-templates, /api/workflows, /api/api-keys, /api/v1/entities) return the same pagination envelope
  • Standard pagination response: { "data": [...], "pagination": { "total": N, "per_page": N, "current_page": N, "last_page": N } }
  • Support ?page=N&per_page=N query parameters consistently
  • Default per_page to a sensible value (e.g., 25)

✅ Acceptance Criteria

  • Given any list endpoint, When called with pagination params, Then the response contains data and pagination keys.
  • Given ?page=2&per_page=10, When sent to any list endpoint, Then the correct page of results is returned.

📋 Task Checklist

  • Create a generic PaginatedResponse<T> wrapper
  • Update all list handlers to use the wrapper
  • Standardize query parameters
  • Add integration tests for pagination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

apiAPI endpoints, contracts, and integrationsbackendimprovementMaintenance and improvements to existing functionalitypriority: lowLow-priority work

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions