# Create Company — CompanyHub

> Creates a new company. See the documentation

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

## Description

Creates a new company. [See the documentation](https://companyhub.com/docs/api-documentation)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | Yes | The name of the company |
| `website` | `string` | No | The website URL of the company |
| `phone` | `string` | No | The phone number of the company |
| `description` | `string` | No | A description of the company |
| `billingStreet` | `string` | No | The billing street address |
| `billingCity` | `string` | No | The billing city |
| `billingState` | `string` | No | The billing state/province |
| `billingCountry` | `string` | No | The billing country |
| `billingPostalCode` | `string` | No | The billing postal/zip code |
| `shippingStreet` | `string` | No | The shipping street address |
| `shippingCity` | `string` | No | The shipping city |
| `shippingState` | `string` | No | The shipping state/province |
| `shippingCountry` | `string` | No | The shipping country |
| `shippingPostalCode` | `string` | No | The shipping postal/zip code |

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

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: "companyhub-create-company",
  arguments: {
    name: "Name",
    website: "Website",
  },
})
```

**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: "companyhub-create-company",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    companyhub: { authProvisionId: "apn_xxxxxxx" },
    name: "Name",
    website: "Website",
  },
})

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": "companyhub-create-company",
    "configured_props": {
      "companyhub": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Name",
      "website": "Website"
    }
  }'
```

---

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