# Update Record — Kintone

> Updates an existing record in a Kintone App. See the documentation

- Key: `kintone-update-record`
- Type: Action (Write)
- Version: 0.0.1
- App: Kintone (`kintone`) — https://pipedream.com/apps/kintone.md
- This page (HTML): https://pipedream.com/apps/kintone/actions/update-record
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/kintone/actions/update-record/update-record.mjs

## Description

Updates an existing record in a Kintone App. [See the documentation](https://kintone.dev/en/docs/kintone/rest-api/records/update-record/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `appId` | `integer` | Yes | The Kintone App ID Options are loaded from the connected account. |
| `recordId` | `string` | No | The Record ID of the record to update. Use this OR Update Key, not both Options are loaded from the connected account. |
| `updateKeyField` | `string` | No | The field code of the unique key (when using Update Key instead of Record ID). Must have 'Prohibit duplicate values' enabled |
| `updateKeyValue` | `string` | No | The value of the unique key to identify the record |
| `revision` | `integer` | No | The expected revision number. If the value does not match, an error will occur and the record will not be updated. If the value is not specified, the revision number will not be checked |
| `record` | `object` | Yes | Field codes and values are specified in this object. Fields not specified here will retain their current values. For more information on field types, refer to the following article: Field Types. Example: {"Text": {"value": "Sample"}, "Number": {"value": 1}} |

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

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: "kintone-update-record",
  arguments: {
    appId: 10,
    recordId: "Record 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: "kintone-update-record",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    kintone: { authProvisionId: "apn_xxxxxxx" },
    appId: 10,
    recordId: "Record 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": "kintone-update-record",
    "configured_props": {
      "kintone": { "authProvisionId": "apn_xxxxxxx" },
      "appId": 10,
      "recordId": "Record ID"
    }
  }'
```

---

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