---
title: "Create Spend Limit"
method: POST
path: "/v2/limits"
tags: ["limits"]
---

# Create Spend Limit

`POST /v2/limits`

Create a team, member, or API-key limit, or a team percentage alert.

## Request body

- SpendLimitCreateRequest — Create an absolute limit or a percentage alert. Set one scope ID for an API-key or membership limit, or neither for a team limit. Percentage alerts set ``parent_limit_id`` and ``threshold_percent``; their interval must match the parent and their amount is inherited.
  - `api_key_id` string, uuid, nullable
  - `membership_id` integer, nullable
  - `parent_limit_id` string, uuid, nullable
  - `threshold_percent` union
    - number
    - string
  - `interval` 'week' | 'month', required
  - `amount_usd` union
    - number
    - string
  - `action` 'alert' | 'block', required
  - `enabled` boolean

## Response `201`

Successful Response

- SpendLimitItem — One limit with its current-period spend. API-key and membership limits use their corresponding ID. Team limits have neither; percentage alerts additionally identify their parent team limit.
  - `id` string, uuid, required
  - `api_key_id` string, uuid, nullable, required
  - `api_key_name` string, nullable, required
  - `membership_id` integer, nullable, required
  - `member_name` string, nullable, required
  - `parent_limit_id` string, uuid, nullable, required
  - `threshold_percent` string, nullable, required
  - `interval` 'week' | 'month', required
  - `amount_usd` string, required
  - `action` 'alert' | 'block', required
  - `enabled` boolean, required
  - `spend_usd` string, required
  - `period_start` string, required
  - `period_end` string, required
  - `editable` boolean, required

## Other responses

- `400` — Invalid or malformed request
- `401` — Missing or invalid credentials
- `403` — Caller may not access this resource
- `404` — Referenced entity does not exist
- `409` — Resource already exists
- `422` — Validation Error

---

[API](https://skmtc.dev/hud/apis/hud-platform.md) · [All operations](https://skmtc.dev/hud/apis/hud-platform/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hud/hud-platform/revisions/58558fc733d9/schema)
