---
description: API access to consents in openli.
---

# Consents

## Withdraw email marketing consent

<mark style="color:green;">`POST`</mark> `https://app.openli.com/api/v1/consents/withdraw_all_email_marketing_consent`

Whenever a user unsubscribes from a newsletter you must use this endpoint to ensure that your audit trail is up-to-date and that the user's email marketing consent is withdrawn

#### Query Parameters

| Name  | Type   | Description           |
| ----- | ------ | --------------------- |
| email | string | The email of the user |

#### Headers

| Name      | Type   | Description  |
| --------- | ------ | ------------ |
| x-api-key | string | Your API key |

{% tabs %}
{% tab title="200 The request was successful, but no user found with the requested e-mail" %}
```
{ "message": "No e-mail marketing consent for specified user" }
```
{% endtab %}

{% tab title="204 The request was successful and the consent is withdrawn" %}
```
```
{% endtab %}
{% endtabs %}

