# Create Job — ClickTime

> Create a Job on Clicktime. See the documentation

- Key: `clicktime-create-job`
- Type: Action (Write)
- Version: 0.0.2
- App: ClickTime (`clicktime`) — https://pipedream.com/apps/clicktime.md
- This page (HTML): https://pipedream.com/apps/clicktime/actions/create-job
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/clicktime/actions/create-job/create-job.mjs

## Description

Create a Job on Clicktime. [See the documentation](https://developer.clicktime.com/docs/api/#/operations/Jobs/CreateJob)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `accountingPackageId` | `string` | No | Unique identifier for the accounting package |
| `billingRate` | `string` | No | The billing rate for the job |
| `isActive` | `boolean` | No | Indicates whether the job is currently active |
| `isEligibleTimeOffAllocation` | `boolean` | No | Determines if the job is eligible for time-off allocation |
| `name` | `string` | Yes | The name of the job |
| `notes` | `string` | No | Additional information related to the job |
| `clientId` | `string` | Yes | Unique identifier of the client associated with a job Options are loaded from the connected account. |
| `includeInRm` | `boolean` | No | Specifies whether the job should be included in RM |
| `isBillable` | `boolean` | No | Indicates whether the job is billable |
| `jobNumber` | `string` | Yes | Unique identifier assigned to a job for tracking purposes |
| `startDate` | `string` | No | The start date of the job, i.e.: 2020-01-01 |
| `endDate` | `string` | No | The end date of the job, i.e.: 2020-01-01 |
| `timeRequiresApproval` | `boolean` | No | Indicates whether time entries for the job require approval |
| `useCompanyBillingRate` | `boolean` | No | Specifies whether the job uses the company-wide billing rate instead of a custom one |

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

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: "clicktime-create-job",
  arguments: {
    accountingPackageId: "Accounting Package ID",
    billingRate: "Billing Rate",
  },
})
```

**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: "clicktime-create-job",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    clicktime: { authProvisionId: "apn_xxxxxxx" },
    accountingPackageId: "Accounting Package ID",
    billingRate: "Billing Rate",
  },
})

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": "clicktime-create-job",
    "configured_props": {
      "clicktime": { "authProvisionId": "apn_xxxxxxx" },
      "accountingPackageId": "Accounting Package ID",
      "billingRate": "Billing Rate"
    }
  }'
```

---

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