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

# Get Authorization Status

> Interface description: Polling platform authorization session status



## OpenAPI

````yaml /openapi/en/aitoearn.openapi.json get /api/v2/channels/accounts/auth/{platform}/status/{sessionId}
openapi: 3.0.1
info:
  title: AiToEarn Open Platform API
  description: >-
    AiToEarn Open Platform API. You can switch between the China and
    international sites for testing. Business success is determined by whether
    the response body has code === 0.
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: China site
  - url: https://aitoearn.ai
    description: International site
security: []
tags:
  - name: AI Services
  - name: AI Services/Video Generation
  - name: AI Services/Image Generation
  - name: Channel Management
  - name: Channel Management/Accounts
  - name: Channel Management/Publishing
  - name: Channel Management/Platforms
  - name: Channel Management/Works
  - name: Channel Management/Account Groups
  - name: Channel Management/Authorization
  - name: Asset Management
  - name: AI Services/Large Language Models
paths:
  /api/v2/channels/accounts/auth/{platform}/status/{sessionId}:
    get:
      tags:
        - Channel Management/Authorization
      summary: Get Authorization Status
      description: 'Interface description: Polling platform authorization session status'
      operationId: AuthController_getAuthStatus_v2
      parameters:
        - name: platform
          in: path
          description: Platform identification
          required: true
          example: ''
          schema:
            type: string
        - name: sessionId
          in: path
          description: Session ID
          required: true
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: >-
            The request has been processed by the service. Business success is
            determined by whether the response body has code === 0.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AuthSessionStatusVo'
                  code:
                    type: integer
                    description: >-
                      Business status code. 0 means success; non-zero means a
                      business error.
                  message:
                    type: string
                    description: Response message.
                  requestId:
                    type: string
                    description: Request ID.
                  timestamp:
                    type: integer
                    description: Error response timestamp in Unix milliseconds.
                required:
                  - code
                  - message
              examples:
                success:
                  summary: Success
                  value:
                    code: 0
                    message: Request succeeded
                    data:
                      sessionId: string
                      status: pending
                      requiresSelection: true
                      errorCode: 1
                      expiresAt: '2026-07-02T12:00:00.000Z'
                      accountId: string
                      accountIds:
                        - string
                      accounts:
                        - accountId: string
                          platform: douyin
                          platformUid: string
                          displayName: string
                          account: string
                          avatarUrl: string
                      selectableAccounts:
                        - platform: douyin
                          platformUid: string
                          displayName: string
                          account: string
                          avatarUrl: string
                          parentPlatformUid: string
                validationFailed10002:
                  summary: ValidationFailed (10002)
                  value:
                    code: 10002
                    message: Parameter validation failed
                    data: {}
                    timestamp: 1772099056662
                unauthorized401:
                  summary: Unauthenticated or invalid API Key
                  value:
                    code: 401
                    message: Unauthorized
                    data: {}
                    timestamp: 1772099056662
                channelAuthPlatformMismatch15040:
                  summary: ChannelAuthPlatformMismatch (15040)
                  value:
                    code: 15040
                    message: Authorization platform does not match
                    data: {}
                    timestamp: 1772099056662
                channelAuthSessionInvalid15039:
                  summary: ChannelAuthSessionInvalid (15039)
                  value:
                    code: 15039
                    message: Authorization session is invalid or expired
                    data: {}
                    timestamp: 1772099056662
      deprecated: false
      security:
        - apikey-header-X-Api-Key: []
components:
  schemas:
    AuthSessionStatusVo:
      type: object
      properties:
        sessionId:
          type: string
          description: Authorization Session ID
        status:
          type: string
          enum:
            - pending
            - completed
            - failed
          description: Authorization Session Status
        requiresSelection:
          type: boolean
          description: Do you need to choose a secondary account?
        errorCode:
          description: Authorization failure error code
          type: number
        expiresAt:
          description: Authorization session expiration time
          type: string
          format: date-time
        accountId:
          description: First local account ID
          type: string
        accountIds:
          description: Local account ID list
          type: array
          items:
            type: string
        accounts:
          description: List of connected accounts
          type: array
          items:
            type: object
            properties:
              accountId:
                type: string
                description: Local account ID
              platform:
                type: string
                enum:
                  - douyin
                  - xhs
                  - wxSph
                  - KWAI
                  - youtube
                  - wxGzh
                  - bilibili
                  - twitter
                  - tiktok
                  - facebook
                  - instagram
                  - threads
                  - pinterest
                  - linkedin
                  - google_business
                description: platform type
              platformUid:
                type: string
                description: Platform account UID
              account:
                description: Platform account supplements unique identification
                type: string
              displayName:
                type: string
                description: Platform account display name
              avatarUrl:
                description: Platform account avatar URL
                type: string
            required:
              - accountId
              - platform
              - platformUid
              - displayName
        selectableAccounts:
          description: List of selectable platform accounts
          type: array
          items:
            type: object
            properties:
              platform:
                type: string
                enum:
                  - douyin
                  - xhs
                  - wxSph
                  - KWAI
                  - youtube
                  - wxGzh
                  - bilibili
                  - twitter
                  - tiktok
                  - facebook
                  - instagram
                  - threads
                  - pinterest
                  - linkedin
                  - google_business
                description: platform type
              platformUid:
                type: string
                description: Platform account UID
              account:
                description: Platform account supplements unique identification
                type: string
              displayName:
                type: string
                description: Platform account display name
              avatarUrl:
                description: Platform account avatar URL
                type: string
              parentPlatformUid:
                description: Parent platform account UID
                type: string
            required:
              - platform
              - platformUid
              - displayName
      required:
        - sessionId
        - status
        - requiresSelection
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Need to get API Key from AiToEarn. Click to go to ["API Key Obtaining
        Tutorial"](/en/use/api-key).

````