Docs


Idlemon Docs Api REST API

REST API


Building a API request

The base URL for all API requests is https://www.idlemon.net/api.

The API responds with application/json, so the request must contain a Accept header with a value of application/json.
If the request contains any data, this data most be JSON encoded and the request must contain a Content-Type header with a value of application/json.

Authentication

All requests must contain the authentication header named Api-Token, this is the project token found on the project page by clicking the "API Token" button.

Logs

Add activity log POST /monitors/:monitor_slug/logs

This endpoint is used to tell Idlemon when a monitor is active, could be a cron job that is finished running.
You find the monitor slug on the monitor edit page.
You can add meta data to the log like how many entities were processed by a cron job, or a error counter.
Below you will find an example cURL request and an example response.

curl --location --request POST 'https://www.idlemon.net/api/monitors/your_monitor_slug/logs' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Api-Token: 0123456789abcdef0123456789abcdef' \
--data-raw '{
    "duration": duration_in_seconds,
    "metas": [
        {
            "name": "meta_name",
            "value": "meta_value"
        },
        {
            "name": "additional_meta_name",
            "value": "additional_meta_value"
        }
    ]
}'

The response will look something like this.

{
    "log": {
        "id": "d8d4fd0a-ae50-11ea-b3de-0242ac130004",
        "duration": 7,
        "metas": [
            {
                "id": "dd170f16-ae50-11ea-b3de-0242ac130004"
                "name": "processed",
                "value": "42",
            },
            {
                "id": "df87dad2-ae50-11ea-b3de-0242ac130004"
                "name": "errors",
                "value": "0",
            }
        ]
    }
}

Projects

View project GET /projects/:project_id

The endpoint is useful for viewing the information about a project and its monitors.
Below you will find an example cURL request and an example response.

curl --location --request GET 'https://www.idlemon.net/api/projects/9934826a-adb5-11ea-a64d-0242ac130004' \
--header 'Accept: application/json' \
--header 'Api-Token: 0123456789abcdef0123456789abcdef'

The response will look something like this if the project have a single monitor.

{
    "project": {
        "id": "9934826a-adb5-11ea-a64d-0242ac130004",
        "name": "Foo",
        "description": "Lorem ipsum",
        "token_last_used": "2025-06-15T11:06:07+00:00",
        "monitors": [
            {
                "id": "c383b446-adb5-11ea-a64d-0242ac130004",
                "project_id": "9934826a-adb5-11ea-a64d-0242ac130004",
                "name": "Bar",
                "slug": "bar",
                "description": "Lorem ipsum",
                "interval": 60,
                "interval_avg": 60,
                "duration_avg": 42,
                "is_idle": false,
                "last_idle": null,
                "last_contact": "2025-06-15T11:00:00+00:00"
            }
        ]
    }
}