---
title: "Grant D-Sports Direct Rep to a user"
method: POST
path: "/api/admin/users/{userId}/rep"
tags: ["Admin", "Rep"]
---

# Grant D-Sports Direct Rep to a user

`POST /api/admin/users/{userId}/rep`

## Request

- Base URL: `https://app.d-sports.org`
- URL: `https://app.d-sports.org/api/admin/users/{userId}/rep`
- Auth: HTTP bearer

isAdmin only. Body: { amount: integer 1–100000, reason?: string max 200, idempotencyKey?: string }. Retries: send an Idempotency-Key header (or body idempotencyKey; the header wins), 1–128 of letters, digits, '_', '-', ':' or '.'. The ledger keys the grant per admin, so a retry returns the original entry with alreadyRecorded: true and grants nothing new; reusing a key with a different amount is 409 IDEMPOTENCY_KEY_REUSED. Without a key each POST is a new grant.

## Path parameters

- `userId` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `amount` integer, required
  - `reason` string
  - `idempotencyKey` string: Same as the Idempotency-Key header; used only when the header is absent.

## Response `200`

{ userId, amount, reason, entryId, alreadyRecorded } — alreadyRecorded is true when an idempotency key replayed an earlier grant.

## Other responses

- `400`: Invalid amount, reason or idempotency key
- `401`: Authentication required
- `403`: Admin access required
- `404`: User not found
- `409`: IDEMPOTENCY_KEY_REUSED — the key was already used for a different amount
- `500`: Failed to record Direct Rep grant

## Changes

- **2026-11-18** `6de639c52609`: 3 info
  - added the new optional `header` request parameter `Idempotency-Key`
  - added the new optional request property `idempotencyKey`
  - added the non-success response with the status `409`
- **2026-08-16** `5e3ba30b2fc2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/changes/api/admin/users/:userId/rep/post.md)

---

[API](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api.md) - [All operations](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/llms.txt) - [OpenAPI document](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/revisions/63735cf90a04?raw)
