Unsubscribe a profile
- Path
/unsubscribe- Auth
- Secret key · server only
const url = 'https://releva.ai/api/v0/unsubscribe';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"maria@example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://releva.ai/api/v0/unsubscribe \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "maria@example.com" }'Opts the profile out shop-wide (subscribedAt cleared, unsubscribedAt set) and removes your shop’s
user-visible subscriptions from it. Subscriptions you only set through the API are kept.
An unknown email or phone number creates a new profile that is unsubscribed.
Email, SMS, Viber and WhatsApp stop for an unsubscribed profile; push, Facebook Ads and Google Ads
audiences do not check the opt-out, so segment those on subscription status too.
Unknown fields are rejected.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Send at least one of email or phoneNumber. Unknown fields are rejected.
object
Links the event to the message or campaign that caused it. All values are ids as strings.
object
Example
{ "email": "maria@example.com"}Responses
Section titled “Responses”Accepted for asynchronous processing.
object
Example
{}Authentication or validation error.
object
Human-readable error. Several validation errors are joined with a space.
Examples
{ "message": "Authorization header is missing."}{ "message": "At least one of (email, phoneNumber) is required."}{ "message": "The object '' contains forbidden keys: 'subscriptions'."}{ "message": "The 'email' field must be a valid e-mail."}{ "message": "phoneNumber must be a valid telephone number starting with + and international code, e.g. +1. Got 12ab instead."}{ "message": "The '' field is required."}The domain is disabled.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "Domain is disabled. Please reach out to support@releva.ai to enable it."}Request body larger than 800 KB.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "request entity too large"}