---
title: "Create challenge"
method: POST
path: "/api/v5/admin/challenges/"
tags: ["Admin Challenges"]
---

# Create challenge

`POST /api/v5/admin/challenges/`

Creates a challenge.
        Parameters:
            - name: Challenge name.
            - type: Only "HABITS" type is possible for now.
            - description: Challenge description
            - startDate: Challenge start date
            - endDate: Challenge end date
            - ownerId: The id of the user to set as an owner of this challenge
            - entitlements: RevenueCat entitlements needed to join this challenge. Null means no needed entitlements.
            - chatGroupLink: Challenge chat group link (WhatsApp or telegram link)
            - maxPoints: Defines the max number of points a user can get in one day, which means the max number of
                habits he can link to this challenge.
            - personalHabitChallenge: Used for personal coaching. Set to false for now.
            - finalGoal: Used for other types of challenges (steps ..). Set to null for now.
            - globalChallenge: Whether the challenge is visible for everyone or not. Set to True for now.
            - teamsNames: List of names of the teams to create

## Request body

- BodyChallengesAdminCreateApiV5AdminChallengesPost
  - `challenge` ChallengeInCreate, required
    - `name` string, required
    - `type` 'HABITS', required — An enumeration.
    - `description` string
    - `startDate` string, date, required
    - `endDate` string, date
    - `ownerId` integer, required
    - `entitlements` string[]
    - `chatGroupLink` string
    - `maxPoints` integer
    - `personalHabitChallenge` boolean
    - `finalGoal` integer
    - `globalChallenge` boolean
    - `icon` string
    - `teamsNames` string[]

## Response `201`

Successful Response

- ChallengeInResponse
  - `challenge` Challenge, required
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `deletedAt` string, date-time
    - `id` integer
    - `name` string, required
    - `type` string, required
    - `description` string
    - `startDate` string, date, required
    - `endDate` string, date
    - `ownerId` integer, required
    - `subscriptionGroups` string[]
    - `entitlements` string[]
    - `chatGroupLink` string
    - `maxPoints` integer
    - `personalHabitChallenge` boolean
    - `finalGoal` integer
    - `globalChallenge` boolean
    - `iconId` integer
    - `iconUrl` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pavlok/apis/pavlok-api-v5.md) · [All operations](https://skmtc.net/pavlok/apis/pavlok-api-v5/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pavlok/pavlok-api-v5/revisions/3d192098b1ac/schema)
