# Edit Data Connection — Hex

> Edit a specific data connection. See the documentation

- Key: `hex-edit-data-connection`
- Type: Action (Write)
- Version: 0.0.1
- App: Hex (`hex`) — https://pipedream.com/apps/hex.md
- This page (HTML): https://pipedream.com/apps/hex/actions/edit-data-connection
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/hex/actions/edit-data-connection/edit-data-connection.mjs

## Description

Edit a specific data connection. [See the documentation](https://learn.hex.tech/docs/api/api-reference#operation/EditDataConnection)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `connectionId` | `string` | Yes | The ID of the connection to update. Options are loaded from the connected account. |
| `sharingWorkspacePublic` | `string` | No | Data connection public sharing access level. |
| `sharingWorkspaceGuests` | `string` | No | Data connection guests sharing access level. |
| `sharingWorkspaceMembers` | `string` | No | Data connection members sharing access level. |
| `schemaRefreshAccess` | `string` | No | Schema refresh access level. |
| `schemaRefreshSchedule` | `object` | No | An object with the schema refresh schedule data. See the documentation for more information. E.g. { "cadence": "DAILY", "enabled": true, "daily": {"timezoneString": "America/New_York", "hour": 12, "minute": 0 } } |
| `schemaFilters` | `object` | No | An object with the schema filters data. See the documentation for more information. E.g. { "tables": {"exclude": {"values": ["table1", "table2"], "matchType": "EXACT"}}, "schemas": {"include": {"values": ["schema1", "schema2"], "matchType": "PREFIX"}}} |
| `allowWritebackCells` | `boolean` | No | Allow writeback cells. |
| `includeMagic` | `boolean` | No | Include magic. |
| `connectViaSsh` | `boolean` | No | Connect via SSH. |
| `description` | `string` | No | The description of the data connection. |
| `connectionDetails` | `object` | No | An object with the connection details data. See the documentation for more information. E.g. { "bigquery": { "serviceAccountJsonConfig": "string", "enableStorageApi": true, "enableDriveAccess": true, "projectId": "string" }} |
| `name` | `string` | No | The name of the data connection. |

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

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: "hex-edit-data-connection",
  arguments: {
    connectionId: "Connection ID",
    sharingWorkspacePublic: "Sharing Workspace Public",
  },
})
```

**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: "hex-edit-data-connection",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    hex: { authProvisionId: "apn_xxxxxxx" },
    connectionId: "Connection ID",
    sharingWorkspacePublic: "Sharing Workspace Public",
  },
})

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": "hex-edit-data-connection",
    "configured_props": {
      "hex": { "authProvisionId": "apn_xxxxxxx" },
      "connectionId": "Connection ID",
      "sharingWorkspacePublic": "Sharing Workspace Public"
    }
  }'
```

---

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