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

# Account Connect Link

> A Henry-hosted link that lets a buyer connect their own login at a store without the password passing through your app: they type it into Henry's page, which stores it as `POST /account/connect` does (encrypted, never returned). Any store whose checkout can sign in takes one, as in hosted checkout; others answer `409`.

Also returns the login's current state and `gmail`, the inbox the store emails sign-in codes to, with its connect link until it is connected. After the buyer signs in, the page offers that Gmail link too.



## OpenAPI

````yaml /v1/api-reference/openapi.documented.json post /account/connect-link
openapi: 3.1.0
info:
  title: Henry Labs API
  version: 1.18.0
  description: Playground for Henry Labs API endpoints
  contact:
    name: Henry Labs API Support
    email: support@henrylabs.ai
servers:
  - url: https://api.henrylabs.ai/v1
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Product
    description: Product search, details, and data enrichment
  - name: Cart
    description: Universal user shopping cart management
  - name: Orders
    description: Order management post purchase
  - name: Merchants
    description: Merchant information and status
  - name: Card
    description: Card tokenization and management
  - name: Account
    description: Buyers' own logins at stores that check out on customers' own accounts
paths:
  /account/connect-link:
    post:
      tags:
        - Account
      summary: Account Connect Link
      description: >-
        A Henry-hosted link that lets a buyer connect their own login at a store
        without the password passing through your app: they type it into Henry's
        page, which stores it as `POST /account/connect` does (encrypted, never
        returned). Any store whose checkout can sign in takes one, as in hosted
        checkout; others answer `409`.


        Also returns the login's current state and `gmail`, the inbox the store
        emails sign-in codes to, with its connect link until it is connected.
        After the buyer signs in, the page offers that Gmail link too.
      operationId: accountConnectLink
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/accountConnectLinkInput'
      responses:
        '200':
          description: A link for the buyer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accountConnectLinkResponse'
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                  message:
                    type: string
                required:
                  - success
                  - status
                  - message
                additionalProperties: false
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                  message:
                    type: string
                required:
                  - success
                  - status
                  - message
                additionalProperties: false
        '404':
          description: No store with this host
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                  message:
                    type: string
                required:
                  - success
                  - status
                  - message
                additionalProperties: false
        '409':
          description: >-
            The store's checkout doesn't sign in, so there is no login to
            connect
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                  message:
                    type: string
                required:
                  - success
                  - status
                  - message
                additionalProperties: false
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import HenrySDK from '@henrylabs/sdk';

            const client = new HenrySDK({
              apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.account.connectLink({
              buyerEmail: 'jane@example.com',
              merchantHost: 'uniqlo.com',
            });

            console.log(response.data);
components:
  schemas:
    accountConnectLinkInput:
      type: object
      properties:
        merchantHost:
          type: string
          minLength: 1
          description: >-
            The store, by the host Henry names it with (for example
            `uniqlo.com`). A URL is accepted and reduced to its host; a leading
            `www.` is ignored.
          example: uniqlo.com
        buyerEmail:
          type: string
          format: email
          pattern: >-
            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
          description: >-
            The buyer the login belongs to: the `buyer.email` your purchases at
            this store carry. Matched case-insensitively.
          example: jane@example.com
      required:
        - merchantHost
        - buyerEmail
    accountConnectLinkResponse:
      type: object
      properties:
        success:
          type: boolean
        status:
          type: string
        message:
          type: string
        data:
          type: object
          properties:
            merchantHost:
              type: string
              description: The store the link connects a login at.
              example: amazon.com
            buyerEmail:
              type: string
              description: The buyer the login is filed under, lowercased.
              example: jane@example.com
            login:
              type: string
              enum:
                - none
                - connected
                - failed
              description: >-
                The buyer's login at this store now. `none`: nothing connected
                yet. `connected`: purchases here sign in with it. `failed`: the
                store would not sign in with it, so purchases here are refused
                until the buyer connects it again through `loginUrl`.
              example: none
            loginUrl:
              type: string
              description: >-
                Henry-hosted page to give the buyer: they type their username
                and password for the store there, never to you. Opening it again
                replaces the login. Valid for 24 hours.
              example: >-
                https://api.henrylabs.ai/v1/account/login/eyJhbGciOiJIUzI1NiJ9...
            expiresAt:
              type: string
              description: When `loginUrl` stops working (ISO 8601).
              example: '2026-11-27T05:00:00.000Z'
            gmail:
              $ref: '#/components/schemas/accountGmail'
          required:
            - merchantHost
            - buyerEmail
            - login
            - loginUrl
            - expiresAt
            - gmail
          additionalProperties: false
      required:
        - success
        - status
        - message
        - data
      additionalProperties: false
    accountGmail:
      type: object
      properties:
        connected:
          type: boolean
          description: >-
            The inbox the store emails (the login's email when the username is
            one, else the buyer's) is connected, so a purchase here can read a
            sign-in code the store emails. Checked with Google on every call: a
            buyer who removed Henry Labs' access in their Google Account reads
            `false` again, with a new `connectUrl`.
          example: false
        connectUrl:
          description: >-
            Link to give the buyer so they can connect that Gmail. Open it in a
            new tab or window, not an iframe. Present until they have. Valid for
            30 days. Beta: Gmail connection works for the Google accounts we've
            enabled for it; contact us to enable your test buyers.
          example: >-
            https://api.henrylabs.ai/v1/tracking/gmail/connect/eyJhbGciOiJIUzI1NiJ9...
          type: string
      required:
        - connected
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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