Локалізовано за допомогою ШІ

Створення блокування

const response = await fetch('https://api.emailit.com/v2/suppressions', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    email: 'unsubscribed@example.com',
    type: 'unsubscribe',
    reason: 'Користувач запросив відписку',
    keep_until: null
  })
});

const result = await response.json();

Відповіді

{
  "object": "suppression",
  "id": "sup_47TaFwzJx6mD7NeJYvLjFxVwbgT",
  "email": "unsubscribed@example.com",
  "type": "unsubscribe",
  "reason": "Користувач запросив відписку",
  "timestamp": "2025-12-24T10:30:00.000000Z",
  "keep_until": null
}