Skip to main content
POST
/
v1
/
admin
/
punishments
/
{entity_type}
/
{entity_id}
/
ban
# Permanent user ban
curl -X POST https://hapi.7331.org/v1/admin/punishments/user/123456789012345678/ban \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{"reason": "Terms of service violation"}'

# Temporary guild ban
curl -X POST https://hapi.7331.org/v1/admin/punishments/guild/987654321098765432/ban \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{"reason": "Spam abuse", "expires_at": "2026-06-01T00:00:00Z"}'
{
  "user_discord_id": "123456789012345678",
  "punishment_type": "BAN",
  "reason": "Terms of service violation",
  "issued_by_discord_id": "999888777666555444",
  "expires_at": null,
  "created_at": "2026-03-05T12:00:00Z",
  "updated_at": "2026-03-05T12:00:00Z"
}
Requires an active admin session cookie. Hierarchy enforced against the target.
entity_type
string
required
Entity type. One of: user, guild.
entity_id
integer
required
Discord snowflake ID of the entity.
reason
string
required
Reason for the ban.
expires_at
string
When the ban expires (UTC, ISO 8601). null for permanent ban.

Response

Returns the created punishment record.
user_discord_id
string
Discord ID of the punished user (null if guild ban).
guild_discord_id
string
Discord ID of the punished guild (null if user ban).
punishment_type
string
required
Always BAN or GUILD_BLACKLIST.
reason
string
required
Reason for the ban.
expires_at
string
Expiration timestamp. null for permanent.
# Permanent user ban
curl -X POST https://hapi.7331.org/v1/admin/punishments/user/123456789012345678/ban \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{"reason": "Terms of service violation"}'

# Temporary guild ban
curl -X POST https://hapi.7331.org/v1/admin/punishments/guild/987654321098765432/ban \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{"reason": "Spam abuse", "expires_at": "2026-06-01T00:00:00Z"}'
{
  "user_discord_id": "123456789012345678",
  "punishment_type": "BAN",
  "reason": "Terms of service violation",
  "issued_by_discord_id": "999888777666555444",
  "expires_at": null,
  "created_at": "2026-03-05T12:00:00Z",
  "updated_at": "2026-03-05T12:00:00Z"
}