# Create Hardware Asset — Snipe-IT

> Creates a new hardware asset in Snipe-IT. See the documentation

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

## Description

Creates a new hardware asset in Snipe-IT. [See the documentation](https://snipe-it.readme.io/reference/hardware-create)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `modelId` | `integer` | Yes | Select the model for this asset Options are loaded from the connected account. |
| `statusId` | `integer` | Yes | Select the status label for this asset Options are loaded from the connected account. |
| `assetTag` | `string` | No | The asset tag for the asset |
| `name` | `string` | No | The name of the asset |
| `image` | `string` | No | Base64 encoded image. Eg. data:@[mime];base64,[base64encodeddata]. |
| `serial` | `string` | No | The serial number of the asset |
| `purchaseDate` | `string` | No | The purchase date of the asset (YYYY-MM-DD format) |
| `purchaseCost` | `string` | No | The purchase cost of the asset |
| `orderNumber` | `string` | No | The order number of the asset |
| `notes` | `string` | No | Notes about the asset |
| `archived` | `boolean` | No | Whether the asset is archived |
| `warrantyMonths` | `integer` | No | The warranty period in months |
| `depreciate` | `boolean` | No | Whether the asset is depreciated |
| `supplierId` | `integer` | No | Select the supplier for this asset Options are loaded from the connected account. |
| `requestable` | `boolean` | No | Whether this asset can be requested by users |
| `rtdLocationId` | `integer` | No | Select the default location for this asset Options are loaded from the connected account. |
| `lastAuditDate` | `string` | No | The date of the last audit for this asset (YYYY-MM-DD format) |
| `locationId` | `integer` | No | Select the location where this asset is located Options are loaded from the connected account. |
| `byod` | `boolean` | No | Whether this asset is a BYOD device. |
| `customFields` | `object` | No | Custom fields for the asset |

## 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-hardware",
  arguments: {
    modelId: 10,
    statusId: 10,
  },
})
```

**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-hardware",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    snipe_it: { authProvisionId: "apn_xxxxxxx" },
    modelId: 10,
    statusId: 10,
  },
})

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-hardware",
    "configured_props": {
      "snipe_it": { "authProvisionId": "apn_xxxxxxx" },
      "modelId": 10,
      "statusId": 10
    }
  }'
```

---

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