---
title: "Modify XP"
method: POST
path: "/v1/communities/{communityId}/members/{memberId}/xp"
tags: ["Members"]
---

# Modify XP

`POST /v1/communities/{communityId}/members/{memberId}/xp`

## Request

- Base URL: `https://api.subo.ai`
- URL: `https://api.subo.ai/v1/communities/{communityId}/members/{memberId}/xp`
- Auth: API key in header `X-API-Key`

Add, subtract, or set a member's XP balance. Admin role required.

## Path parameters

- `communityId` string, required
- `memberId` string, required

## Request body

- object
  - `operation` 'add' | 'subtract' | 'set', required: add — increment; subtract — decrement (floor 0); set — absolute value
  - `amount` integer, required

## Response `200`

Updated member

- object
  - `data` Member
    - `id` string
    - `platform_id` string, nullable
    - `name` string, nullable
    - `nick` string, nullable: Server-specific display name (Discord nickname)
    - `avatar_url` string, nullable
    - `access` 'admin' | 'creator' | 'member': Effective access level: the higher of derived_access and granted_access
    - `derived_access` 'admin' | 'creator', nullable: Access that comes from the member's Discord permissions (server owner, Manage Server, or a configured mod role). Recomputed by Subo; cannot be changed through the API
    - `granted_access` 'admin' | 'creator', nullable: Access granted through the web app or PUT .../access. Adds to derived_access, never lowers it
    - `rank` integer, nullable: XP leaderboard rank within the community
    - `xp_total` integer
    - `xp_monthly` integer
    - `participation` integer: Number of surveys completed by this member
    - `achievements` object[]: Achievement records earned by this member
    - `joined_at` string, date-time, nullable
    - `left_at` string, date-time, nullable

## Other responses

- `400`: Invalid request body
- `401`: Invalid or missing API key
- `403`: Forbidden — the key or user lacks permission for this resource or operation
- `404`: Resource not found
- `429`: Rate limit exceeded — wait `retry_after` seconds before retrying. The same value appears in the `Retry-After` header.

---

[API](https://skmtc.dev/subo/apis/subo-api.md) · [All operations](https://skmtc.dev/subo/apis/subo-api/llms.txt) · [OpenAPI document](https://skmtc.dev/subo/apis/subo-api/revisions/12eab2ae4505?raw)
