---
title: "Update a usage quota"
method: PATCH
path: "/api/v2/usage/quotas/{quota_namespace}/{id}"
tags: ["Usage Metering"]
---

# Update a usage quota

`PATCH /api/v2/usage/quotas/{quota_namespace}/{id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/usage/quotas/{quota_namespace}/{id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `billing_edit`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/usage/quotas/:quota_namespace/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Updates the supplied fields on a usage quota and leaves omitted fields unchanged. For an organization-wide quota, `pending_usage_limit` schedules a limit for the next usage period. The quota must belong to the caller's organization or one of its descendants, and its opaque identifier must belong to the requested quota namespace. Requires the `billing_edit` permission.

## Path parameters

- `quota_namespace` string, required
- `id` string, required

## Request body

- UsageQuotaUpdateRequest: Request containing the usage quota resource to update.
  - `data` UsageQuotaUpdateData, required: A usage quota resource to update.
    - `attributes` UsageQuotaUpdateAttributes, required: Attributes to update on a usage quota. At least one of `usage_limit`, `enforced`, or `pending_usage_limit` must be provided. Omitting a property leaves its current value unchanged.
      - `enforced` boolean, nullable: Whether to actively block usage above the limit. Omit this field to leave the current enforcement setting unchanged.
      - `pending_usage_limit` integer, nullable: The non-negative, whole-number limit to schedule for the organization-wide quota in the usage units defined by the quota namespace. It is not checked against current usage. Each write schedules the value for 00:00 UTC on the first day of the next calendar month and replaces any previously scheduled change; the server computes `pending_effective_from`. Omit this field to leave any scheduled change unchanged, including when raising `usage_limit`; use `DELETE /api/v2/usage/quotas/{quota_namespace}/{id}/pending` to cancel one.
      - `usage_limit` integer, nullable: The new quota limit in the usage units defined by the quota namespace. For an organization-wide quota (empty scope), the limit must be greater than the usage already recorded in the current period. Omit this field to leave the current limit unchanged.
    - `id` string, required: The opaque usage quota identifier, which must match the identifier in the request path.
    - `type` 'quotas', required: The JSON:API resource type for a usage quota.

## Response `200`

OK

- UsageQuotaResponse: Response containing a usage quota.
  - `data` UsageQuotaResponseData, required: A usage quota resource.
    - `attributes` UsageQuotaResponseAttributes, required: Attributes of a usage quota.
      - `enforced` boolean, required: Whether usage above the limit is actively blocked instead of only tracked or alerted on.
      - `org_public_id` string, required: The public ID of the organization that owns the quota.
      - `pending_effective_from` string: The future UTC month when the scheduled limit takes effect, formatted as `YYYY-MM`, starting at 00:00 UTC on its first day. Present only together with `pending_usage_limit` and omitted when no change is scheduled.
      - `pending_usage_limit` number, double: The usage limit scheduled for the organization-wide quota in the usage units defined by the quota namespace. A value of `0` is valid. At the start of the effective month, this value becomes `usage_limit` and both pending fields are omitted. Omitted when no change is scheduled.
      - `scope` UsageQuotaResponseScope: A namespace-specific key and value identifying what the quota applies to within an organization. The object contains exactly one entry. A `user_handle` value of `"*"` identifies the default quota applied to users without a specific quota. This field is omitted for an organization-wide quota.
      - `usage_limit` number, double, required: The quota limit in the usage units defined by the quota namespace. May be fractional for quotas configured before public writes required whole units.
    - `id` string, required: An opaque usage quota identifier. Clients must pass this value back verbatim in update and delete requests and must not infer any structure from it.
    - `type` 'quotas', required: The JSON:API resource type for a usage quota.

## Other responses

- `400`: Bad Request. Returned if the request is malformed, if the `id` in the request body does not match the `id` in the request path, if none of `usage_limit`, `enforced`, or `pending_usage_limit` is provided, or if `pending_usage_limit` is set on a scoped quota.
- `403`: Forbidden
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
