# Update Job — VisualPing

> Update an existing job. See the docs here

- Key: `visualping-update-job`
- Type: Action (Write)
- Version: 0.0.3
- App: VisualPing (`visualping`) — https://pipedream.com/apps/visualping.md
- This page (HTML): https://pipedream.com/apps/visualping/actions/update-job
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/visualping/actions/update-job/update-job.mjs

## Description

Update an existing job. [See the docs here](https://develop.api.visualping.io/doc.html#tag/Jobs/paths/~1v2~1jobs~1%7BjobId%7D/put)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `workspaceId` | `string` | Yes | The workspace ID Options are loaded from the connected account. |
| `jobId` | `string` | Yes | The job ID Options are loaded from the connected account. |
| `organisationId` | `string` | No | Unique ID of the organisation. |
| `url` | `string` | No | Url of the web page monitored by this job. |
| `description` | `string` | No | Job Description |
| `mode` | `string` | No | Job mode |
| `active` | `boolean` | No | Whether the job is active or paused. |
| `interval` | `string` | No | Job's crawling interval expressed in minutes. Examples: 5, 15, 1440... |
| `trigger` | `string` | No | Job's diff detection trigger expressed in percents. Examples: 0.1, 25... |
| `proxy` | `string` | No | String code representing the optional proxy to use for this job. Contact Visualping for details. |
| `fixedProxyAlias` | `string` | No | For internal use. |
| `xpath` | `string` | No | Optional xpath representing the root web element to consider for this job. |
| `renderer` | `string` | No | For internal use. |
| `disableJS` | `boolean` | No | For internal use. |
| `pageHeight` | `string` | No | For internal use. |
| `targetDevice` | `string` | No | 1 for regular desktop crawling of a specific area (used typically in conjunction with a crop area), 4 for full page desktop crawling (mostly used with text jobs), 3 for desktop crawling with special fold extractions. 2 for mobile. |
| `waitTime` | `integer` | No | Number of seconds to wait the crawling and before applying any actions on the wab page. |
| `preactionsActive` | `boolean` | No | Whether Preactions is active or not. |
| `preactionsObjects` | `any` | No | Array of LegacyJobPreAction objects. |
| `advancedScheduleActive` | `boolean` | No | Whether advanced schedule is active or not. |
| `multicheckEnabled` | `string` | No | For internal use. |
| `enableSmsAlert` | `boolean` | No | Used to enable sms notifications for the considered job. Typically false. |
| `enableEmailAlert` | `boolean` | No | Used to enable email notifications for the considered job. Typically false. |
| `useSlackNotification` | `boolean` | No | If this job uses slack notification. |
| `useTeamsNotification` | `boolean` | No | If this job uses teams notification. |
| `useWebhookNotification` | `boolean` | No | If this job uses webhook notification. |
| `useDiscordNotification` | `boolean` | No | If this job uses discord notification. |
| `useSlackAppNotification` | `boolean` | No | If this job uses slack app notification. |

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

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: "visualping-update-job",
  arguments: {
    workspaceId: "Workspace ID",
    jobId: "Job 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: "visualping-update-job",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    visualping: { authProvisionId: "apn_xxxxxxx" },
    workspaceId: "Workspace ID",
    jobId: "Job 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": "visualping-update-job",
    "configured_props": {
      "visualping": { "authProvisionId": "apn_xxxxxxx" },
      "workspaceId": "Workspace ID",
      "jobId": "Job ID"
    }
  }'
```

---

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