> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# RemoveVote

# Package: comments

# Namespace: Votes

# Method link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/remove-vote.md

## Permission Scopes:
Manage comment votes: SCOPE.DC_COMMENTS.MANAGE-VOTES

## Introduction

Removes the current identity's vote and returns the removed vote.

Specify the `voteId` returned by a vote response or
[Query Votes](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/query-votes.md) and the same `contextData` used to cast the vote.
A repeated removal fails when the vote no longer exists.

---

## REST API

### Schema

```
 Method: removeVote
 Description: Removes the current identity's vote and returns the removed vote.  Specify the `voteId` returned by a vote response or [Query Votes](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/query-votes.md) and the same `contextData` used to cast the vote. A repeated removal fails when the vote no longer exists.
 URL: https://www.wixapis.com/v1/votes/{voteId}
 Method: DELETE
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  voteId
 Method parameters: 
   param name: contextData | type: ContextData | description: Identifies the app and context containing the resource. When provided, `contextData` takes precedence over the deprecated `contextToken`.  
        - name: appDefId | type: string | description: GUID of the app that owns the context.  | validation: format GUID
        - name: contextId | type: string | description: GUID of the context containing the resource.  | validation: maxLength 128
        - name: contextType | type: string | description: Optional type used by the app to resolve its context.  
   query param name: contextToken | type: contextToken | description: Legacy context token. Use `contextData` instead.  
   param name: voteId | type:   none | required: true 
 Return type: RemoveVoteResponse
  - name: vote | type: Vote | description: Vote removed.  
     - name: resourceId | type: string | description: GUID of the resource receiving the vote. For comments, this is the comment GUID.  | validation: maxLength 128
     - name: resourceFqdn | type: string | description: Entity type receiving the vote. For comments, this is `wix.comments.v2.comment`.  | validation: maxLength 300
     - name: voteId | type: string | description: Vote GUID.  | read-only: true | validation: format GUID
     - name: type | type: Type | description: Vote type.  | read-only: true 
         - enum:
         -     UNKNOWN: Unknown vote type.
         -     UPVOTE: Vote in favor of the resource.
         -     DOWNVOTE: Vote against the resource.
     - name: createdBy | type: SocialIdentity | description: Identity that cast the vote.  | read-only: true 
        - name: identityId | type: string | description:   | validation: format GUID
        - name: identityType | type: IdentityType | description:   
             - enum: ANONYMOUS, MEMBER, USER, SERVICE, MEMBER_GROUP
     - name: createdDate | type: string | description: Date and time the vote was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the vote was updated.  | read-only: true | validation: format date-time
     - name: context | type: VoteContext | description: App and context containing the resource.  
        - name: contextId | type: string | description: GUID of the context containing the resource.  | validation: maxLength 128
        - name: contextType | type: string | description: Type used by the app to identify the context.  
        - name: appDefId | type: string | description: GUID of the app that owns the context.  | read-only: true | validation: format GUID
        - name: metaSiteId | type: string | description: Site GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments when the vote is updated.  | read-only: true 

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MISSING_METASITE_CONTEXT | Description: The authenticated request does not contain a site context.
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: PERMISSION_DENIED | Description: The [identity](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities.md) used to call the method doesn't have the required permissions.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: VOTE_NOT_FOUND | Description: Couldn't find the vote.


```

### Examples

### Remove the current identity vote
Specify your returned vote ID and the same context used to cast the vote. The sample response represents a successful removal.

```curl
curl -X DELETE \
'https://www.wixapis.com/v1/votes/5361b1fb-4e51-43f8-9247-05e1253b3119?contextData=%7B%22appDefId%22%3A%2291c9d6a7-6667-41fb-b0b4-7d3b3ff0b02e%22%2C%22contextId%22%3A%2264ad407e0bf87891bba7de3a%22%7D' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.comments.votes.removeVote(voteId, options)
 Description: Removes the current identity's vote and returns the removed vote.  Specify the `voteId` returned by a vote response or [Query Votes](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/query-votes.md) and the same `contextData` used to cast the vote. A repeated removal fails when the vote no longer exists.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  voteId
 Method parameters: 
   param name: options | type: RemoveVoteOptions  none  
        - name: contextData | type: ContextData | description: App and context containing the resource.  
           - name: appDefId | type: string | description: GUID of the app that owns the context.  | validation: format GUID
           - name: contextId | type: string | description: GUID of the context containing the resource.  | validation: maxLength 128
           - name: contextType | type: string | description: Optional type used by the app to resolve its context.  
   param name: voteId | type: string | description: GUID of the vote to remove. | required: true 
 Return type: PROMISE<RemoveVoteResponse>
  - name: vote | type: Vote | description: Vote removed.  
     - name: resourceId | type: string | description: GUID of the resource receiving the vote. For comments, this is the comment GUID.  | validation: maxLength 128
     - name: resourceFqdn | type: string | description: Entity type receiving the vote. For comments, this is `wix.comments.v2.comment`.  | validation: maxLength 300
     - name: voteId | type: string | description: Vote GUID.  | read-only: true | validation: format GUID
     - name: type | type: Type | description: Vote type.  | read-only: true 
         - enum:
         -     UNKNOWN: Unknown vote type.
         -     UPVOTE: Vote in favor of the resource.
         -     DOWNVOTE: Vote against the resource.
     - name: createdBy | type: SocialIdentity | description: Identity that cast the vote.  | read-only: true 
        - name: identityId | type: string | description:   | validation: format GUID
        - name: identityType | type: IdentityType | description:   
             - enum: ANONYMOUS, MEMBER, USER, SERVICE, MEMBER_GROUP
     - name: _createdDate | type: Date | description: Date and time the vote was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the vote was updated.  | read-only: true 
     - name: context | type: VoteContext | description: App and context containing the resource.  
        - name: contextId | type: string | description: GUID of the context containing the resource.  | validation: maxLength 128
        - name: contextType | type: string | description: Type used by the app to identify the context.  
        - name: appDefId | type: string | description: GUID of the app that owns the context.  | read-only: true | validation: format GUID
        - name: metaSiteId | type: string | description: Site GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments when the vote is updated.  | read-only: true 

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MISSING_METASITE_CONTEXT | Description: The authenticated request does not contain a site context.
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: PERMISSION_DENIED | Description: The [identity](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities.md) used to call the method doesn't have the required permissions.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: VOTE_NOT_FOUND | Description: Couldn't find the vote.


```

### Examples

### RemoveVote for the current identity
Use visitor or member authentication and replace the sample IDs with your comment, vote, and voting-enabled category IDs as applicable.

```javascript
import { votes } from "@wix/comments";

export async function removeVoteExample() {
  const response = await votes.removeVote("5361b1fb-4e51-43f8-9247-05e1253b3119", {
    contextData: {
      appDefId: "91c9d6a7-6667-41fb-b0b4-7d3b3ff0b02e",
      contextId: "64ad407e0bf87891bba7de3a",
    },
  });
  return response;
}

/* Promise resolves to the removed vote in { vote }, using the same Vote shape
   returned by upvote and downvote, including voteId, type, and context. */

```

### removeVote (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { votes } from '@wix/comments';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { votes },
  // Include the auth strategy and host as relevant
});


async function removeVote(voteId,options) {
  const response = await myWixClient.votes.removeVote(voteId,options);
};
```

---