Skip to main content
POST
/
polls
Create Poll Endpoint
curl --request POST \
  --url http://localhost:8080/polls \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "questions": [
    {
      "text": "<string>",
      "options": [
        {
          "text": "<string>"
        }
      ]
    }
  ],
  "description": "<string>",
  "reward_enabled": false,
  "reward_amount_kopeks": 0
}
'
{
  "id": 123,
  "title": "<string>",
  "description": "<string>",
  "reward_enabled": true,
  "reward_amount_kopeks": 123,
  "reward_amount_rubles": 123,
  "questions": [
    {
      "id": 123,
      "text": "<string>",
      "order": 123,
      "options": [
        {
          "id": 123,
          "text": "<string>",
          "order": 123
        }
      ]
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Body

application/json
title
string
required
Required string length: 1 - 255
questions
PollQuestionCreate · object[]
required
Minimum array length: 1
description
string | null
Maximum string length: 4000
reward_enabled
boolean
default:false
reward_amount_kopeks
integer
default:0
Required range: 0 <= x <= 1000000000

Response

Successful Response

id
integer
required
title
string
required
description
string | null
required
reward_enabled
boolean
required
reward_amount_kopeks
integer
required
reward_amount_rubles
number
required
questions
PollQuestionResponse · object[]
required
created_at
string<date-time>
required
updated_at
string<date-time>
required