Create challenge

POST /1/challenges

Create challenge

application/json

Body

Responses

POST /1/challenges
curl \
 --request POST 'https://api.localsporthero.com/1/challenges' \
 --header "Content-Type: application/json" \
 --data '{"name":"string","type":"string","startDate":"string","endDate":"string","public":true,"totalRounds":42,"timeZoneId":"string","properties":[],"inviteUserIds":[],"nextParticipantWindowInSeconds":42}'
Request examples
{
  "name": "string",
  "type": "string",
  "startDate": "string",
  "endDate": "string",
  "public": true,
  "totalRounds": 42,
  "timeZoneId": "string",
  "properties": [],
  "inviteUserIds": [],
  "nextParticipantWindowInSeconds": 42
}
Response examples (200)
{
  "challenge": {
    "id": "df2cd71c-d006-4a46-8e2a-d09503273f07",
    "type": "tag, goal, battle",
    "name": "De Marathon",
    "startDate": "2022-05-02T11:00:00.000Z",
    "endDate": "2022-05-02T11:00:00.000Z",
    "metaData": [
      {
        "id": "85362399-38e1-4255-87a0-f3f984ed16d9",
        "name": "Push-ups",
        "type": "seconds, meters, number or exercise",
        "value": 1000,
        "priority": 1
      }
    ],
    "timeZoneId": "Europe/Amsterdam",
    "totalRounds": 1,
    "currentRound": 1,
    "status": "pending, started, ended",
    "language": "nl, en",
    "participantship": {
      "id": "string",
      "role": "string"
    },
    "invite": {
      "id": "string",
      "date": "2022-05-02T11:00:00.000Z"
    },
    "jokers": [
      {
        "id": "string",
        "participantId": "string",
        "date": "2022-05-02T11:00:00.000Z"
      }
    ],
    "participantMetaData": [
      {
        "id": "string",
        "participantId": "string",
        "value": 42,
        "date": "2022-05-02T11:00:00.000Z"
      }
    ],
    "participants": [
      {
        "id": "85362399-38e1-4255-87a0-f3f984ed16d9",
        "challengeId": "85362399-38e1-4255-87a0-f3f984ed16d9",
        "role": "user or admin",
        "user": {
          "id": "1ab474d5-e1fa-4340-ba6a-5642e720ea6a",
          "nickname": "Stevertje",
          "fullName": "Stefan de Jong",
          "email": "stefandejong@gmail.com",
          "language": "nl",
          "startDate": "2022-05-02T11:00:00.000Z",
          "imageUrl": "https://example.org/image.jpg",
          "waitingListValue": 0,
          "notificationsEnabled": true,
          "notifyDaysBefore": [
            -1,
            1
          ],
          "private": false,
          "yourFriendship": {
            "id": "85362399-38e1-4255-87a0-f3f984ed16d9",
            "status": "requested, accepted or blocked",
            "date": "2022-05-02T11:00:00.000Z",
            "muted": false
          },
          "theirFriendship": {
            "id": "85362399-38e1-4255-87a0-f3f984ed16d9",
            "status": "requested, accepted or blocked",
            "date": "2022-05-02T11:00:00.000Z",
            "muted": false
          }
        }
      }
    ],
    "nextParticipant": {
      "id": "85362399-38e1-4255-87a0-f3f984ed16d9",
      "challengeId": "85362399-38e1-4255-87a0-f3f984ed16d9",
      "role": "user or admin",
      "user": {
        "id": "1ab474d5-e1fa-4340-ba6a-5642e720ea6a",
        "nickname": "Stevertje",
        "fullName": "Stefan de Jong",
        "email": "stefandejong@gmail.com",
        "language": "nl",
        "startDate": "2022-05-02T11:00:00.000Z",
        "imageUrl": "https://example.org/image.jpg",
        "waitingListValue": 0,
        "notificationsEnabled": true,
        "notifyDaysBefore": [
          -1,
          1
        ],
        "private": false,
        "yourFriendship": {
          "id": "85362399-38e1-4255-87a0-f3f984ed16d9",
          "status": "requested, accepted or blocked",
          "date": "2022-05-02T11:00:00.000Z",
          "muted": false
        },
        "theirFriendship": {
          "id": "85362399-38e1-4255-87a0-f3f984ed16d9",
          "status": "requested, accepted or blocked",
          "date": "2022-05-02T11:00:00.000Z",
          "muted": false
        }
      }
    },
    "nextParticipantDueDate": "2022-05-02T11:00:00.000Z",
    "nextParticipantWindowInSeconds": 86400
  }
}