Skip to main content
POST
/
achievements
/
{id}
Update an achievement by id
curl --request POST \
  --url https://{subdomain}.nudj.cx/api/v2/admin/achievements/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '{
  "progressPeriod": "daily",
  "criteria": {
    "type": "<string>",
    "parameters": {
      "query": "<string>",
      "operator": "==",
      "attribute": "<string>",
      "value": 123
    }
  },
  "displayMode": "default",
  "queries": [
    {
      "type": "<string>",
      "alias": "<string>",
      "parameters": {
        "eventName": "<string>",
        "eventCategory": "achievement",
        "eventSubCategory": "achievement-completion",
        "eventSourceId": "<string>",
        "tags": [
          "<string>"
        ]
      },
      "isCommunityScoped": true
    }
  ],
  "queryDescriptions": {},
  "tags": [
    "<string>"
  ],
  "campaigns": [
    "<string>"
  ],
  "status": "archived",
  "startsAt": "<string>",
  "expiresAt": "<string>",
  "featured": true,
  "isGlobalTemplate": true,
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "details": {
    "title": "<string>",
    "description": "<string>",
    "light": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    },
    "dark": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    }
  }
}'
{
  "id": "<string>",
  "organisationId": "<string>",
  "communityId": "<string>",
  "details": {
    "title": "<string>",
    "description": "<string>",
    "light": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    },
    "dark": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    }
  },
  "progressPeriod": "daily",
  "displayMode": "default",
  "tags": [
    "<string>"
  ],
  "campaigns": [
    "<string>"
  ],
  "criteria": {
    "type": "<string>",
    "parameters": {
      "query": "<string>",
      "operator": "==",
      "attribute": "<string>",
      "value": 123
    }
  },
  "queries": [
    {
      "type": "<string>",
      "alias": "<string>",
      "parameters": {
        "eventName": "<string>",
        "eventCategory": "achievement",
        "eventSubCategory": "achievement-completion",
        "eventSourceId": "<string>",
        "tags": [
          "<string>"
        ]
      },
      "isCommunityScoped": true
    }
  ],
  "queryDescriptions": {},
  "status": "archived",
  "featured": true,
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "isGlobalTemplate": true,
  "startsAt": "<string>",
  "expiresAt": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "createdBy": "<string>",
  "updatedBy": "<string>"
}

Authorizations

x-api-token
string
header
required

Headers

x-language
string

The language to update the achievement in. This will update the achievement's content for the specified language.

Path Parameters

id
string
required

The id of the achievement to update

Body

application/json

The input required to update an achievement

progressPeriod
enum<string>

The period over which progress is tracked/reset

Available options:
daily,
weekly,
monthly,
yearly,
open
criteria
object

This represents a condition that must be met by a user for the achievement to be completed Node that sums values from a specific event attribute and compares against a threshold

  • Sum Condition Node
  • Count Condition Node
  • Logical Condition Node
displayMode
enum<string>

The display mode for the achievement. Useful to make the distinction between normal user achievments and achievments designed for implementing custom app functionality.

Available options:
default,
custom
queries
Event Query Node · object[]

The event queries used to measure progress against this achievement's criteria

queryDescriptions
object

A map of query alias to user-readable descriptions, useful for displaying in the UI. Can be localised across additional languages.

tags
string[]

The ids of the tags on the achievement

campaigns
string[]

The ids of the campaigns on the achievement

status
enum<string>

The status of the achievement

Available options:
archived,
draft,
expired,
live,
scheduled
startsAt
string | null

When this achievement becomes available to the user

expiresAt
string | null

When this achievement expires

Whether the achievement is featured

isGlobalTemplate
boolean

Whether the achievement is a global template

availableAsTemplateForOrganisations
string[]

The organisations that the achievement is available as a template for

details
object

Input for updating entity details with all fields optional

Response

Successful response

An achievement

id
string
required

The id of the achievement

organisationId
string
required

The id of the organisation this achievement belongs to

details
object
required

Used to describe an entity

progressPeriod
enum<string>
required

The period over which progress is tracked/reset

Available options:
daily,
weekly,
monthly,
yearly,
open
displayMode
enum<string>
required

The display mode for the achievement. Useful to make the distinction between normal user achievments and achievments designed for implementing custom app functionality.

Available options:
default,
custom
tags
string[]
required

The ids of the tags on the achievement

campaigns
string[]
required

The ids of the campaigns on the achievement

criteria
object
required

This represents a condition that must be met by a user for the achievement to be completed Node that sums values from a specific event attribute and compares against a threshold

  • Sum Condition Node
  • Count Condition Node
  • Logical Condition Node
queries
Event Query Node · object[]
required

The event queries used to measure progress against this achievement's criteria

queryDescriptions
object
required

A map of query alias to user-readable descriptions, useful for displaying in the UI. Can be localised across additional languages.

status
enum<string>
required

The status of the achievement

Available options:
archived,
draft,
expired,
live,
scheduled
availableAsTemplateForOrganisations
string[]
required

The organisations that the achievement is available as a template for

isGlobalTemplate
boolean
required

Whether the achievement is a global template

createdAt
string
required

When this achievement was created

updatedAt
string
required

When this achievement was last updated

createdBy
string
required

The admin user who created this achievement

updatedBy
string
required

The admin user who last updated this achievement

communityId
string | null

The id of the community this achievement belongs to

Whether the achievement is featured

startsAt
string | null

When this achievement becomes available to the user

expiresAt
string | null

When this achievement expires

I