# Create Organization — Agendor

> Create Organization See the documentation.

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

## Description

Create Organization [See the documentation](https://api.agendor.com.br/docs/#operation/Create%20organization).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | Yes | Display name |
| `legalName` | `string` | No | Legal name |
| `cnpj` | `string` | No | Legal document number (CNPJ) |
| `description` | `string` | No | Your description of this organization. |
| `logo` | `string` | No | URL of the logo |
| `website` | `string` | No | URL of the website |
| `ranking` | `string` | No | Ranking displayed as stars in the page. |
| `ownerUser` | `string` | No | User ID or email of the owner of this organization. Options are loaded from the connected account. |
| `contact` | `object` | No | Contact object can have the following properties: email, work, mobile, fax, whatsapp, facbeook, twitter, instagram, linked_in, skype. Please check the documentation in the description for more information. |
| `address` | `object` | No | Address Object can have the following properties: postal_code, country, district, state, street_name, street_number, additional_info, city. Please check the documentation in the description for more information. |
| `leadOrigin` | `string` | No | Lead origin. Options are loaded from the connected account. |
| `category` | `string` | No | Category ID or name. Options are loaded from the connected account. |
| `sector` | `string` | No | Sector ID or name. Options are loaded from the connected account. |
| `products` | `string[]` | No | Array of product IDs. Options are loaded from the connected account. |
| `allowedUsers` | `string[]` | No | Array of IDs of users that should be able to see this organization. Options are loaded from the connected account. |
| `allowToAllUsers` | `boolean` | No | Set true if this organization should be visible to all users. |
| `customFields` | `object` | No | Custom fields information. |

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

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: "agendor-create-organization",
  arguments: {
    name: "Name",
    legalName: "Legal Name",
  },
})
```

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

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": "agendor-create-organization",
    "configured_props": {
      "agendor": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Name",
      "legalName": "Legal Name"
    }
  }'
```

---

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