Skip to content

Replaces the whole badge catalogue with the submitted list, keying each badge by its slug and marking any uploaded logo as permanent media.

Every badge needs a title; a missing slug is derived from it. SVG shapes and emoji are sanitised, and a badge with neither falls back to an empty emoji. Because the set is stored whole, a badge left out of the payload is removed.

Endpoint

  • Method: POST

  • Path: /admin/user-badges

  • Edition: PRO

  • Controller: UserBadgeController@saveBadges

  • Route source: fluent-community-pro/app/Modules/UserBadge/UserBadgeModule.php:20

  • Requires the FluentCommunity community-admin permission (or a WordPress super admin).

  • Requires FluentCommunity Pro.

  • Removing a badge here does not clear the badge slug already stored on member profiles.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

POST Save User Badges

POST
/admin/user-badges

Replaces the whole badge catalogue with the submitted list, keying each badge by its slug and marking any uploaded logo as permanent media.

Controller: UserBadgeController@saveBadges
Route source: fluent-community-pro/app/Modules/UserBadge/UserBadgeModule.php:20

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Request Body

application/json
JSON
{
  
"badges": [
  
  
{
  
  
  
"config": {
  
  
  
  
"shape_svg": "string"
  
  
  
},
  
  
  
"show_label": "string",
  
  
  
"slug": "string",
  
  
  
"title": "string"
  
  
}
  
]
}

Responses

Successful response

application/json
JSON
{
  
"badges": {
  
  
"admin": {
  
  
  
"config": {
  
  
  
  
"shape_svg": "string"
  
  
  
},
  
  
  
"show_label": "string",
  
  
  
"slug": "string",
  
  
  
"title": "string"
  
  
}
  
},
  
"message": "string"
}

Playground

Authorization
Body

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation