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

# Connect an account

> Create a link that connects a social account to Unsora, to open yourself or send to whoever owns the account.

Returns the platform's sign-in link, the same link **Copy link** makes in the app. Whoever opens it signs in to the platform, and the account appears in [List accounts](https://tryunsora.com/docs/api-reference/accounts/get_accounts.md). The link works for one hour.

```bash theme={null}
curl -X POST "https://mvp.tryunsora.com/api/v1/accounts/connect" \
  -H "Authorization: Bearer uns_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"platform": "instagram"}'
```

```json theme={null}
{
  "success": true,
  "data": {
    "platform": "instagram",
    "url": "https://www.instagram.com/oauth/authorize?...",
    "shared": true,
    "expiresAt": "2026-12-04T15:00:00.000Z"
  }
}
```

## Shared or not

* **Shared** (the default): anyone who opens the link can connect an account, with no Unsora login. Use it to send the link to a client. It ends on a public "Connected" page.
* **`"shared": false`**: for you. It ends on your accounts page in the app.

## Reconnecting

When an account's sign-in expires, pass its id as `reconnect_account_id` with the same platform. Reconnecting refreshes the account and doesn't use a new slot on your plan.

## Platforms

`youtube`, `tiktok`, `instagram`, `instagram_facebook` (an Instagram business account through its Facebook Page), `facebook`, `threads`, `bluesky`, `pinterest`, `linkedin`, `x`, `google_business`.

Bluesky signs in from the account's handle, so it needs `handle` (for example `alice.bsky.social`) and its link is for you only.

## Errors

| HTTP | Code | When |
| - | - | - |
| `400` | `INVALID_PLATFORM` | Unknown platform |
| `400` | | Bluesky without `handle`, or `reconnect_account_id` is another platform's account |
| `403` | `PLAN_REQUIRED` | No active plan |
| `403` | `ACCOUNT_LIMIT_REACHED` | Every account slot on your plan is used |
| `403` | `PLATFORM_UNAVAILABLE` | The platform isn't live yet |
| `404` | | `reconnect_account_id` isn't one of your accounts |


## OpenAPI

````yaml POST /accounts/connect
openapi: 3.1.0
info:
  title: Unsora API
  version: 1.4.0
  description: >-
    Public API for Unsora integrations. Authenticate with an Unsora API key
    (`uns_…`, created under Developers → API keys in the app) as a Bearer token
    in the Authorization header. Limit: 60 requests per minute per key; over it,
    429 with code RATE_LIMIT_EXCEEDED.
servers:
  - url: https://mvp.tryunsora.com/api/v1
    description: Production
  - url: /api/v1
    description: This server
security: []
tags:
  - name: User
  - name: Models
    description: >-
      Every video, image and motion-control model, with each model's inputs
      taken from the provider's own request schema and prices quoted live. One
      generate endpoint covers all of them.
  - name: Video
  - name: Image
  - name: Influencer
  - name: Thumbnail
  - name: Clipping
  - name: Music
  - name: Voiceover
  - name: Upscaler
  - name: Subtitle removal
  - name: Motion control
  - name: Avatar
  - name: Movie materials
  - name: Voice clones
  - name: Voice changer
  - name: Uploads
  - name: Scheduler
paths:
  /accounts/connect:
    post:
      tags:
        - Scheduler
      summary: Create a link to connect a social account
      description: >-
        Returns a sign-in link that connects a social account to your Unsora
        account: the link the app's **Copy link** button makes. Open it yourself
        or send it to whoever owns the account; they sign in to the platform and
        the account appears in GET /accounts. The link works for one hour. A
        shared link (the default) needs no Unsora login and ends on the public
        /connected page; `shared: false` ends on your signed-in accounts page.
        Connecting needs a free slot on your plan, except when
        `reconnect_account_id` names an account of the same platform whose
        sign-in expired. Bluesky needs `handle` and its link is never shared.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - platform
              properties:
                platform:
                  type: string
                  enum:
                    - youtube
                    - tiktok
                    - instagram
                    - instagram_facebook
                    - facebook
                    - threads
                    - bluesky
                    - pinterest
                    - linkedin
                    - x
                    - google_business
                  description: >-
                    Platform to connect. `instagram_facebook` connects an
                    Instagram business account through the Facebook Page it is
                    linked to. `google` is accepted for YouTube.
                shared:
                  type: boolean
                  default: true
                  description: >-
                    true: anyone who opens the link can connect an account, with
                    no Unsora login. false: for you, ending on your signed-in
                    accounts page.
                reconnect_account_id:
                  type: string
                  description: >-
                    An account id from GET /accounts whose sign-in expired.
                    Reconnecting the same platform account refreshes it and
                    takes no new slot.
                handle:
                  type: string
                  description: 'Bluesky only: the account''s handle, e.g. alice.bsky.social.'
      responses:
        '200':
          description: Connect link
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      platform:
                        type: string
                        example: instagram
                      url:
                        type: string
                        description: The platform's sign-in page. Open it in a browser.
                      shared:
                        type: boolean
                      expiresAt:
                        type: string
                        format: date-time
        '400':
          description: >-
            Unknown platform, a Bluesky link without handle, or a reconnect id
            of another platform
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            `PLAN_REQUIRED` (no active plan), `ACCOUNT_LIMIT_REACHED` (every
            slot on the plan is used) or `PLATFORM_UNAVAILABLE` (the platform
            isn't live yet)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: reconnect_account_id is not one of your accounts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: string
        code:
          type: string
        message:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Unsora API key (`uns_…`). A Clerk session token also works.

````

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