# Create User — Snipe-IT

> Creates a new user in Snipe-IT with profile information required for asset or license assignments. See the documentation

- Key: `snipe_it-create-user`
- Type: Action (Write)
- Version: 0.0.2
- App: Snipe-IT (`snipe_it`) — https://pipedream.com/apps/snipe-it.md
- This page (HTML): https://pipedream.com/apps/snipe-it/actions/create-user
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/snipe_it/actions/create-user/create-user.mjs

## Description

Creates a new user in Snipe-IT with profile information required for asset or license assignments. [See the documentation](https://snipe-it.readme.io/reference/users-2)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `firstName` | `string` | Yes | The first name of the user |
| `username` | `string` | Yes | The username for the user (required for login) |
| `password` | `string` | Yes | The password for the user account |
| `passwordConfirmation` | `string` | Yes | The password confirmation for the user account |
| `lastName` | `string` | No | The last name of the user |
| `email` | `string` | No | The email address of the user |
| `activated` | `boolean` | No | Whether the user account is activated |
| `phone` | `string` | No | The phone number of the user |
| `jobtitle` | `string` | No | The job title of the user |
| `managerId` | `integer` | No | Select the manager for this user Options are loaded from the connected account. |
| `employeeNum` | `string` | No | The employee number of the user |
| `notes` | `string` | No | Notes about the user |
| `companyId` | `integer` | No | Select the company for this user Options are loaded from the connected account. |
| `twoFactorEnrolled` | `boolean` | No | Whether the user is enrolled in two-factor authentication |
| `twoFactorOptIn` | `boolean` | No | Whether the user has opted in to two-factor authentication |
| `departmentId` | `integer` | No | Select the department for this user Options are loaded from the connected account. |
| `locationId` | `integer` | No | Select the location where this asset is located Options are loaded from the connected account. |
| `remote` | `boolean` | No | Whether or not the user is a remote worker |
| `groups` | `string[]` | No | Select the groups for this user Options are loaded from the connected account. |
| `autoAssignLicenses` | `boolean` | No | Whether to automatically assign licenses to the user |
| `vip` | `boolean` | No | Whether this user is a VIP |
| `startDate` | `string` | No | The user's start date (YYYY-MM-DD format) |
| `endDate` | `string` | No | The user's end date (YYYY-MM-DD format) |

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

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: "snipe_it-create-user",
  arguments: {
    firstName: "First Name",
    username: "Username",
  },
})
```

**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: "snipe_it-create-user",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    snipe_it: { authProvisionId: "apn_xxxxxxx" },
    firstName: "First Name",
    username: "Username",
  },
})

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": "snipe_it-create-user",
    "configured_props": {
      "snipe_it": { "authProvisionId": "apn_xxxxxxx" },
      "firstName": "First Name",
      "username": "Username"
    }
  }'
```

---

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