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

> ## Agent Instructions
> Base URL: https://api.social-api.ai/v1. Send your API key in the Authorization header: Authorization: Bearer <your API key>.
> Every error response from /v1 is JSON: { "error": { "code", "message", "meta" (optional) }, "request_id" }. Branch on error.code; use error.message only for logs.
> A 429 response carries a Retry-After header, in seconds, when the limit has a known wait.
> Paginated list endpoints return next_cursor, at the top level or inside pagination (see /guides/pagination). Pass it as the cursor query parameter to get the next page. An absent or empty next_cursor means you have the last page.
> Treat every ID as an opaque string: do not parse it or assume a format.
> Support differs by platform and by operation. Check /platforms/overview before assuming an operation works on a platform. An unsupported operation returns 501 with error.code resource.not_supported.

# Start a migration

> Starts a migration from another provider with an API key from your account there, and returns the first assessment of your accounts. Calling it again replaces the key. You must accept the current authorisation text: send its `version` from `GET /v1/migrations/{provider}`. Dashboard sessions only; API keys get 403.



## OpenAPI

````yaml /api-reference/openapi.json post /migrations
openapi: 3.0.0
info:
  description: >-
    Unified social media inbox API. Read and respond to comments, DMs, reviews,
    and mentions across Instagram, Facebook, Threads, Google Business Profile,
    TikTok, LinkedIn, and YouTube through a single REST API. X/Twitter and
    Trustpilot coming soon.
  title: SocialAPI.AI
  contact:
    name: SocialAPI.AI Support
    email: support@social-api.ai
  license:
    name: MIT
  version: '1.0'
servers:
  - url: https://api.social-api.ai/v1
security: []
paths:
  /migrations:
    post:
      tags:
        - Migration
      summary: Start a migration
      description: >-
        Starts a migration from another provider with an API key from your
        account there, and returns the first assessment of your accounts.
        Calling it again replaces the key. You must accept the current
        authorisation text: send its `version` from `GET
        /v1/migrations/{provider}`. Dashboard sessions only; API keys get 403.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/api_endpoints.StartMigrationRequest'
        description: Provider, key and accepted authorisation version
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.MigrationResponse'
        '400':
          description: >-
            Invalid body, unknown provider, or authorisation not accepted
            (`migration.authorisation_required`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '403':
          description: >-
            Dashboard session required, the feature is not available on your
            account yet (`auth.beta_only`), or your role cannot manage
            migrations; ask an Admin or the Owner (`auth.insufficient_role`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '409':
          description: >-
            Another SocialAPI account is already migrating this provider account
            (`migration.already_claimed`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '422':
          description: >-
            The provider rejected the key (`migration.key_invalid`), or it lacks
            read access to profiles or accounts (`migration.key_restricted`,
            `meta.required_group` names what is missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '502':
          description: The provider did not answer; retry (`migration.source_unavailable`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api_endpoints.StartMigrationRequest:
      type: object
      required:
        - authorisation_version
        - key
        - provider
      properties:
        authorisation_version:
          description: >-
            Version of the authorisation text you accepted, as returned in
            `authorisation.version`.
          type: string
        key:
          description: >-
            API key from your account with that provider. It needs read access
            to profiles and accounts.
          type: string
        provider:
          description: Identifier of the provider you are moving from.
          type: string
    api_endpoints.MigrationResponse:
      type: object
      properties:
        assessed_at:
          description: >-
            When the accounts were last read, RFC 3339. Null until the first
            read succeeds.
          type: string
        assessment:
          description: >-
            Your accounts and how they map to SocialAPI. Null until started, or
            when your provider could not be read.
          allOf:
            - $ref: '#/components/schemas/api_endpoints.MigrationAssessment'
        assessment_error:
          description: >-
            Why `assessment` is null on a started migration:
            `migration.key_invalid`, `migration.key_restricted` or
            `migration.source_unavailable`.
          type: string
        authorisation:
          description: Text to accept before starting, and its version.
          allOf:
            - $ref: '#/components/schemas/api_endpoints.MigrationAuthorisation'
        authorisation_version:
          description: Version of the authorisation text accepted. Null until started.
          type: string
        authorised_at:
          description: When the authorisation was accepted, RFC 3339. Null until started.
          type: string
        base_url:
          description: Base URL to set in your existing client. Null until started.
          type: string
          example: https://z.social-api.ai/api
        created_at:
          description: When the migration started, RFC 3339. Null until started.
          type: string
        cut_over:
          description: Accounts already reconnected to SocialAPI.
          type: integer
        forwarded_calls:
          description: Requests sent through the base URL since the migration started.
          type: integer
        key_hint:
          description: Start and end of the key in use. Null until started.
          type: string
        started:
          description: True once a migration has started.
          type: boolean
    api_endpoints.ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/api_endpoints.ErrorBody'
    api_endpoints.MigrationAssessment:
      type: object
      properties:
        brands:
          description: Brands needed across all profiles.
          type: integer
        pages_per_brand:
          description: Most Pages any one Brand needs on a single platform.
          type: integer
        profiles:
          description: One entry per profile at your provider.
          type: array
          items:
            $ref: '#/components/schemas/api_endpoints.MigrationProfile'
        recommended_plan:
          description: Cheapest plan that fits.
          allOf:
            - $ref: '#/components/schemas/api_endpoints.MigrationPlan'
        servable_accounts:
          description: Accounts SocialAPI can serve.
          type: integer
        stays_with_provider:
          description: Accounts that stay with your provider, by platform.
          type: array
          items:
            $ref: '#/components/schemas/api_endpoints.MigrationUnsupported'
    api_endpoints.MigrationAuthorisation:
      type: object
      properties:
        text:
          type: string
        version:
          type: string
    api_endpoints.ErrorBody:
      type: object
      properties:
        code:
          type: string
          example: resource.not_found
        message:
          type: string
          example: Account not found
        meta:
          type: object
          additionalProperties: {}
    api_endpoints.MigrationProfile:
      type: object
      properties:
        brands:
          type: integer
        id:
          type: string
        name:
          type: string
        pages_per_brand:
          type: integer
        servable_accounts:
          type: integer
        splits:
          description: Why the profile needs more than one Brand, one line per reason.
          type: array
          items:
            type: string
    api_endpoints.MigrationPlan:
      type: object
      properties:
        brands_limit:
          type: integer
        name:
          type: string
        pages_per_brand:
          type: integer
        tier:
          type: string
          example: starter
    api_endpoints.MigrationUnsupported:
      type: object
      properties:
        count:
          type: integer
        platform:
          description: Platform name as your provider reports it.
          type: string
        reason:
          description: >-
            Why the accounts stay: "unserved platform", "ads", "telephony",
            "commerce", "unknown platform" or "linked to another account".
          type: string
  securitySchemes:
    BearerAuth:
      description: >-
        Prefix your API key with "Bearer ". Example: `Authorization: Bearer
        sapi_key_...`
      type: apiKey
      name: Authorization
      in: header

````

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