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

# Ban a user

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

## Request

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

Admin-only endpoint that bans a user account: it deactivates the account, rotates the email activation token so a leaked/shared token cannot reactivate it, and sets is_banned. This is the only way a user gets banned — the previous automated excessive-usage monitor that banned accounts on its own has been removed; banning now happens exclusively through this endpoint.

## Path parameters

- `id` string, required

## Headers

- `x-api-key` string, required

## Request body

- BillingAdminBanUserRequestDoc
  - `reason` string: reason is an optional note recorded on the user's account explaining why they were banned.

## Response `200`

Updated account state

- BillingAdminUserAccountResponseDoc
  - `code` integer
  - `data` BillingAdminUserAccountDoc
    - `ban_reason` string
    - `banned_at` string: banned_at/banned_by/ban_reason are only present once a user has been banned at least once; they record the most recent ban action and are not cleared on unban.
    - `banned_by` string
    - `created_at` string
    - `email` string
    - `id` string
    - `is_activated` boolean
    - `is_banned` boolean
    - `last_login_at` string
    - `plan` string
    - `provider` string
    - `signup_accept_language` string
    - `signup_attribution` ModelsSignupAttribution
      - `auth_click` ModelsSignupAttributionClick
        - `clicked_at` string
        - `cta_id` string
        - `cta_location` string
        - `destination` string
        - `href` string
        - `link_id` string
        - `page_type` string
        - `path` string
        - `provider` string
        - `search` string
        - `section_id` string
      - `first_touch` ModelsSignupAttributionTouch
        - `campaign` string
        - `captured_at` string
        - `content` string
        - `creative_format` string
        - `landing_path` string
        - `marketing_tactic` string
        - `medium` string
        - `referrer_host` string
        - `referrer_path` string
        - `referrer_url` string
        - `source` string
        - `source_platform` string
        - `term` string
      - `last_touch` ModelsSignupAttributionTouch
        - `campaign` string
        - `captured_at` string
        - `content` string
        - `creative_format` string
        - `landing_path` string
        - `marketing_tactic` string
        - `medium` string
        - `referrer_host` string
        - `referrer_path` string
        - `referrer_url` string
        - `source` string
        - `source_platform` string
        - `term` string
      - `signup_click` ModelsSignupAttributionClick
        - `clicked_at` string
        - `cta_id` string
        - `cta_location` string
        - `destination` string
        - `href` string
        - `link_id` string
        - `page_type` string
        - `path` string
        - `provider` string
        - `search` string
        - `section_id` string
    - `signup_browser_id_hash` string: Hash of a random first-party browser marker; it is only intended to correlate accounts during admin review.
    - `signup_browser_language` string
    - `signup_country` string
    - `signup_ip` string: signup_* fields are captured once at signup and never updated -- they describe the browser/network that created the account, not its ongoing API traffic (see AdminUserRecentIPs for that).
    - `signup_last_referrer_host` string
    - `signup_locale` string
    - `signup_referrer_host` string
    - `signup_region` string
    - `username` string
  - `msg` string

## Other responses

- `400`: Invalid request body
- `401`: Authentication required
- `403`: Admin plan required
- `404`: User not found
- `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/028417aa35bb?raw)
