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

# Get User Login Link

> This will create a link that can be used for "quick account creation" for a user.

When going to this link, if the provided email already has a Zapier account, the user will be asked to log in.
If the email does not have a Zapier account, the user will be asked to create an account with the provided email and name.

Upon creating an account or logging in, the user will be taken to the `redirect_to` URL.

A suggested flow for this is:
- Check if you have an AI Actions OAuth token for a user
- If you do not, send the user to a page on your site for initiating PKCE OAuth flow, storing the `code_verifier` for them securely.
- Use this endpoint, with a `redirect_to` of `https://actions.zapier.com/oauth/authorize/` with the following query parameters:
    - client_id: Your AI Actions OAuth client ID
    - scope: `openid nla:exposed_actions:execute`
    - response_type: `code`
    - redirect_uri: The URL on your site that will handle the OAuth callback, must be in the list of allowed redirect URIs for your AI Actions OAuth client.
    - code_challenge: The SHA256 hash of the `code_verifier` from the previous step.
    - code_challenge_method: `S256`

The user will get a Zapier account, be brought to AI Actions where they will see the OAuth consent screen, and then will be brought back to your site
with an OAuth `code` that can be used with `https://actions.zapier.com/oauth/token/` with the following data in the body with `Content-Type: application/x-www-form-urlencoded`:
    - client_id: Your AI Actions OAuth client ID
    - grant_type: `authorization_code`
    - code_verifier: The verifier stored for your user when generating the login URL
    - redirect_uri: The same URL you used for the `redirect_uri` in the previous step.
    - code: The code in the query parameters of the URL that the user was redirected to.



## OpenAPI

````yaml get /api/v2/auth/login-link/
openapi: 3.1.0
info:
  title: Zapier AI Actions API V2
  version: 1.0.0
  description: ''
servers:
  - url: https://actions.zapier.com
security: []
paths:
  /api/v2/auth/login-link/:
    get:
      tags:
        - auth
      summary: Get User Login Link
      description: >-
        This will create a link that can be used for "quick account creation"
        for a user.


        When going to this link, if the provided email already has a Zapier
        account, the user will be asked to log in.

        If the email does not have a Zapier account, the user will be asked to
        create an account with the provided email and name.


        Upon creating an account or logging in, the user will be taken to the
        `redirect_to` URL.


        A suggested flow for this is:

        - Check if you have an AI Actions OAuth token for a user

        - If you do not, send the user to a page on your site for initiating
        PKCE OAuth flow, storing the `code_verifier` for them securely.

        - Use this endpoint, with a `redirect_to` of
        `https://actions.zapier.com/oauth/authorize/` with the following query
        parameters:
            - client_id: Your AI Actions OAuth client ID
            - scope: `openid nla:exposed_actions:execute`
            - response_type: `code`
            - redirect_uri: The URL on your site that will handle the OAuth callback, must be in the list of allowed redirect URIs for your AI Actions OAuth client.
            - code_challenge: The SHA256 hash of the `code_verifier` from the previous step.
            - code_challenge_method: `S256`

        The user will get a Zapier account, be brought to AI Actions where they
        will see the OAuth consent screen, and then will be brought back to your
        site

        with an OAuth `code` that can be used with
        `https://actions.zapier.com/oauth/token/` with the following data in the
        body with `Content-Type: application/x-www-form-urlencoded`:
            - client_id: Your AI Actions OAuth client ID
            - grant_type: `authorization_code`
            - code_verifier: The verifier stored for your user when generating the login URL
            - redirect_uri: The same URL you used for the `redirect_uri` in the previous step.
            - code: The code in the query parameters of the URL that the user was redirected to.
      operationId: api_meta_get_user_login_link
      parameters:
        - in: query
          name: sign_up_first_name
          schema:
            description: The first name of the user.
            title: Sign Up First Name
            type: string
          required: true
          description: The first name of the user.
        - in: query
          name: sign_up_last_name
          schema:
            description: The last name of the user.
            title: Sign Up Last Name
            type: string
          required: true
          description: The last name of the user.
        - in: query
          name: sign_up_email
          schema:
            description: >-
              The email of the user. If an account for this email already
              exists, the user will instead be asked to login.
            title: Sign Up Email
            type: string
          required: true
          description: >-
            The email of the user. If an account for this email already exists,
            the user will instead be asked to login.
        - in: query
          name: redirect_to
          schema:
            default: /config/login-success
            description: >-
              The AI Actions URL to redirect the user to after login. If you
              have an OAuth client, you can use this to redirect to the consent
              screen for your OAuth application.
            title: Redirect To
            type: string
          required: false
          description: >-
            The AI Actions URL to redirect the user to after login. If you have
            an OAuth client, you can use this to redirect to the consent screen
            for your OAuth application.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginLink'
      security:
        - AccessPointApiKeyHeader: []
        - AccessPointOAuth: []
components:
  schemas:
    LoginLink:
      properties:
        login_link:
          anyOf:
            - type: string
            - type: 'null'
          title: Login Link
      title: LoginLink
      type: object
  securitySchemes:
    AccessPointApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
    AccessPointOAuth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize/
          tokenUrl: /oauth/token/
          scopes:
            nla:exposed_actions:execute: Run AI Actions
            openid: OpenID Connect scope

````