---
title: "Add or remove an account's credits, with a note. Owner only."
method: POST
path: "/v1/admin/accounts/{account_id}/credits"
tags: ["admin"]
---

# Add or remove an account's credits, with a note. Owner only.

`POST /v1/admin/accounts/{account_id}/credits`

## Request

- Base URL: `https://api.hookdetector.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.hookdetector.com/v1/admin/accounts/{account_id}/credits`
- Auth: none declared

Change an account's balance by delta (a whole number from -1,000,000 to 1,000,000,
not zero) with a required note (1 to 200 characters). A change that would take the
balance below zero is 422 credits_below_zero and nothing changes; an unknown account
is 404 account_not_found. Every change is audited in the same transaction (GET
/v1/admin/actions). Needs the admin scope and an admin account. MCP:
admin_adjust_credits.

## Path parameters

- `account_id` string, required

## Headers

- `authorization` string, nullable: Bearer hd_... from POST /v1/accounts or POST /v1/keys

## Request body

- AdminCreditsIn
  - `delta` integer: credits to add (positive) or remove (negative), not zero
  - `note` string: why, for the audit (required)

## Response `200`

Successful Response

- AdminCreditsOut
  - `account_id` string, required
  - `credits` integer, required: the balance after the change
  - `delta` integer, required

## Other responses

- `401`: missing, invalid, revoked or expired API key (code key_expired)
- `403`: the key lacks the admin scope (insufficient_scope), or its account is not the owner's (admin_required)
- `404`: not found on this account
- `413`: request body over the size cap
- `422`: invalid input
- `500`: our fault; names the request id

---

[API](https://skmtc.dev/hookdetector/apis/hook-detector.md) · [All operations](https://skmtc.dev/hookdetector/apis/hook-detector/llms.txt) · [OpenAPI document](https://skmtc.dev/hookdetector/apis/hook-detector/revisions/b136a2804d2b?raw)
