> ## 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 Keys in the app, and only workspace admins can see it.

# Run a video helper

> Look up a value a video generator needs, such as the voices an Image Text Slides video can use.

Some generators take an input you cannot guess. `image-text-slides` needs a `voice`, and its `loadVoices` helper lists the voices it can use. It is the only helper today. `seedance` has none.

```bash theme={"system"}
curl -X POST "https://api.postqueen.ai/public/v1/video/function" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"identifier": "image-text-slides", "functionName": "loadVoices"}'
```

The answer lists the voices:

```json theme={"system"}
{
  "voices": [
    {
      "id": "YOUR_VOICE_ID",
      "name": "Sarah",
      "preview_url": "https://cdn.example.com/voice-sample.mp3"
    }
  ]
}
```

Send the `id` you picked as `customParams.voice` to [Generate a video](/public-api/videos/generate). `preview_url` plays a sample of the voice. Running a helper uses no credit.

## If it fails

| Answer                                           | What to do                                                                                        |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
| `400` `Function ... not found on video instance` | The generator has no helper of that name. The only helper is `loadVoices`, on `image-text-slides` |
| `400` with a `message` list                      | `identifier` or `functionName` is missing                                                         |
| `404` `Video generator ... not found`            | The `identifier` is not a generator. Use `image-text-slides` or `seedance`                        |
| `500` `Internal server error`                    | The voice service did not answer. Try again                                                       |

The `404` body names the identifier you sent:

```json theme={"system"}
{ "statusCode": 404, "message": "Video generator image-slides not found" }
```


## OpenAPI

````yaml POST /video/function
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 Keys** 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, and a request
    refused with `400` counts too. `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:
  /video/function:
    post:
      tags:
        - AI video
      summary: Run a video helper
      description: >-
        Runs a helper that looks up a value a generator's `customParams` need.
        The only helper today is `loadVoices` on `image-text-slides`, which
        lists the voices its `voice` takes. An `identifier` that is not a
        generator answers `404` with `Video generator <identifier> not found`.
      operationId: runVideoFunction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - identifier
                - functionName
              properties:
                identifier:
                  type: string
                  description: The generator, such as `image-text-slides`
                functionName:
                  type: string
                  description: The helper, such as `loadVoices`
                params:
                  type: object
                  description: The helper's inputs. `loadVoices` takes none
            example:
              identifier: image-text-slides
              functionName: loadVoices
      responses:
        '201':
          description: The helper's answer. For `loadVoices`, the voices
          content:
            application/json:
              schema:
                type: object
                properties:
                  voices:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Send it as `voice`
                        name:
                          type: string
                        preview_url:
                          type: string
                          description: A sample of the voice
              example:
                voices:
                  - id: YOUR_VOICE_ID
                    name: Sarah
                    preview_url: https://cdn.example.com/voice-sample.mp3
        '400':
          description: >-
            `identifier` or `functionName` is missing, or the generator has no
            helper of that name
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NestError'
              example:
                statusCode: 400
                message: Function voices not found on video instance
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            `Video generator <identifier> not found`: the `identifier` is not a
            video generator
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NestError'
              example:
                statusCode: 404
                message: Video generator my-generator not found
        '500':
          description: The voice service refused the call
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NestError'
              example:
                statusCode: 500
                message: Internal server error
components:
  schemas:
    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
    MessageError:
      type: object
      description: The error shape of most checks written into the public API itself
      properties:
        msg:
          type: string
  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 Keys, or an OAuth access token
        (`pos_...`). Send it as it is, with no `Bearer` prefix.

````