# Create Artifact — Rendex

> Turn Markdown or HTML plus a small branding theme into a branded PDF + PNG and a hosted share page in one call. Returns pdfUrl, pngUrl, shareUrl, and expiresAt. See the documentation.

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

## Description

Turn Markdown or HTML plus a small branding theme into a branded PDF + PNG and a hosted share page in one call. Returns `pdfUrl`, `pngUrl`, `shareUrl`, and `expiresAt`. [See the documentation](https://rendex.dev/docs/api-reference#post-artifact).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `content` | `string` | Yes | The Markdown or HTML body to render into a branded artifact. |
| `inputFormat` | `string` | No | How to interpret content: markdown is converted to styled HTML; html is used as a body fragment. |
| `formats` | `string[]` | No | Which artifact formats to produce. Each format charges 1 credit. Defaults to both. |
| `brandName` | `string` | No | Plain-text header line shown beside the logo (maps to branding.header). |
| `title` | `string` | No | Title for the hosted share page. Falls back to Brand Name when set; both populate branding.header (the API's single header field). |
| `accentColor` | `string` | No | CSS color for the accent bar, links, and headings (e.g. #EA580C, rebeccapurple). |
| `logoUrl` | `string` | No | Absolute http(s) URL of a logo image shown in the artifact header. |
| `footer` | `string` | No | Plain-text footer line shown at the bottom of every page. |
| `expiresIn` | `integer` | No | Seconds until the hosted artifact URLs expire (3600–2592000). Defaults to 86400 (24 hours). |

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

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: "rendex-create-artifact",
  arguments: {
    content: "Content",
    inputFormat: "Input Format",
  },
})
```

**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: "rendex-create-artifact",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    rendex: { authProvisionId: "apn_xxxxxxx" },
    content: "Content",
    inputFormat: "Input Format",
  },
})

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": "rendex-create-artifact",
    "configured_props": {
      "rendex": { "authProvisionId": "apn_xxxxxxx" },
      "content": "Content",
      "inputFormat": "Input Format"
    }
  }'
```

---

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