> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Pins & boards

Publish an image pin or a video pin, manage boards and edit a published pin, plus every platformSpecificData field.

A plain post becomes an image pin when the media is an image, and a video pin when it is a video.

`boardId`, `title` and `link` go in `platformSpecificData` on the Pinterest entry. `content` is the pin description.

## Image pin

A single image pinned to a board.

Use a 2:3 aspect ratio (1000 x 1500 px) for the best display in the Pinterest feed.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data: published } = await zernio.posts.createPost({
  body: {
    content: 'Modern kitchen renovation ideas for small spaces',
    mediaItems: [
      { type: 'image', url: 'https://cdn.example.com/kitchen-ideas.jpg' }
    ],
    platforms: [{
      platform: 'pinterest',
      accountId: '66b2e19d8c3f5a7e9d0b1c2d',
      platformSpecificData: {
        title: 'Modern Kitchen Renovation Ideas',
        boardId: '1022106146582011234',
        link: 'https://myblog.com/kitchen-renovation'
      }
    }],
    publishNow: true
  }
});

console.log(published.post.platforms[0].platformPostUrl);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

published = client.posts.create_post(
    content="Modern kitchen renovation ideas for small spaces",
    media_items=[
        {"type": "image", "url": "https://cdn.example.com/kitchen-ideas.jpg"}
    ],
    platforms=[{
        "platform": "pinterest",
        "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
        "platformSpecificData": {
            "title": "Modern Kitchen Renovation Ideas",
            "boardId": "1022106146582011234",
            "link": "https://myblog.com/kitchen-renovation"
        }
    }],
    publish_now=True
)

print(published["post"]["platforms"][0]["platformPostUrl"])
```
</Tab>
<Tab value="curl">
```bash
curl -X POST https://zernio.com/api/v1/posts \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Modern kitchen renovation ideas for small spaces",
    "mediaItems": [
      {"type": "image", "url": "https://cdn.example.com/kitchen-ideas.jpg"}
    ],
    "platforms": [{
      "platform": "pinterest",
      "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
      "platformSpecificData": {
        "title": "Modern Kitchen Renovation Ideas",
        "boardId": "1022106146582011234",
        "link": "https://myblog.com/kitchen-renovation"
      }
    }],
    "publishNow": true
  }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "post": {
    "_id": "65f1c0a9e2b5af0012ab34cd",
    "status": "published",
    "platforms": [
      {
        "platform": "pinterest",
        "status": "published",
        "platformPostUrl": "https://www.pinterest.com/pin/..."
      }
    ]
  }
}
```

Every sample below changes only the `mediaItems` or the `platforms` entry of this request.

## Video pin

A single video pinned to a board.

`coverImageUrl` sets a custom cover. `coverImageKeyFrameTime` extracts a frame at that second instead.

```json
"mediaItems": [
  { "type": "video", "url": "https://cdn.example.com/recipe.mp4" }
],
"platforms": [{
  "platform": "pinterest",
  "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
  "platformSpecificData": {
    "title": "5-Minute Breakfast Recipe",
    "boardId": "1022106146582011234",
    "link": "https://myrecipes.com/quick-breakfast",
    "coverImageUrl": "https://cdn.example.com/recipe-cover.jpg"
  }
}]
```

## Boards

Every pin belongs to a board. List the boards on a connected account, or create one through the API.

The `boards:write` scope is part of every Pinterest connection, so no reconnect is needed.

### List boards

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: boards } = await zernio.connect.getPinterestBoards({
  path: { accountId: '66b2e19d8c3f5a7e9d0b1c2d' }
});

console.log(boards.boards);
```
</Tab>
<Tab value="Python">
```python
boards = client.connect.get_pinterest_boards(account_id="66b2e19d8c3f5a7e9d0b1c2d")

print(boards["boards"])
```
</Tab>
<Tab value="curl">
```bash
curl "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/pinterest-boards" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```
</Tab>
</Tabs>

Response (`200`):

```json
{
  "boards": [
    {
      "id": "1022106146582011234",
      "name": "Kitchen Ideas",
      "description": "Renovations and layouts",
      "privacy": "PUBLIC",
      "url": "https://www.pinterest.com/yourhandle/kitchen-ideas/"
    }
  ]
}
```

### Create a board

The response carries the new board's `id`, which works at once as `platformSpecificData.boardId`. `privacy` is `PUBLIC` (default), `PROTECTED` or `SECRET`.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: created } = await zernio.connect.createPinterestBoard({
  path: { accountId: '66b2e19d8c3f5a7e9d0b1c2d' },
  body: {
    name: 'Summer Recipes',
    description: 'My favorite summer recipes',
    privacy: 'PUBLIC'
  }
});

console.log(created.board.id);
```
</Tab>
<Tab value="Python">
```python
created = client.connect.create_pinterest_board(
    account_id="66b2e19d8c3f5a7e9d0b1c2d",
    name="Summer Recipes",
    description="My favorite summer recipes",
    privacy="PUBLIC",
)

print(created["board"]["id"])
```
</Tab>
<Tab value="curl">
```bash
curl -X POST "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/pinterest-boards" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Summer Recipes",
    "description": "My favorite summer recipes",
    "privacy": "PUBLIC"
  }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "board": {
    "id": "1022106146582019876",
    "name": "Summer Recipes",
    "description": "My favorite summer recipes",
    "privacy": "PUBLIC",
    "url": "https://www.pinterest.com/yourhandle/summer-recipes/"
  }
}
```

Pinterest rejects a duplicate board name on the same account. You cannot pin to a secret board you do not own.

A board-creation error from Pinterest comes back with its original message and a `502`.

## Edit a published pin

[Edit post](/posts/edit-post) replaces the description of a pin that is already live, up to the same 800 characters a create takes.

The title, media, destination `link` and board cannot be changed. A title derived from the first line of the original content at publish time stays as it was.

There is no time window and no edit limit, and the pin id is unchanged.

<Callout type="warn">
Pinterest's pin-update endpoint is a closed beta. Until Pinterest allowlists the app, every edit request is rejected with a "beta feature not yet enabled" error. Nothing on your side changes that; Pinterest grants the access.
</Callout>

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: edited } = await zernio.posts.editPost({
  path: { postId: '65f1c0a9e2b5af0012ab34cd' },
  body: {
    platform: 'pinterest',
    content: 'Updated pin description with the new recipe link details'
  }
});

console.log(edited.id, edited.url);
```
</Tab>
<Tab value="Python">
```python
edited = client.posts.edit_post(
    post_id="65f1c0a9e2b5af0012ab34cd",
    platform="pinterest",
    content="Updated pin description with the new recipe link details"
)

print(edited["id"], edited["url"])
```
</Tab>
<Tab value="curl">
```bash
curl -X POST https://zernio.com/api/v1/posts/65f1c0a9e2b5af0012ab34cd/edit \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "pinterest",
    "content": "Updated pin description with the new recipe link details"
  }'
```
</Tab>
</Tabs>

Response (`200`):

```json
{
  "success": true,
  "id": "1022106146582013456",
  "url": "https://www.pinterest.com/pin/1022106146582013456/",
  "message": "Post edited successfully"
}
```

**Several accounts.** If the post was published to several Pinterest accounts, pass `accountId` to pick which copy to edit. Without it, the first `pinterest` entry on the post is edited.

## Platform fields

All fields go in `platformSpecificData` on the Pinterest entry.

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `boardId` | string | | The board to pin to. Send it on every post. Get board ids from `GET /v1/accounts/{accountId}/pinterest-boards`, or [create a board](#create-a-board) with `POST` on the same path. |
| `boardSectionId` | string | | Section inside the board. The pin lands on the board itself when omitted. Pinterest rejects the pin if the section does not belong to `boardId`, so send both together. No Zernio endpoint returns section ids: read them from Pinterest's own board sections API, which the same connected account can call. |
| `title` | string (max 100 chars) | First line of content | Pin title, searchable by Pinterest users. |
| `link` | string (URL) | | Destination when someone clicks the pin. Must be valid HTTPS, no URL shorteners. The field that drives traffic. Alias: `url`. |
| `coverImageUrl` | string (URL) | | Custom cover image for video pins. |
| `coverImageKeyFrameTime` | number (seconds) | `0` | Extract a video frame at this many seconds as the cover. Ignored when `coverImageUrl` is set. |
| `isAiGenerated` | boolean | `false` | `true` creates the pin with Pinterest's AI_MODIFIED disclosure (an "AI modified" label). `false` omits the disclosure; Pinterest may still label a pin from its own detection. |