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

# List social accounts

> Returns all social accounts accessible to the authenticated user.



## OpenAPI

````yaml /public/api.json get /social-accounts
openapi: 3.1.0
info:
  title: PostFlow
  version: '1'
  description: >-
    The PostFlow API gives you access to analytics data from your PostFlow
    organization and provides you with tools for scheduling and publishing
    social media posts directly from your own application, automation tool, or
    AI assistant.


    ### What is PostFlow?

    PostFlow is a social media management platform designed to help teams and
    creators plan, collaborate, and publish social media content.


    ### Base URL

    The base URL for the PostFlow API is:


    ```http

    https://api.postflow.app/v1

    ```


    For media requests use base URL:

    ```http

    https://media.postflow.app/api/v1

    ```



    ### Authentication

    All API requests require a bearer token in the Authorization header.


    You can generate an API token from your [PostFlow account
    settings](https://new.postflow.app/settings/account/api). Once you have your
    token, include it in the Authorization header of your API requests as
    follows:



    ```http

    Authorization: Bearer YOUR_API_TOKEN

    ```



    ### Headers


    API requests must include the following headers:


    ```http

    Accept: application/json

    Content-Type: application/json

    ```


    ### Make your first request

    Once you have a token, you can make requests directly to the API. The
    following example returns basic information about your organization:


    ```bash

    curl https://api.postflow.app/v1/organizations \
      -H "Authorization: Bearer YOUR_API_TOKEN" \
      -H "Accept: application/json"
    ```


    ## Rate limits


    The PostFlow API implements rate limiting to ensure fair usage and protect
    against abuse. The default limit is **60 requests per minute** per
    authenticated user.


    Each API response includes the following headers with information about your
    current rate limit status:


    - `X-RateLimit-Limit` - maximum number of requests allowed per minute

    - `X-RateLimit-Remaining` - number of requests remaining in the current
    window

    - `X-RateLimit-Reset` - Unix timestamp when the rate limit resets


    ## PostFlow IDs


    Every object in the PostFlow API has a unique ID. PostFlow uses a system
    called "Snowflake ID" created by Twitter.


    These IDs are **64-bit unsigned integers**. Some programming languages
    (JavaScript) cannot accurately represent 64-bit integers.


    > **Warning:** You must **ALWAYS** use strings for PostFlow IDs in your
    code.



    ### String vs integer in Javascript


    In JavaScript, integers are limited to 53 bits. This causes precision loss
    with large IDs:


    ```javascript

    // This loses precision!

    const id = 10765432100123456789;

    console.log(id.toString()); // "10765432100123458000" — wrong!


    // Use strings instead

    const id = "10765432100123456789";

    console.log(id); // "10765432100123456789" — correct!

    ```


    ### Comparing IDs


    Examples of how you can compare PostFlow IDs:



    ```javascript javascript

    // Use BigInt


    if (BigInt(post1.id) > BigInt(post2.id)) {
        console.log("post1 is newer");
    }

    ```


    ```python python

    # Python handles large integers natively


    if post1.id > post2.id:
        print("post1 is newer")
    ```


    ```php php

    # PHP is safe with 64-bit integers


    if (post1->id > post2->id) {
        dd("post1 is newer");
    }

    ```


    ## Relationships & includes


    Some endpoints support the `include` query parameter to enrich the response
    with related resources. Pass a comma-separated list of relationship names to
    load them alongside the primary data.


    ```http

    GET /posts?include=media

    ```


    Multiple relationships can be included by separating them with a comma:


    ```http

    GET /posts?include=media,labels,postComments

    ```


    ## OpenAPI collection


    The raw OpenAPI specifications for the PostFlow API are available below.
    They can be used with various API tools and code generators that support the
    OpenAPI format.


    - [PostFlow API](https://postflow.app/docs/public/api.json)

    - [Media API](https://postflow.app/docs/public/media.json)


    > You can copy the above URLs to import them into API tools such as Postman.
servers:
  - url: https://api.postflow.app/v1
security:
  - http: []
tags:
  - name: User
  - name: Organization
  - name: Social accounts
  - name: Posts
  - name: Posts bulk
  - name: Post activities
  - name: Post metrics
  - name: Analytics
  - name: Widgets
  - name: Calendar notes
  - name: Groups
  - name: Labels
paths:
  /social-accounts:
    get:
      tags:
        - Social accounts
      summary: List social accounts
      description: Returns all social accounts accessible to the authenticated user.
      operationId: socialAccount.index
      parameters:
        - name: include
          in: query
          description: Available includes are `user`.
          schema:
            type: string
      responses:
        '200':
          description: The collection of `SocialAccountData`
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SocialAccountData'
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
components:
  schemas:
    SocialAccountData:
      type: object
      properties:
        id:
          type: string
        socialNetwork:
          $ref: '#/components/schemas/SocialNetwork'
        organization_id:
          type: string
        user_id:
          type:
            - string
            - 'null'
          description: ID of user who connected social account
        group_id:
          type:
            - string
            - 'null'
          description: The ID of the group to which the social account belongs
        name:
          type:
            - string
            - 'null'
          description: Display name of the social media account
        custom_name:
          type:
            - string
            - 'null'
          description: Custom name to easily recognize this account in PostFlow
        username:
          type:
            - string
            - 'null'
          description: Username for the social media account
        headline:
          type:
            - string
            - 'null'
          description: Headline / bio of the social media account
        followers_count:
          type:
            - integer
            - 'null'
          description: Number of followers, updated once a day
        verified:
          type: boolean
          description: Checks whether the account is verified on the network
        profile_link:
          type:
            - string
            - 'null'
          description: URL to the profile
        avatar_link:
          type:
            - string
            - 'null'
          description: URL to the profile picture of the social account
        social_id:
          type:
            - string
            - 'null'
          description: Unique identifier for the account on the social network
        pi_boards:
          type: array
          description: Pinterest boards for this account
          items:
            $ref: '#/components/schemas/PinterestBoardData'
        pi_default_board_id:
          type:
            - string
            - 'null'
          description: Default Pinterest board ID
        pi_default_section_id:
          type:
            - string
            - 'null'
          description: Default Pinterest board section ID
        ig_shopping_product_tag_eligibility:
          type: boolean
          description: >-
            Determines whether an Instagram account is eligible to tag products
            from the catalog
        yt_playlists:
          type:
            - array
            - 'null'
          description: YouTube playlists for this account
          items:
            type: string
        yt_categories:
          type:
            - array
            - 'null'
          description: YouTube categories for this account
          items:
            type: string
        connection_expired_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The date on which the access token expired. If this value is not
            null, you must manually refresh the connection for the account
        external_sync_enabled:
          type: boolean
          description: >-
            Automatically sync posts that were published on this account outside
            of PostFlow
        created_at:
          type: string
          format: date-time
          description: The date the account was first connected to PostFlow
        user:
          anyOf:
            - $ref: '#/components/schemas/UserData'
              description: >-
                User who connected social account. This data is not always
                available, depends on the endpoint and the `include` parameter
            - type: 'null'
      required:
        - id
        - socialNetwork
        - organization_id
        - user_id
        - group_id
        - name
        - custom_name
        - username
        - headline
        - followers_count
        - verified
        - profile_link
        - avatar_link
        - social_id
        - pi_boards
        - pi_default_board_id
        - pi_default_section_id
        - ig_shopping_product_tag_eligibility
        - yt_playlists
        - yt_categories
        - connection_expired_at
        - external_sync_enabled
        - created_at
        - user
      title: SocialAccountData
    SocialNetwork:
      type: string
      enum:
        - twitter
        - linkedin
        - linkedin_page
        - facebook
        - instagram
        - tiktok
        - bluesky
        - pinterest
        - google_business_profile
        - youtube
        - threads
        - snapchat
        - dribbble
        - tumblr
      x-enum-varnames:
        - Twitter
        - LinkedIn
        - LinkedInPage
        - FacebookPage
        - Instagram
        - TikTok
        - Bluesky
        - Pinterest
        - GoogleBusinessProfile
        - YouTube
        - Threads
        - Snapchat
        - Dribbble
        - Tumblr
      title: SocialNetwork
    PinterestBoardData:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        privacy:
          type: string
        description:
          type:
            - string
            - 'null'
        image_cover_url:
          type:
            - string
            - 'null'
        sections:
          type: array
          default: []
          items:
            $ref: '#/components/schemas/PinterestBoardSectionData'
      required:
        - id
        - name
        - privacy
        - description
        - image_cover_url
        - sections
      title: PinterestBoardData
    UserData:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
        phone:
          type:
            - string
            - 'null'
        inviter_id:
          type:
            - string
            - 'null'
          description: The ID of the user who invited the user to the organization
        organization_id:
          type: string
        role:
          $ref: '#/components/schemas/UserRole'
        is_client:
          type: boolean
        can_approve:
          type: boolean
          description: Determines whether the user can approve posts
        can_connect_account:
          type: boolean
          description: >-
            Determines whether the user can connect social media accounts to the
            organization
        can_access_all_groups:
          type: boolean
          description: >-
            Determines whether the user has permissions to all groups in the
            organization. If not, check the permissions for the individual
            groups in `groupIds`
        self_approval:
          type: boolean
          description: >-
            Automatically grant your approval when you assign yourself as the
            assignee
        time_format_24:
          type: boolean
          description: The user's preferred time format
        week_start_day:
          $ref: '#/components/schemas/WeekDay'
          description: >-
            The user's preferred start of the calendar week


            `0` Sunday <br/> `1` Monday <br/> `2` Tuesday <br/> `3` Wednesday
            <br/> `4` Thursday <br/> `5` Friday <br/> `6` Saturday
        date_format:
          $ref: '#/components/schemas/DateFormat'
          description: |-
            The user's preferred date format

            `1` DMY <br/> `2` MDY <br/> `3` YMD
        color:
          $ref: '#/components/schemas/BaseColor'
        avatar:
          type:
            - string
            - 'null'
          description: URL to the profile image of the user
        invited_at:
          type:
            - string
            - 'null'
          format: date-time
          description: The date the user was invited to join the organization
        created_at:
          type: string
          format: date-time
          description: The date the user signed up
        open_cu_links_in_app:
          type: boolean
          description: >-
            The user's preference for how to open ClickUp links, in the app or
            in a browser
          default: false
        groupIds:
          type: array
          description: >-
            The IDs of the groups the user has access to. Always check
            `can_access_all_groups` first to see if the user has access to all
            groups.


            If the user has permissions to all groups, this value will be an
            empty array
          default: []
          items:
            type: string
      required:
        - id
        - name
        - email
        - phone
        - inviter_id
        - organization_id
        - role
        - is_client
        - can_approve
        - can_connect_account
        - can_access_all_groups
        - self_approval
        - time_format_24
        - week_start_day
        - date_format
        - color
        - avatar
        - invited_at
        - created_at
        - open_cu_links_in_app
        - groupIds
      title: UserData
    PinterestBoardSectionData:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
      title: PinterestBoardSectionData
    UserRole:
      type: string
      enum:
        - owner
        - manager
        - member
        - viewer
      x-enum-varnames:
        - Owner
        - Manager
        - Member
        - Viewer
      title: UserRole
    WeekDay:
      type: integer
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
      x-enum-varnames:
        - Sunday
        - Monday
        - Tuesday
        - Wednesday
        - Thursday
        - Friday
        - Saturday
      description: >-
        `0` Sunday <br/> `1` Monday <br/> `2` Tuesday <br/> `3` Wednesday <br/>
        `4` Thursday <br/> `5` Friday <br/> `6` Saturday
      title: WeekDay
    DateFormat:
      type: integer
      enum:
        - 1
        - 2
        - 3
      x-enum-varnames:
        - DMY
        - MDY
        - YMD
      description: '`1` DMY <br/> `2` MDY <br/> `3` YMD'
      title: DateFormat
    BaseColor:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
      x-enum-varnames:
        - Red
        - Green
        - Blue
        - Yellow
        - Orange
        - Pink
        - Purple
        - Sky
        - Gray
      description: >-
        `1` Red <br/> `2` Green <br/> `3` Blue <br/> `4` Yellow <br/> `5` Orange
        <br/> `6` Pink <br/> `7` Purple <br/> `8` Sky <br/> `9` Gray
      title: BaseColor
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
  securitySchemes:
    http:
      type: http
      scheme: bearer

````