On this page

الأوسمة — badges a community grants its members.

Plan: every route needs the awards feature (403 FEATURE_NOT_AVAILABLE).

Who reads what:

  • GET /awards accepts an optional token. An approved, un-banned member gets every non-hidden award (moderators also see hidden ones). A guest of a PUBLIC community whose admin opened awards to guests gets only isGuestVisible awards, without recipients. Anyone else — a signed-in non-member, and every non-member of a PRIVATE community — gets an empty page. A PRIVATE community's guest preview uses the public endpoint, which returns opaque teasers (/api/communities/public/{slug}/awards).
  • Every other read requires membership.

Who writes: awards:manage (hide/unhide also awards:moderate). Uploading an icon is refused while the manager is restricted from media or suspended (403 RESTRICTION_BLOCKED) and counts against the storage quota.

11 endpoints.

MethodPathSummary
GET/api/communities/{communityId}/awardsList awards
POST/api/communities/{communityId}/awardsCreate an award (awards:manage)
DELETE/api/communities/{communityId}/awards/{awardId}Delete an award (awards:manage)
GET/api/communities/{communityId}/awards/{awardId}One award (members)
PUT/api/communities/{communityId}/awards/{awardId}Edit an award (awards:manage)
POST/api/communities/{communityId}/awards/{awardId}/grantGrant an award (awards:manage)
POST/api/communities/{communityId}/awards/{awardId}/hideHide an award (awards:manage or awards:moderate)
GET/api/communities/{communityId}/awards/{awardId}/recipientsWho holds an award (members)
DELETE/api/communities/{communityId}/awards/{awardId}/recipients/{userId}Revoke a member's award (awards:manage)
POST/api/communities/{communityId}/awards/{awardId}/unhideUnhide an award (awards:manage or awards:moderate)
GET/api/communities/{communityId}/awards/users/{userId}A member's earned awards (members)

Auth: optional — a token changes what you can see (see "Who may read what").

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
qquerynostring—
categoryIdquerynostring—
rarityIdquerynostring—
pagequerynointeger—
pageSizequerynointeger—

Responses

StatusDescriptionBody
200{ success, data: Award[], page, pageSize, total, hasNext } — empty for a caller who may not see awards—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—

Request body (required) — multipart/form-data

Type: AwardWriteForm

Responses

StatusDescriptionBody
201data is the Award—
400Validation error—
403Missing awards:manage, RESTRICTION_BLOCKED, or FEATURE_NOT_AVAILABLE—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
awardIdpathyesstring—

Responses

StatusDescriptionBody
200Deleted—
404Not found—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
awardIdpathyesstring—

Responses

StatusDescriptionBody
200data is the Award—
404Not found—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
awardIdpathyesstring—

Request body — multipart/form-data

Type: AwardWriteForm

Responses

StatusDescriptionBody
200data is the Award—
403Missing awards:manage, RESTRICTION_BLOCKED, or FEATURE_NOT_AVAILABLE—
404Not found—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
awardIdpathyesstring—

Request body (required) — application/json

FieldTypeRequiredDescription
audienceenum: all, moderators, specificyes—
targetUserIdsstring[]noUser ids; required when audience is specific; must be members of this community
reasonstringno—

Responses

StatusDescriptionBody
201data reports who received it—
400Invalid audience or targets—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
awardIdpathyesstring—

Responses

StatusDescriptionBody
200data is the Award—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
awardIdpathyesstring—

Responses

StatusDescriptionBody
200data lists the recipients—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
awardIdpathyesstring—
userIdpathyesstring—

Responses

StatusDescriptionBody
200Revoked—
404Not found—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
awardIdpathyesstring—

Responses

StatusDescriptionBody
200data is the Award—

Auth: Bearer JWT required.

Parameters

NameInRequiredTypeDescription
communityIdpathyesstring (uuid)—
userIdpathyesstring—

Responses

StatusDescriptionBody
200data is Award[] (hidden awards excluded)—