# Create User — ClickTime

> Create an User on ClickTime. See the documentation

- Key: `clicktime-create-user`
- 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-user
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/clicktime/actions/create-user/create-user.mjs

## Description

Create an User on ClickTime. [See the documentation](https://developer.clicktime.com/docs/api/#/operations/Users/CreateManagedUser)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `billingRate` | `string` | No | The billing rate for the user |
| `isActive` | `boolean` | No | Indicates whether the user is currently active |
| `name` | `string` | Yes | The name of the user |
| `startDate` | `string` | No | The start date of the user, i.e.: 2020-01-01 |
| `costModel` | `string` | No | Defines the cost model used for the user |
| `costRate` | `string` | No | The internal cost rate associated with the user |
| `email` | `string` | Yes | The email address associated with the user |
| `employmentTypeId` | `string` | No | Unique identifier for the user's employment type Options are loaded from the connected account. |
| `role` | `string` | No | The role assigned to the user |

## 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-user",
  arguments: {
    billingRate: "Billing Rate",
    isActive: true,
  },
})
```

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

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-user",
    "configured_props": {
      "clicktime": { "authProvisionId": "apn_xxxxxxx" },
      "billingRate": "Billing Rate",
      "isActive": true
    }
  }'
```

---

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