POST
/
mailing-lists
/
Create Mailing List
const url = 'https://api.thanks.io/api/v2/mailing-lists/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"description":"Birthday List","sub_account_id":7,"qrcode_url":"https://www.google.com"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "type": "manual",
  "description": "New Mailing List (Created via API 09/07/2024)",
  "sub_account_id": 7,
  "user_id": 2,
  "updated_at": "2024-09-07 02:10:32",
  "created_at": "1 second ago",
  "id": 610
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

201
application/json

Created

The response is of type object.