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

# List Slack channels

> List the channels of a connected Slack workspace, to post into one.

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

A Slack account is a whole workspace, so each post picks a channel. Send a channel's `id` as `accounts[].settings.channel_id` on [Create a post](/docs/api-reference/posts/create.md), or save it in the account's [Post defaults](/docs/api-reference/accounts/update-account-defaults.md) so posts without one go there.

```json theme={null}
{
  "accounts": [
    {
      "id": 16410,
      "settings": {
        "channel_id": "C01ANNOUNCE"
      }
    }
  ]
}
```

* Public channels are listed to everyone who can reach the account. PostSyncer posts in a public channel without joining it. A post with files joins the channel first, since Slack shares files only in a channel the app is in.
* Private channels are listed only when the key belongs to the person who connected the workspace: their names are private to their members. A private channel shows up once the app is in it: type `/invite @PostSyncer` in the channel.
* The list is the one PostSyncer keeps for the account, not read from Slack each time. When it's more than 10 minutes old, it's read again in the background: `meta.refreshing` is `true`, and asking again in a moment gives the new list. `meta.synced_at` says when it was last read, and is `null` until the first read.
* When the last read from Slack failed, `meta.error` says why in a plain sentence, and the list is the last one read. PostSyncer then waits 5 minutes before reading again, so `meta.refreshing` stays `false` in that time. `meta.error` is `null` otherwise.

## Errors

| Status | `code` | When | Retry? |
| - | - | - | - |
| 400 | `INVALID_PROVIDER` | The account isn't a Slack account. | No: use a Slack 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. |
| 409 | `NEEDS_RECONNECT` | The Slack workspace needs to be reconnected in PostSyncer. | After the workspace is reconnected. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |

## Related

* [Post to Slack](/docs/platforms/slack.md): what a Slack post takes.
* [Create a post](/docs/api-reference/posts/create.md): `channel_id` in `settings`.


## OpenAPI

````yaml GET /accounts/{account}/slack/channels
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 14 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.
  - name: Billing
    description: >-
      The owner's plan, invoices and the links that pay for, change or cancel
      it.
  - name: Team
    description: A workspace's teammates and invitations, and their roles.
  - name: Notifications
    description: >-
      Your bell and notification settings, and the workspace's Slack, Discord
      and Telegram channels.
  - name: Blog-to-social
    description: Blog feeds that turn a workspace's new articles into posts.
  - name: Products
    description: Products the workspace's posts can promote.
  - name: Contacts
    description: People who commented on the workspace's posts, and the lists they are on.
  - name: Profile
    description: 'The key''s user: their name and sign-in email.'
  - name: API keys
    description: 'Your API keys: listing and deleting them.'
  - name: Agent sign-up
    description: >-
      An AI agent signs a person up with a code emailed to them, and gets their
      first key. No key needed.
paths:
  /accounts/{account}/slack/channels:
    get:
      tags:
        - Accounts
      summary: List Slack channels
      description: >-
        Needs `accounts:read`. The channels of a connected Slack posting
        workspace the app can post to, from the list PostSyncer keeps for the
        account. A list older than 10 minutes is read from Slack again in the
        background: `meta.refreshing` is then `true`, and asking again in a
        moment returns the new list. When the last read failed, `meta.error`
        says why and no new read starts for 5 minutes. Public channels are
        listed to everyone; private channels the app was invited to are listed
        only to the person who connected the workspace. Send a channel `id` as
        `accounts[].settings.channel_id` on Create a post.
      operationId: listSlackPostingChannels
      parameters:
        - name: account
          in: path
          required: true
          description: The Slack workspace account.
          schema:
            type: integer
      responses:
        '200':
          description: Channels in the connected Slack workspace.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SlackPostingChannel'
                  meta:
                    type: object
                    required:
                      - synced_at
                      - refreshing
                      - error
                    properties:
                      synced_at:
                        type: string
                        format: date-time
                        nullable: true
                        description: >-
                          When the list was last read from Slack. `null` until
                          the first read.
                      refreshing:
                        type: boolean
                        description: >-
                          `true` when the list is being read from Slack again in
                          the background. Ask again in a moment for the new
                          list.
                      error:
                        type: string
                        nullable: true
                        description: >-
                          Why the last read from Slack failed, in plain words,
                          or `null`. The list is the last one read.
              examples:
                default:
                  summary: Channels in a connected Slack workspace
                  value:
                    data:
                      - id: C01ANNOUNCE
                        name: announcements
                        is_private: false
                        is_member: true
                        num_members: 42
                        topic: Halden Coffee launches
                    meta:
                      synced_at: '2030-03-14T09:30:00+00:00'
                      refreshing: false
                      error: null
        '400':
          description: The account is not a Slack account.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - INVALID_PROVIDER
              examples:
                invalid_provider:
                  summary: Wrong platform
                  value:
                    message: Account is not a Slack 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: Account not found in your accessible workspaces.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                not_found:
                  summary: No such account
                  value:
                    message: Not found.
        '409':
          description: The Slack account needs to be reconnected.
          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 required
                  value:
                    message: >-
                      This Slack workspace needs to be reconnected in PostSyncer
                      before its channels can be listed.
                    code: NEEDS_RECONNECT
        '429':
          $ref: '#/components/responses/RateLimited429'
components:
  schemas:
    SlackPostingChannel:
      type: object
      description: >-
        A channel in a connected Slack workspace (GET
        /accounts/{account}/slack/channels).
      required:
        - id
        - name
        - is_private
        - is_member
        - num_members
        - topic
      properties:
        id:
          type: string
          description: Channel ID to pass as accounts[].settings.channel_id.
        name:
          type: string
        is_private:
          type: boolean
        is_member:
          type: boolean
        num_members:
          type: integer
        topic:
          type: string
    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.
        error:
          type: string
          description: >-
            A code a few errors add, such as `rate_limited`. See [Handle
            errors](/essentials/error-handling#answers-with-an-error-code).
  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.