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

# Connect a LinkedIn Account (Username/Password)

> Create or update a LinkedIn account

Before connecting a LinkedIn account using email and password authentication, you must first [Create an Identity](/v1/api/identities/create) to associate the account with.
Once you have created an identity, you can use this endpoint to connect their LinkedIn account using their email and password credentials.

<Note>
  **Checkpoint Handling**: LinkedIn will likely require you to complete a checkpoint. Use the [Resolve LinkedIn Checkpoint](/v1/api/linkedin/checkpoint) endpoint to handle this.

  The checkpoint endpoint supports various verification methods including mobile app approval, SMS codes, email verification, 2FA codes, and more. See the checkpoint documentation for detailed handling instructions for each checkpoint type.
</Note>


## OpenAPI

````yaml v1/api/business.json post /identities/{identity_uid}/integrations/linkedin
openapi: 3.1.0
info:
  title: ED's Public API
  description: ED's Public API
  version: 26.622.88
servers:
  - url: https://api.edges.run/v1/
security:
  - APIKeyHeader: []
paths:
  /identities/{identity_uid}/integrations/linkedin:
    post:
      tags:
        - Core
      summary: Create or update a LinkedIn account
      description: Create or update a LinkedIn account
      operationId: create_linkedin_account
      parameters:
        - name: identity_uid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Identity Uid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                auth_data:
                  type: object
                  properties:
                    basic:
                      type: object
                      properties:
                        username:
                          type: string
                          example: elon@musk.com
                        password:
                          type: string
                          example: '********'
                  required:
                    - basic
            example:
              auth_data:
                basic:
                  username: elon@musk.com
                  password: '********'
      responses:
        '200':
          description: Successfully created or updated LinkedIn account.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GenericResponse_AccountPublicWithCheckpointModel_
              example:
                auth_type: BASIC
                setup_source: API
                is_shared: false
                name: elon@musk.com LinkedIn Account
                uid: 123e4567-e89b-12d3-a456-426614174000
                integration_permalink: linkedin
                created_at: '2023-10-01T12:00:00Z'
                level: Classic
                identity_uid: 5678e456-e89b-12d3-a456-426614174001
                checkpoint:
                  type: PHONE_REGISTER
                status: VALID
        '400':
          description: Bad Request.
          content:
            application/json:
              examples:
                invalid_username_password_400:
                  summary: username or password invalid.
                  value:
                    message: username or password invalid.
                    error_label: INVALID-CREDENTIALS-400
        '409':
          description: Conflict.
          content:
            application/json:
              examples:
                identity_management_disabled:
                  summary: Identity Already Has an Account
                  value:
                    message: >-
                      An account is already linked to this identity and
                      integration.
                    error_label: CREATE_OR_UPDATE_ACCOUNT_409_CONFLICT
                linkedin-id-conflict-409:
                  summary: LinkedIn ID conflict.
                  value:
                    message: An account with the same Linkedin ID already exists.
                    error_label: CREATE_OR_UPDATE_ACCOUNT_409_CONFLICT
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: internal Error.
          content:
            application/json:
              examples:
                login-account-500-error:
                  summary: Could not login the account.
                  value:
                    message: Could not login the account.
                    error_label: LOGIN_ACCOUNT_ERROR
                unsupported-challenge-500:
                  summary: Unsupported challenge while logging into LinkedIn.
                  value:
                    message: >-
                      Unsupported challenge identified, please contact the
                      support and provide it with the identity_uid so we can
                      address it.
                    error_label: UNSUPPORTED_CHALLENGE
                login-simple-challenge-500:
                  summary: Can't resolve LinkedIn login challenge.
                  value:
                    message: >-
                      Error while solving challenge, retry in 5 minutes, if it
                      persists contact support
                    error_label: LOGIN_SIMPLE_CHALLENGE
                captcha-challenge-error-500:
                  summary: Captcha Challenge too many attempts.
                  value:
                    message: >-
                      Error while resolving the challenge, the Captcha challenge
                      seem to be pending. Re-send username and password to
                      overcome this
                    error_label: CAPTCHA_CHALLENGE_ERROR
components:
  schemas:
    GenericResponse_AccountPublicWithCheckpointModel_:
      allOf:
        - $ref: '#/components/schemas/AccountPublicWithCheckpointModel'
      title: GenericResponse[AccountPublicWithCheckpointModel]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AccountPublicWithCheckpointModel:
      properties:
        setup_source:
          anyOf:
            - type: string
              enum:
                - MANUAL
                - EXTENSION
                - SHARED
                - API
            - type: 'null'
          title: Setup Source
        auth_method:
          anyOf:
            - type: string
              enum:
                - BASIC
                - OAUTH
                - COOKIES
                - APIKEY
            - type: 'null'
          title: Auth Method
        is_shared:
          type: boolean
          title: Is Shared
          default: false
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        uid:
          type: string
          format: uuid
          title: Uid
        integration_permalink:
          anyOf:
            - type: string
            - type: 'null'
          title: Integration Permalink
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        status:
          type: string
          enum:
            - VALID
            - INVALID
            - PENDING
            - LIMIT_REACHED
          title: Status
        level:
          anyOf:
            - type: string
            - type: 'null'
          title: Level
        user_uid:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Uid
        identity_uid:
          type: string
          format: uuid
          title: Identity Uid
        meta:
          anyOf:
            - $ref: '#/components/schemas/IntegrationAccountMeta'
            - type: 'null'
          title: Meta
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        checkpoint:
          anyOf:
            - $ref: '#/components/schemas/Checkpoint'
            - type: 'null'
        last_synced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Synced At
      type: object
      required:
        - status
        - identity_uid
      title: AccountPublicWithCheckpointModel
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    IntegrationAccountMeta:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        id:
          anyOf:
            - type: string
            - type: integer
            - type: 'null'
          title: Id
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        profile_image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Image Url
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        emails:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Emails
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        phones:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Phones
      type: object
      title: IntegrationAccountMeta
    Checkpoint:
      properties:
        type:
          anyOf:
            - type: string
              enum:
                - 2FA
                - OTP
                - EMAIL
                - IN_APP_VALIDATION
                - PHONE_REGISTER
                - CAPTCHA
                - LOGIN_FORM
                - UNKNOWN
            - type: 'null'
          title: Type
      type: object
      title: Checkpoint
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key required for authentication. Add your API key in the X-API-Key
        header.

````