PHPackages                             morningtrain/toggl-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. morningtrain/toggl-api

ActiveLibrary[API Development](/categories/api)

morningtrain/toggl-api
======================

A complete native php wrapper for the Toggl API

v1.2.0(4y ago)3659.5k—9.4%27[2 issues](https://github.com/Morning-Train/toggl-api/issues)[15 PRs](https://github.com/Morning-Train/toggl-api/pulls)1GNU General Public License v3.0PHP

Since Nov 20Pushed 1y ago3 watchersCompare

[ Source](https://github.com/Morning-Train/toggl-api)[ Packagist](https://packagist.org/packages/morningtrain/toggl-api)[ Docs](http://morningtrain.dk/)[ RSS](/packages/morningtrain-toggl-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (15)Used By (1)

About
=====

[](#about)

PHP class to connect with the Toggl API.

This was coded on an early

Installation
============

[](#installation)

It can be installed with composer

```
composer require morningtrain/toggl-api

```

Dependencies
============

[](#dependencies)

It depends on guzzlehttp/guzzle ver.6.

Guzzle can be added with the following composer snippet: (or automatically when installing through composer)

```
{
    "require": {
        "guzzlehttp/guzzle": "^6.0"
    }
}

```

Changelog
=========

[](#changelog)

### 14/06/2021

[](#14062021)

- Added methods for some of the undocumented project\_group endpoints. This will make it possible to assign, update or remove groups from private projects.

### 30/06/17

[](#300617)

- Changed function name from getDashboadForWorkspace to getDashboardForWorkspace, if your system is using getDashboadForWorkspace please change it to getDashboardForWorkspace.

Examples
========

[](#examples)

For details about the different objects required in the Toggl Api, take a look at their documentation: [https://github.com/toggl/toggl\_api\_docs](https://github.com/toggl/toggl_api_docs)

Toggl API
---------

[](#toggl-api)

### Initialization

[](#initialization)

```
$toggl = new MorningTrain\TogglApi\TogglApi('my-api-token');

```

### Get available endpoints

[](#get-available-endpoints)

```
$toggl->getAvailableEndpoints();

```

### Clients

[](#clients)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/clients.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md)

#### Creating a client

[](#creating-a-client)

```
$toggl->createClient($clientObject);

```

#### Updating a client

[](#updating-a-client)

```
$toggl->updateClient($clientId, $clientObject);

```

#### Deleting a client

[](#deleting-a-client)

```
$toggl->deleteClient($clientId);

```

#### Get all clients

[](#get-all-clients)

```
$toggl->getClients();

```

#### Get all projects for a client

[](#get-all-projects-for-a-client)

```
$toggl->getClientProjects($clientId);

```

#### Get all active projects for a client

[](#get-all-active-projects-for-a-client)

```
$toggl->getActiveClientProjects($clientId);

```

#### Get all inactive projects for a client

[](#get-all-inactive-projects-for-a-client)

```
$toggl->getInactiveClientProjects($clientId);

```

#### Get both active and inactive projects for a client

[](#get-both-active-and-inactive-projects-for-a-client)

```
$toggl->getAllClientProjects($clientId);

```

#### Get client by id

[](#get-client-by-id)

```
$toggl->getClientById($clientId);

```

### Project users

[](#project-users)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/project\_users.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/project_users.md)

#### Create project user

[](#create-project-user)

```
$toggl->createProjectUser($projectUserObject);

```

#### Create project users

[](#create-project-users)

```
$toggl->createProjectUsers($projectUserObject);

```

#### Update project user

[](#update-project-user)

```
$toggl->updateProjectUser($projectUserId, $projectUserObject);

```

#### Update project users

[](#update-project-users)

```
$toggl->updateProjectUsers($projectUserIds, $projectUserObject);

```

#### Create project users

[](#create-project-users-1)

```
$toggl->deleteProjectUser($projectUserId);

```

#### Create project users

[](#create-project-users-2)

```
$toggl->deleteProjectUsers($projectUserIds);

```

### Projects

[](#projects)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/projects.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/projects.md)

#### Create project

[](#create-project)

```
$toggl->createProject($projectObject);

```

#### Update project

[](#update-project)

```
$toggl->updateProject($projectId, $projectObject);

```

#### Delete project

[](#delete-project)

```
$toggl->deleteProject($projectId);

```

#### Delete projects

[](#delete-projects)

```
$toggl->deleteProjects($projectIds);

```

#### Get users for project

[](#get-users-for-project)

```
$toggl->getProjectUserRelations($projectId);

```

#### Get project tasks

[](#get-project-tasks)

```
$toggl->getProjectTasks($projectId);

```

#### Get project by ID

[](#get-project-by-id)

```
$toggl->getProject($projectId);

```

### Dashboard

[](#dashboard)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/dashboard.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/dashboard.md)

#### Get dashboard for workspace

[](#get-dashboard-for-workspace)

```
$toggl->getDashboardForWorkspace($workspaceId);

```

### Users

[](#users)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/users.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/users.md)

#### Get me

[](#get-me)

$related defaults to false. Set it to true, to get related data

```
$toggl->getMe($related);

```

#### Update me

[](#update-me)

```
$toggl->updateMe($userObject);

```

#### Sign up

[](#sign-up)

```
$toggl->signup($userObject);

```

#### Reset API Token

[](#reset-api-token)

```
$toggl->resetApiToken();

```

### Workspaces

[](#workspaces)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/workspaces.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/workspaces.md)

#### Get workspaces

[](#get-workspaces)

```
$toggl->getWorkspaces();

```

#### Get workspace by ID

[](#get-workspace-by-id)

```
$toggl->getWorkspace($workspaceId);

```

#### Update workspace

[](#update-workspace)

```
$toggl->updateWorkspace($workspaceId, $workspaceObject);

```

#### Get workspace users

[](#get-workspace-users)

```
$toggl->getWorkspaceUsers($workspaceId);

```

#### Get workspace clients

[](#get-workspace-clients)

```
$toggl->getWorkspaceClients($workspaceId);

```

#### Get workspace projects

[](#get-workspace-projects)

```
$toggl->getWorkspaceProjects($workspaceId);

```

#### Get workspace tasks

[](#get-workspace-tasks)

```
$toggl->getWorkspaceTasks($workspaceId);

```

#### Get workspace tags

[](#get-workspace-tags)

```
$toggl->getWorkspaceTags($workspaceId);

```

### Workspace users

[](#workspace-users)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/workspace\_users.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/workspace_users.md)

#### Invite users to workspace

[](#invite-users-to-workspace)

```
$toggl->inviteUsersToWorkspace($workspaceId, $emails);

```

#### Update workspace user

[](#update-workspace-user)

```
$toggl->updateWorkspaceUser($workspaceUserId, $userObject);

```

#### Delete workspace user

[](#delete-workspace-user)

```
$toggl->deleteWorkspaceUser($workspaceUserId);

```

#### Get workspace users for workspace

[](#get-workspace-users-for-workspace)

```
$toggl->getWorkspaceUserRelations($workspaceId);

```

### Tags

[](#tags)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/tags.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/tags.md)

#### Create tag

[](#create-tag)

```
$toggl->createTag($tagObject);

```

#### Update tag

[](#update-tag)

```
$toggl->updateTag($tagId, $tagObject);

```

#### Delete tag

[](#delete-tag)

```
$toggl->deleteTag($tagId);

```

### Tasks

[](#tasks)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/tags.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/tags.md)

#### Get task

[](#get-task)

```
$toggl->getTask($taskId);

```

#### Create task

[](#create-task)

```
$toggl->createTask($taskObject);

```

#### Update task

[](#update-task)

```
$toggl->updateTask($taskId, $taskObject);

```

#### Update tasks

[](#update-tasks)

```
$toggl->updateTasks($taskId, $taskObject);

```

#### Delete task

[](#delete-task)

```
$toggl->deleteTask($taskId);

```

#### Delete tasks

[](#delete-tasks)

```
$toggl->deleteTasks($taskIds);

```

### Time entries

[](#time-entries)

[https://github.com/toggl/toggl\_api\_docs/blob/master/chapters/time\_entries.md](https://github.com/toggl/toggl_api_docs/blob/master/chapters/time_entries.md)

#### Create time entry

[](#create-time-entry)

```
$toggl->createTimeEntry($timeEntryObject);

```

#### Start time entry

[](#start-time-entry)

```
$toggl->startTimeEntry($timeEntryObject);

```

#### Stop time entry

[](#stop-time-entry)

```
$toggl->stopTimeEntry($timeEntryIds);

```

#### Get time entry

[](#get-time-entry)

```
$toggl->getTimeEntry($timeEntryIds);

```

#### Get running time entry

[](#get-running-time-entry)

```
$toggl->getRunningTimeEntry();

```

#### Get time entries

[](#get-time-entries)

```
$toggl->getTimeEntries();

```

#### Get time entries in range

[](#get-time-entries-in-range)

```
$toggl->getTimeEntriesInRange($start, $end);

```

#### Update tags for time entries

[](#update-tags-for-time-entries)

```
$toggl->updateTagsForTimeEntries($timeEntryIds, $timeEntryObject);

```

#### Update time entry

[](#update-time-entry)

```
$toggl->updateTimeEntry($timeEntryIds, $timeEntryObject);

```

#### Delete time entry

[](#delete-time-entry)

```
$toggl->deleteTimeEntry($timeEntryIds);

```

Reports API
-----------

[](#reports-api)

[https://github.com/toggl/toggl\_api\_docs/blob/master/reports.md](https://github.com/toggl/toggl_api_docs/blob/master/reports.md)

### Initialization

[](#initialization-1)

```
$toggl = new MorningTrain\TogglApi\TogglReportsApi('my-api-token');

```

### Get available endpoints

[](#get-available-endpoints-1)

```
$toggl->getAvailableEndpoints();

```

### Methods

[](#methods)

#### Get project report

[](#get-project-report)

```
$toggl->getProjectReport($query);

```

#### Get summary report

[](#get-summary-report)

```
$toggl->getSummaryReport($query);

```

#### Get details report

[](#get-details-report)

```
$toggl->getDetailsReport($query);

```

#### Get weekly report

[](#get-weekly-report)

```
$toggl->getWeeklyReport($query);

```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 57.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~290 days

Recently: every ~218 days

Total

11

Last Release

929d ago

Major Versions

v1.2.0 → v2.0.0-alpha.12023-09-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/278725?v=4)[morningtrain](/maintainers/morningtrain)[@morningtrain](https://github.com/morningtrain)

---

Top Contributors

[![bjarnebonde](https://avatars.githubusercontent.com/u/5835042?v=4)](https://github.com/bjarnebonde "bjarnebonde (52 commits)")[![derhasi](https://avatars.githubusercontent.com/u/118502?v=4)](https://github.com/derhasi "derhasi (10 commits)")[![Rubatharisan](https://avatars.githubusercontent.com/u/4179393?v=4)](https://github.com/Rubatharisan "Rubatharisan (7 commits)")[![charlesfsl](https://avatars.githubusercontent.com/u/28458957?v=4)](https://github.com/charlesfsl "charlesfsl (5 commits)")[![arrisar](https://avatars.githubusercontent.com/u/846173?v=4)](https://github.com/arrisar "arrisar (3 commits)")[![scs-ben](https://avatars.githubusercontent.com/u/2318300?v=4)](https://github.com/scs-ben "scs-ben (3 commits)")[![SimonJnsson](https://avatars.githubusercontent.com/u/11147193?v=4)](https://github.com/SimonJnsson "SimonJnsson (2 commits)")[![Mat-Gr](https://avatars.githubusercontent.com/u/22744066?v=4)](https://github.com/Mat-Gr "Mat-Gr (2 commits)")[![mb-afk](https://avatars.githubusercontent.com/u/6816797?v=4)](https://github.com/mb-afk "mb-afk (2 commits)")[![raitisg](https://avatars.githubusercontent.com/u/763837?v=4)](https://github.com/raitisg "raitisg (1 commits)")[![notFloran](https://avatars.githubusercontent.com/u/523981?v=4)](https://github.com/notFloran "notFloran (1 commits)")[![karsteel](https://avatars.githubusercontent.com/u/5285980?v=4)](https://github.com/karsteel "karsteel (1 commits)")[![godbout](https://avatars.githubusercontent.com/u/121373?v=4)](https://github.com/godbout "godbout (1 commits)")

---

Tags

phpapitoggl

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/morningtrain-toggl-api/health.svg)

```
[![Health](https://phpackages.com/badges/morningtrain-toggl-api/health.svg)](https://phpackages.com/packages/morningtrain-toggl-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

574.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
