# Create a QR Code — CodeQR

> Creates a new QR Code in CodeQR using the QR Codes API. See the documentation

- Key: `codeqr-create-qrcode`
- Type: Action (Write)
- Version: 0.0.3
- App: CodeQR (`codeqr`) — https://pipedream.com/apps/codeqr.md
- This page (HTML): https://pipedream.com/apps/codeqr/actions/create-qrcode
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/codeqr/actions/create-qrcode/create-qrcode.mjs

## Description

Creates a new QR Code in CodeQR using the QR Codes API. [See the documentation](https://codeqr.mintlify.app/api-reference/endpoint/create-a-qrcode)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `type` | `string` | Yes | Select the type of QR Code to generate. |
| `static` | `boolean` | Yes | Yes = Static QR Code (fixed content); No = Dynamic QR Code (editable content). |
| `url` | `string` | No | The destination URL of the QR Code. |
| `text` | `string` | No | Text content stored in the QR Code. |
| `trackConversion` | `boolean` | No | Enable tracking of conversions for the QR Code. Only available for dynamic QR Codes. |
| `title` | `string` | No | Title associated with the QR Code. |
| `bgColor` | `string` | No | Background color of the QR Code. |
| `fgColor` | `string` | No | Foreground color of the QR Code. |
| `showLogo` | `boolean` | No | Whether to display a logo in the QR Code. |
| `src` | `string` | No | URL of the logo to display in the QR Code (only if Show Logo is true). |
| `comments` | `string` | No | Comments or notes about the QR Code. |
| `expiresAt` | `string` | No | The date and time when the short link will expire (ISO 8601). Only available for dynamic QR Codes. E.g. 2025-06-13T05:31:56Z |
| `expiredUrl` | `string` | No | The URL to redirect to when the short link has expired. Only available for dynamic QR Codes. |

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

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: "codeqr-create-qrcode",
  arguments: {
    type: "QR Code Type",
    static: 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: "codeqr-create-qrcode",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    codeqr: { authProvisionId: "apn_xxxxxxx" },
    type: "QR Code Type",
    static: 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": "codeqr-create-qrcode",
    "configured_props": {
      "codeqr": { "authProvisionId": "apn_xxxxxxx" },
      "type": "QR Code Type",
      "static": true
    }
  }'
```

---

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