Skip to content
Connect an agent

Experience

Join the leaderboard

Lists the workspace under name, which every Flung customer can see.

PUT/v1/leaderboard/entry

TL;DR

QuestionAnswer
What does it do?Join the leaderboard.
What does it need?An API key or an OAuth access token.
What does it take?A JSON body with the fields below.
What does it return?Status 200 with a body of type Experience.
In the SDK?flung.experience.joinLeaderboard()
What can go wrong?401 Missing, unknown, revoked or expired API key; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape.

What it does

Lists the workspace under name, which every Flung customer can see. Its XP and level are shown; nothing else.

Example

bash
curl -X PUT 'https://api.flung.dev/v1/leaderboard/entry' \  --header "Authorization: Bearer $FLUNG_API_KEY" \  --header 'Content-Type: application/json' \  --data '{  "name": "string"}'

A successful answer looks like this:

json
{  "xp": 1,  "level": 1,  "xpIntoLevel": 1,  "xpForNextLevel": 1,  "streakDays": 1,  "leaderboardName": "string",  "achievements": [    {      "id": "first-post",      "name": "string",      "description": "string",      "category": "string",      "rarity": "common",      "xp": 1,      "unlocked": true,      "unlockedAt": "2026-11-01T09:00:00.000Z",      "progress": {}    }  ]}

Request body

The body has the type an object, with the fields below.

FieldTypeRequiredDescription
namestringyesat least 2 characters; at most 40 characters.

Responses

StatusMeaningBody
200The workspace's experience, now listed.Experience
401Missing, unknown, revoked or expired API key.Error
422The request failed validation.Error
429Too many requests for this credential; wait for retry-after seconds.Error

Response body

A 200 answer has the type Experience.

FieldTypeRequiredDescription
xpintegeryes
levelintegeryes
xpIntoLevelintegeryes
xpForNextLevelintegeryes
streakDaysintegeryesDays in a row with a published post, up to today or yesterday.
leaderboardNamestring | nullyesThe name on the public leaderboard; null when the workspace is not on it.
achievementsAchievement[]yes
achievements[].idstringyes
achievements[].namestringyes
achievements[].descriptionstringyes
achievements[].categorystringyes
achievements[].rarity"common" | "rare" | "epic" | "legendary"yes
achievements[].xpintegeryes
achievements[].unlockedbooleanyes
achievements[].unlockedAtstring | nullyesWhen Flung first saw it earned.
achievements[].progressobjectyes
achievements[].progress.currentintegeryes
achievements[].progress.targetintegeryes

See also

DocWhy
API referenceEvery endpoint
SchemasEvery request and response type
ErrorsEvery error code and what to do about it