Badges

Grant a badge to a user

POST
https://discourse.example.com/user_badges.json

Body

application/json
Any of
usernamestringrequired

The username of the user to grant the badge to.

badge_idinteger

The ID of the badge to grant. Either badge_id or badge_name is required.

badge_namestring

The name of the badge to grant. Either badge_id or badge_name is required.

reasonstring

Optional URL of a post or topic associated with the grant. Cannot be used together with post_id.

post_idinteger>= 1

Optional ID of a visible, non-deleted post associated with the grant. Cannot be used together with reason.

suppress_notificationbooleanfalse

Suppress the notification for this grant only. Omit or set to false to preserve normal notification behavior, including existing suppression rules. The badge is still granted and grant events still occur.

any
any

Response

200OK

badge granted