# Update Billable Metric

`PATCH https://api.suger.cloud/org/{orgId}/billableMetric/{billableMetricId}`

Update the name, description and status of the billable metric for the given organization.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |
| `billableMetricId` | path | string | yes | Billable Metric ID |

## Request Body

Required.

Content-Type: `application/json` · Schema: `UpdateBillableMetricParams`

**`UpdateBillableMetricParams`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string | no |  |
| `name` | string | no |  |
| `status` | BillableMetricStatus | no |  |

## Responses

### 200 — OK

Content-Type: `application/json` · Schema: `BillableMetric`

**`BillableMetric`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `aggregationType` | BillableMetricAggregationType | no |  |
| `creationTime` | string | no |  |
| `description` | string | no |  |
| `id` | string | no |  |
| `info` | BillableMetricInfo | no |  |
| `lastUpdateTime` | string | no |  |
| `name` | string | no |  |
| `organizationId` | string | no |  |
| `status` | BillableMetricStatus | no |  |

**`BillableMetricInfo`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filterGroups` | array<BillableMetricFilterGroup> | no | FilterGroups is a list of filter groups. The filterGroups are connected by AND. |
| `groupBys` | array<string> | no | GroupBys is a list of fields to group by. |
| `propertyUniqueOn` | string | no | The target property for unique count aggregate. |

**`BillableMetricFilterGroup`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filters` | array<BillableMetricFilter> | no |  |

**`BillableMetricFilter`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no |  |
| `operation` | BillableMetricFilterOperation | no |  |
| `value` | object | no | The value of the filter. The type of the value depends on the valueType. |
| `valueType` | BillableMetricFilterValueType | no |  |

### 400 — Bad request error

Content-Type: `application/json`

### 404 — billable metric not found

Content-Type: `application/json`

### 500 — Internal server error

Content-Type: `application/json`

## Example

_Generated from this operation's schema. Values are placeholders — substitute your own ids, and set `SUGER_TOKEN` to a bearer token from the [OAuth client-credentials exchange](https://doc.fours.com/settings/oauth-app/)._

### Request

```bash
curl -X PATCH 'https://api.suger.cloud/org/{orgId}/billableMetric/{billableMetricId}' \
  -H "Authorization: Bearer $SUGER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "description": "string",
  "name": "Acme Corp",
  "status": "ACTIVE"
}'
```

### Response — 200

```json
{
  "aggregationType": "COUNT",
  "creationTime": "2026-01-31T12:00:00Z",
  "description": "string",
  "id": "01H0000000000000000000",
  "info": {
    "filterGroups": [
      {
        "filters": [
          {}
        ]
      }
    ],
    "groupBys": [
      "string"
    ],
    "propertyUniqueOn": "string"
  },
  "lastUpdateTime": "2026-01-31T12:00:00Z",
  "name": "Acme Corp",
  "organizationId": "01H0000000000000000000",
  "status": "ACTIVE"
}
```

### Error — 400

```json
"string"
```

---

API reference: https://doc.fours.com/api/
