Zum Inhalt springen
aYOUne
← CRM API

Drafts

Singular: Draft — Base-URL: https://crm-api.ayoune.app — Zugriff: CRUD — Maschinenlesbare Beschreibung (JSON · YAML)

Jetzt ausprobieren beta

Requests werden über den consumer-app Proxy an *.ayoune.app weitergeleitet. Tokens bleiben im Browser und werden pro Call mitgesendet.

Beispiel-Response (aufgezeichnet) Beispiel

Eine echte, zuvor aufgezeichnete GET /:id-Antwort dieses Endpunkts — nicht der Live-Call oben. Sensible Felder sind maskiert.

{
  "payload": {
    "_id": "6acc55bc7625d45cca5db35f",
    "type": "mail",
    "attachments": [],
    "subject": "SQUARE_ROSE_LANDO CALRISSIAN",
    "sent": false,
    "mode": "new",
    "sendState": "draft",
    "modifiedBy": "6045f4d25704710012485569",
    "createdBy": "6045f4d25704710012485569",
    "shares": [],
    "createdAt": "2026-10-12T03:36:28.212Z",
    "updatedAt": "2026-10-12T03:36:28.212Z"
  },
  "meta": {
    "links": [
      {
        "rel": "self",
        "href": "https://crm-api.ayoune.app/drafts/6acc55bc7625d45cca5db35f",
        "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": "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": "Mailboxes",
        "title": "MODEL_MAILBOX",
        "href": "https://api.ayoune.app/config/mailboxes",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.mailboxes"
      },
      {
        "rel": "ImapMails",
        "title": "MODEL_IMAPMAIL",
        "href": "https://api.ayoune.app/crm/imapmails",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "crm.imapmails"
      },
      {
        "rel": "Employees",
        "title": "MODEL_EMPLOYEE",
        "href": "https://api.ayoune.app/hr/employees",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "hr.employees"
      }
    ],
    "debugId": "6ad834b7aea9302526b17b8d",
    "errors": [],
    "actions": [
      {
        "rel": "self",
        "action": "COPY",
        "title": "MODEL_DRAFT",
        "href": "https://api.ayoune.app/crm/drafts/6acc55bc7625d45cca5db35f/copy",
        "method": "post",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      },
      {
        "rel": "self",
        "action": "DELETE",
        "title": "MODEL_DRAFT",
        "href": "https://api.ayoune.app/crm/drafts/6acc55bc7625d45cca5db35f",
        "method": "delete",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      }
    ],
    "version": {
      "host": "2026.79.1",
      "core": "2026.386.0"
    },
    "rateLimit": {
      "limit": "10000",
      "remaining": "9855",
      "reset": "1792557684",
      "resetDate": "Wed Oct 21 2026"
    },
    "responseTime": 652.399569,
    "code": 200,
    "status": "success",
    "error": false
  }
}

Endpunkte

MethodePathBeschreibungRight
GET /drafts Liste mit Filtern/Paginierung crm.drafts.view
GET /drafts/:id Einzelner Datensatz crm.drafts.view
POST /drafts Neuen Datensatz erstellen crm.drafts.new
PUT /drafts Datensatz aktualisieren crm.drafts.edit
DELETE /drafts/:id Datensatz löschen crm.drafts.delete

SDK

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

// Alle abrufen
const list = await ay.crm.drafts.find().limit(10).exec();

// Einzelnen Datensatz
const one = await ay.crm.drafts.findById('OBJECT_ID').exec();

// Erstellen
const created = await ay.crm.drafts.create({ name: 'Foo' });

Weiterführend