# Search Detailed Time Entries — Toggl Track

> Search workspace-wide Toggl Track time entries with structured filters and provider-computed totals. Follows Toggl Reports API cursors up to an explicit cap and returns deterministic JSON without model rewriting. Only present the entries…

- Key: `toggl-search-detailed-time-entries`
- Type: Action (Read-only)
- Version: 1.0.0
- App: Toggl Track (`toggl`) — https://pipedream.com/apps/toggl.md
- This page (HTML): https://pipedream.com/apps/toggl/actions/search-detailed-time-entries
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/toggl/actions/search-detailed-time-entries/search-detailed-time-entries.mjs

## Description

Search workspace-wide Toggl Track time entries with structured filters and provider-computed totals. Follows Toggl Reports API cursors up to an explicit cap and returns deterministic JSON without model rewriting. Only present the entries as a complete report when `complete` is true; otherwise use **Export Detailed Time Entries**. Results are limited by the connected user's Toggl permissions. [See the documentation](https://engineering.toggl.com/docs/track/reports/detailed_reports/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `workspaceId` | `integer` | Yes | The Toggl Track workspace ID, e.g. 1234567. Use List Workspace ID Options to find accessible workspace IDs. Options are loaded from the connected account. |
| `datePreset` | `string` | No | Optional report range resolved using the connected user's Toggl timezone and first day of week, e.g. last_month. For all-user reports, Toggl evaluates dates in each time entry creator's profile timezone. |
| `startDate` | `string` | No | Inclusive report start date in YYYY-MM-DD format, e.g. 2026-09-01. Required with End Date when Date Preset is not used. |
| `endDate` | `string` | No | Inclusive report end date in YYYY-MM-DD format, e.g. 2026-09-30. It may be the same as Start Date. |
| `timezone` | `string` | No | Optional IANA timezone used to resolve Date Preset, e.g. America/Chicago. Defaults to the connected user's Toggl profile timezone. |
| `userIds` | `integer[]` | No | Return entries for these user IDs, subject to the connected user's Toggl permissions, e.g. [1234567]. Use List Workspace Users and its userId field to find accessible IDs. |
| `userName` | `string` | No | Optional full or partial name or email, e.g. Angus. It must resolve to exactly one accessible workspace user. The resolved ID is combined with User IDs. |
| `projectIds` | `integer[]` | No | Include only these project IDs, e.g. [123456789]. Find IDs in Toggl Track project settings or the workspace projects API. |
| `clientIds` | `integer[]` | No | Include only these client IDs, e.g. [12345678]. Find IDs in Toggl Track client settings or the workspace clients API. |
| `taskIds` | `integer[]` | No | Include only these task IDs, e.g. [12345678]. Find IDs in Toggl Track project tasks or the workspace tasks API. |
| `tagIds` | `integer[]` | No | Include only entries with these tag IDs, e.g. [1234567]. Find IDs in Toggl Track workspace settings or the workspace tags API. |
| `description` | `string` | No | Include entries whose description matches this value, e.g. weekly planning. |
| `billable` | `boolean` | No | Filter entries by billable status, e.g. true. This filter requires the corresponding Toggl feature. |
| `pageSize` | `integer` | Yes | Number of rows requested from Toggl per API call, e.g. 50. |
| `maxResults` | `integer` | Yes | Maximum rows returned across all server-side pages, e.g. 1000. If reached before Toggl is exhausted, capHit and hasMore are true and totalCount is null. |
| `cursor` | `object` | No | Optional nextCursor object returned by a previous run, e.g. {"firstId": 123, "firstRowNumber": 51}. Header values are preserved unchanged. |
| `fields` | `string[]` | Yes | Raw Toggl fields to return, e.g. ["user_id", "seconds"]. The slim default omits descriptions. Select All Fields for the complete API rows. |
| `orderBy` | `string` | Yes | Field used to order results, for example date. Date ordering is recommended for repeatable report pulls. |
| `orderDirection` | `string` | Yes | Direction used to order report rows, e.g. ASC. |
| `firstId` | `integer` | No | Deprecated. Prefer Cursor. The nextCursor.firstId value from an earlier action version, e.g. 1234567890. |
| `firstRowNumber` | `integer` | No | Deprecated. Prefer Cursor. The nextCursor.firstRowNumber value from an earlier action version, e.g. 50. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "toggl",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "toggl-search-detailed-time-entries",
  arguments: {
    workspaceId: 10,
    datePreset: "Date Preset",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "toggl-search-detailed-time-entries",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    toggl: { authProvisionId: "apn_xxxxxxx" },
    workspaceId: 10,
    datePreset: "Date Preset",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "toggl-search-detailed-time-entries",
    "configured_props": {
      "toggl": { "authProvisionId": "apn_xxxxxxx" },
      "workspaceId": 10,
      "datePreset": "Date Preset"
    }
  }'
```

---

- App: https://pipedream.com/apps/toggl.md · All apps: https://pipedream.com/apps
