ADR 0371: Pinterest Pins are a social destination sent from the CLI under the author's own OAuth token, sandbox first
- Status: Accepted
- Date: 2026-10-29
- Parent epic: #383
- Story: #394 (task DIST3.2.1)
Context#
Story #393 builds a post's Pinterest Pin card (ADRs 0368 to 0370) and sends nothing. Story #394 asks to connect Pinterest and publish recipe and travel Pins, after verifying Pinterest's developer approval, boards, token and Pin permissions. Epic #383 requires that unsupported API access becomes a guided workflow, that credentials never reach a static bundle or a log, and that self-hosted static publishing is unchanged. The provider capability contract (ADRs 0325 to 0327) is the place every destination states what open.blog does there.
What was verified (2026-10-29)#
- The request. Pinterest's official API description, version 5.28.0
(openapi.json):
POST /v5/pinscreates a Pin "on a board or board section owned by the operation user_account" fromboard_id(digits), optionalboard_section_id,title(at most 100 characters),description(800),alt_text(500),link(2,048) and amedia_source:image_base64(content_typeimage/jpegorimage/png, anddata),image_url, several images, or avideo_idfrom a separate media upload. There is no draft or publishing-time field. It answers201with the Pin (id, digits, and the fields sent) or aPinterest.Lib.Error(code,message) with400,401,403,404or429. The operation says it "is intended solely for publishing new content created by the user". - Boards.
GET /v5/boardslists the token owner's boards and the group boards they collaborate on, paged bybookmark(page_sizeat most 250); secret boards need theboards:read_secretscope, which open.blog does not ask for.GET /v5/boards/{board_id}/pinslists a board's Pins withlink,titleandcreated_at. - Permissions. OAuth 2.0 (
https://www.pinterest.com/oauth/, token at/v5/oauth/token). The schema listsboards:read,boards:write,pins:readandpins:writefor creating a Pin (a Pinterest community report of April 2026 confirms the API refuses a Pin withoutboards:write). - Developer approval. Access tiers: an
approved app starts with Trial access, and "all Pins and Boards created with Trial access are only visible to
their creator as Sandbox entities"; Standard access, granted after Pinterest reviews a video of the app's
authentication flow and integration, is needed for Pins others can see. Trial apps are rate limited per app per
day, Standard apps per user per minute; no numbers are published there. The
sandbox is the same API at
api-sandbox.pinterest.com; the app console generates a sandbox token that "lasts 30 days", and a sandbox token does not work in production nor a production token in the sandbox. Sandbox entities are separate from production ones: production boards are filtered out ofGET /v5/boardsthere, and the way the sandbox page gives to get a sandbox board isPOST /v5/boardsonapi-sandbox.pinterest.com, so a new sandbox token has no board until one is made that way. Collecting a person's password or session cookies instead of OAuth is grounds for refusing an app.
Decision#
- Pinterest is a provider in the capability contract.
pinterest, familysocial(a Pin links the canonical post and carries no copy of the article, as an announcement does), label "Pinterest", loginoauth2with the four scopes above, canonicallinked, publishingexplicit-approval. Capabilities:link,textandimageby the adapter;videomanual (Pinterest takes it, through an upload this adapter does not make);article,draftandscheduleunsupported (the request has no such field).maxTextCharsis 800, the description's limit; the title, alternative text and link limits are the card's own (ADR 0370). Both halves and the fixture hold it (ADR 0327); the hosted half reads it but never admits it as an announcement adapter, because it schedules nothing (ADR 0326). - Sent from the CLI, not the hosted worker. A Pin is the author's explicit act on one built card
(
openblog pinterest, ADR 0372), likeopenblog syndicate. The hosted queue (ADRs 0316 to 0318) schedules a caption and a link, keeps no image, and would need a new hosted table for boards and image bytes; nothing in this story needs scheduling, so no hosted schema changes. - The author's own OAuth token, in the environment. open.blog reads a Pinterest access token from
PINTEREST_ACCESS_TOKENand never stores, prints or logs it. The author obtains it through Pinterest's own OAuth for their app (the app console's "Generate token" for the sandbox, or Pinterest's authorization flow for production) with the four scopes. open.blog never asks for a Pinterest password or cookie. Running its own OAuth client and refresh is deferred to a hosted connection (a later story), so this release holds no client secret. - Sandbox first.
syndication.pinterest.environmentissandbox(the default,api-sandbox.pinterest.com, where Pins are visible only to the author) orproduction(api.pinterest.com), which the author sets on purpose once their app has Standard access. A sandbox Pin is reported as visible only to the author. - A sandbox board is a guided manual step. Because pinterest.com boards are not visible in the sandbox,
openblog pinterest boardswith an empty sandbox prints the onePOST /v5/boardsrequest to make a sandbox board (naming$PINTEREST_ACCESS_TOKEN, never the token), anddocs/pinterest.mdgives the same step. open.blog does not make boards itself: that would be a second write path to confirm and test, for a one-time setup step. Aboards --createcommand can be added later if authors need it. - Only the author's own published work. A Pin is built only from a production-visible post's card, its image only from a file the site itself serves (ADR 0372), which keeps within "new content created by the user".
Considered options#
- A hosted connection through the existing social OAuth (ADRs 0295, 0299). Deferred: it would give Pinterest a sealed, refreshable grant, but needs an additive hosted schema for boards and Pin attempts and a place for image bytes. The CLI path proves the contract first and changes no hosted state.
- A new family
visual. Rejected: the existing rules (a linked canonical, no article copy) fit a Pin, and a new family would widen a closed contract both halves must read. - Default to production. Rejected: an app without Standard access cannot publish there, and the sandbox lets an author try a Pin without anyone seeing it.
Consequences#
ProviderId::ALLincludes Pinterest; the fixture anddocs/provider-capabilities.mdlist it.- No static build, feed, export, cross-posting plan or hosted route reads the Pinterest manifest or token.