A deep dive into Hubstaff's API: Unlocking custom workflows

Take a deep dive into Hubstaff's API features, data structure, and how your dev team can leverage it to power custom workflows and time tracking customizations that fit your business case.

When scaling global teams, there’s no time for clunky tools or half-baked data. Engineers need real visibility, flexible integrations, and the power to automate workflows, and the Hubstaff API allows for just that. 

Hubstaff is a powerful time tracking and productivity platform used by over 140k users across 150 countries. With Hubstaff’s API, you can give your team flexibility and control over how data is accessed and displayed. It allows developers to create custom workflows, plug into your existing stack, and deliver a transparent, branded experience your clients will love.

With the API, your team can:

  • Automate custom workflows across your existing internal systems
  • Keep workforce data in sync with tools, such as your HRIS and Hubstaff
  • Enrich internal operational dashboards with the workforce data managers need
  • Feed workforce data into BI tools for deeper analysis and executive reporting

In this article, we'll cover Hubstaff’s API features, data structure, and how your dev team can get started with custom workflows and time tracking customizations to your liking.

Getting started with Hubstaff's API

The Hubstaff developer API is flexible, making it approachable for experienced dev teams and those newer to APIs.  

hubstaff-time-tracking-API.png

The Hubstaff V2 API lets your dev team read and write data to build custom portals, display activities, tasks, and notes, and tailor the interface to your brand while filtering and presenting data exactly how your clients need to see it.

Here's a quick rundown of what your team will be working with:

  • RESTful architecture: The API uses REST (Representational State Transfer) principles to create a standard and familiar interface structure that speeds up integration and reduces dev ramp-up time.

  • HTTPS encryption:All API requests are secured with HTTPS using TLS encryption.

  • JSON data format: The API uses JSON, a lightweight, widely adopted text-based data exchange format. This makes it simple for your team to debug, build, and iterate.

  • OAuth 2.0 / OpenID Connect authentication: The API authentication system is based on the authorization system in OAuth 2.0. Using industry-standard protocols, ensure secure, modern identity verification.

  • Versioned endpoints: The API endpoints are versioned to make changes without breaking existing code that depends on them. Your team can confidently build with a versioned API, knowing future updates won’t break your existing workflows.

*Note: We will notify the app's owner(s) when we release newer versions and obsolete older versions. This will be a two-step process, with a grace period to deprecate and finally obsolete older versions.

Developer onboarding tips:

Your dev team will have access to the documentation and guidance they need to start building with the Hubstaff API, including:

  • Detailed authentication instructions and API documentation
  • Examples of typical use cases and workflows
  • Instructions for how to manage their API tokens
  • Guidance on optimizing the development process with RESTful principles, versioning, and rate limits

In a nutshell, Hubstaff API integration features are built to work with every system. You can customize how you want data delivered to you and your team.

Understanding Hubstaff's data structure

Before diving further, here's a quick overview of the Hubstaff organization data structure, which will help you understand the correlation between key objects and entities.

The core entities

  • Organizations: Organizations are the parent structure for teams. They include users, projects, and time data.
  • Projects: Tasks or clients assigned to orgs that users track time to.
  • Users: Your team members. Each user is part of an org, and you can assign them to specific projects accordingly.
  • Time Entries: Time entries are the blocks of time that users track during their workday.
  • Activities: Data tied to time entries, such as the percentage of mouse and keyboard interactions, optional screenshots, URL visits, and app usage.

The relationship between data and entities

  • First, a "User" logs time to a "Project", which belongs to an "Organization".
  • Time Entries are then attached to both users and projects.
  • Activities during a time tracking session further enrich time entries with productivity metrics.

Your workforce data, now AI-ready

Hubstaff’s API, CLI, and MCP server make it possible for AI tools and agents to query, analyze, and work with real workforce data in real time.

Use cases

  • AI-powered workforce analytics
  • Natural language reporting
  • Productivity anomaly detection
  • Workforce automation workflows
  • AI agent integrations

Explore Hubstaff CLI

Try it out

Common API use cases for custom workflows

The Hubstaff V2 API lets your development team programmatically read and write data. This allows you to build custom workflows and display Hubstaff information exactly how you need.

For example, you could build a separate, fully branded client portal with the Hubstaff API. From there, clients can log in to view filtered activities, tasks, and notes.

The API helps provide high-quality developer tools to:

  • Present Hubstaff with your branding and customize the experience
  • Connect data across multiple tools to uncover correlations
  • Display data to your clients based on your preference

To help your dev team draw inspiration from these custom workflows designed using the Hubstaff API, here are some use cases of syncing your internal data with the Hubstaff platform:

1. Sync time log data to internal dashboards

Use the Hubstaff API to connect workforce data to your custom internal dashboards, alongside data from existing tools your team already works with. For instance, you could combine today's tracked time with the current tracking status from Hubstaff and availability data from Slack or a calling tool. Then managers can see key information from multiple systems on a single dashboard without switching between tools.

2. Automating reports

Use the Hubstaff API to automate the delivery of weekly time and activity reports directly to your clients' inboxes. This will inform clients on time, activity, and productivity updates across teams without manual effort.

3. Attendance alerts

Utilize Hubstaff webhooks for real-time event notifications and send updates to your internal systems via HTTP callbacks. For example, you can keep an attendance or availability dashboard up to date as relevant Hubstaff events take place. This reduces the need to repeatedly perform API calls and ensures whenever an event trigger happens, your dashboard is updated.

4. Custom workflow for time entry approval

Build custom time entry approval by collecting time entries through the Hubstaff API and running them through your custom business logic (e.g., time duration >15 mins, project validation, manual approval for weekend hours).

Unleash the power of custom workflows with the Hubstaff API

The Hubstaff API is a foundation for building smarter, more connected systems that put your brand and dev team in complete control. The API gives you the autonomy and precision to tailor workflows to your needs.

Be it optimizing time tracking, syncing project data, automating reports, or delivering a branded client experience.

With rich documentation, getting started is simple, and the potential is limitless. Explore the Hubstaff Developer Portal and start building with the API today.

Leverage the Hubstaff API to build workflows tailored to your team

Connect time and activity data to tools of your choice and develop custom solutions.