Ova

How to create a private app in HubSpot?

Published in HubSpot Integrations 5 mins read

Creating a private app in HubSpot allows you to build custom integrations and tools specifically tailored for your single HubSpot account, enhancing its functionality and workflow. This process involves defining your app's basic information and crucial API permissions (scopes).

How to Create a Private App in HubSpot?

Creating a private app in HubSpot is a straightforward process that empowers you to develop custom solutions perfectly aligned with your business needs. These apps serve as a secure bridge between your HubSpot portal and external systems, or as internal tools to automate specific tasks within your account.

Step-by-Step Guide to Private App Creation

Follow these steps to successfully set up your private app in HubSpot:

  1. Access Your HubSpot Settings:

    • In your HubSpot account, locate and click the settings icon (⚙️) in the main navigation bar, usually found in the top right corner.
  2. Navigate to Private Apps:

    • In the left sidebar menu, scroll down and navigate to Integrations.
    • Under "Integrations," click on Private Apps. This section lists any private apps you've already created or provides the option to create new ones.
  3. Initiate App Creation:

    • Click the Create private app button. This will open the app creation interface, starting with the "Basic Info" tab.
  4. Configure Basic Information (Basic Info Tab):

    • On the Basic Info tab, you'll configure the fundamental details of your app. This typically includes:
      • App name: A unique and descriptive name for your app (e.g., "Custom Data Sync," "Website Lead Scraper").
      • Description: A brief explanation of what your app does and its purpose.
      • Logo: Upload an optional logo to easily identify your app.
      • Company name: Your company's name.
      • Developer email: An email address for support or notifications related to the app.
    • These details help you and other users understand the app's function at a glance.
  5. Define API Permissions (Scopes Tab):

    • After configuring basic info, click the Scopes tab. Scopes are crucial as they define what data and functionalities your app can access and modify within your HubSpot account via the API.
    • At the top of the page, click Add new scope or select the necessary scopes from the available categories.

    Understanding Scopes:
    HubSpot organizes its API access into various scopes, each granting permission to specific areas like:

    • crm.objects.contacts.read (read contact data)
    • crm.objects.contacts.write (create/update contact data)
    • crm.schemas.custom_objects.read (read custom object definitions)
    • forms (access forms data)
    • tickets (manage tickets)

    Best Practices for Scopes:

    • Least Privilege: Always select only the scopes absolutely necessary for your app to function. Granting excessive permissions can pose security risks.
    • Review Regularly: As your app evolves, periodically review and adjust its scopes to ensure they remain appropriate.
  6. Review and Create App:

    • Once you've selected all necessary scopes, review all your settings across the "Basic Info" and "Scopes" tabs.
    • After confirming everything is correct, click the Create app button (or similar, depending on HubSpot's UI).
  7. Obtain Your Access Token:

    • Upon successful creation, HubSpot will generate an Access Token for your private app. This token is essential for authenticating your API requests.
    • Important: Copy this token immediately and store it securely. HubSpot will only display it once. If you lose it, you'll need to generate a new one, which invalidates the old token.

    Example of an Access Token usage (conceptual):

    GET /crm/v3/objects/contacts?limit=10
    Authorization: Bearer YOUR_ACCESS_TOKEN

Why Use Private Apps?

Private apps are ideal for scenarios where you need:

  • Custom Integrations: Connect HubSpot with internal systems, legacy databases, or specialized third-party services not available in the App Marketplace.
  • Workflow Automation: Build tools to automate specific, complex tasks unique to your business processes. For instance, a private app could automatically update contact properties based on external data sources or create deals after specific internal events.
  • Data Synchronization: Keep data consistent between HubSpot and another system (e.g., syncing customer data with an ERP or accounting software).
  • Enhanced Reporting: Pull raw HubSpot data into external reporting tools for custom analytics that go beyond standard HubSpot reports.

Key Considerations for Private App Development

When developing with private apps, keep these points in mind:

  • API Rate Limits: Be aware of HubSpot's API rate limits to avoid disruptions. Design your app to handle these limits gracefully, potentially by implementing retry mechanisms or batching requests. You can monitor your API usage in your HubSpot account settings.
  • Security: Protect your access token at all costs. Never embed it directly in client-side code, and ensure any server-side applications handling the token are secured.
  • Error Handling: Implement robust error handling in your application to gracefully manage API errors, network issues, or unexpected responses.
  • Documentation: Maintain clear documentation for your private app, including its purpose, how it works, required scopes, and any maintenance notes. This is especially important if multiple developers or team members will be involved.

Examples of Private App Use Cases

Here are a few practical examples of how private apps can be utilized:

  • Custom Lead Scoring: Develop an internal tool that calculates a unique lead score based on proprietary algorithms and updates a custom contact property in HubSpot.
  • Automated Invoice Generation: When a deal reaches a specific stage in HubSpot, trigger a private app to create an invoice in an external accounting system using deal and contact data.
  • Website Chat Integration: Integrate a niche live chat platform with HubSpot, allowing chat transcripts to be saved as contact notes or activities.
  • Employee Onboarding Automation: Use HubSpot's custom objects and a private app to manage employee onboarding tasks, syncing data with HR systems.

By leveraging private apps, you gain immense flexibility to extend HubSpot's capabilities, making it an even more powerful platform for your organization.