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

# createUsageMeasurement

> Create usage measurement



**mutation** `createUsageMeasurement(usageMeasurement: UsageMeasurementCreateInput!): UsageMeasurementWithCurrentUsage!`

> Deprecated: Deprecated query, use `reportUsage` instead

## Arguments

**`usageMeasurement`**: `UsageMeasurementCreateInput!` (required)

Input for creating a usage measurement

## Returns

`UsageMeasurementWithCurrentUsage!`

**`createdAt`**: `DateTime!`

Timestamp of when the record was created

---

**`credit`**: `UsageMeasurementCredit`

The optimistic balance of the credit wallet (currency) that this feature consumes from, in credit units. It is the per-currency total shared across every feature drawing on that currency — not this feature’s individual consumption — and reflects usage before async reconciliation. Populated only for credit-backed features.

---

**`currentUsage`**: `Float`

The current measured usage value

---

**`customerId`**: `String!`

Customer id

---

**`environmentId`**: `String!`

The unique identifier for the environment

---

**`featureId`**: `String!`

Feature id

---

**`id`**: `UUID!`

Unique identifier for the entity

---

**`nextResetDate`**: `DateTime`

The date when the next usage reset will occur

> Deprecated: renamed to usagePeriodEnd

---

**`resourceId`**: `String`

The customer resource this usage applies to. Optional — only required if the customer has multiple resources (for example, one subscription per workspace or site) and usage needs to be tracked separately per resource; omit it to report usage at the customer level.

---

**`timestamp`**: `DateTime!`

Timestamp

---

**`usagePeriodEnd`**: `DateTime`

The end date of the usage period in which this measurement resides (for entitlements with a reset period)

---

**`usagePeriodStart`**: `DateTime`

The start date of the usage period in which this measurement resides (for entitlements with a reset period)

---

**`value`**: `Float!`

The usage measurement record

## Examples

```graphql Mutation
mutation CreateUsageMeasurement($usageMeasurement: UsageMeasurementCreateInput!) {
  createUsageMeasurement(usageMeasurement: $usageMeasurement) {
    createdAt
    credit {
      consumed
      currencyId
      currentUsage
      timestamp
      usageLimit
      usagePeriodEnd
    }
    currentUsage
    customerId
    environmentId
    featureId
  }
}
```

```json Variables
{
  "usageMeasurement": {
    "customerId": "string",
    "featureId": "string",
    "value": 1.5
  }
}
```

```json Response
{
  "data": {
    "createUsageMeasurement": {
      "createdAt": "value",
      "credit": {
        "consumed": 1.5,
        "currencyId": "string",
        "currentUsage": 1.5,
        "timestamp": "value",
        "usageLimit": 1.5,
        "usagePeriodEnd": "value"
      },
      "currentUsage": 1.5,
      "customerId": "string",
      "environmentId": "string",
      "featureId": "string"
    }
  }
}
```


## Related topics

- [UsageMeasurementCreateInput](https://docs.stigg.io/graphql-reference/types/UsageMeasurementCreateInput.md)
- [UsageMeasurement](https://docs.stigg.io/graphql-reference/types/UsageMeasurement.md)
- [Report usage measurements](https://docs.stigg.io/api-reference/usage/report-usage-measurements.md)
- [usageMeasurements](https://docs.stigg.io/graphql-reference/queries/usageMeasurements.md)
- [UsageMeasurementWithCurrentUsage](https://docs.stigg.io/graphql-reference/types/UsageMeasurementWithCurrentUsage.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.