Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/polls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Polls Feature

This document describes the polls feature in the Devoter API.

## Overview

The polls feature allows users to create, manage, and participate in polls.

## API Endpoints

- `GET /polls` - Retrieve a list of polls
- `POST /polls` - Create a new poll
- `GET /polls/:id` - Retrieve a specific poll
- `PUT /polls/:id` - Update a poll
- `DELETE /polls/:id` - Delete a poll

## Usage

### Creating a Poll

To create a poll, send a POST request to `/polls` with the following JSON payload:

```json
{
"title": "Sample Poll",
"options": ["Option 1", "Option 2", "Option 3"],
"expiresAt": "2023-12-31T23:59:59Z"
}
```

### Voting on a Poll

To vote on a poll, send a POST request to `/polls/:id/vote` with the selected option.

## Error Handling

Refer to the [Error Handling](error-handling.md) documentation for common error responses.

## Rate Limiting

This feature is subject to rate limiting as described in the [Rate Limiting](rate-limiting.md) documentation.