badge_achievements

Create a badge achievement

Changed on

Award a badge to a user. Requires administrator privileges. Successful writes log api_badge_achievement_create with the actor and target ids in the admin API audit log.

Integration Tips:

  • user_id: The numeric ID of the user receiving the badge.
  • badge_id: The numeric ID of the badge being awarded.
  • rewarding_context_message_markdown: Optional personalized message shown in the notification or profile feed to explain why the user was awarded the badge.
  • metadata: Optional key/value data stored with the achievement for context.
  • If the badge cannot be awarded more than once and the user already holds it, the request is rejected with 409 Conflict, and the conflicting achievement_id is included in the response. A 422 is returned for other request errors.
post/api/badge_achievements

Request

  • Base URL
    https://dev.to
  • Auth
    • API key in header api-key
    • or HTTP bearer

Request body

Response

created

idinteger required
user_idinteger required
badge_idinteger required
rewarding_context_message_markdownstring nullable
include_default_descriptionboolean
metadataobject

Key/value data supplied for context

created_atstring date-time required
updated_atstring date-time required

Changes

    • info

      added the new optional request property /

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      endpoint added