Posts

Create Pinterest pins through the shared posts API with image pins and video pins with board selection.

Publish pins to Pinterest boards through the shared posts surface. Every destination must include an explicit boardId.

Quick Start

Create a pin in under a minute:

import { Configuration, PostsApi } from "@onepostly/sdk";

const postsApi = new PostsApi(
  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY })
);

const response = await postsApi.createPost({
  createPostBody: {
    "text": "Ship day",
    "mediaUrls": [
      "https://cdn.onepostly.com/media/product.jpg"
    ],
    "mediaKind": "image",
    "destinations": [
      {
        "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",
        "boardId": "1234567890123456789"
      }
    ]
  },
});
console.log(response);
{
  "post": {
    "id": "b3e1a7c2-8f4d-4e6a-9c1b-2d3e4f5a6b7c",
    "text": "Ship day",
    "mediaUrls": [
      "https://cdn.onepostly.com/media/product.jpg"
    ],
    "mediaKind": "image",
    "status": "queued",
    "scheduledFor": null,
    "timezone": null,
    "destinations": [
      {
        "id": "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
        "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",
        "platform": "pinterest",
        "status": "draft",
        "externalPostId": "17895695668004550",
        "externalUrl": "https://www.pinterest.com/pin/17895695668004550/",
        "errorCode": null,
        "errorMessage": null,
        "publishedAt": "2026-08-25T10:00:00.000Z",
        "metrics": null
      }
    ],
    "createdAt": "2026-08-25T10:00:00.000Z",
    "updatedAt": "2026-08-25T10:00:00.000Z"
  }
}

The response is 202 Accepted with status: "queued". When published, the destination carries the pin id (externalPostId) and a https://www.pinterest.com/pin/PIN_ID/ link. Poll GET /v1/posts/:id or receive webhooks.

Content Types

Image Pin

A single image pinned to a board. Use 2:3 aspect ratio (1000 × 1500 px) for optimal display in the Pinterest feed.

import { Configuration, PostsApi } from "@onepostly/sdk";

const postsApi = new PostsApi(
  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY })
);

const response = await postsApi.createPost({
  createPostBody: {
    "text": "10 Tips for Better Photography",
    "mediaUrls": [
      "https://cdn.example.com/photo.jpg"
    ],
    "mediaKind": "image",
    "destinations": [
      {
        "accountId": "YOUR_PINTEREST_ACCOUNT_ID",
        "boardId": "YOUR_BOARD_ID",
        "link": "https://myblog.com/photography-tips"
      }
    ]
  },
});
console.log(response);
{
  "post": {
    "id": "b3e1a7c2-8f4d-4e6a-9c1b-2d3e4f5a6b7c",
    "text": "10 Tips for Better Photography",
    "mediaUrls": [
      "https://cdn.example.com/photo.jpg"
    ],
    "mediaKind": "image",
    "status": "queued",
    "scheduledFor": null,
    "timezone": null,
    "destinations": [
      {
        "id": "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
        "accountId": "YOUR_PINTEREST_ACCOUNT_ID",
        "platform": "pinterest",
        "status": "draft",
        "externalPostId": "17895695668004550",
        "externalUrl": "https://www.pinterest.com/pin/17895695668004550/",
        "errorCode": null,
        "errorMessage": null,
        "publishedAt": "2026-08-25T10:00:00.000Z",
        "metrics": null
      }
    ],
    "createdAt": "2026-08-25T10:00:00.000Z",
    "updatedAt": "2026-08-25T10:00:00.000Z"
  }
}

Video Pin

A single video pinned to a board. Video uploads are processed asynchronously on Pinterest. The pin becomes visible once processing completes. Add coverImageUrl to set a custom cover; otherwise Pinterest extracts a frame from the video.

import { Configuration, PostsApi } from "@onepostly/sdk";

const postsApi = new PostsApi(
  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY })
);

const response = await postsApi.createPost({
  createPostBody: {
    "text": "5-Minute Breakfast Recipe",
    "mediaUrls": [
      "https://cdn.example.com/recipe.mp4"
    ],
    "mediaKind": "video",
    "destinations": [
      {
        "accountId": "YOUR_PINTEREST_ACCOUNT_ID",
        "boardId": "YOUR_BOARD_ID",
        "link": "https://myrecipes.com/quick-breakfast",
        "coverImageUrl": "https://cdn.example.com/recipe-cover.jpg"
      }
    ]
  },
});
console.log(response);
{
  "post": {
    "id": "b3e1a7c2-8f4d-4e6a-9c1b-2d3e4f5a6b7c",
    "text": "5-Minute Breakfast Recipe",
    "mediaUrls": [
      "https://cdn.example.com/recipe.mp4"
    ],
    "mediaKind": "video",
    "status": "queued",
    "scheduledFor": null,
    "timezone": null,
    "destinations": [
      {
        "id": "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
        "accountId": "YOUR_PINTEREST_ACCOUNT_ID",
        "platform": "pinterest",
        "status": "draft",
        "externalPostId": "17895695668004550",
        "externalUrl": "https://www.pinterest.com/pin/17895695668004550/",
        "errorCode": null,
        "errorMessage": null,
        "publishedAt": "2026-08-25T10:00:00.000Z",
        "metrics": null
      }
    ],
    "createdAt": "2026-08-25T10:00:00.000Z",
    "updatedAt": "2026-08-25T10:00:00.000Z"
  }
}

Media Requirements

Images

PropertyRequirement
Max images1 per pin
FormatsJPEG, PNG, WebP, GIF
Max file size32 MB
Recommended1000 × 1500 px (2:3 aspect ratio)
Min dimensions100 × 100 px

Aspect ratios

RatioDimensionsUse Case
2:31000 × 1500 pxOptimal, Standard Pin
1:11000 × 1000 pxSquare Pin
1:2.11000 × 2100 pxLong Pin (max height)

Use 2:3 for the best display in the Pinterest feed.

GIFs

Pinterest supports animated GIFs. They auto-play in the feed and are treated as images (not video). Max file size is 32 MB, but keeping under 10 MB is recommended for fast loading.

Videos

PropertyRequirement
Max videos1 per pin
FormatsMP4, MOV
Max file size64 MB through Onepostly
Duration4 seconds - 15 minutes
Aspect ratio2:3, 1:1, or 9:16
PropertyMinimumRecommended
Resolution240p1080p
Frame rate25 fps30 fps

Media URL Requirements

These do not work as media URLs:

  • Google Drive returns an HTML download page, not the file
  • Dropbox returns an HTML preview page
  • OneDrive / SharePoint returns HTML
  • iCloud returns HTML

Test your URL in an incognito browser window. If you see a webpage instead of the raw image or video, the URL will not work.

Media URLs must be publicly accessible, return actual media bytes with the correct Content-Type, and use HTTPS.

Destination Parameters

Every Pinterest destination accepts the following parameters:

Prop

Type

The post text is the Pin description, capped at 800 characters; longer requests are rejected with VALIDATION_ERROR. The title falls back to the first line of the post text when omitted.

The Pin title is derived from the first line of the post text, not the whole text. To set a different title, pass title explicitly.

Schedule

Add scheduledFor (local wall time) and timezone to create a scheduled pin:

  • timezone defaults to UTC. Use an IANA name like Europe/Istanbul
  • Do not append Z or an offset to scheduledFor: it is local wall time
  • Max 1 year ahead
  • Cancel with DELETE /v1/posts/:id any time before it publishes

Remote Delete

Removes the pin from the board:

import { Configuration, PostsApi } from "@onepostly/sdk";

const postsApi = new PostsApi(
  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY })
);

const response = await postsApi.deletePostDestination({
  destinationId: "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
});
console.log(response);
{
  "post": {
    "id": "b3e1a7c2-8f4d-4e6a-9c1b-2d3e4f5a6b7c",
    "text": "Ship day",
    "mediaUrls": [
      "https://cdn.onepostly.com/media/product.jpg"
    ],
    "mediaKind": "image",
    "status": "queued",
    "scheduledFor": null,
    "timezone": null,
    "destinations": [
      {
        "id": "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a",
        "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",
        "platform": "pinterest",
        "status": "draft",
        "externalPostId": "17895695668004550",
        "externalUrl": "https://www.pinterest.com/pin/17895695668004550/",
        "errorCode": null,
        "errorMessage": null,
        "publishedAt": "2026-08-25T10:00:00.000Z",
        "metrics": null
      }
    ],
    "createdAt": "2026-08-25T10:00:00.000Z",
    "updatedAt": "2026-08-25T10:00:00.000Z"
  }
}

Publish Errors

CodeCauseFix
VALIDATION_ERRORMissing destinations[].boardId, a non-HTTPS link, or a shortened linkSend a board id and a full HTTPS destination URL
MEDIA_REQUIREDNo media URL passedAdd at least one entry to mediaUrls
INVALID_MEDIAUnsupported type, size, or a multi-image pinPinterest pins accept one image or one video
MEDIA_UNFETCHABLEPinterest could not download the URLUse a public HTTPS URL
MEDIA_UPLOAD_FAILEDVideo upload or processing failedRetry; check the file plays correctly
BOARD_NOT_FOUNDThe board id does not existList boards and pass a valid id
TOKEN_INVALIDConnection token expired or revokedReconnect the account
PERMISSION_DENIEDConnection lacks pins:writeReconnect the account
UNSUPPORTED_FEATUREThread, quote, or reply sent to PinterestRemove them. They are not Pinterest concepts
UNSUPPORTED_MEDIA_KINDmediaKind: "text", "stories", or "multi-image"Use image or video
RATE_LIMITEDPinterest throttled the requestRetry later

See Also