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

# Connect with email + password

> Start an attempt-based login. Returns immediately with an `attempt_id` and `polling_url`; the login runs in the background. Poll `GET /v1/connect/login/{attemptId}` until `state` is `completed_success` (an `account_id` is present) or a challenge state (`needs_otp`, `needs_app_otp`, `needs_email`, `needs_face_otp`). Pass `auth_type: "mobile_app"` to start a QR/mobile session the creator approves on their own device. Requires `accounts:write`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/connect/login
openapi: 3.1.0
info:
  title: onlyfanskit REST API
  description: >-
    Connect OnlyFans accounts and act on them over HTTP. Authenticate with a
    bearer API key, connect a creator account once, then call any method or
    stream realtime events. Not affiliated with OnlyFans or Fenix International
    Limited.
  version: 1.0.0
servers:
  - url: https://api.onlyfanskit.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Identity, keys, and usage for the calling org.
  - name: Connect
    description: Link OnlyFans accounts via cookie, cURL, email/password, or mobile.
  - name: Accounts
    description: Manage connected accounts.
  - name: SDK
    description: Call any SDK method against a connected account.
  - name: Realtime
    description: Server-Sent Events stream of account activity.
  - name: Webhooks
    description: HTTP callbacks for account events.
paths:
  /v1/connect/login:
    post:
      tags:
        - Connect
      summary: Connect with email + password
      description: >-
        Start an attempt-based login. Returns immediately with an `attempt_id`
        and `polling_url`; the login runs in the background. Poll `GET
        /v1/connect/login/{attemptId}` until `state` is `completed_success` (an
        `account_id` is present) or a challenge state (`needs_otp`,
        `needs_app_otp`, `needs_email`, `needs_face_otp`). Pass `auth_type:
        "mobile_app"` to start a QR/mobile session the creator approves on their
        own device. Requires `accounts:write`.
      operationId: connectLogin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectLoginBody'
      responses:
        '202':
          description: Attempt started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Attempt'
        '503':
          $ref: '#/components/responses/Problem'
components:
  schemas:
    ConnectLoginBody:
      type: object
      properties:
        auth_type:
          type: string
          enum:
            - credentials
            - mobile_app
          default: credentials
        email:
          type: string
          format: email
          description: Required for `credentials` login.
        password:
          type: string
          description: Required for `credentials` login.
        label:
          type: string
          maxLength: 120
        remember_credentials:
          type: boolean
          description: Seal credentials to enable later reauthentication.
        proxy_country:
          $ref: '#/components/schemas/ProxyCountry'
    Attempt:
      type: object
      properties:
        attempt_id:
          type: string
        state:
          type: string
          description: Lifecycle state of the attempt.
          enum:
            - pending
            - awaiting_mobile_session
            - needs_otp
            - needs_app_otp
            - needs_email
            - needs_face_otp
            - wrong_2fa_code_retry
            - completed_success
            - completed_failed
        account_id:
          type: string
          nullable: true
          description: Present once `state` is `completed_success`.
        polling_url:
          type: string
          nullable: true
        verification_page_url:
          type: string
          nullable: true
        phone_url:
          type: string
          nullable: true
        embed_url:
          type: string
          nullable: true
        otp_channel:
          type: string
          nullable: true
        email_mask:
          type: string
          nullable: true
        next_actions:
          type: array
          items:
            type: string
    ProxyCountry:
      type: string
      enum:
        - us
        - uk
      description: Egress proxy region for the account's traffic.
    Problem:
      type: object
      description: RFC 9457 problem details. Errors carry `application/problem+json`.
      properties:
        type:
          type: string
          format: uri
          description: Stable problem type URI under https://onlyfanskit.dev/problems/.
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        instance:
          type: string
        code:
          type: string
          description: Stable slug — matches the last segment of `type`.
        retryable:
          type: boolean
        retryAfterSec:
          type: integer
        upstreamCode:
          type: integer
          nullable: true
        upstreamMessage:
          type: string
          nullable: true
      required:
        - type
        - title
        - status
  responses:
    Problem:
      description: An RFC 9457 problem detail.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````