---
title: "Grant a user bonus credits"
method: POST
path: "/admin/billing/users/{id}/credits"
tags: ["Billing"]
---

# Grant a user bonus credits

`POST /admin/billing/users/{id}/credits`

## Request

- Base URL: `https://api.crawlora.net/api/v1`
- URL: `https://api.crawlora.net/api/v1/admin/billing/users/{id}/credits`
- Auth: API key in header `x-api-key`

Admin-only endpoint that grants a user bonus credits, for example to compensate an account blocked by a quota. The grant is idempotent on idempotency_key: repeating a request with the same key credits the user once. Granted credits are added to the user's spendable balance and tracked separately from referral rewards. Like all bonus credits they belong to the current billing period and do not carry into the next one.

## Path parameters

- `id` string, required

## Headers

- `x-api-key` string, required

## Request body

- BillingAdminCreditGrantRequestDoc
  - `credits` integer: credits is the number of credits to grant or revoke. Must be positive.
  - `idempotency_key` string: idempotency_key makes the operation replay-safe: repeating a request with the same key applies it once.
  - `reason` string: reason is the justification, recorded on the user's billing state.

## Response `200`

Updated credit snapshot

- BillingBillingStateResponseDoc
  - `code` integer
  - `data` BillingBillingStateDoc
    - `allow_overage` boolean
    - `created_at` string
    - `credits_remaining` integer
    - `credits_used` integer
    - `currency` string
    - `daily_credit_limit` integer
    - `daily_credits_remaining` integer
    - `daily_credits_used` integer
    - `daily_key` string
    - `expected_subscription_amount_cents` integer
    - `expected_total_amount_cents` integer
    - `hard_limit` boolean
    - `included_credits` integer
    - `overage_credits` integer
    - `pending_plan` string
    - `pending_plan_effective_at` string
    - `period_end` string
    - `period_key` string
    - `period_start` string
    - `plan` string
    - `pricing_source` string
    - `subscription_price_cents` integer
    - `updated_at` string
    - `user_id` string
  - `msg` string

## Other responses

- `400`: Invalid request body
- `401`: Authentication required
- `403`: Admin plan required
- `500`: Internal server error

---

[API](https://skmtc.dev/crawlora/apis/crawlora-api.md) · [All operations](https://skmtc.dev/crawlora/apis/crawlora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/crawlora/apis/crawlora-api/revisions/afac9b012a27?raw)
