> For the complete documentation index, see [llms.txt](https://docs.cuoral.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuoral.com/api-reference/customers/company/metrics/set-company-metric-value.md).

# Set Company Metric Value

POST /external/v1/external/v1/customers/companies/{company\_id}/metrics&#x20;

### Request ⚙️

#### Parameters

| **Name**    | **Type** | **Description**                                      | **Location** | **Required** |
| ----------- | -------- | ---------------------------------------------------- | ------------ | ------------ |
| company\_id | `string` | Company ID (UUID) for which the metric is being set. | Path         | Yes          |

#### Request Body (application/json)

| **Field**   | **Type** | **Description**                                                         | **Example**       | **Required** |
| ----------- | -------- | ----------------------------------------------------------------------- | ----------------- | ------------ |
| metric\_id  | `string` | The unique ID of the metric being updated (e.g., `'revenue'`, `'ARR'`). | `"ARR_METRIC_ID"` | Yes          |
| company\_id | `string` | The ID of the company (redundant, but often required in the body).      | `"COMP-F7E6D5"`   | Yes          |
| value       | `string` | The value to set for the metric.                                        | `"125000.50"`     | Yes          |

Example Request Body:

```json
{
  "metric_id": "monthly_users",
  "company_id": "COMP-F7E6D5",
  "value": "9500"
}
```

***

### Responses&#x20;

#### Successful Response (201) (application/json)

Returns the created or updated metric record.

| **Field**     | **Type**            | **Description**                                                       |
| ------------- | ------------------- | --------------------------------------------------------------------- |
| id            | `integer`           | The internal database ID of the metric entry.                         |
| company\_id   | `integer`           | The ID of the company (as an integer).                                |
| metric\_id    | `integer`           | The internal ID of the metric type.                                   |
| metric\_name  | `string`            | The human-readable name of the metric.                                |
| data\_type    | `string`            | The data type of the stored value (e.g., `STRING`, `NUMBER`, `DATE`). |
| value         | `string`            | The value that was set.                                               |
| time\_created | `string` (datetime) | Creation timestamp.                                                   |
| time\_updated | `string` (datetime) | Last update timestamp.                                                |

Example Response Body (201):

JSON

```json
{
  "id": 101,
  "company_id": 501,
  "metric_id": 12,
  "metric_name": "Monthly Active Users",
  "data_type": "NUMBER",
  "value": "9500",
  "time_created": "2025-11-27T09:52:39.743Z",
  "time_updated": "2025-11-27T09:52:39.743Z"
}
```

#### Validation Error (422)&#x20;

JSON

```json
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```
