aYOUne
← Marketing API

Newsletters

Singular: Newsletter — Base URL: https://marketing-api.ayoune.app — Access: CRUD

play_circle Try it now beta

Requests are proxied through the consumer-app to *.ayoune.app. Tokens stay in your browser and are forwarded per call.

Example response (recorded) sample

A real, previously recorded GET /:id response of this endpoint — not the live call above. Sensitive fields are masked.

{
  "payload": {
    "canceled": {
      "value": false,
      "when": "2024-02-29T16:30:51.196Z"
    },
    "_id": "65e0b13b121b7d48fe1592b6",
    "name": "",
    "promotional": true,
    "editor": "6045f4d25704710012485569",
    "attachments": [],
    "subscribers": [],
    "subscriber": 0,
    "opens": 0,
    "openrate": 0,
    "clicks": 0,
    "clickrate": 0,
    "bounces": 0,
    "bouncerate": 0,
    "autoSend": false,
    "sent": false,
    "status": "draft",
    "progress": 0,
    "realSubscribers": 0,
    "cleanedSubscribers": 0,
    "createdBy": "6045f4d25704710012485569",
    "links": [],
    "createdAt": "2024-02-29T16:30:51.197Z",
    "updatedAt": "2024-02-29T16:30:51.197Z"
  },
  "meta": {
    "links": [
      {
        "rel": "self",
        "href": "https://marketing-api.ayoune.app/newsletters/65e0b13b121b7d48fe1592b6",
        "method": "get",
        "title": "GET",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      }
    ],
    "relations": [
      {
        "rel": "Consumers",
        "title": "MODEL_CONSUMER",
        "href": "https://api.ayoune.app/crm/consumers",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "crm.consumers"
      },
      {
        "rel": "EMailTemplates",
        "title": "MODEL_EMAILTEMPLATE",
        "href": "https://api.ayoune.app/config/emailtemplates",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.emailtemplates"
      },
      {
        "rel": "Mails",
        "title": "MODEL_MAIL",
        "href": "https://api.ayoune.app/config/mails",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.mails"
      },
      {
        "rel": "ConsumerLists",
        "title": "MODEL_CONSUMERLIST",
        "href": "https://api.ayoune.app/crm/consumerlists",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "crm.consumerlists"
      },
      {
        "rel": "ConsumerLists",
        "title": "MODEL_CONSUMERLIST",
        "href": "https://api.ayoune.app/crm/consumerlists",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "crm.consumerlists"
      },
      {
        "rel": "NewsletterTypes",
        "title": "MODEL_NEWSLETTERTYPE",
        "href": "https://api.ayoune.app/config/newslettertypes",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.newslettertypes"
      }
    ],
    "debugId": "6a6194abf78ad61f1990f3e2",
    "errors": [],
    "actions": [
      {
        "rel": "self",
        "action": "COPY",
        "title": "MODEL_NEWSLETTER",
        "href": "https://api.ayoune.app/marketing/newsletters/65e0b13b121b7d48fe1592b6/copy",
        "method": "post",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      },
      {
        "rel": "self",
        "action": "DELETE",
        "title": "MODEL_NEWSLETTER",
        "href": "https://api.ayoune.app/marketing/newsletters/65e0b13b121b7d48fe1592b6/copy",
        "method": "post",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      }
    ],
    "version": {
      "host": "2026.24.4",
      "core": "2026.257.1"
    },
    "rateLimit": {
      "limit": "2500",
      "remaining": "1906",
      "reset": "1784783437",
      "resetDate": "Thu Jul 23 2026"
    },
    "responseTime": 67.701788,
    "code": 200,
    "status": "success",
    "error": false
  }
}

Endpoints

MethodPathDescriptionRight
GET /newsletters List with filters/pagination marketing.newsletters.view
GET /newsletters/:id Single record marketing.newsletters.view
POST /newsletters Create new record marketing.newsletters.new
PUT /newsletters Update record marketing.newsletters.edit
DELETE /newsletters/:id Delete record marketing.newsletters.delete

SDK

import { aYOUne } from '@tolinax/ayoune';
const ay = new aYOUne('pat_your_token');

// List all
const list = await ay.marketing.newsletters.find().limit(10).exec();

// Single record
const one = await ay.marketing.newsletters.findById('OBJECT_ID').exec();

// Create
const created = await ay.marketing.newsletters.create({ name: 'Foo' });

See also