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

# Connect account

> Returns a five-minute browser connection URL bound to the API-key profile. Facebook, Instagram, LinkedIn personal profiles, Pinterest, Reddit, Threads, TikTok, X, and YouTube return direct provider OAuth URLs. Bluesky returns a PostOnce-hosted app-password form. No existing PostOnce browser session is required. Creating the URL does not confirm connection; list accounts after authorization to verify it.



## OpenAPI

````yaml /openapi/public-api.yaml post /v1/accounts/connect/{platform}
openapi: 3.1.0
info:
  title: PostOnce Public API
  version: 1.0.0-alpha
  description: Public API for PostOnce paid users
servers:
  - url: https://postonce.to/api/public
security:
  - bearerAuth: []
paths:
  /v1/accounts/connect/{platform}:
    post:
      summary: Connect account
      description: >-
        Returns a five-minute browser connection URL bound to the API-key
        profile. Facebook, Instagram, LinkedIn personal profiles, Pinterest,
        Reddit, Threads, TikTok, X, and YouTube return direct provider OAuth
        URLs. Bluesky returns a PostOnce-hosted app-password form. No existing
        PostOnce browser session is required. Creating the URL does not confirm
        connection; list accounts after authorization to verify it.
      parameters:
        - $ref: '#/components/parameters/platform'
      responses:
        '201':
          description: Account connection URL created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectAccountResponse'
        '401':
          description: Missing, invalid, revoked, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
        '403':
          description: Missing required scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Unsupported platform.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    platform:
      name: platform
      in: path
      required: true
      schema:
        type: string
        enum:
          - bluesky
          - facebook
          - instagram
          - linkedin
          - pinterest
          - reddit
          - snapchat
          - threads
          - tiktok
          - twitter
          - youtube
      description: Social platform to connect.
  schemas:
    ConnectAccountResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            hosted_url:
              type: string
              nullable: true
              example: >-
                https://postonce.to/dashboard/accounts?connect=twitter&source=public_api
            authorization_url:
              type: string
              nullable: true
              description: >-
                Five-minute browser connection URL bound to the API-key profile
                with signed state. OAuth platforms return a direct provider URL;
                Bluesky returns a PostOnce-hosted app-password form.
              example: https://www.tiktok.com/v2/auth/authorize/?client_key=...
            mode:
              type: string
              enum:
                - credential_form_url
                - oauth_authorization_url
              example: oauth_authorization_url
            platform:
              type: string
              example: twitter
    AuthErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_api_key
            message:
              type: string
              example: Invalid API key.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: workflow_limit_reached
            message:
              type: string
              example: You have reached the maximum number of workflows for your plan.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````