> ## 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.

# Get accounts

> List Instagram and TikTok accounts connected for scheduling

Returns social accounts connected to the authenticated user. Use each account `id` when calling [Create Post](/api-reference/posts/create_post).

```bash theme={null}
curl "https://mvp2.tryunsora.com/api/v1/accounts" \
  -H "Authorization: Bearer uns_live_YOUR_API_KEY"
```

Example response:

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": "cm123abc",
      "provider": "instagram",
      "providerAccountId": "...",
      "accountName": "My Page",
      "accountUsername": "mypage",
      "profilePicture": "https://...",
      "expiresAt": "2026-12-01T00:00:00.000Z"
    },
    {
      "id": "cm456def",
      "provider": "tiktok",
      "providerAccountId": "...",
      "accountName": "My TikTok",
      "accountUsername": "mytiktok",
      "profilePicture": "https://...",
      "expiresAt": "2026-12-01T00:00:00.000Z"
    }
  ]
}
```

`provider` values include `instagram` and `tiktok`.


## OpenAPI

````yaml GET /accounts
openapi: 3.1.0
info:
  title: Unsora API
  version: 1.2.0
  description: >-
    Public API for Unsora integrations. Authenticate with Clerk JWT or
    uns_live_* API key. API keys are rate-limited to 60 requests/minute and
    support idempotency keys. Async jobs complete via polling GET
    /image/status/{id}.
servers:
  - url: https://mvp.tryunsora.com/api/v1
    description: Versioned API (recommended)
security: []
tags:
  - name: Clippings
  - name: Connect
  - name: Image Generations
  - name: Music Generations
  - name: Influencer Studio
  - name: Posts
  - name: Thumbnails
  - name: User
  - name: Video Generations
paths:
  /accounts:
    get:
      tags:
        - Connect
      summary: Get accounts
      description: >-
        Returns social accounts connected to the authenticated user for
        scheduling posts.
      responses:
        '200':
          description: Connected accounts list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectedAccountsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ConnectedAccountsResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/SocialAccount'
      required:
        - success
        - data
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: string
        code:
          type: string
        message:
          type: string
      required:
        - error
    SocialAccount:
      type: object
      properties:
        id:
          type: string
        provider:
          type: string
        providerAccountId:
          type: string
        accountName:
          anyOf:
            - type: string
            - type: 'null'
        accountUsername:
          anyOf:
            - type: string
            - type: 'null'
        profilePicture:
          anyOf:
            - type: string
              format: uri
            - type: 'null'
        expiresAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
      required:
        - id
        - provider
        - providerAccountId
        - accountName
        - accountUsername
        - profilePicture
        - expiresAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Clerk session JWT or Unsora API key (uns_live_*)

````