# Send Print Job — PrintNode

> Sends a print job to a specified printer. See the documentation

- Key: `printnode-send-print-job`
- Type: Action (Write)
- Version: 1.0.4
- App: PrintNode (`printnode`) — https://pipedream.com/apps/printnode.md
- This page (HTML): https://pipedream.com/apps/printnode/actions/send-print-job
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/printnode/actions/send-print-job/send-print-job.mjs

## Description

Sends a print job to a specified printer. [See the documentation](https://www.printnode.com/en/docs/api/curl#creating-print-jobs)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `printerId` | `integer` | Yes | Select a Printer or provide a custom Printer ID. Options are loaded from the connected account. |
| `contentType` | `string` | Yes | The type of content you are sending. See the documentation for more information |
| `filePath` | `string` | Yes | The file to upload. Provide either a file URL or a path to a file in the /tmp directory (for example, /tmp/myFile.txt) |
| `title` | `string` | No | A title to give the print job. This is the name which will appear in the operating system's print queue. |
| `source` | `string` | No | A text description of how the print job was created or where the print job originated. |
| `options` | `object` | No | An object describing various options which can be set for this print job. See the documentation for more information. |
| `expireAfter` | `integer` | No | The maximum number of seconds PrintNode should retain this print job in the event that the print job cannot be printed immediately. |
| `qty` | `integer` | No | A positive integer specifying the number of times this print job should be delivered to the print queue. |
| `authentication` | `object` | No | If access to the file URL requires HTTP Basic or Digest Authentication, specify the username and password information here. See the documentation for more information. |
| `syncDir` | `dir` | No | SyncDir |

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

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: "printnode-send-print-job",
  arguments: {
    printerId: 10,
    contentType: "Content Type",
  },
})
```

**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: "printnode-send-print-job",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    printnode: { authProvisionId: "apn_xxxxxxx" },
    printerId: 10,
    contentType: "Content Type",
  },
})

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": "printnode-send-print-job",
    "configured_props": {
      "printnode": { "authProvisionId": "apn_xxxxxxx" },
      "printerId": 10,
      "contentType": "Content Type"
    }
  }'
```

---

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