---
title: "Assigns a badge to a user"
method: PUT
path: "/users/profile/badge"
tags: ["UserProfile"]
---

# Assigns a badge to a user

`PUT /users/profile/badge`

## Request

- Base URL: `https://auth.viafoura.co`
- URL: `https://auth.viafoura.co/users/profile/badge`
- Auth: one of:
  - HTTP basic
  - OAuth 2
    - Client credentials
    - Token URL: `https://auth.viafoura.io/authorize_client`

Calling this operation will assign a badge to a user on the site (scope) present in the authentication token.
The payload in this request requires the unique id of the user from a third party authentication provider, in combination with the type code of the provider. See below for more details
Badges must exist before being assigned to users.

## Request body

- BadgeAssignEntity
  - `third_party_user_id` string: The third party authentication provider id for the user.
  - `third_party_type` string: The type of the third party authentication provider. Please contact Viafoura support for a list of supported providers.
  - `label` string, required: The unique identifier of an existing badge

## Response `200`

The badge has been assigned to the user.

## Other responses

- `400`: The badge label or user cannot be found. Make sure the user exists in the targeted site and the badge has been previously created.
- `401`: The authentication token is missing or has expired

---

[API](https://skmtc.dev/viafoura/apis/authentication-user-management-api.md) - [All operations](https://skmtc.dev/viafoura/apis/authentication-user-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/viafoura/apis/authentication-user-management-api/revisions/cefb7f5f5ef3?raw)
