Skip to main content
GET
/
v1
/
admin
/
punishments
/
search
# All bans
curl "https://hapi.7331.org/v1/admin/punishments/search?punishment_type=3&limit=10" \
  -b cookies.txt

# Active punishments for a user
curl "https://hapi.7331.org/v1/admin/punishments/search?user_id=123456789012345678&active_only=true" \
  -b cookies.txt
{
  "punishments": [
    {
      "id": 42,
      "discord_user_id": "123456789012345678",
      "discord_guild_id": null,
      "punishment_type": "BAN",
      "discord_issued_by_id": "999888777666555444",
      "reason": "Terms of service violation",
      "expires_at": null,
      "is_lifted": false,
      "lifted_at": null,
      "discord_lifted_by_id": null,
      "created_at": "2026-01-15T12:00:00Z",
      "updated_at": "2026-01-15T12:00:00Z"
    }
  ],
  "total": 1,
  "limit": 25,
  "offset": 0
}
Requires an active admin session cookie.
user_id
integer
Filter by punished user’s Discord ID.
guild_id
integer
Filter by punished guild’s Discord ID.
issued_by
integer
Filter by issuer’s Discord ID.
punishment_type
integer
Filter by type. 1 = Warning, 2 = Timeout, 3 = Ban, 4 = Guild Blacklist.
active_only
boolean
default:"false"
Only show active punishments (not lifted or expired).
offset
integer
default:"0"
Pagination offset.
limit
integer
default:"25"
Page size. Range: 1-100.

Response

punishments
object[]
required
Page of punishment records.
total
integer
required
Total matching punishments.
limit
integer
required
Page size used.
offset
integer
required
Offset used.
# All bans
curl "https://hapi.7331.org/v1/admin/punishments/search?punishment_type=3&limit=10" \
  -b cookies.txt

# Active punishments for a user
curl "https://hapi.7331.org/v1/admin/punishments/search?user_id=123456789012345678&active_only=true" \
  -b cookies.txt
{
  "punishments": [
    {
      "id": 42,
      "discord_user_id": "123456789012345678",
      "discord_guild_id": null,
      "punishment_type": "BAN",
      "discord_issued_by_id": "999888777666555444",
      "reason": "Terms of service violation",
      "expires_at": null,
      "is_lifted": false,
      "lifted_at": null,
      "discord_lifted_by_id": null,
      "created_at": "2026-01-15T12:00:00Z",
      "updated_at": "2026-01-15T12:00:00Z"
    }
  ],
  "total": 1,
  "limit": 25,
  "offset": 0
}