Skip to main content
POST
/
unsubscribes
JavaScript
import Moonbase from '@moonbaseai/sdk';

const client = new Moonbase({
  apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});

const unsubscribe = await client.unsubscribes.create({ email: 'yoda@moonbase.ai' });

console.log(unsubscribe.created_at);
{ "type": "unsubscribe", "email": "yoda@moonbase.ai", "created_at": "2025-02-17T16:00:00.000Z" }

Authorizations

Authorization
string
header
required

Your Moonbase API key.

Body

application/json

The email for the unsubscribe.

email
string
required

Response

Successful response.

type
string
required
Allowed value: "unsubscribe"
email
string
required
created_at
string<date-time>
required