# pub.chive.governance.getUserVote

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.governance.getUserVote)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.governance.getUserVote/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.governance.getUserVote/examples)

## Definitions

### `pub.chive.governance.getUserVote`

**Type**: `query`

Get a user's vote on a specific proposal, if they have voted

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `userDid` | `string` (did) | Yes | User DID |
| `proposalId` | `string` | Yes | Proposal identifier |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `vote` | `union` | Yes | Vote if found, or null |

#### Errors

- **NotFound**

### `pub.chive.governance.getUserVote#voteView`

**Type**: `object`

View of a vote on a proposal

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | Vote identifier |
| `cid` | `string` | Yes | Content identifier |
| `uri` | `string` (at-uri) | Yes | Vote AT-URI |
| `vote` | `string` | Yes | Vote value |
| `weight` | `integer` | Yes | Weighted vote value (scaled by 1000 for 0.0-1.0 range) |
| `voterDid` | `string` (did) | Yes | Voter DID |
| `createdAt` | `string` (datetime) | Yes | Vote timestamp |
| `rationale` | `string` | No | Vote rationale |
| `voterRole` | `string` | Yes | Voter governance role |
| `proposalUri` | `string` (at-uri) | Yes | Proposal AT-URI |

## Raw Schema

```json
{
  "id": "pub.chive.governance.getUserVote",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "NotFound"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "vote"
          ],
          "properties": {
            "vote": {
              "refs": [
                "#voteView"
              ],
              "type": "union",
              "description": "Vote if found, or null"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "proposalId",
          "userDid"
        ],
        "properties": {
          "userDid": {
            "type": "string",
            "format": "did",
            "description": "User DID"
          },
          "proposalId": {
            "type": "string",
            "description": "Proposal identifier"
          }
        }
      },
      "description": "Get a user's vote on a specific proposal, if they have voted"
    },
    "voteView": {
      "type": "object",
      "required": [
        "id",
        "uri",
        "cid",
        "proposalUri",
        "voterDid",
        "voterRole",
        "vote",
        "weight",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Vote identifier"
        },
        "cid": {
          "type": "string",
          "description": "Content identifier"
        },
        "uri": {
          "type": "string",
          "format": "at-uri",
          "description": "Vote AT-URI"
        },
        "vote": {
          "type": "string",
          "description": "Vote value",
          "knownValues": [
            "approve",
            "reject",
            "abstain",
            "request-changes"
          ]
        },
        "weight": {
          "type": "integer",
          "maximum": 1000,
          "minimum": 0,
          "description": "Weighted vote value (scaled by 1000 for 0.0-1.0 range)"
        },
        "voterDid": {
          "type": "string",
          "format": "did",
          "description": "Voter DID"
        },
        "createdAt": {
          "type": "string",
          "format": "datetime",
          "description": "Vote timestamp"
        },
        "rationale": {
          "type": "string",
          "description": "Vote rationale"
        },
        "voterRole": {
          "type": "string",
          "description": "Voter governance role",
          "knownValues": [
            "community-member",
            "reviewer",
            "domain-expert",
            "administrator"
          ]
        },
        "proposalUri": {
          "type": "string",
          "format": "at-uri",
          "description": "Proposal AT-URI"
        }
      },
      "description": "View of a vote on a proposal"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
