{"uid":"cap_SVfIONXtaHpiwbYT3gf6Z","slug":"pagination-contract-audit-7368faa8","name":"Pagination Contract Audit","description":"Audit a pagination contract for the ways it loses or repeats rows. The central finding is the one almost every paginated API has at first: a sort on a non-unique field with no unique tiebreaker, so rows that compare equal have no defined order and a caller walking the pages can get one row twice and never get its neighbour, with nothing failing. Also reports offset pagination over a mutable sort, an unbounded page size, contradictory bounds, and a cursor contract that also takes an offset.","url":"https://api.zfinia.com/x402/v1/pagination-contract-audit?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"contract":{"type":"object","properties":{"sort":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":200},"unique":{"type":"boolean"},"mutable":{"type":"boolean"}}},"maxItems":20},"style":{"enum":["cursor","keyset","offset","page"],"type":"string"},"page_size_max":{"type":"integer","minimum":1},"max_total_results":{"type":"integer","minimum":1},"page_size_default":{"type":"integer","minimum":1}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.24","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.24/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.24","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.24","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_NFPCXtYigriIYka8Rts62","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.24","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Audits a pagination contract definition to detect data-loss and row-duplication bugs including non-unique sort fields, mutable-sort offsets, unbounded page sizes, and mixed cursor/offset usage.","exampleAgentPrompt":"Can you audit this pagination contract for me — it uses offset-style pagination, sorted by 'created_at' which is not unique and is mutable, with a default page size of 20 and a max of 500?","exampleUseCases":[{"title":"Catching duplicate rows in sort design","prompt":"I have a paginated API that sorts by 'updated_at' which isn't unique, uses offset pagination, and has a default page size of 50 with a max of 1000 — can you audit the contract and tell me if callers might see duplicate or missing rows?"},{"title":"Validating cursor pagination safety","prompt":"My API uses cursor-based pagination and sorts by 'id' which is unique and immutable, with a page size max of 200 — audit this contract and check if there are any ways a client walking the pages could lose or repeat records."},{"title":"Reviewing mixed offset and cursor contract","prompt":"Our pagination design uses cursor style but we also accept an offset parameter as a fallback — sort is on 'score' which is not unique. Can you audit this contract and tell me what the risks are?"}],"resultDescription":"A structured audit report listing all detected pagination contract problems: non-unique sort fields lacking a unique tiebreaker (the central finding), offset pagination over mutable sorts, unbounded or contradictory page size bounds, and cursor contracts that also accept an offset parameter — each finding described with enough detail for the developer to understand the data-loss or row-duplication risk.","failureModes":["Missing or malformed contract object returns a validation error","Sort array items missing required fields like 'field' or 'unique' may cause incomplete analysis","No findings returned if the contract appears sound — not an error, just a clean audit","Sort array exceeding 20 items is rejected by schema limit","Invalid enum value for style field causes request rejection"],"whenToPreferThis":"Use this endpoint when you need to programmatically verify that a paginated API contract is free of row-loss and row-duplication bugs before shipping or reviewing it — especially when the sort fields, pagination style, or page size bounds are developer-supplied and need a deterministic structural audit rather than a general code review.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T06:34:59.315Z","isFirstParty":false,"canonicalSlug":"pagination-contract-audit-7368faa8"}