# Create Dimension — Paigo

> Creates a new dimension inside the Paigo platform. See the documentation

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

## Description

Creates a new dimension inside the Paigo platform. [See the documentation](http://www.api.docs.paigo.tech/#tag/Dimensions/operation/Create%20a%20dimension)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `dimensionName` | `string` | Yes | A friendly, human-readable name for the dimension |
| `consumptionUnitType` | `string` | Yes | Consumption unit type of the dimension |
| `consumptionUnit` | `string` | Yes | Consumption unit type of the dimension Options are loaded from the connected account. |
| `usageIncrement` | `string` | Yes | The minimum increment for usage amount. As an example, if usage increment is 1 Hour job execution time, then 1 Hour and 5 Minutes execution time may be calculated as 1 Hour or 2 Hours, depending on the rounding algorithm field of the dimension. |
| `rounding` | `string` | Yes | The rounding algorithm that is used to calculate the amount of usage increment. Ceiling algorithm rounds up, floor algorithm rounds down, the round algorithm rounds to the nearest whole integer rounding half away from zero. |
| `usageEntitlement` | `string` | No | Used with Subscription Tier Offering type. SaaS customers subscribed to a subscription tier are entitled to use the amount of product with regard to the dimension up to the value specified in this field. For example, a subscription tier may entitle subscribers to make up to 1,000,000 API requests. |
| `overageAllowed` | `string` | No | Used with Subscription Tier Offering type. When the usage entitlement is specified, this field decides if allowing SaaS customers to use more than entitled amount of the product dimension. |

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

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: "paigo-create-dimension",
  arguments: {
    dimensionName: "Dimension Name",
    consumptionUnitType: "Consumption Unit Type",
  },
})
```

**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: "paigo-create-dimension",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    paigo: { authProvisionId: "apn_xxxxxxx" },
    dimensionName: "Dimension Name",
    consumptionUnitType: "Consumption Unit Type",
  },
})

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": "paigo-create-dimension",
    "configured_props": {
      "paigo": { "authProvisionId": "apn_xxxxxxx" },
      "dimensionName": "Dimension Name",
      "consumptionUnitType": "Consumption Unit Type"
    }
  }'
```

---

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