Achievements
Create Achievement
Define a new achievement for your app. The slug must be unique within your app and cannot be reused after deletion.
POST
/api/achievements/create.php
Requires
Authorization: AppID:AppKey headerRequest body
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | required | Unique identifier [a-z0-9_-]. E.g. first_kill |
| name | string | required | Display name shown to users |
| description | string | optional | What the user must do to unlock |
| icon | string | optional | URL of the achievement icon |
| rarity | string | optional | common (default), uncommon, rare, epic, legendary |
| xp | int | optional | XP granted on unlock. Default: 0 |
| secret | bool | optional | Hidden until unlocked. Default: false |
Test this endpoint
Headers
Body
Success response 200
{
"success": true,
"achievement": {
"id": 1,
"app_id": "com.myapp.game",
"slug": "first_kill",
"name": "First Kill",
"description": "Get your first kill",
"icon": null,
"rarity": "common",
"xp": 100,
"secret": false,
"created_at": "2026-05-29 14:00:00"
}
}
Errors
| Code | Message | Cause |
|---|---|---|
| 401 | Authorization header with appid:appkey is required. | Missing or malformed header |
| 401 | Invalid app credentials. | AppID or AppKey not recognized |
| 400 | slug and name are required. | Missing required fields |
| 400 | Invalid slug format. | Slug contains characters outside [a-z0-9_-] |
| 400 | Invalid rarity value. | Rarity must be one of the five defined values |
| 409 | A achievement with this slug already exists for this app. | Duplicate slug |