Create a Pin
Create a new pin with markdown content or any of the 43 pin types.
Endpoint
POST /v1/pinsAuthentication
Requires API key with pins:write scope.
Authorization: Bearer pk_live_your_api_keyRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
data_type | string | No | Legacy field (json, markdown, text, pin-card). Prefer pin_type instead. Defaults to markdown. |
pin_type | string | No | One of 43 product types — see Pin types overview (defaults to markdown) |
pin_config | object | No | Pin configuration (content, settings, etc.) |
pin_layout | string | No | Layout size: "1x1", "1x2", "2x1", "2x2", "3x1", "3x2", "3x3", "4x4" |
is_public | boolean | No | Public visibility (default: false) |
allow_edit | boolean | No | Allow editors to modify (default: false) |
require_sign_in | boolean | No | Require sign-in to view (default: false) |
allow_comments | boolean | No | Enable comments (default: false) |
metadata | object | Yes | Pin metadata including title |
pending_invites | object | No | Email-to-role mapping for pending collaborators |
Metadata Object
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Pin title (minimum required field) |
tags | string[] | No | Tags for organization |
pin_type | string | No | Pin type (can also be specified at root level) |
pin_config | object | No | Pin configuration (can also be specified at root level) |
pin_layout | string | No | Pin layout (can also be specified at root level) |
Pending Invites Object
Optional email-to-role mapping for inviting collaborators upon pin creation:
{
"user@example.com": "editor",
"viewer@example.com": "viewer"
}Examples
Minimum Required: Simple Markdown Pin
The absolute minimum to create a pin - just a title:
Client-JS
import { PindownClient } from '@pindownai/client-js'
const client = new PindownClient({
apiKey: process.env.PINDOWN_API_KEY
})
const pin = await client.pins.create({
metadata: {
title: 'My First Pin'
}
})
console.log('Pin created:', pin.id)Markdown Pin with Permissions
Create a public pin with comments enabled:
Client-JS
const pin = await client.pins.create({
pin_type: 'markdown',
is_public: true,
allow_comments: true,
require_sign_in: false,
metadata: {
title: 'Public Documentation',
tags: ['docs', 'team']
}
})Pin with Pending Invites
Create a pin and invite collaborators immediately:
Client-JS
const pin = await client.pins.create({
metadata: {
title: 'Team Project Pin'
},
pending_invites: {
'editor@team.com': 'editor',
'viewer@team.com': 'viewer'
}
})Pin Types
Pins support 43 typed pin_type values, each with a validated pin_config. See Pin Types & Schemas for required fields and full examples per type.
Example with stat cards:
Client-JS
const pin = await client.pins.create({
pin_type: 'stat-cards',
pin_layout: '2x1',
pin_config: {
cards: [{
title: 'Total Revenue',
value: '$125,430',
change: '+18.2%',
trend: 'up'
}, {
title: 'New Customers',
value: '1,234',
change: '+12%',
trend: 'up'
}]
},
metadata: {
title: 'Revenue Dashboard',
tags: ['sales', 'kpi']
}
})Response
{
"success": true,
"data": {
"id": "p-abc123def456",
"data_type": "pin-card",
"created_at": 1699027800000,
"is_public": false,
"allow_edit": false,
"require_sign_in": false,
"allow_comments": false
},
"message": "Pin created successfully"
}Error Responses
400 Bad Request
{
"success": false,
"error": {
"code": "PIN_CONFIG_INVALID",
"message": "Invalid pin_config for pin_type \"stat-cards\" at cards: …"
}
}401 Unauthorized
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}Next Steps
- Pin Types & Schemas — All 43 types with config schemas
- Update pin — Modify pin data
- Share pin — Configure sharing & permissions
- Batch create — Create many pins at once