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

> ## Agent Instructions
> PostQueen's hosted API is https://api.postqueen.ai. The public API base is https://api.postqueen.ai/public/v1 and takes the raw API key in the Authorization header, with no Bearer prefix.
> The MCP server for posting is https://api.postqueen.ai/mcp/YOUR_API_KEY (or /mcp with Authorization: Bearer YOUR_API_KEY). docs.postqueen.ai/mcp only searches these docs and cannot post.
> The API key is under Connections > API key in the app, and only workspace admins can see it.

# Create a connect link

> A PostQueen page that connects one new channel to your workspace, for someone to open in a browser.

[Get a connect URL](https://docs.postqueen.ai/public-api/integrations/connect.md) returns the network's own sign-in page. This returns a PostQueen page instead: whoever opens it first reads what connecting the channel means, then continues to the network to sign in and approve. They do not need a PostQueen account, so you can send the link to a client or a teammate.

```json theme={"dark"}
{ "integration": "linkedin-page", "redirectUrl": "https://example.com/settings/social" }
```

## How long a link works

* One hour, and one channel. Once a channel is connected through it, create a new link for the next one.
* A sign-in that was cancelled on the network can be tried again with the same link.
* It cannot reconnect a channel you already have. Use [Get a connect URL](https://docs.postqueen.ai/public-api/integrations/connect.md) with `refresh` for that.

## Which networks it is for

The networks that sign in on their own consent page: Instagram (`instagram`, `instagram-standalone`), Facebook, Threads, X, TikTok, TikTok Business, YouTube, LinkedIn, LinkedIn Page, Pinterest, Google Business Profile, Discord, Slack, Mastodon, Tumblr, Twitch, Kick, VK, Dribbble, MeWe and Whop. Any other network answers `400`: connect it from **Add Channel** in the app.

## After the sign-in

With a `redirectUrl`, the page names that website before the person continues, and the confirmation offers a button back to it. Its query string carries `added` (the network's identifier), `focus` (the new channel's id) and `msg` (a short status). Without one, a person signed in to PostQueen lands on their **Channels** page, and anyone else sees that the channel is connected.

> [!TIP]
>
> The new channel appears in [List channels](https://docs.postqueen.ai/public-api/integrations/list.md).

> [!NOTE]
>
> The plan's channel limit is checked when you create the link and again when the person continues. During the free trial, a network that unlocks when the trial ends answers `406`.


## OpenAPI

````yaml POST /integrations/connect
openapi: 3.1.0
info:
  title: PostQueen Public API
  version: 1.0.0
  license:
    name: MIT
    identifier: MIT
  description: >-
    Schedule posts, upload media, read analytics and manage the channels of your
    PostQueen workspace.


    ## Authentication


    Send your API key in the `Authorization` header exactly as it is, with no
    prefix:


    ```

    Authorization: YOUR_API_KEY

    ```


    The key is under **Connections > API key** in the app. Only a workspace
    Admin or Super Admin can reveal or rotate it. An app your users sign in to
    with OAuth sends its `pos_` access token in the same header, also with no
    prefix. The workspace needs a subscription, and the free trial counts.


    ## Rate limits


    A workspace can send 30 `POST /posts` requests an hour. A request refused
    with `400` or `422` during validation gets its slot back; one refused once
    the posts are being created counts. `POST /upload` and `POST
    /upload-from-url` allow 300 requests an hour each, per workspace. Nothing
    else is limited. A limited endpoint answers with `X-RateLimit-Limit`,
    `X-RateLimit-Remaining` and `X-RateLimit-Reset` headers, and over the limit
    with `429` and `Retry-After` (seconds).


    ## Terminology


    The app says channel, the API says integration. They are the same thing: a
    connected account on a network.
servers:
  - url: https://api.postqueen.ai/public/v1
    description: PostQueen
security:
  - ApiKeyAuth: []
tags:
  - name: Channels
    description: Connected channels. The API calls them integrations.
  - name: Posts
    description: Create, list, change and delete posts
  - name: Media
    description: Upload files to the media library
  - name: Clipping
    description: >-
      Turn a YouTube video into short vertical clips. Not available on PostQueen
      yet
  - name: AI video
    description: Generate a video with AI into the media library
  - name: Analytics
    description: Channel and post metrics
  - name: Notifications
    description: The workspace's notifications
  - name: OAuth
    description: Sign-in for apps that act for other PostQueen workspaces
paths:
  /integrations/connect:
    post:
      tags:
        - Channels
      summary: Create a connect link
      description: >-
        Returns the URL of a PostQueen page that connects one new channel to
        your workspace. Whoever opens it reads what connecting the channel
        means, then continues to the network to sign in and approve the access.
        They do not need a PostQueen account.


        The link works for one hour and for one channel: once a channel is
        connected through it, create a new one for the next. A sign-in that was
        cancelled can be tried again with the same link. It cannot reconnect a
        channel you already have: use Get a connect URL with `refresh` for that.


        It is for networks that sign in on their own consent page. A network
        that connects with a handle, key, password, server address, bot code,
        wallet or the browser extension answers `400`: connect those from **Add
        Channel** in the app.


        The plan's channel limit is checked when you create the link, and again
        when the person continues from the page.
      operationId: createConnectLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - integration
              properties:
                integration:
                  type: string
                  description: >-
                    The network's identifier, for example `youtube`,
                    `linkedin-page` or `instagram-standalone`
                redirectUrl:
                  type: string
                  format: uri
                  maxLength: 2048
                  description: >-
                    An absolute `http` or `https` URL with no `#` fragment. The
                    page names its website before the person continues, and once
                    the channel is connected it offers a button to this URL,
                    with `added` (the network's identifier), `focus` (the new
                    channel's id) and `msg` (a short status) added to its query
                    string. Without it, a person signed in to PostQueen lands on
                    their **Channels** page, and anyone else sees that the
                    channel is connected
            example:
              integration: youtube
              redirectUrl: https://example.com/settings/social
      responses:
        '201':
          description: The URL to hand to the person
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: >-
                      The PostQueen page that connects the channel. It works for
                      one hour and one channel
              example:
                url: https://app.postqueen.ai/integrations/connect/3f9c...
        '400':
          description: >-
            A network that cannot be connected with a link, a `redirectUrl` that
            is refused, or a body that fails validation (the standard error
            shape, with `message` as a list)
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/MessageError'
                  - $ref: '#/components/schemas/NestError'
              examples:
                notLinkable:
                  summary: A network that connects another way
                  value:
                    msg: >-
                      This platform cannot be connected with a link, add it from
                      the PostQueen app instead
                redirect:
                  summary: A redirect URL with a fragment or credentials
                  value:
                    msg: >-
                      The redirect URL must be an absolute http(s) URL without a
                      fragment or credentials
                validation:
                  summary: Validation
                  value:
                    message:
                      - redirectUrl must be a URL address
                    error: Bad Request
                    statusCode: 400
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: The workspace is at its plan's channel limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequired'
              example:
                statusCode: 402
                message: >-
                  You have reached the maximum number of channels for your
                  subscription. Please upgrade your subscription to add more
                  channels.
                url: https://app.postqueen.ai/billing
        '406':
          description: >-
            During the free trial, a network that unlocks when the trial ends
            (X)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageError'
              example:
                msg: >-
                  X unlocks when your free trial ends. End the trial to connect
                  it now.
components:
  schemas:
    MessageError:
      type: object
      description: The error shape of most checks written into the public API itself
      properties:
        msg:
          type: string
    NestError:
      type: object
      description: >-
        The standard error shape: validation errors, not-found errors and rate
        limits
      properties:
        statusCode:
          type: integer
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        error:
          type: string
    PaymentRequired:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        url:
          type: string
          description: The billing page
  responses:
    Unauthorized:
      description: >-
        `No API Key found`, `Invalid API key`, `Invalid OAuth token`, or `No
        subscription found` when the workspace has no subscription
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageError'
          example:
            msg: Invalid API key
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your API key from Connections > API key, or an OAuth access token
        (`pos_...`). Send it as it is, with no `Bearer` prefix.

````

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