---
title: "Grant a badge to a user"
method: POST
path: "/user_badges.json"
tags: ["Badges", "Users"]
---

# Grant a badge to a user

`POST /user_badges.json`

## Request

- Base URL: `https://discourse.example.com`
- URL: `https://discourse.example.com/user_badges.json`
- Auth: none declared

## Request body

- union
  - object
    - `username` string, required: The username of the user to grant the badge to.
    - `badge_id` integer, required: The ID of the badge to grant. Either badge_id or badge_name is required.
    - `badge_name` string: The name of the badge to grant. Either badge_id or badge_name is required.
    - `reason` string: Optional URL of a post or topic associated with the grant. Cannot be used together with post_id.
    - `post_id` integer: Optional ID of a visible, non-deleted post associated with the grant. Cannot be used together with reason.
    - `suppress_notification` boolean: 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.
  - object
    - `username` string, required: The username of the user to grant the badge to.
    - `badge_id` integer: The ID of the badge to grant. Either badge_id or badge_name is required.
    - `badge_name` string, required: The name of the badge to grant. Either badge_id or badge_name is required.
    - `reason` string: Optional URL of a post or topic associated with the grant. Cannot be used together with post_id.
    - `post_id` integer: Optional ID of a visible, non-deleted post associated with the grant. Cannot be used together with reason.
    - `suppress_notification` boolean: 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.

## Response `200`

badge granted

## Changes

- **2026-09-23** `aa525bcf6bef`: 1 info
  - endpoint added
- **2022-03-05** `e1108b0434c0`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/discourse/apis/discourse-api-documentation/changes/user_badges.json/post.md)

---

[API](https://skmtc.dev/discourse/apis/discourse-api-documentation.md) - [All operations](https://skmtc.dev/discourse/apis/discourse-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/discourse/apis/discourse-api-documentation/revisions/8de25dc67c85?raw)
