# Create or Update Company — Gainsight

> Create or update a company record. See the documentation

- Key: `gainsight_nxt-create-or-update-company`
- Type: Action (Write)
- Version: 0.0.3
- App: Gainsight (`gainsight_nxt`) — https://pipedream.com/apps/gainsight-nxt.md
- This page (HTML): https://pipedream.com/apps/gainsight-nxt/actions/create-or-update-company
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/gainsight_nxt/actions/create-or-update-company/create-or-update-company.mjs

## Description

Create or update a company record. [See the documentation](https://support.gainsight.com/gainsight_nxt/API_and_Developer_Docs/Company_and_Relationship_API/Company_API_Documentation#Parameters)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | Yes | The name of the company. If a company record with this name exists, it will be updated, otherwise a new one will be created. |
| `industry` | `string` | No | The industry name of the company. |
| `arr` | `string` | No | The annual recurring revenue of the company, as a currency value. |
| `employees` | `integer` | No | The number of employees the company has. |
| `lifecycleInWeeks` | `integer` | No | The number of weeks the entire process goes through. |
| `originalContractDate` | `string` | No | The date the engagement with the client started, in YYYY-MM-DD format. |
| `renewalDate` | `string` | No | The upcoming renewal date of the contract, in YYYY-MM-DD format. |
| `stage` | `string` | No | The current stage of the company in the sales pipeline. |
| `status` | `string` | No | The current status of the company. |
| `additionalOptions` | `object` | No | Additional parameters to send in the request. See the documentation for available parameters. Values will be parsed as JSON where applicable. |

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

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: "gainsight_nxt-create-or-update-company",
  arguments: {
    name: "Name",
    industry: "Industry",
  },
})
```

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

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": "gainsight_nxt-create-or-update-company",
    "configured_props": {
      "gainsight_nxt": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Name",
      "industry": "Industry"
    }
  }'
```

---

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