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

# Link Password provider

> Create or submit link provider password via the Junction API. Requires authentication with your team API key.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
       --url {{BASE_URL}}/v2/link/provider/password/{provider} \
       --header 'Accept: application/json' \
       --header 'Content-Type: application/json' \
       --header 'x-vital-link-token: <VITAL-LINK-TOKEN>' \
       --data '
  {
       "username": "test",
       "password": "test"
  }
  '
  ```

  ```typescript TypeScript theme={null}
  import { JunctionClient, JunctionEnvironment, PasswordProviders } from "@junction-api/sdk";

  const client = new JunctionClient({
      apiKey: "YOUR_API_KEY",
      environment: JunctionEnvironment.Sandbox,
  });

  const data = await client.link.connectPasswordProvider({
      provider: PasswordProviders.Whoop,
      username: "<username>",
      password: "<password>",
  });
  ```

  ```python Python theme={null}
  from junction import Junction, PasswordProviders
  from junction.environment import JunctionEnvironment

  client = Junction(
      api_key="YOUR_API_KEY",
      environment=JunctionEnvironment.SANDBOX,
  )

  data = client.link.connect_password_provider(
      PasswordProviders.WHOOP,
      username="<username>",
      password="<password>",
  )
  ```

  ```java Java theme={null}
  import com.junction.api.Junction;
  import com.junction.api.core.Environment;
  import com.junction.api.resources.link.requests.IndividualProviderData;
  import com.junction.api.types.PasswordProviders;

  Junction client = Junction.builder()
      .apiKey("YOUR_API_KEY")
      .environment(Environment.SANDBOX)
      .build();

  var data = client.link().connectPasswordProvider(
      PasswordProviders.WHOOP,
      IndividualProviderData.builder()
          .username("<username>")
          .password("<password>")
          .build()
  );
  ```

  ```go Go theme={null}
  import (
      "context"

      junction "github.com/junction-api/junction-go"
      "github.com/junction-api/junction-go/client"
      "github.com/junction-api/junction-go/option"
  )

  c := client.NewClient(
      option.WithApiKey("YOUR_API_KEY"),
      option.WithBaseURL(junction.Environments.Sandbox),
  )

  response, err := c.Link.ConnectPasswordProvider(context.TODO(), &junction.IndividualProviderData{
      Provider: junction.PasswordProvidersWhoop,
      Username: "<username>",
      Password: "<password>",
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</RequestExample>


## OpenAPI

````yaml POST /v2/link/provider/password/{provider}
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.4.495
servers:
  - url: https://api.us.junction.com
    x-fern-server-name: Production
  - url: https://api.eu.junction.com
    x-fern-server-name: ProductionEU
  - url: https://api.sandbox.us.junction.com
    x-fern-server-name: Sandbox
  - url: https://api.sandbox.eu.junction.com
    x-fern-server-name: SandboxEU
security:
  - apiKeyAuth: []
paths:
  /v2/link/provider/password/{provider}:
    post:
      tags:
        - link
      summary: Connect Password Provider
      description: This connects auth providers that are password based.
      operationId: connect_password_provider_v2_link_provider_password__provider__post
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PasswordProviders'
            title: Providers that require password auth
        - name: x-vital-link-token
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Vital-Link-Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IndividualProviderData'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderLinkResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security: []
components:
  schemas:
    PasswordProviders:
      type: string
      enum:
        - whoop
        - renpho
        - peloton
        - zwift
        - eight_sleep
        - beurer_api
        - dexcom
        - hammerhead
        - my_fitness_pal
        - kardia
        - abbott_libreview
        - tandem_source
      title: PasswordProviders
      description: ℹ️ This enum is non-exhaustive.
    IndividualProviderData:
      properties:
        username:
          type: string
          title: Username
          description: Username for provider
        password:
          type: string
          title: Password
          description: Password for provider
        region:
          anyOf:
            - $ref: '#/components/schemas/Region'
            - type: 'null'
          description: >-
            Provider region to authenticate against. Only applicable to specific
            providers. ℹ️ This enum is non-exhaustive.
      type: object
      required:
        - username
        - password
      title: IndividualProviderData
    ProviderLinkResponse:
      properties:
        state:
          type: string
          enum:
            - success
            - error
            - pending_provider_mfa
          title: State
          description: ℹ️ This enum is non-exhaustive.
        redirect_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Redirect Url
          description: >-
            The redirect URL you supplied when creating the Link Token (via
            `POST /v2/link/token`).
        error_type:
          anyOf:
            - type: string
              enum:
                - invalid_token
                - token_expired
                - token_not_validated
                - token_consumed
                - provider_credential_error
                - provider_password_expired
                - provider_api_error
                - unsupported_region
                - duplicate_connection
                - required_scopes_not_granted
                - incorrect_mfa_code
                - user_cancelled
            - type: 'null'
          title: Error Type
          description: >-
            The Link Error Type. This field is populated only when state is
            `error`. ℹ️ This enum is non-exhaustive.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: >-
            A developer-readable debug description of the Link Error. This field
            is populated only when state is `error`.
        provider_mfa:
          anyOf:
            - $ref: '#/components/schemas/ProviderMFARequest'
            - type: 'null'
          description: >-
            The provider MFA request. This field is populated only when state is
            `pending_provider_mfa`.
        provider:
          $ref: '#/components/schemas/PasswordProviders'
          deprecated: true
          description: ℹ️ This enum is non-exhaustive.
        connected:
          type: boolean
          title: Connected
          deprecated: true
        provider_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Id
          deprecated: true
      type: object
      required:
        - state
        - provider
        - connected
        - provider_id
      title: ProviderLinkResponse
      example:
        state: success
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    Region:
      type: string
      enum:
        - us
        - eu
        - de
        - fr
        - ca
        - br
        - ar
        - cl
        - co
        - mx
        - gb
        - ie
        - au
        - nz
        - nl
        - at
        - be
        - bh
        - ch
        - cz
        - dk
        - eg
        - es
        - fi
        - gr
        - hr
        - il
        - it
        - jo
        - kw
        - lb
        - lu
        - 'no'
        - om
        - pl
        - pt
        - qa
        - sa
        - se
        - si
        - sk
        - tr
        - za
        - in
        - sg
        - hk
        - kr
        - ph
        - tw
      title: Region
      description: ℹ️ This enum is non-exhaustive.
    ProviderMFARequest:
      properties:
        method:
          type: string
          enum:
            - sms
            - email
          title: Method
          description: >-
            The MFA method requested by the password provider to complete
            authentication. ℹ️ This enum is non-exhaustive.
        hint:
          type: string
          title: Hint
          description: >-
            The MFA hint provided by the password provider, e.g., the redacted
            phone number.
      type: object
      required:
        - method
        - hint
      title: ProviderMFARequest
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````