> For the complete documentation index, see [llms.txt](https://docs.hablla.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/hablla/people/cancel-subscription.md).

# Cancel Subscription

The Unsubscribe operation is an essential tool for managing your contacts' communication preferences and ensuring compliance with data protection laws (such as LGPD).

Unlike the "Block" operation, which is a general block, this action allows you to record that a contact has requested not to receive further communications through a specific channel (such as Email, Phone, SMS, etc.).

The operation works by locating the person by the channel identifier (the "key", such as the email address or phone number) and marking them as "unsubscribed" for that type of communication.

#### How to Configure

1. In Hablla Studio, add the "People" block to your automation flow.
2. In the "Operation" field, select the "Unsubscribe" option.
3. In the "Type" field, select the communication channel from which the person wishes to unsubscribe.
4. In the "Key" field (`key`), enter the identifier corresponding to the selected type (the email, the phone number, etc.).

### Parameters

| Field         | Type         | Required? | Description                                                                                                                                                             |
| ------------- | ------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Type (`type`) | Options List | ✅ Yes     | The communication channel to which the unsubscribe will be applied. Options: `Email`, `phone`, `Telegram`, `Facebook`, `Instagram`.                                     |
| Key (`key`)   | Text         | ✅ Yes     | The unique identifier of the contact in the chosen channel. For example, if the `Type` is `Email`, the `Key` should be the email address (e.g.: `contato@exemplo.com`). |

### Structure (Using JSON)

The JSON request body must contain the `channel` type and the `key` (contact identifier).

To unsubscribe an email:

JSON

```
{
  "type": "email",
  "key": "joana.souza@example.com"
}
```

To unsubscribe a phone:

JSON

```
{
  "type": "phone",
  "key": "+5511987654321"
}
```

***

### 🚀 Example Use Case

Purpose: Automatically process unsubscribe requests coming from the footer of a marketing email.

1. Configure your email sending platform to send a Webhook to an endpoint of your flow in Hablla whenever a user clicks the "Unsubscribe" link. The platform must send the user's email address in the webhook body.
2. Create a flow that starts with this Webhook trigger.
3. Add the "People" block with the "Unsubscribe" operation.
4. In the "Type" field, select the option `Email`.
5. In the "Key" field, enter the variable that contains the user's email coming from the trigger (e.g.: `{{trigger.body.email}}`).
6. (Optional) Add a subsequent step to remove the "Newsletter" tag from the person's profile to ensure they are not included in future segmentations for that communication.

With this flow, you automate 100% of the opt-out process, ensuring the user's request is handled instantly, preventing improper sends and keeping your company in compliance with market best practices.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/hablla/people/cancel-subscription.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
