Import users into any HubSpot account from an external app
Learn how to set up the User import source feature to register your public app as a data source for bulk user imports. This means customers who have installed your app in their HubSpot account can use it to bulk import users. This feature is only available for public apps.
Before you configure your app to use the User import source feature, you'll need to set up and host two API endpoints that will accept POST
requests from HubSpot when a customer who's installed your app triggers a bulk user import.
One endpoint you set up will be to return account data, while the other will return user data. The specifications for each endpoint are detailed in the sections below.
Requests are sent with the HubSpot Signature. To ensure that the requests that are received are from HubSpot, they can be validated using the signature: https://developers.hubspot.com/docs/api/webhooks/validating-requests
The URL of the endpoint that returns account data should be structured like https://BASE_PATH_OF_YOUR_SERVICE/feature/USER_IMPORT/event/FETCH_ACCOUNTS
.
HubSpot wil provide the following fields in the body of the request:
The response you return when HubSpot makes a POST request to the endpoint should be a JSON-formatted object with the following fields:
The URL of the endpoint that returns account data should be structured like https://BASE_PATH_OF_YOUR_SERVICE/feature/USER_IMPORT/event/FETCH_USERS.
HubSpot wil provide the following fields in the body of the request:
The response you return when HubSpot makes a POST request to the endpoint should be a JSON-formatted object with the following fields:
- In your app developer account, navigate to apps in the main navigation bar.
- Select the app.
- Click the Auth tab.
- In the Scopes section, click Add new scope.
- In the right panel, select the
settings.users.write
scope and click Update. - Click Save changes.
- In the left sidebar, click More features.
- In the Target URL section, enter the URL that HubSpot will make a
POST
request to when events trigger. Or, use this testing URL:https://api.hubspot.com/integration-components-example/v1/sample-app-webhooks/beta-app
- Click to toggle the User import source switch on.
- Click Save changes.
Test the functionality
After setting up your two endpoints and configuring your app settings, you can test your endpoints out:
- Install your app.
- In your HubSpot account, click the settings icon in the top navigation bar.
- In the left sidebar menu, navigate to Users & Teams.
- Click Create user.
- In the Or create multiple users at once section, click your app to begin the import process.
- Follow the steps in this article to import and set up your users.
Thank you for your feedback, it means a lot to us.