---
title: "Sets the monthly quota on every non-revoked verified key of an identity (subscription plans). Idempotent by `reason`."
method: POST
path: "/admin/identities/{email}/quota"
tags: ["admin"]
---

# Sets the monthly quota on every non-revoked verified key of an identity (subscription plans). Idempotent by \`reason\`.

`POST /admin/identities/{email}/quota`

## Request

- Base URL: `https://api.mapmap.ai`
- URL: `https://api.mapmap.ai/admin/identities/{email}/quota`
- Auth: HTTP bearer

## Path parameters

- `email` string, required

## Request body

- SetQuotaRequest: Body for `POST /admin/identities/{email}/quota`.
  - `monthly_quota` integer, required: New monthly quota for every non-revoked verified key of the identity (>= 0). Provisional keys keep their allowance.
  - `reason` string, required: Idempotency reason, e.g. `stripe-sub:sub_…:1750000000`. Repeating a reason is a no-op returning the recorded state.

## Response `200`

Quota applied (or unchanged, when the reason was replayed)

- QuotaResponse: Response for `POST /admin/identities/{email}/quota`.
  - `duplicate` boolean, required: `true` when the reason had already been applied (idempotent replay; nothing changed).
  - `email` string, required: Canonical (lowercased) identity email.
  - `keys_updated` integer, required: Number of keys updated (0 on an idempotent replay).
  - `monthly_quota` integer, required: The quota recorded for this reason.

## Other responses

- `400`: Invalid quota or reason
- `401`: Missing or wrong admin token
- `404`: Unknown identity email

---

[API](https://skmtc.dev/mapmap/apis/sn-gateway.md) · [All operations](https://skmtc.dev/mapmap/apis/sn-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/mapmap/apis/sn-gateway/revisions/2293be8b4c38?raw)
