Add authentication with Basic Authentication
APIs using Basic Authentication will authenticate users with a username and password. In your Zapier integration using Basic Auth, Zapier includes the username and password credentials in the API request bundle every time Zapier polls an API endpoint for new data or posts new data to an API endpoint.
Example Basic Auth screen for users inside Zapier
Use Basic Auth if your API requires a username and password or other basic fields, needs no special configuration, and specifically if your API leverages “HTTP Basic Authentication”. For further customization of your login flow or to request additional data from users, API Key authentication may be a better fit.
1. Build an input form
- Open the Authentication tab in Zapier visual builder and select Basic Auth.
The pre-built input form for Basic Authentication includes a username and password field already.
Add additional fields if your API documentation requires it by selecting Add Fields and fill in the details for your field. Add the most commonly needed fields first, in the order users expect, as you cannot reorder fields once added.
Add the required Key, the name your API uses to reference this field.
Fill in the optional fields, as appropriate, especially the Label:
– Label: A human-friendly name for this field that will be shown to users in the authentication form.
– Required? (checkbox): Check if this field is required for successful authentication.
– Type: All input fields use the
string text field by default; select
password instead if you would like to obscure the data as users enter it.
– Help Text: Include details to assist users in authenticating with your app, especially if they may be unsure where to find the data needed within your app. Format text with Markdown, and include a hyperlink if needed.
– Input Format: (optional) Help users figure out exactly what piece of data you need them to enter. For example, for a subdomain, https://.yourdomain.com/.
– Default Value: Include a value for this field to be used as a fallback. For optional fields, the default value is set on initial connection creation and used in the API call instead of missing or null values every time the Zap runs. For required fields, this value is used during connection creation, but not when the Zap runs (Zapier raises an error for missing/null values instead).
Input fields marked as password and all authentication fields with sensitive, private data such as both username and password from Basic Auth are automatically censored at runtime. These values are stored in the Auth bundle and used in API calls, but are replaced in Zapier’s logs with a censored value like this
Computed fields are not applicable to Basic Authentication and are only used with OAuth v2 and Session Auth.
Each input field is listed with its label, key, type, and required status in your authentication settings. Click the field to edit it, or click the gear icon and select Delete to remove a field.
- Once you’ve added all the input fields to your authentication form, select Continue
2. Add a Test API Request
Add an API call to your API that requires no configuration, typically a
/mecall. Add the URL for the API call, and set the call type, typically a
GET. This will test the user-entered credentials to ensure it enables a successful API call to your app.
The username and password input fields are automatically included in the URL Params and the HTTP Headers. Click Show Options to remove the details where they are not needed. It is typically not recommended to pass any sensitive information such as the password in the URL Params. Passing it through the headers or even the body is preferable.
3. Configure a Connection Label
Review connection label documentation to optionally differentiate the app accounts users connect.
4. Test your authentication
Connect a valid user account to test authentication.