---
title: "Create a player rating"
method: POST
path: "/v1/users/{user_id}/ratings"
tags: ["Player Ratings"]
---

# Create a player rating

`POST /v1/users/{user_id}/ratings`

## Request

- Base URL: `https://api.hify.club`
- URL: `https://api.hify.club/v1/users/{user_id}/ratings`
- Auth: API key in header `X-User-Token`

## Request body

- object
  - `rating` object, required
    - `sport_id` integer, required
    - `rating` number, required
    - `source` 'self_rated' | 'facility' | 'dupr' | 'itr' | 'hify', required
    - `facility_id` integer, nullable: Required when source is "facility"

## Response `201`

Rating created

- PlayerRating
  - `id` integer
  - `rating` number
  - `source` 'self_rated' | 'facility' | 'dupr' | 'itr' | 'hify'
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `sport` object: Serialized sport object
  - `facility` object, nullable: Serialized facility object (null when source is not facility)

## Other responses

- `401`: Unauthorized
- `404`: User not found
- `422`: Unprocessable entity

---

[API](https://skmtc.dev/hify/apis/hify-apis.md) - [All operations](https://skmtc.dev/hify/apis/hify-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/hify/apis/hify-apis/revisions/b5920403538d?raw)
