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
ofhttps://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.
Authorizations
Query Parameters
The first name of the user.
The last name of the user.
The email of the user. If an account for this email already exists, the user will instead be asked to login.
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.