Back

Hubspot Ticketing API Essential Guide

Aug 9, 20246 minute read

What type of API does Hubspot Ticketing provide?

HubSpot Ticketing primarily uses a REST API. Here are the key points about HubSpot's API types:

REST API

  • HubSpot's primary API type is REST (Representational State Transfer).
  • The REST API allows interaction with various HubSpot resources like contacts, companies, deals, and tickets.
  • It uses standard HTTP methods (GET, POST, PUT, DELETE) for operations.
  • All HubSpot APIs are built using REST conventions and designed to have a predictable URL structure.

GraphQL API

  • HubSpot also offers GraphQL support.
  • GraphQL provides more flexibility in querying data and can reduce the number of API requests needed.
  • It allows developers to request specific data fields and nested data in a single query.
  • While GraphQL is available, REST remains the primary API type for most HubSpot operations.

Key Considerations

  • All HubSpot API calls are made under https://api.hubapi.com and all responses return standard JSON.
  • The APIs use many standard HTTP features, including methods (POST, GET, PUT, DELETE) and error response codes.
  • For the Tickets API specifically, it allows you to manage and create ticket records, as well as sync ticket data between HubSpot and other systems.
  • HubSpot provides client libraries in various programming languages to help developers interact with the APIs more easily.

In summary, while HubSpot offers both REST and GraphQL APIs, the Ticketing API primarily uses REST. The REST API is the most widely used and supported API type for interacting with HubSpot's resources, including tickets.

Does the Hubspot Ticketing API have webhooks?

Webhook Support

Yes, the official HubSpot API does support webhooks, including for tickets.

Event Types

You can subscribe to the following ticket-related events:

  • ticket.creation
  • ticket.deletion
  • ticket.propertyChange
  • ticket.associationChange

Key Points

  • Webhooks are set up for a HubSpot app, not individual accounts. Any account that installs your app will be subscribed to its webhook subscriptions.

  • You need to set up a HubSpot app and specify a URL to receive webhook notifications.

  • The webhook endpoint needs to be a publicly available, secure (HTTPS) endpoint that can handle the webhook payloads.

  • Webhook payloads are sent as POST requests containing JSON formatted data.

Limitations

  • There are no specific webhook events for ticket notes or engagements like meetings. The documentation does not list these as available subscription types.

  • For engagement events like booking a meeting, you may need to use polling with the Engagements API instead of webhooks.

Best Practices

  • Validate webhook requests using the X-HubSpot-Signature header to ensure they are coming from HubSpot.

  • Consider using webhooks instead of polling for better scalability, especially for apps with many installations.

In summary, while the HubSpot Ticketing API does support webhooks for core ticket events, it appears to lack specific webhook support for ticket notes or engagement events like meetings. You may need to use a combination of webhooks and polling APIs to cover all your use cases.

Rate Limits and other limitations

The API Rate Limits for the HubSpot Ticketing API are as follows:

General Rate Limits

HubSpot has different rate limits based on the product tier and whether the API add-on is used [1][4]:

  • Free & Starter:

    • Burst: 100 requests per 10 seconds
    • Daily: 250,000 requests
  • Professional & Enterprise:

    • Burst: 150 requests per 10 seconds
    • Daily: 500,000 requests
  • API add-on (any tier):

    • Burst: 200 requests per 10 seconds
    • Daily: 1,000,000 requests

OAuth Apps

For OAuth apps, each HubSpot account that installs your app is limited to 100 requests every 10 seconds [1]. This limit applies regardless of the account's subscription tier or API add-on status.

Key Points to Consider

  1. Daily limits reset at midnight based on the HubSpot account's time zone setting [1][4].

  2. Integrations exceeding their limits will receive error responses with a 429 response code [1][4].

  3. Requests resulting in an error response should not exceed 5% of your total daily requests [1][4].

  4. Integrations that poll HubSpot for new or updated information are limited to polling for changes at intervals of five minutes or more [4].

  5. The search API endpoints are rate limited to four requests per second per authentication token [1].

Best Practices

  1. Cache data for repeat calls to reduce the number of API requests [2].

  2. Use batch APIs when possible to update multiple records in a single request [2].

  3. Utilize smart lists and workflow starting conditions to automate processes and reduce API calls [2].

  4. Use webhooks to get updated data from HubSpot instead of constantly polling for changes [2].

  5. Monitor your API usage using the rate limit headers provided in API responses [1][2].

By following these guidelines and best practices, you can effectively work within the HubSpot API rate limits and optimize your integration's performance.

Latest API Version

Based on the search results provided, here are the key points regarding the most recent version of the HubSpot Ticketing API:

Current API Version

The most recent version of the HubSpot Ticketing API is part of the next generation of HubSpot's API that was launched in early 2020 [3]. This is referred to as "the new version" or "updated API" in the search results.

Key Points

  1. HubSpot has redesigned their tickets API, and it is currently available in developer preview [2].

  2. The new API is part of HubSpot's effort to improve API consistency and completeness [3].

  3. While the new version exists, older endpoints are still stable and supported [3]. However, HubSpot strongly recommends upgrading to the latest available version for better consistency and additional functionality [3].

  4. The updated APIs can be found on HubSpot's new API reference docs [3].

  5. All HubSpot APIs, including the Ticketing API, are built using REST conventions and are designed to have a predictable URL structure [4].

Best Practices

  1. It's recommended to use the most recent version of the API for new integrations and to update existing integrations when possible [3].

  2. Subscribe to the HubSpot Developer Changelog to stay informed about the latest updates, breaking changes, and other significant changes to functionality [5].

  3. When working with the API, use the base domain https://api.hubapi.com for all API calls [3][4].

  4. Consider using HubSpot's official client libraries to interact with the APIs more easily [4].

While the search results don't provide a specific version number for the Ticketing API, they indicate that the most recent version is part of the next generation of HubSpot's API launched in 2020. For the most up-to-date and specific version information, it would be best to check the official HubSpot API documentation or contact HubSpot support directly.

How to get a Hubspot Ticketing developer account and API Keys?

Here are the key steps to get a developer account for HubSpot Ticketing and create an API integration:

  1. Create a HubSpot developer account:

    • Go to https://developers.hubspot.com/ and click "Get started" to create a free developer account.
  2. Create a new app in your developer account:

    • Once logged in, go to "Manage apps" and click "Create app".
    • Give your app a name and configure the basic settings.
  3. Set up authentication:

    • Choose OAuth 2.0 as the authentication method for your app.
    • Configure the scopes needed for ticket management (e.g. tickets, contacts).
  4. Get API credentials:

    • After creating the app, you'll receive a Client ID and Client Secret.
    • You'll use these to authenticate API requests.
  5. Set up a test account:

    • Create a HubSpot test account to develop and test your integration.
  6. Start making API calls:

    • Use the Tickets API endpoints to create and manage tickets.
    • You can use the /crm/v3/objects/tickets endpoint to create tickets.
  7. Associate contacts/companies:

    • Use the Associations API to link tickets to contacts and companies.
  8. Add custom properties:

    • You can add custom fields to tickets using the Properties API.

Key points to consider:

  • Use OAuth 2.0 for secure authentication.
  • Test thoroughly in a test account before going live.
  • Follow HubSpot's API rate limits and best practices.
  • Use the HubSpot client libraries to simplify development.

What can you do with the Hubspot Ticketing API?

Based on the search results, here are the key data models you can interact with using the HubSpot Ticketing API, along with what is possible for each:

Tickets

  • Represent customer requests for help or support
  • Can be created, retrieved, updated, and deleted
  • Must have properties set when creating:
    • source_type (e.g. email, chat, phone)
    • stage (e.g. new, waiting, closed)
    • created_by (contact ID who created the ticket)
  • Can be associated with contacts, companies, deals, or engagements
  • Have properties like subject, content, pipeline stage, etc.

Contacts

  • Store information about individual people
  • Can be associated with tickets
  • Can be set as the creator of a ticket

Companies

  • Store information about businesses or organizations
  • Can be associated with tickets

Deals

  • Represent revenue opportunities
  • Can be associated with tickets

Engagements/Activities

  • Represent interactions like calls, emails, meetings, notes, etc.
  • Can be associated with tickets

Custom Objects

  • Allow storing custom data types (Enterprise only)
  • Can potentially be associated with tickets, depending on configuration

Pipelines

  • Tickets must be assigned to a pipeline
  • Default pipeline used if not specified when creating ticket

Properties

  • Custom properties can be created to store additional ticket data
  • Managed through the CRM Object Properties API

The API allows creating, retrieving, updating, and deleting ticket records, as well as managing their associations with other objects like contacts and companies. Custom properties and pipelines provide flexibility in how ticket data is structured and organized.