> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postsyncer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Pinterest board sections

> List the sections of a Pinterest board, to pin into one.

> [!NOTE]
>
> Needs `accounts:read`. See [Permissions](https://docs.postsyncer.com/essentials/authentication.md#permissions).

A Pinterest board can be split into sections. To pin into one, send its `id` as `accounts[].settings.board_section_id` on [Create a post](https://docs.postsyncer.com/api-reference/posts/create.md), with the board's id as `board_id`. A section belongs to one board, so `board_section_id` without `board_id` is refused with a 422.

1. Get the account's boards: `boards` on [Get an account](https://docs.postsyncer.com/api-reference/accounts/get.md).
2. List one board's sections here.
3. Send both ids in the account's `settings`.

```json theme={null}
{
  "accounts": [
    {
      "id": 305,
      "settings": {
        "board_id": "1060316680877291436",
        "board_section_id": "5251788495612345678"
      }
    }
  ]
}
```

The list is read from Pinterest each time, in Pinterest's order. A board without sections gives `"data": []`: pin to the board itself by leaving `board_section_id` out. Board and section ids are long numbers: keep them as strings.

## Errors

| Status | `code` | When | Retry? |
| - | - | - | - |
| 400 | `INVALID_PROVIDER` | The account isn't a Pinterest account. | No: use a Pinterest account. |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `accounts:read`, or its user is inactive. | No: grant it in Settings → API. |
| 404 | | No account with that id in the workspaces the key can reach. | No. |
| 404 | `BOARD_NOT_FOUND` | Pinterest has no board with that id on this account. | No: take a board id from Get an account. |
| 409 | `NEEDS_RECONNECT` | The account needs to be reconnected in PostSyncer. | After the account is reconnected. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |
| 502 | `PLATFORM_ERROR` | Pinterest did not answer with the sections. `message` gives its reason. | Yes, in a moment. |

## Related

* [Get an account](https://docs.postsyncer.com/api-reference/accounts/get.md): the account's `boards`.
* [Create a post](https://docs.postsyncer.com/api-reference/posts/create.md): `board_id` and `board_section_id` in `settings`.


## OpenAPI

````yaml GET /accounts/{account}/pinterest/boards/{board}/sections
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
paths:
  /accounts/{account}/pinterest/boards/{board}/sections:
    get:
      tags:
        - Accounts
      summary: List Pinterest board sections
      description: >-
        Needs `accounts:read`. The sections of one of a Pinterest account's
        boards, read from Pinterest, in Pinterest's order. To pin into a
        section, send its `id` as `accounts[].settings.board_section_id` on
        [Create a post](/api-reference/posts/create), with the board's id as
        `board_id`. Board ids are in `boards` on [Get an
        account](/api-reference/accounts/get). A board without sections gives an
        empty list: pin to the board itself.
      operationId: listPinterestBoardSections
      parameters:
        - name: account
          in: path
          required: true
          description: The Pinterest account.
          schema:
            type: integer
        - name: board
          in: path
          required: true
          description: The board's id, from `boards` on Get an account.
          schema:
            type: string
            pattern: ^[0-9]+$
            example: '1060316680877291436'
      responses:
        '200':
          description: The board's sections; `data` is `[]` when it has none.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PinterestBoardSection'
              examples:
                default:
                  summary: Two sections
                  value:
                    data:
                      - id: '5251788495612345678'
                        name: Spring menu
                      - id: '5251788495612345679'
                        name: Behind the counter
                none:
                  summary: A board without sections
                  value:
                    data: []
        '400':
          description: The account isn't a Pinterest account.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - INVALID_PROVIDER
              examples:
                not_pinterest:
                  summary: Not a Pinterest account
                  value:
                    message: Account is not a Pinterest account
                    code: INVALID_PROVIDER
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: The key lacks `accounts:read`, or its user is inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks accounts:read
                  value:
                    message: >-
                      This API key does not have the "accounts:read" permission.
                      Edit the key in PostSyncer under Settings → API to grant
                      it.
                inactive_account:
                  summary: The key's user is inactive
                  value:
                    message: Your account is inactive.
        '404':
          description: >-
            No account with that id in the workspaces the key can reach, or
            Pinterest has no board with that id on this account
            (`BOARD_NOT_FOUND`).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - BOARD_NOT_FOUND
              examples:
                not_found:
                  summary: No such account
                  value:
                    message: Not found.
                board_not_found:
                  summary: No such board on this account
                  value:
                    message: >-
                      Pinterest has no board with this id on this account. The
                      account's boards and their ids are in Get an account
                      (get-account).
                    code: BOARD_NOT_FOUND
        '409':
          description: >-
            The account needs to be reconnected in PostSyncer before Pinterest
            can be read: it is marked to reconnect, or Pinterest refused its
            sign-in (HTTP 401 or 403). Trying again won't help.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - NEEDS_RECONNECT
              examples:
                needs_reconnect:
                  summary: Reconnect the account
                  value:
                    message: >-
                      This Pinterest account needs to be reconnected in
                      PostSyncer before its board sections can be listed.
                    code: NEEDS_RECONNECT
        '429':
          $ref: '#/components/responses/RateLimited429'
        '502':
          description: >-
            Pinterest did not answer with the sections. `message` gives
            Pinterest's reason; try again in a moment.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - PLATFORM_ERROR
              examples:
                platform_error:
                  summary: Pinterest had a server error
                  value:
                    message: >-
                      Pinterest did not list this board's sections: Pinterest
                      answered 503. Try again in a moment.
                    code: PLATFORM_ERROR
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url https://postsyncer.com/api/v1/accounts/305/pinterest/boards/1060316680877291436/sections \
              --header 'Authorization: Bearer <token>'
        - lang: javascript
          label: JavaScript
          source: >-
            const options = {method: 'GET', headers: {Authorization: 'Bearer
            <token>'}};


            fetch('https://postsyncer.com/api/v1/accounts/305/pinterest/boards/1060316680877291436/sections',
            options)
              .then(res => res.json())
              .then(res => console.log(res))
              .catch(err => console.error(err));
        - lang: python
          label: Python
          source: >-
            import requests


            url =
            "https://postsyncer.com/api/v1/accounts/305/pinterest/boards/1060316680877291436/sections"


            headers = {"Authorization": "Bearer <token>"}


            response = requests.get(url, headers=headers)


            print(response.text)
        - lang: php
          label: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://postsyncer.com/api/v1/accounts/305/pinterest/boards/1060316680877291436/sections",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer <token>"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
components:
  schemas:
    PinterestBoardSection:
      type: object
      description: >-
        A section of a Pinterest board (GET
        /accounts/{account}/pinterest/boards/{board}/sections).
      required:
        - id
        - name
      properties:
        id:
          type: string
          pattern: ^[0-9]+$
          description: >-
            The section's id: send it as `accounts[].settings.board_section_id`,
            with the board's id as `board_id`.
        name:
          type: string
          description: The section's name, as it shows on Pinterest.
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
  responses:
    Unauthorized401:
      description: No API key, or not a valid one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              summary: No valid API key
              value:
                message: Unauthenticated.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.