Skip to main content
PATCH
/
challenge-groups
/
{id}
Update a challenge group by id
curl --request PATCH \
  --url https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '{
  "status": "archived",
  "type": "random",
  "period": "daily",
  "challengeIds": [
    "<string>"
  ],
  "activeAmount": 2,
  "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>"
    }
  },
  "type": "random",
  "period": "daily",
  "challengeIds": [
    "<string>"
  ],
  "activeAmount": 2,
  "status": "archived",
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Authorizations

x-api-token
string
header
required

Headers

x-language
string

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

Path Parameters

id
string
required

The id of the challenge group

Body

application/json

The input required to update a challenge group

status
enum<string>

The challenge group status

Available options:
archived,
draft,
expired,
live,
scheduled
type
enum<string>

The challenge selection type

Available options:
random,
sequential
period
enum<string>

The rotation period

Available options:
daily,
weekly,
monthly,
yearly,
open
challengeIds
string[]

The challenge IDs in this group

activeAmount
number

Number of active challenges to show

Required range: x >= 1
details
object

Input for updating entity details with all fields optional

Response

Successful response

A challenge group

id
string
required

The id of the challenge group

organisationId
string
required

The id of the organisation the challenge group belongs to

communityId
string
required

The id of the community the challenge group belongs to

details
object
required

Used to describe an entity

type
enum<string>
required

The challenge selection type

Available options:
random,
sequential
period
enum<string>
required

The rotation period

Available options:
daily,
weekly,
monthly,
yearly,
open
challengeIds
string[]
required

The challenge IDs in this group

activeAmount
number
required

Number of active challenges to show

Required range: x >= 1
status
enum<string>
required

The challenge group status

Available options:
archived,
draft,
expired,
live,
scheduled
createdAt
string
required

The creation date of the challenge group

updatedAt
string | null

The update date of the challenge group

I