# Update Post — Brilliant Directories

> Updates a post in your website database. See the documentation

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

## Description

Updates a post in your website database. [See the documentation](https://support.brilliantdirectories.com/support/solutions/articles/12000088887-api-overview-and-testing-the-api-from-admin-area)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `postId` | `string` | Yes | The unique identifier for the post to update |
| `userId` | `integer` | No | The unique identifier for a user. |
| `dataId` | `integer` | No | The data id for the post. |
| `dataType` | `integer` | No | The data type for the post. |
| `postTitle` | `string` | No | The title of the post. |
| `postContent` | `string` | No | The content of the post. |
| `postCategory` | `string` | No | The category of the post. |
| `postType` | `string` | No | The type of the post. |
| `postTags` | `string[]` | No | A list of tags to the post. |
| `postStatus` | `boolean` | No | The status of the post. |
| `postStartDate` | `string` | No | The start date of the post. Format yyyymmddhhmmss |

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

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: "brilliant_directories-update-post",
  arguments: {
    postId: "Post ID",
    userId: 10,
  },
})
```

**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: "brilliant_directories-update-post",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    brilliant_directories: { authProvisionId: "apn_xxxxxxx" },
    postId: "Post ID",
    userId: 10,
  },
})

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": "brilliant_directories-update-post",
    "configured_props": {
      "brilliant_directories": { "authProvisionId": "apn_xxxxxxx" },
      "postId": "Post ID",
      "userId": 10
    }
  }'
```

---

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