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

# Connect an account

> Create a workspace-bound OAuth URL. Open the returned URL in a browser to authorize the provider.



## OpenAPI

````yaml /api-reference/openapi.json get /public/v1/workspaces/{workspaceId}/social/{integration}
openapi: 3.0.0
info:
  title: PostlyBee Public API
  description: >-
    Connect accounts, create and manage social posts, inspect analytics and
    notifications, and upload media with the PostlyBee Public API.
  version: 1.0.0
  contact:
    name: PostlyBee Support
    url: https://postlybee.com
    email: support@postlybee.com
  license:
    name: Proprietary
    url: https://postlybee.com/terms
servers:
  - url: https://api.postlybee.com
    description: Production
security: []
tags:
  - name: Workspaces
    description: List workspaces available to the API token.
  - name: Posts
    description: Create, list, update, and delete social posts.
  - name: Media
    description: Upload media and use enabled video generators.
  - name: Accounts
    description: Discover connected social accounts.
  - name: Analytics
    description: Inspect account and published-post performance.
  - name: Notifications
    description: List workspace notifications.
  - name: Utilities
    description: Verify access and find posting slots.
paths:
  /public/v1/workspaces/{workspaceId}/social/{integration}:
    get:
      tags:
        - Accounts
      summary: Connect an account
      description: >-
        Create a workspace-bound OAuth URL. Open the returned URL in a browser
        to authorize the provider.
      operationId: createAccountConnectionUrl
      parameters:
        - name: integration
          required: true
          in: path
          description: Provider identifier, such as x, linkedin, or pinterest.
          schema:
            type: string
        - name: refresh
          required: false
          in: query
          description: Provider account ID when reconnecting an existing account.
          schema:
            type: string
        - name: externalUrl
          required: false
          in: query
          description: Instance URL for providers such as Mastodon.
          schema:
            type: string
        - name: workspaceId
          required: true
          in: path
          description: Workspace ID returned by GET /public/v1/workspaces.
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiOAuthUrlDto'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorDto'
        '401':
          description: The bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorDto'
        '403':
          description: The workspace plan does not allow another account.
        '429':
          description: Hourly API limit exceeded.
      security:
        - public-api: []
components:
  schemas:
    PublicApiOAuthUrlDto:
      type: object
      properties:
        url:
          type: string
          example: https://provider.example.com/oauth/authorize?...
      required:
        - url
    PublicApiErrorDto:
      type: object
      properties:
        msg:
          type: string
          example: Invalid API token
      required:
        - msg
  securitySchemes:
    public-api:
      scheme: bearer
      bearerFormat: API token
      type: http
      description: >-
        User API token from Settings → Public API. Access is restricted by
        scopes and workspace selection.

````