# Update Bitlink — Bitly

> Updates fields in the specified link

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

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `bitlink` | `string` | Yes | A Bitlink made of the domain and hash |
| `references` | `object` | No | Bitlink references |
| `link` | `string` | No | Complete bitlink url |
| `id` | `string` | No | Bitlink ID |
| `longUrl` | `string` | No | Url that was shortened |
| `title` | `string` | No | Bitlink title |
| `archived` | `boolean` | No | Archived bitlink (true or false) |
| `createdAt` | `string` | No | Bitlink created date. Example: 2006-03-12T16:29:46+0000 |
| `createdBy` | `string` | No | Bitlink created_by ID |
| `clientId` | `string` | No | Bitlink client ID |
| `customBitlinks` | `string[]` | No | Provide an array of custom bitlinks Example: [ "https://microsoft.com/documentation", "https://github.com/contact", "https://gitlab.com/forum", "https://pipedream.com/chat ] |
| `tags` | `string[]` | No | Enter array of tags |
| `launchpadIds` | `string[]` | No | Enter array of Launchpad IDs |
| `deeplinks` | `string[]` | No | Provide an object. Each object should represent a row. Example: { "guid": "Ra1bcD2eF3h", "bitlink": "bit.ly/documentation", "app_uri_path": "/store?id': '123456", "install_url": "https://play.google.com/store/apps/details?id=com.bitly.app', "app_guid": "Ab1cdE2fG3h", "os": "android", "install_type": "promote_install", "created": "2011-10-05T14:48:00.000Z", "modified": "2011-10-06T14:48:00.000Z" "brand_guid": "Ba1bc23dE4F" } |
| `isDeleted` | `boolean` | No | Bitlink deleted (true or false) |

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

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: "bitly-update-bitlink",
  arguments: {
    bitlink: "Bitlink",
    references: "References",
  },
})
```

**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: "bitly-update-bitlink",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    bitly: { authProvisionId: "apn_xxxxxxx" },
    bitlink: "Bitlink",
    references: "References",
  },
})

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": "bitly-update-bitlink",
    "configured_props": {
      "bitly": { "authProvisionId": "apn_xxxxxxx" },
      "bitlink": "Bitlink",
      "references": "References"
    }
  }'
```

---

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