aYOUne
← Konfiguration API

States

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

play_circle 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": "6a700c1d5551b2d3b320d541",
    "readOnly": true,
    "isSensor": false,
    "isSwitch": false,
    "isLight": false,
    "isOverTime": false,
    "availableForWallboard": false,
    "showOnWallboard": false,
    "environment": "production",
    "domain": "ayoune.core",
    "prefix": "",
    "postfix": "",
    "key": "",
    "group": "default",
    "isDraft": true,
    "createdBy": "6045f4d25704710012485569",
    "createdAt": "2026-08-03T03:33:49.177Z",
    "updatedAt": "2026-08-03T03:33:49.177Z"
  },
  "meta": {
    "links": [
      {
        "rel": "self",
        "href": "https://config-api.ayoune.app/states/6a700c1d5551b2d3b320d541",
        "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": "Events",
        "title": "MODEL_EVENT",
        "href": "https://api.ayoune.app/automation/events",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "automation.events"
      }
    ],
    "debugId": "6a83ce8961c67fb131d5e503",
    "errors": [],
    "actions": [
      {
        "rel": "self",
        "action": "COPY",
        "title": "MODEL_STATE",
        "href": "https://api.ayoune.app/config/states/6a700c1d5551b2d3b320d541/copy",
        "method": "post",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      },
      {
        "rel": "self",
        "action": "DELETE",
        "title": "MODEL_STATE",
        "href": "https://api.ayoune.app/config/states/6a700c1d5551b2d3b320d541/copy",
        "method": "post",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      }
    ],
    "version": {
      "host": "2026.145.0",
      "core": "2026.307.0"
    },
    "rateLimit": {
      "limit": "2500",
      "remaining": "2477",
      "reset": "1787026578",
      "resetDate": "Tue Aug 18 2026"
    },
    "responseTime": 253.280654,
    "code": 200,
    "status": "success",
    "error": false
  }
}

Endpunkte

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

SDK

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

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

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

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

Weiterführend