Skip to Content
Pindown.ai is in early alpha - features may change
Client SDKPages API

Pages API

The Pages API provides methods to create, read, update, and delete pages, and manage pins within pages.

Getting Started

import { PindownClient } from '@pindownai/client-js' const client = new PindownClient({ apiKey: process.env.PINDOWN_API_KEY }) // Access pages API const pages = client.pages

Create Page

Create a new page:

const page = await client.pages.create({ metadata: { title: 'Monthly Sales Report', tags: ['sales', 'monthly', 'report'] } }) console.log(`Page created: ${page.id}`)

Get Page

Retrieve a page by ID:

const page = await client.pages.get('pg-abc123') console.log(`Page: ${page.metadata.title}`) console.log(`Pins: ${page.pins.length}`)

List Pages

List all your pages:

const result = await client.pages.list({ limit: 20, offset: 0 }) console.log(`Found ${result.total} pages`) result.pages.forEach(page => { console.log(`- ${page.metadata.title} (${page.pins.length} pins)`) })

List Shared Pages

List pages shared with you:

const result = await client.pages.listShared({ limit: 20, offset: 0 }) console.log(`Found ${result.total} shared pages`)

Update Page

Update a page’s metadata:

const page = await client.pages.update('pg-abc123', { metadata: { title: 'Updated Report Title', tags: ['sales', 'monthly', 'updated'] } }) console.log(`Page updated: ${page.id}`)

Delete Page

Delete a page:

await client.pages.delete('pg-abc123') console.log('Page deleted')

Add Pin to Page

Add a pin to a page:

await client.pages.addPin('pg-abc123', { pin_id: 'p-xyz789' }) console.log('Pin added to page')

Remove Pin from Page

Remove a pin from a page:

await client.pages.removePin('pg-abc123', 'p-xyz789') console.log('Pin removed from page')

List Pins in Page

Get all pins in a page:

const result = await client.pages.listPins('pg-abc123') console.log(`Page has ${result.total} pins`) result.pins.forEach(pinId => { console.log(`- Pin: ${pinId}`) })

Batch Operations

Batch Get Pages

Get multiple pages at once:

const result = await client.pages.batchGet([ 'pg-abc123', 'pg-def456', 'pg-ghi789' ]) console.log(`Found: ${result.found.length}`) console.log(`Not found: ${result.not_found.length}`) console.log(`Permission denied: ${result.permission_denied.length}`)

Complete Example

Create a page and add pins to it:

import { PindownClient } from '@pindownai/client-js' async function createReportPage() { const client = new PindownClient({ apiKey: process.env.PINDOWN_API_KEY! }) // 1. Create page const page = await client.pages.create({ metadata: { title: 'Monthly Sales Report', tags: ['sales', 'monthly'] } }) // 2. Create pins const headerPin = await client.pins.create({ pin_type: 'markdown', pin_config: { content: '# Monthly Sales Report\n\n## Executive Summary' }, metadata: { title: 'Report Header' } }) const statsPin = await client.pins.create({ pin_type: 'stat-cards', pin_config: { cards: [ { title: 'Revenue', value: '$145,230', change: '+23.5%', trend: 'up' } ] }, metadata: { title: 'Key Metrics' } }) // 3. Add pins to page await client.pages.addPin(page.id, { pin_id: headerPin.id }) await client.pages.addPin(page.id, { pin_id: statsPin.id }) console.log('✅ Page created with pins!') console.log(`🔗 View at: https://pindown.ai/pages/${page.id}`) return page } createReportPage()

Next Steps