# Create Post — Circle

> Create a new post in a selected space within your Circle community. See the documentation

- Key: `circle-create-post`
- Type: Action (Write)
- Version: 0.0.4
- App: Circle (`circle`) — https://pipedream.com/apps/circle.md
- This page (HTML): https://pipedream.com/apps/circle/actions/create-post
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/circle/actions/create-post/create-post.mjs

## Description

Create a new post in a selected space within your Circle community. [See the documentation](https://api.circle.so/#ffc804e8-02a8-48dc-a5c8-dc278f909fa4)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `communityId` | `string` | Yes | Select the community you want to interact with. Options are loaded from the connected account. |
| `spaceId` | `string` | Yes | Select the space within the community. Options are loaded from the connected account. |
| `status` | `string` | No | The post's status. Default is published |
| `publishedAt` | `string` | No | Acts as the publish time and is required when status is scheduled. Must be in the past when status is published. Format: YYYY-MM-DDTHH:MM:SS.SSSZ |
| `name` | `string` | Yes | The name of the post |
| `body` | `string` | Yes | The body of the post. |
| `isPinned` | `boolean` | Yes | Whether the post is pinned to the top or not. |
| `isCommentsEnabled` | `boolean` | Yes | Whether comments are shown or not. |
| `isCommentsClosed` | `boolean` | Yes | Whether users can comment or not. |
| `isLikingEnabled` | `boolean` | No | Whether links are enabled or not. |
| `userEmail` | `string` | No | Email of the community member to post from. Defaults to admin if empty. Options are loaded from the connected account. |

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

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: "circle-create-post",
  arguments: {
    communityId: "Community ID",
    spaceId: "Space 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: "circle-create-post",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    circle: { authProvisionId: "apn_xxxxxxx" },
    communityId: "Community ID",
    spaceId: "Space 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": "circle-create-post",
    "configured_props": {
      "circle": { "authProvisionId": "apn_xxxxxxx" },
      "communityId": "Community ID",
      "spaceId": "Space ID"
    }
  }'
```

---

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