> ## Documentation Index
> Fetch the complete documentation index at: https://docs.userorbit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vote on Topic

> Cast an upvote on a topic (feature request). Requires subscriber authentication.

## Authentication

```bash theme={null}
Authorization: Bearer SUBSCRIBER_JWT_TOKEN
```

## Request Body

<ParamField body="id" type="string" required>
  Topic ID (UUID) to vote on
</ParamField>

## Response

<ResponseField name="data" type="object">
  Created vote object

  <Expandable title="properties">
    <ResponseField name="id" type="string">Vote ID</ResponseField>
    <ResponseField name="topicId" type="string">Topic ID</ResponseField>
    <ResponseField name="creatorId" type="string">Subscriber ID</ResponseField>
    <ResponseField name="createdAt" type="string">Vote timestamp</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.userorbit.com/v1/public/topic-votes.create' \
  --header 'Authorization: Bearer SUBSCRIBER_JWT_TOKEN' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "id": "topic-uuid-123"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.userorbit.com/v1/public/topic-votes.create', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${subscriberToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ id: topicId })
  });

  const { data } = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "id": "vote-uuid",
      "topicId": "topic-uuid-123",
      "creatorId": "sub-uuid-789",
      "createdAt": "2024-01-17T16:00:00Z"
    }
  }
  ```
</ResponseExample>

## Error Responses

```json Not Authenticated theme={null}
{
  "error": "Bad request"
}
```

```json Already Voted theme={null}
{
  "error": "Duplicate vote"
}
```

## Behavior

* **One Vote Per Subscriber**: Each subscriber can only vote once
* **Database Constraint**: Prevents duplicate votes

## Notes

* Requires subscriber authentication
* Returns error if already voted
* Vote immediately visible in count
