> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmeasure.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Billable Metric

> Update a billable metric



## OpenAPI

````yaml https://api.getmeasure.com/api/v1/docs/api_spec.json patch /companies/{company_id}/billable_metrics/{id}
openapi: 3.1.0
info:
  title: Measure API
  description: APIs to communicate with Measure
  version: 1.0.0
servers:
  - url: https://api.getmeasure.com/api/v1
security: []
paths:
  /companies/{company_id}/billable_metrics/{id}:
    patch:
      tags:
        - Pricing
      summary: Update Billable Metric
      description: Update a billable metric
      operationId: Update_Billable_Metric
      parameters:
        - name: company_id
          in: path
          description: 'The company ID with the prefix ''cmp_''. '
          required: true
          schema:
            description: 'The company ID with the prefix ''cmp_''. '
            type: string
        - name: id
          in: path
          description: The resource ID
          required: true
          schema:
            description: The resource ID
            type: string
        - name: Idempotency-Key
          in: header
          description: >-
            The idempotency key that will be used to ensure the request is only
            performed once
          schema:
            description: >-
              The idempotency key that will be used to ensure the request is
              only performed once
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestUpdateBillableMetricRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBillableMetricRepresentation'
      deprecated: false
      security:
        - apiKey:
            - ''
components:
  schemas:
    RequestUpdateBillableMetricRequest:
      properties:
        description:
          description: The description of the billable metric
          type:
            - 'null'
            - string
        external_name:
          description: The public name of the billable metric
          type:
            - 'null'
            - string
        name:
          description: The name of the billable metric
          type:
            - 'null'
            - string
      type: object
    ResponseBillableMetricRepresentation:
      properties:
        company_id:
          description: The company ID for the billable metric
          type: string
        created_at:
          description: The date the billable metric was created
          format: date-time
          type: string
        description:
          description: Any description attached to the billable metric
          type: string
        editable:
          description: Whether the billable metric can be further edited
          type: boolean
        external_name:
          description: The public name of the billable metric
          type: string
        id:
          description: The ID of the billable metric in Measure
          type: string
        is_billable:
          description: Whether this is a billable metric
          type: boolean
        item_id:
          description: The billable item this metric is tied to
          type: string
        metering_rule:
          $ref: '#/components/schemas/ModelMeteringRule'
          description: JSON representation of the metering rule associated with the metric
        name:
          description: The name of the billable metric
          type: string
        standard:
          description: >-
            Whether this is a standard billable metric in Measure or a custom
            billable metric
          type: boolean
        state:
          description: The state of the metric which can be one of ACTIVE or ARCHIVED
          type: string
        type:
          description: >-
            The type of the billable metric which can be one of LICENSE_METRIC,
            ONETIME_METRIC or CUSTOM_METRIC depending if it is a standard
            billable metric in Measure or a custom metric
          type: string
        updated_at:
          description: The date the billable metric was last updated
          format: date-time
          type: string
      type: object
    ModelMeteringRule:
      properties:
        aggregator:
          type: string
        group_keys:
          items:
            type: string
          type:
            - array
            - 'null'
        property:
          type: string
        rule:
          $ref: '#/components/schemas/ModelMatchingRule'
      type: object
    ModelMatchingRule:
      properties:
        comparator:
          $ref: '#/components/schemas/ModelMatchingRuleComparator'
      type: object
    ModelMatchingRuleComparator:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ModelMatchingRule'
          type: array
        left_item:
          $ref: '#/components/schemas/ModelMatchingRuleItem'
        right_item:
          $ref: '#/components/schemas/ModelMatchingRuleItem'
        type:
          type: string
      type: object
    ModelMatchingRuleItem:
      properties:
        comparator:
          $ref: '#/components/schemas/ModelMatchingRuleComparator'
        item_type:
          type: string
        property:
          type: string
        value:
          type: string
      type: object
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````