> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/api-reference/002_company/003_message_sentiment_analysis/002__confirm_unsubscribe_based_on_analysis.md).

# Confirm Unsubscribe Based On Analysis

GraphQL endpoint: `/company`

Once you receive a sentiment analysis result via webhook, you can provide feedback on the suggested action you want to take using the `feedbackOnDetectedUnsubscribe` mutation. You can either confirm the unsubscribe via action: "UNSUBSCRIBE" or reject the result and keep the subscription by passing action: "DONT\_UNSUBSCRIBE".

The webhook result that was mentioned will contain a payload like this:

```json
{
  "external_communication_id": "00000000-0000-4000-8000-000000000001",
  "timestamp": "2026-01-15T09:00:00.000000",
  "action": "unsubscribe"
}
```

## Query

```graphql
mutation (
    $externalCommunicationId: String!
    $action: UnsubscribeType!
) {
  feedbackOnDetectedUnsubscribe (
    externalCommunicationId: $externalCommunicationId
    action: $action
  ) {
    status
  }
}

```

## Variables

```json
{
  "action": "UNSUBSCRIBE",
  "externalCommunicationId": "00000000-0000-4000-8000-000000000002"
}
```

## Response

```json
{
  "data": {
    "feedbackOnDetectedUnsubscribe": {
      "status": "OK"
    }
  }
}
```
