{"id":24211493,"url":"https://github.com/go-api-libs/toggl","last_synced_at":"2025-08-04T16:43:25.174Z","repository":{"id":267352874,"uuid":"900983602","full_name":"go-api-libs/toggl","owner":"go-api-libs","description":"Go library for the toggl. The Toggl API allows developers to interact with Toggl's time tracking service programmatically. It provides endpoints for managing time entries, projects, clients, tags, and user information. With this API, you can automate time tracking, generate detailed reports, and integrate Toggl with other tools and services.","archived":false,"fork":false,"pushed_at":"2025-01-20T15:08:33.000Z","size":2641,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-03T16:22:03.227Z","etag":null,"topics":["api","api-client","api-library","automation","go","golang","integration","openapi","openapi3","productivity","project-management","time-management","time-management-tools","time-tracking","toggl","toggl-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-api-libs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T20:36:25.000Z","updated_at":"2025-01-20T15:08:34.000Z","dependencies_parsed_at":"2024-12-17T00:55:52.399Z","dependency_job_id":null,"html_url":"https://github.com/go-api-libs/toggl","commit_stats":null,"previous_names":["go-api-libs/toggl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/go-api-libs/toggl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftoggl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftoggl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftoggl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftoggl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-api-libs","download_url":"https://codeload.github.com/go-api-libs/toggl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftoggl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268723674,"owners_count":24296673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","api-library","automation","go","golang","integration","openapi","openapi3","productivity","project-management","time-management","time-management-tools","time-tracking","toggl","toggl-api"],"created_at":"2025-01-14T02:35:26.235Z","updated_at":"2025-08-04T16:43:25.108Z","avatar_url":"https://github.com/go-api-libs.png","language":"Go","readme":"# Toggl API\n[![Go Reference](https://pkg.go.dev/badge/github.com/go-api-libs/toggl.svg)](https://pkg.go.dev/github.com/go-api-libs/toggl/pkg/toggl)\n[![Official Documentation](https://img.shields.io/badge/docs-API-blue)](https://engineering.toggl.com/docs/)\n[![OpenAPI](https://img.shields.io/badge/OpenAPI-3.1-blue)](/api/openapi.json)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-api-libs/toggl)](https://goreportcard.com/report/github.com/go-api-libs/toggl)\n![Code Coverage](https://img.shields.io/badge/coverage-98%25-brightgreen)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\nThe Toggl API allows developers to interact with Toggl's time tracking service programmatically. It provides endpoints for managing time entries, projects, clients, tags, and user information. With this API, you can automate time tracking, generate detailed reports, and integrate Toggl with other tools and services.\n\n## Installation\n\nTo install the library, use the following command:\n\n```shell\ngo get github.com/go-api-libs/toggl/pkg/toggl\n```\n\n## Usage\n\n### Example 1: Return Current User\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/go-api-libs/toggl/pkg/toggl\"\n)\n\nfunc main() {\n\tc, err := toggl.NewClient(\"myUsername\", os.Getenv(\"TOGGL_PASSWORD\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\tuserWithRelated, err := c.GetMe(ctx, \u0026toggl.GetMeParams{WithRelatedData: true})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use userWithRelated object\n}\n\n```\n\n### Example 2: Create a time entry\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/go-api-libs/toggl/pkg/toggl\"\n)\n\nfunc main() {\n\tc, err := toggl.NewClient(\"myUsername\", os.Getenv(\"TOGGL_PASSWORD\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\ttimeEntry, err := c.CreateTimeEntry(ctx, 2230580, toggl.NewTimeEntry{\n\t\tCreatedWith: \"github.com/go-api-libs/toggl\",\n\t\tStart:       mustParseTime(\"2024-12-15T21:17:59.593648+01:00\"),\n\t\tWorkspaceID: 2230580,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use timeEntry object\n}\n\n```\n\n### Example 3: Get current time entry\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/go-api-libs/toggl/pkg/toggl\"\n)\n\nfunc main() {\n\tc, err := toggl.NewClient(\"myUsername\", os.Getenv(\"TOGGL_PASSWORD\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\ttimeEntry, err := c.GetCurrentTimeEntry(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use timeEntry object\n}\n\n```\n\n### Example 4: Stop an existing time entry\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/go-api-libs/toggl/pkg/toggl\"\n)\n\nfunc main() {\n\tc, err := toggl.NewClient(\"myUsername\", os.Getenv(\"TOGGL_PASSWORD\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\ttimeEntry, err := c.StopTimeEntry(ctx, 2230580, 3730303299)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use timeEntry object\n}\n\n```\n\n### Example 5: List time entries\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/go-api-libs/toggl/pkg/toggl\"\n)\n\nfunc main() {\n\tc, err := toggl.NewClient(\"myUsername\", os.Getenv(\"TOGGL_PASSWORD\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\ttimeEntries, err := c.ListTimeEntries(ctx, \u0026toggl.ListTimeEntriesParams{\n\t\tBefore:         mustParseTime(\"2024-12-16T03:25:20+01:00\"),\n\t\tEndDate:        mustParseTime(\"2024-12-16T03:25:20+01:00\"),\n\t\tIncludeSharing: true,\n\t\tMeta:           true,\n\t\tSince:          1734304527,\n\t\tStartDate:      mustParseTime(\"2024-12-16T03:25:20+01:00\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use timeEntries slice\n}\n\n```\n\n### Example 6: Create a new organization\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/go-api-libs/toggl/pkg/toggl\"\n)\n\nfunc main() {\n\tc, err := toggl.NewClient(\"myUsername\", os.Getenv(\"TOGGL_PASSWORD\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\tsimpleOrganization, err := c.CreateOrganization(ctx, toggl.NewOrganization{\n\t\tName:          \"Your Organization\",\n\t\tWorkspaceName: \"Your Workspace\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use simpleOrganization object\n}\n\n```\n\n### Example 7: List my organizations\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/go-api-libs/toggl/pkg/toggl\"\n)\n\nfunc main() {\n\tc, err := toggl.NewClient(\"myUsername\", os.Getenv(\"TOGGL_PASSWORD\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\torganizations, err := c.ListOrganizations(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use organizations slice\n}\n\n```\n\n### Example 8: Get organization data\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/go-api-libs/toggl/pkg/toggl\"\n)\n\nfunc main() {\n\tc, err := toggl.NewClient(\"myUsername\", os.Getenv(\"TOGGL_PASSWORD\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tctx := context.Background()\n\torganization, err := c.GetOrganization(ctx, 9011051)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use organization object\n}\n\n```\n\n## Additional Information\n\n- [**Go Reference**](https://pkg.go.dev/github.com/go-api-libs/toggl/pkg/toggl): The Go reference documentation for the client package.\n- [**Official Documentation**](https://engineering.toggl.com/docs/): The official API documentation.\n- [**OpenAPI Specification**](./api/openapi.json): The OpenAPI 3.1.0 specification.\n- [**Go Report Card**](https://goreportcard.com/report/github.com/go-api-libs/toggl): Check the code quality report.\n\n## Contributing\n\nIf you have any contributions to make, please submit a pull request or open an issue on the [GitHub repository](https://github.com/go-api-libs/toggl).\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-api-libs%2Ftoggl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-api-libs%2Ftoggl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-api-libs%2Ftoggl/lists"}