# Create New User — LightSpeed VT

> Creates a new user in the LightSpeed VT system. See the documentation

- Key: `lightspeed_vt-create-new-user`
- Type: Action (Write)
- Version: 0.0.2
- App: LightSpeed VT (`lightspeed_vt`) — https://pipedream.com/apps/lightspeed-vt.md
- This page (HTML): https://pipedream.com/apps/lightspeed-vt/actions/create-new-user
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/lightspeed_vt/actions/create-new-user/create-new-user.mjs

## Description

Creates a new user in the LightSpeed VT system. [See the documentation](https://lsvtapi.stoplight.io/docs/lsvt-rest-api/26844d671bbcf-create-user)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `isActive` | `boolean` | No | Set to return active or inactive users only. |
| `locationId` | `string` | Yes | Specifies the location Id. Options are loaded from the connected account. |
| `username` | `string` | Yes | The username of the new user. |
| `password` | `string` | Yes | The password for the new user. |
| `email` | `string` | Yes | The email of the new user. |
| `firstName` | `string` | Yes | The first name of the new user. |
| `lastName` | `string` | Yes | The last name of the new user. |
| `middleName` | `string` | No | The middle name of the new user. |
| `title` | `string` | No | The title of the new user. |
| `gender` | `string` | No | The gender of the new user. |
| `dob` | `string` | No | Valid ISO 8601 timestamp, i.e. yyyyy-MM-ddTHH:mm:ssZ - User's date of birth. |
| `language` | `string` | No | Default: en-us - Language to set for user - Any valid ISO 639-1 code with region. |
| `accessLevel` | `integer` | Yes | The access level for the new user. See Access Levels Definition |
| `companyName` | `string` | No | The company of the new user. |
| `teamId` | `string` | No | Id for team assigned to user. Options are loaded from the connected account. |
| `jobPositionId` | `string` | No | Id for job position assigned to user. Options are loaded from the connected account. |
| `hireDate` | `string` | No | Valid ISO 8601 timestamp, i.e. yyyyy-MM-ddTHH:mm:ssZ - User's hiring date. |
| `startDate` | `string` | No | Valid ISO 8601 timestamp, i.e. yyyyy-MM-ddTHH:mm:ssZ - User's starting date. |
| `releaseDate` | `string` | No | Valid ISO 8601 timestamp, i.e. yyyyy-MM-ddTHH:mm:ssZ - User's release date. |
| `expireDate` | `string` | No | Valid ISO 8601 timestamp, i.e. yyyyy-MM-ddTHH:mm:ssZ - User's account expiration date. |
| `affiliateId` | `string` | No | Affiliate Id associated with creation of user's account. |
| `vendorId` | `string` | No | Custom vendor Id associated with creation of user's account. |
| `misc1` | `string` | No | Miscellaneous info field 1. |
| `misc2` | `string` | No | Miscellaneous info field 2. |
| `phone1` | `string` | No | User's phone number 1. |
| `phone2` | `string` | No | User's phone number 2. |
| `contentRole` | `integer[]` | No | List of content roles Ids. Options are loaded from the connected account. |
| `lockUsername` | `boolean` | No | Restricts user from changing its username. |
| `lockUsernamePassword` | `boolean` | No | Restricts user from changing its username and password. |
| `forcePasswordUpdate` | `boolean` | No | Forces user to update its password upon first sign in. |
| `updateMyProfile` | `boolean` | No | Restricts user from updating its profile. |
| `manageUsers` | `boolean` | No | Restricts user from managing other users. |
| `billingFrequency` | `integer` | No | Use to specify the billing schedule frequency in months. Required if your API settings are set to require this parameter. |
| `grossFeeCharged` | `string` | No | Use to specify the fee per user. Required if your API settings are set to require this parameter. |
| `promoCode` | `string` | No | Promo code used during user's account creation. |
| `address1` | `string` | No | User's address line 1. |
| `address2` | `string` | No | User's address line 2. |
| `city` | `string` | No | User's city. |
| `state` | `string` | No | User's state or province. |
| `zip` | `string` | No | User's zip or postal code. |
| `country` | `string` | No | User's country. |
| `mobile` | `string` | No | User's mobile phone. |
| `addPhone` | `string` | No | User's phone number 3. |
| `cellCountry` | `string` | No | User's mobile phone country code. |
| `handle` | `string` | No | This is the Display Name under My Profile. View Support Article. |
| `hometown` | `string` | No | User's hometown. |
| `aboutMe` | `string` | No | A short description about the user. |
| `facebook` | `string` | No | Facebook username. |
| `linkedIn` | `string` | No | LinkedIn username. |
| `instagram` | `string` | No | Instagram username. |
| `twitter` | `string` | No | Twitter handle. |
| `youtube` | `string` | No | Youtube username. |
| `tikTok` | `string` | No | TikTok username. |

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

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: "lightspeed_vt-create-new-user",
  arguments: {
    isActive: true,
    locationId: "Location 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: "lightspeed_vt-create-new-user",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    lightspeed_vt: { authProvisionId: "apn_xxxxxxx" },
    isActive: true,
    locationId: "Location 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": "lightspeed_vt-create-new-user",
    "configured_props": {
      "lightspeed_vt": { "authProvisionId": "apn_xxxxxxx" },
      "isActive": true,
      "locationId": "Location Id"
    }
  }'
```

---

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