Iridium CMSIridium CMS

Content

The Iridium CMS RESTful API is a powerful tool for building applications and services. It provides a simple and intuitive interface for interacting with your data.

The API is built on top Hono, a powerful and flexible web framework.

These sections will walk you through the API and how to use it using curl or fetch, however, the API can also be used via the REST Client for a typesafe experience.

Elements

For example, to get the current user:


const req = await fetch('{cmsURL}/api/elements/{id-or-slug}');
const data = await req.json();

{
  "data": {
    "id": "iop3Hbo",
    "name": "Home",
    "slug": "home",
    "type": "element",
    "atom": "pages",
    "title": "Home",
    "description": "Home Page",
    "tags": ["foo", "bar"],
    "content": [
      {
        "id": "eINt0Ms",
        "atom": "eINt0Ms",
        "type": "eINt0Ms",
        "title": "Title",
        "description": "Description",
        "image": {
          "id": "DZXBPev",
          "name": "home-hero",
          "slug": "home-hero",
          "alt": "",
          "caption": "",
          "width": 768,
          "height": 362,
          "ext": "jpg",
          "mime": "image/jpeg",
          "hash": "7986dd51dc09e09556ec93ca5dab60c84401729ee5d864735528582b7fefe8a2",
          "size": 128205,
          "url": "//api/media/DZXBPev",
          "src": "/api/media/DZXBPev.jpg",
          "createdAt": "2024-07-16T17:09:12.740Z",
          "updatedAt": "2024-07-16T17:09:12.740Z",
          "formats": {}
        },
        "mode": "dark",
        "reverse": false,
        "links": []
      }
    ]
  }
}