Overview
POST
/gamification/realms/{ecosystemId}/eventsgamificationIngest a realm custom event (owner or admin) — bumps the type’s stat and awards any newly-earned badges
Create a record in events.
Auth: bearerAuth — calls run as the authenticated user.
Parameters
- ecosystemIdpathstring
Request body
application/json · optional
- namestring
A custom event type defined for this realm
- subjectTypestring
- subjectIdstring
- dedupeKeystring
Required idempotency key the caller owns (e.g. the source event id); the same key never double-counts
Example
{
"name": "string",
"subjectType": "string",
"subjectId": "string",
"dedupeKey": "string"
}Responses
200
Deduped no-op (dedupeKey already seen)
- ingestedboolean
false ⇒ the dedupeKey was already seen (no-op)
- statKeystring
- newBadgesGamificationBadge[]
- xpGainedinteger
Example
{
"ingested": true,
"statKey": "string",
"newBadges": [
{
"id": "string",
"name": "string",
"description": "string",
"icon": "string",
"criteriaType": "string",
"criteriaThreshold": 0,
"pointValue": 0,
"subjectType": "string"
}
],
"xpGained": 0
}201
Ingested — stat bumped, badges evaluated
- ingestedboolean
false ⇒ the dedupeKey was already seen (no-op)
- statKeystring
- newBadgesGamificationBadge[]
- xpGainedinteger
Example
{
"ingested": true,
"statKey": "string",
"newBadges": [
{
"id": "string",
"name": "string",
"description": "string",
"icon": "string",
"criteriaType": "string",
"criteriaThreshold": 0,
"pointValue": 0,
"subjectType": "string"
}
],
"xpGained": 0
}400
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}401
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}403
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}404
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/gamification/realms/{ecosystemId}/events" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"subjectType": "string",
"subjectId": "string",
"dedupeKey": "string"
}'JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/gamification/realms/{ecosystemId}/events", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: "{\n \"name\": \"string\",\n \"subjectType\": \"string\",\n \"subjectId\": \"string\",\n \"dedupeKey\": \"string\"\n}",
});
const data = await res.json();