# Start Tracking Time — TrackingTime

> Start tracking time of a task. See the documentation

- Key: `trackingtime-start-tracking-time`
- Type: Action (Write)
- Version: 0.0.3
- App: TrackingTime (`trackingtime`) — https://pipedream.com/apps/trackingtime.md
- This page (HTML): https://pipedream.com/apps/trackingtime/actions/start-tracking-time
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/trackingtime/actions/start-tracking-time/start-tracking-time.mjs

## Description

Start tracking time of a task. [See the documentation](https://api.trackingtime.co/doc/time_tracking.html#sync:~:text=Sync%20tracking%20event-,Start%20Tracking%20Time,-Starts%20a%20timer)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `taskId` | `string` | Yes | The task ID Options are loaded from the connected account. |
| `projectId` | `string` | No | The project ID Options are loaded from the connected account. |
| `date` | `string` | No | The event's start date. Format ISO 8601: yyyy-MM-dd HH:mm:ss like 2014-01-31 17:30:59 |
| `estimatedTime` | `string` | No | Set a new estimated time for this task |
| `stopRunningTask` | `boolean` | No | If set to true, any currently running task will be stopped before the new one is started. |
| `returnTask` | `boolean` | No | If set to true, a task object is returned |
| `tags` | `boolean` | No | An array of tags to be added to the newly created time entry. E.g. [{"n":"name","c":"color","v":"value","t":"type"}] |
| `timezone` | `string` | No | The user's timezone as GMT+3 or GMT+03:00 |

## 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": "trackingtime",
      },
    },
  },
)

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: "trackingtime-start-tracking-time",
  arguments: {
    taskId: "Task ID",
    projectId: "Project ID",
  },
})
```

**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: "trackingtime-start-tracking-time",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    trackingtime: { authProvisionId: "apn_xxxxxxx" },
    taskId: "Task ID",
    projectId: "Project ID",
  },
})

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": "trackingtime-start-tracking-time",
    "configured_props": {
      "trackingtime": { "authProvisionId": "apn_xxxxxxx" },
      "taskId": "Task ID",
      "projectId": "Project ID"
    }
  }'
```

---

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