{
"id": "social.coves.feed.vote.create",
"defs": {
"main": {
"type": "procedure",
"input": {
"schema": {
"type": "object",
"required": [
"subject",
"direction"
],
"properties": {
"subject": {
"ref": "com.atproto.repo.strongRef",
"type": "ref",
"description": "Strong reference to the post or comment being voted on"
},
"direction": {
"type": "string",
"maxLength": 64,
"description": "Vote direction: up for upvote, down for downvote",
"knownValues": [
"up",
"down"
]
}
}
},
"encoding": "application/json"
},
"errors": [
{
"name": "NotAuthorized",
"description": "User is not authorized to vote on this content"
},
{
"name": "InvalidSubject",
"description": "The subject reference is invalid or malformed"
}
],
"output": {
"schema": {
"type": "object",
"properties": {
"cid": {
"type": "string",
"format": "cid",
"description": "CID of the created vote. Absent if the vote was toggled off."
},
"uri": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the created vote. Absent if the vote was toggled off."
}
}
},
"encoding": "application/json"
},
"description": "Create or toggle a vote on a post or comment. If a vote in the same direction exists, it will be removed (toggled off). If a vote in the opposite direction exists, it will be replaced."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}