Help with Toggl Track API

Describe the problem/error/question

I’m using the Toggl Track API to get time entries. I haven’t used it probably for two months. Now that I re-launched it the API it’s only getting time entries from 10 days ago, when in reality there are two months worth of registered time entries.

I saw in this link saying you should be using a reports function, but I’m not sure. I got lost in there. Although the reply says that with said function you can get time entries from 365 days ago, I don’t need it to be that much, just 2 months is enough.

How should I proceed?

What is the error message (if any)?

No errors

Please share your workflow

Share the output returned by the last node

Got time entries from today (January, 27 to January 17)

Information on your n8n setup

  • n8n version: 1.75.2
  • Database (default: SQLite): I’m not sure, most likely Default.
  • n8n EXECUTIONS_PROCESS setting (default: own, main): I’m not sure, most likely Default.
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows 10

@Cristobal_Alarcon

You are using the me endpoint, which is basically the equivalent of the Timer page, which is limited to how far back it can show data.

Try using the Reports Endpoints instead, you set a date range of 365 days
there: Reports API - Toggl Community

if this answers your question then please hit the ‘solution’ button

You just copy pasted what the Veljko said on the link I shared :confused:

Did someone say Veljko :joy:

Nice to see Toggl Track getting some love here! I actually help run support over at Toggl, so just wanted to chime in real quick.

What we know now is that endpoint you’re using /me/time_entries only returns recent entries—so what you’re seeing (e.g., missing data after a few weeks) sounds like it’s running into that limitation. For pulling longer time periods, you’d likely want to switch over to the Reports API, specifically the Detailed Report endpoint.

You can specify a date range if you include the following in the request body:

  • start_date: your start date (e.g., 2025-04-01)
  • end_date: your end date (e.g., 2025-06-19)
  • Other optional filters (e.g., project_ids, user_ids)

Keep in mind that the API results for the Detailed Report are paginated—make sure your request handles page and per_page values to fetch all entries you need (50 per page).

I haven’t personally tested this in n8n, but the approach would likely involve using the HTTP node, sending a POST request with your desired date range, and looping through pages if needed. Might require a bit of JSON formatting in the body and pagination logic, but should be doable!

Reaching the limits of my n8n knowledge, I’ll need to stop advising you here :sweat_smile:

Let me know if you hit a wall on the Toggl API side — happy to help where I can! :raising_hands:

1 Like

EDIT: Solved it. I was choosing the wrong option in Sep 7. Details below.

I can’t believe it, I did solve it by myself but I messed up something and I think it undid my changes :sob:

I’m back to square one. I have no idea what I did but back then I got it working somehow. I did do something like that using start_date and end_date, but I don’t remember how I wrote it. Besides that I need the JSON to be dynamic, the starting date being 45 days ago and end date being today.

Most likely I used ChatGPT and corrected the errors by bruteforce and trial and error. Although now I’m again using GPT but I have no luck in my attempts.

What I did so far:

  1. Set HTTP node

  2. Method: Post

  3. URL: https://api.track.toggl.com/reports/api/v3/workspace/-MY-WORKSPACE-NUMBER/search/time_entries
    3.a- How to get Workspace ID/number: Go to the main Toggl Track Dashboard
    3.b- Click on your name
    3.c- There should be a " :gear: Manage workspaces" button
    3.d- Copy the number I highlight in red


    3.e- Replace the “-MY-WORKSPACE-NUMBER” with the ID you copied.

  4. Authentication: Generic Credential Type

  5. Generic Auth Type: Basic Auth

  6. Basic Auth: [Credential I previusly created]

  1. Send Query Parameters
    7.a- Using JSON
    7.b- I insert this JSON
  {
    start_date: {{$now.minus({ days: 45 }).toISODate()}},
    end_date:   {{$now.toISODate()}}
  }
  1. Test step

However I get this error: JSON parameter needs to be valid JSON.

To be honest I have no idea how the JSON should be.

Corrected step 7

  1. Choose “Send Body”
    7.a- Using fields below
    7.b- First parameter. Name: start_date. Value: {{ $now.minus({ days: 45 }).toISODate() }}
    7.c- Second parameter. Name: end_date. Value: { $now.toISODate() }}

That fixed it. This changes some properties for the next nodes, so you’ll have to tinker the following nodes to adapt accordingly to the changes made here (if you had a workflow previously before doing all of this).

2 Likes

NICE! Happy to see that :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.