Papers
List papers
List and filter the papers in your workspace.
List the papers in your workspace, optionally filtered by name, file type or metadata.
List papers
const { items, total } = await paperful.papers.list();
for (const paper of items) {
console.log(paper.id, paper.fileName);
} Filter papers
const { items } = await paperful.papers.list({
fileName: "report",
extension: ["pdf", "docx"],
}); Filter by metadata
Only return papers whose metadata matches. Pass a value to match it exactly, an array to match any of the values, or gt, gte, lt and lte to match a numeric range.
const { items } = await paperful.papers.list({
metadata: {
category: ["invoice", "receipt"],
amount: { gte: 100, lt: 1000 },
paid: true,
},
}); A paper must match every key to be returned.
Paginate
Results are paginated. Pass the returned cursor to get the next page.
let page = await paperful.papers.list();
while (page.cursor?.next) {
page = await paperful.papers.list({ next: page.cursor.next });
} Options
Prop
Type