---
title: "400 Bad request"
description: "QuotaStack could not work with the request you sent. Nothing changed."
---

# 400 Bad request

`https://api.quotastack.io/errors/bad-request`

QuotaStack could not work with the request you sent. Nothing changed.

## Why it happened

- The body was not valid JSON, or a field held the wrong type.
- You sent both `customer_id` and `external_customer_id`, or you sent neither.
- A path or query value was missing, such as a [subscription](/docs/concepts/subscriptions) ID.
- You tried to change a metered [billable metric](/docs/concepts/metering), which this API cannot do.

## How to fix it

1. Read `detail` in the reply. The text names the problem in plain words.
2. Check the request against the field table for that call.
3. Send exactly one customer field when the call takes one.

### Example response 400

```json
{
  "type": "https://api.quotastack.io/errors/bad-request",
  "title": "Bad Request",
  "status": 400,
  "detail": "Provide exactly one of customer_id or external_customer_id."
}
```

## Which calls return this

- [`GET /v1/customers`](/docs/api/customers#listCustomers)
- [`POST /v1/customers`](/docs/api/customers#createCustomer)
- [`PATCH /v1/customers/{id}`](/docs/api/customers#updateCustomer)
- [`PATCH /v1/customer-by-external-id/{external_id}`](/docs/api/customers#updateCustomerByExternalId)
- [`POST /v1/customers/{customer_id}/credits/grant`](/docs/api/credits#grantCustomerCredits)
- [`POST /v1/customers/{customer_id}/credits/adjust`](/docs/api/credits#adjustCustomerCredits)
- [`GET /v1/entitlements/check`](/docs/api/entitlements#checkEntitlement)
- [`POST /v1/customers/{id}/entitlements/{billable_metric_key}/increment`](/docs/api/entitlements#incrementGauge)
- [`POST /v1/customers/{id}/entitlements/{billable_metric_key}/decrement`](/docs/api/entitlements#decrementGauge)
- [`POST /v1/entitlements/consume`](/docs/api/entitlements#consumeEntitlement)
- [`POST /v1/customer-by-external-id/{external_id}/entitlements/{billable_metric_key}/increment`](/docs/api/entitlements#incrementGaugeByExternalId)
- [`POST /v1/customer-by-external-id/{external_id}/entitlements/{billable_metric_key}/decrement`](/docs/api/entitlements#decrementGaugeByExternalId)
- [`POST /v1/usage`](/docs/api/usage#recordUsage)
- [`POST /v1/usage/batch`](/docs/api/usage#recordUsageBatch)
- [`POST /v1/imports/customers`](/docs/api/imports#importCustomer)
- [`POST /v1/subscriptions`](/docs/api/subscriptions#createSubscription)
- [`POST /v1/subscriptions/{id}/upgrade`](/docs/api/subscriptions#upgradeSubscription)
- [`POST /v1/subscriptions/{id}/overrides`](/docs/api/overrides#createOverride)
- [`PATCH /v1/subscriptions/{id}/overrides/{billable_metric_key}`](/docs/api/overrides#updateOverride)
- [`POST /v1/reservations`](/docs/api/reservations#reserveCredits)
