Create a challenge (manager)

POST /manager/challenges
application/json

Body Required

  • id integer
  • start_date string(date-time)
  • end_date string(date-time)
  • active boolean
  • challengeable_type string
  • challengeable object

    One of:
  • points integer
  • proportional_points boolean
  • titles array[object]
    Hide titles attributes Show titles attributes object
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string
  • images array[object]
    Hide images attributes Show images attributes object
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string
  • descriptions array[object]
    Hide descriptions attributes Show descriptions attributes object
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string

Responses

  • 201 application/json

    returns the created challenge

    Hide response attributes Show response attributes object
    • id integer
    • start_date string(date-time)
    • end_date string(date-time)
    • active boolean
    • challengeable_type string
    • challengeable object

      One of:
    • points integer
    • proportional_points boolean
    • titles array[object]
      Hide titles attributes Show titles attributes object
      • id_i18n_content integer
      • lang string

        Values are en_GB, fr_FR, es_ES, or de_DE.

      • content string
    • images array[object]
      Hide images attributes Show images attributes object
      • id_i18n_content integer
      • lang string

        Values are en_GB, fr_FR, es_ES, or de_DE.

      • content string
    • descriptions array[object]
      Hide descriptions attributes Show descriptions attributes object
      • id_i18n_content integer
      • lang string

        Values are en_GB, fr_FR, es_ES, or de_DE.

      • content string
  • 401 application/json

    Unauthorized.

    Hide response attribute Show response attribute object
    • message string
  • 403

    Forbidden - You don't have permission to access this route

  • 422 application/json

    Unprocessable Content

    Hide response attributes Show response attributes object
    • message string

      Error message.

    • errors object
      Hide errors attributes Show errors attributes object
      • field array[string]

        Error message details.

      • * array[string] Additional properties

        Error message details.

POST /manager/challenges
curl \
 --request POST 'https://domain.tld/api/v2/manager/challenges' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"id":42,"start_date":"2025-05-04T09:42:00Z","end_date":"2025-05-04T09:42:00Z","active":true,"challengeable_type":"string","challengeable":{"order_attribution":"string","product_sku":"string"},"points":42,"proportional_points":true,"titles":[{"lang":"en_GB","content":"Hello"}],"images":[{"lang":"en_GB","content":"Hello"}],"descriptions":[{"lang":"en_GB","content":"Hello"}]}'
Request examples
{
  "id": 42,
  "start_date": "2025-05-04T09:42:00Z",
  "end_date": "2025-05-04T09:42:00Z",
  "active": true,
  "challengeable_type": "string",
  "challengeable": {
    "order_attribution": "string",
    "product_sku": "string"
  },
  "points": 42,
  "proportional_points": true,
  "titles": [
    {
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "images": [
    {
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "descriptions": [
    {
      "lang": "en_GB",
      "content": "Hello"
    }
  ]
}
Response examples (201)
{
  "id": 42,
  "start_date": "2025-05-04T09:42:00Z",
  "end_date": "2025-05-04T09:42:00Z",
  "active": true,
  "challengeable_type": "string",
  "challengeable": {
    "order_attribution": "string",
    "product_sku": "string"
  },
  "points": 42,
  "proportional_points": true,
  "titles": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "images": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "descriptions": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ]
}
Response examples (401)
{
  "message": "Unauthorized."
}
Response examples (422)
{
  "message": "field is required! (and 3 more error)",
  "errors": {
    "field": [
      "Error message details here"
    ],
    "additionalProperty1": [
      "Error message details here"
    ],
    "additionalProperty2": [
      "Error message details here"
    ]
  }
}