Machines API
These endpoints list your machines and do what the Machines page does: add, rename and delete machines, set their OS, keep their notes and history, and get their install and uninstall commands. Two public lists tell you which targets and Python versions you can pick.
List machines
GET /api/get_all_machines/ lists every machine on your account. It is a read.
GET /api/get_all_machines/
curl -s https://eyalsec.com/api/get_all_machines/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000"
{
"machines": [
["2026-07-01T00:00:00Z", "web-01", "installed", "3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41",
"ubuntu_24_04_x86_64", "bc0ef13-20260604T120000Z", "bc0ef13-20260605T080000Z",
"3.13", false, false, false, false, "python", "local", "local",
"Payments API, production", "2026-10-26T09:12:00Z", null, 3, "high", "",
"6a1f0c3e-2b7d-4e9a-8c15-0d4f3b2a9e77", false, true, false, "production", "", true]
]
}
The machine row
Each machine is an array of 28 values in a fixed order. New values are only ever added at the end, so read by position.
| Index | Field | Meaning |
|---|---|---|
| 0 | created_at |
When you added the machine. |
| 1 | machine_name |
The name you gave it. |
| 2 | status |
created, pending, installed or failed (shown on the dashboard as installation error). See status. |
| 3 | public_id |
The machine's handle in every other API call. See public id. |
| 4 | os_type |
The distribution and architecture, such as ubuntu_24_04_x86_64. auto for an es-python machine whose build is detected when its install runs; it changes to the real target as soon as the install starts. |
| 5 | installed_build |
The build installed on the machine. |
| 6 | current_build |
The newest build available for this machine. When it differs from installed_build, an update is available (see build badge). |
| 7 | python_version |
The Python version the machine runs, such as 3.13 (es-python). auto until the install decides it, like os_type. |
| 8 | socket_only |
Retired. Machines added now always read false; some older machines may still read true. |
| 9 | clone_locked |
true when its copy was seen running elsewhere. See clone. |
| 10 | stalled |
true when an install has sat in pending too long. |
| 11 | stale_agent |
true when an old copy, replaced by a reinstall, is still reporting. See old copy. |
| 12 | agent_kind |
The product the machine runs: one of the event lists' view values, such as python or browser. |
| 13 | install_mode |
Where es-python is set to be installed on the host: local, local-python, global or global-python (see Add a machine). |
| 14 | installed_mode |
The install mode the host last reported having. Empty until an install succeeds; it differs from install_mode until a changed mode is installed. |
| 15 | note |
The machine's note. Empty when it has none. |
| 16 | last_contact_at |
The last time the machine reached EyalSec, updated at most every 5 minutes. null when it never has. |
| 17 | silent_since |
When an installed machine was marked no contact after 3 days without any. null while it is in contact. |
| 18 | events_24h |
How many new events the machine reported in the last 24 hours. |
| 19 | top_severity_24h |
The highest severity among those events. Empty when there are none. |
| 20 | install_error |
Why a failed or stopped install did not finish. Empty otherwise. |
| 21 | host_id |
The computer the machine is on. es-python machines that share it are several Python versions on one computer, and count as one machine (see Another Python). |
| 22 | powered_off |
true when the machine's switch is set to unprotected: EyalSec is not watching it and it is not billed (see Turn a machine on or off). |
| 23 | raise |
true when the machine has a Raise policy in force (see Raise badge), false when it reports only. null when the machine's product has no Raise mode. |
| 24 | raise_held |
true when the machine's Raise policy waits for a subscription that covers more machines with Raise, so it reports for now. |
| 25 | environment |
The machine's environment: production, staging, test or development. Empty when not set. |
| 26 | off_reason |
Why the machine is unprotected. subscription_ended when its subscription ended; it is protected again once a subscription is paid. unpaid, spend_limit or paused when its switch is on and it is unprotected until payment, until the spend limit is raised, or while the account is paused; it is protected again once that is settled on the Billing page. Empty when you switched it off yourself or it is protected. |
| 27 | protected |
true when the machine is protected now. false when it is switched off, and also while off_reason holds it. |
The machine's secret is never returned. You refer to a machine by its public_id.
Download the machine list
GET /api/machines_export returns every machine on your account as a CSV file, or as JSON with format=json. It holds the facts of the machine row under named columns, the same file the Download list (CSV) link on the Machines page saves. It is a read.
GET /api/machines_export?format=csv
curl -s "https://eyalsec.com/api/machines_export?format=csv" \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-o machines.csv
The columns are id (the public_id), name, product (such as es-python), status, os, python_version, install_mode, installed_mode, installed_build, current_build, socket_only, clone_locked, stalled, stale_agent, created_at, installed_at, last_contact_at, silent_since, events_24h, top_severity_24h, install_error and note. New columns are only added at the end. Times are UTC and empty when there is none. JSON answers {"count": N, "rows": [...]}, each row an object keyed by those columns with every value a string. Any format other than csv or json is a 400.
Add a machine
POST /api/add_new_machine/ registers a new es-python or es-chromium machine. It is a write; the fields match the Add machine form.
POST /api/add_new_machine/
Form fields:
| Field | Meaning |
|---|---|
machine_name |
Required. The display name. |
product |
python (the default) or browser. Your account needs that product (403 otherwise). |
distro, arch |
Optional, python only. Leave both out (or send distro=auto) to have the build detected on the host when its install runs; the machine is then stored with os_type auto. Give both to choose the build yourself: they are combined into the os_type, such as ubuntu_24_04 and x86_64 (see supported targets). Giving only one of them is a 422. Unused for browser. |
python_version |
python only. auto means the host's own Python version when a build exists for it, and 3.13 otherwise. When you leave the build to detection, it defaults to auto and any supported version is accepted (an install on a host without that version is refused by name). When you give distro and arch, it defaults to 3.13, and a version must be available for that target (see Python versions); one that exists but is not available is a 422 naming both. |
host |
Optional, python only. The public_id of one of your es-python machines: the new machine is another Python version on that same computer (see Another Python). |
install_mode |
python only. Where es-python is installed on the host: local (the default) installs it for the user who runs the command; local-python does the same and also makes python and python3 run es-python for that user; global installs it for every user and needs sudo; global-python does that and makes python and python3 run es-python for every user. Any other value is a 422. |
curl -s https://eyalsec.com/api/add_new_machine/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-d machine_name=web-01
The answer is 200 with the new machine:
{ "Name": "web-01", "OsType": "auto", "Status": "created",
"PublicID": "0b9d7e21-4c3a-4f5e-8a61-2d9c0e7f1b53", "PythonVersion": "auto", "SocketOnly": "false",
"AgentKind": "python", "InstallMode": "local", "HostID": "6a1f0c3e-2b7d-4e9a-8c15-0d4f3b2a9e77" }
With -d distro=ubuntu_24_04 -d arch=x86_64 the same call stores that build instead, and the answer reads "OsType": "ubuntu_24_04_x86_64" and "PythonVersion": "3.13".
A new es-python machine starts with the socket and file sources on, as machine settings (see Sources watched from the start). A source you have already set for all machines is left to that setting.
An es-chromium machine (product=browser) needs only a name, and its answer leaves out the es-python fields:
{ "Name": "test-browser", "OsType": "", "Status": "created",
"PublicID": "0b9d7e21-4c3a-4f5e-8a61-2d9c0e7f1b53", "AgentKind": "browser" }
There is no limit on machines. An account with no card on file gets 402 with "error": "To add machines, add a card on the Billing page, under Settings." and "billing_url": "/scanner/billing", the page where the card is added Other errors: 422 for a missing or invalid field, an unknown target or Python version; 403 for a product your account does not have. SocketOnly is always "false", and a socket_only field you send is ignored.
Another Python on the same computer
Send host with the public_id of an es-python machine and an explicit python_version to add that version to the same computer. The answer carries the same HostID as the machine you named. The computer still counts once on your bill.
curl -s https://eyalsec.com/api/add_new_machine/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-d "machine_name=web-01 (3.14)" -d python_version=3.14 \
-d host=3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41
Errors: 422 when python_version is missing or auto, 409 when that computer already has the version, 404 when host is not one of your es-python machines. Its install has to run on the same computer: on another one, /install.sh refuses it with a 409 and the command stays valid.
The es-chromium install command
POST /api/machines/generate/ is the Add machine and Install buttons of the Machines page for es-chromium. It is a write. Send product=browser to add a new es-chromium machine and get its install command in the same answer:
POST /api/machines/generate/
| Field | Meaning |
|---|---|
product |
Required. The product's agent kind: browser for es-chromium, or the agent kind of another product your account holds. python is a 422 that points you to POST /api/add_new_machine/. |
public_id |
Optional. One of your machines of that product. A fresh install command for it is returned and nothing is added, which is how you get a new command when one expired before it was run. |
name |
Optional, where the product takes one (machine_name works too). An es-chromium machine is named for the time it was added; rename it with POST /api/rename_machine/. |
curl -s https://eyalsec.com/api/machines/generate/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-d product=browser
{ "secret": "<single-use-secret>",
"script_path": "https://eyalsec.com/es-chromium/install.sh",
"public_id": "0b9d7e21-4c3a-4f5e-8a61-2d9c0e7f1b53",
"machine_name": "es-chromium 2026-11-14 12:00:00 0b9d" }
The secret is single-use and expires after 10 minutes. Adding a machine needs a card or credit on the account, as above (402 otherwise), and a fresh command for an existing machine is a 402 too while billing stops that machine. Errors: 403 for a product your account does not have, 404 for a public_id that is not one of your machines, 409 when that machine belongs to another product.
Set a machine's OS
POST /api/set_machine_os/ changes the distribution and architecture a machine is installed for. It is a write; see Set OS.
POST /api/set_machine_os/
Form fields: machine_name (the display name), distro and arch, all required. An unknown target is a 422, and a name that is not one of your machines is a 404. Setting the OS of a machine whose build was left to detection fixes the build to the one you set; its python_version stays as it was.
curl -s https://eyalsec.com/api/set_machine_os/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-d machine_name=web-01 -d distro=debian_12 -d arch=aarch64
{ "machine_name": "web-01", "os_type": "debian_12_aarch64" }
Rename a machine
POST /api/rename_machine/ gives a machine a new display name. It is a write; see Rename.
POST /api/rename_machine/
JSON body: public_id and machine_name, both required. The name is trimmed and must then be 1 to 128 characters (422 otherwise). A machine that is not yours is a 404.
curl -s https://eyalsec.com/api/rename_machine/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"public_id":"3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41","machine_name":"db-primary"}'
{ "public_id": "3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41", "machine_name": "db-primary" }
Delete a machine
POST /api/delete_machine/ removes a machine and every event it reported. It is a write, it cannot be undone, and it answers 204 with no body. See Delete.
POST /api/delete_machine/
JSON body: public_id. A machine that is not yours is a 404.
curl -s https://eyalsec.com/api/delete_machine/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"public_id":"3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41"}'
Protected and unprotected
POST /api/machines/{public_id}/power/ sets the machine to protected or unprotected, as the switch on the Machines page and the Python runs page does. It is a write. JSON body: on, true for protected or false for unprotected.
Unprotected, EyalSec stops watching the machine. Within 30 seconds its Python stops checking, blocking and reporting, anything it still sends is discarded, and nothing it runs is billed. Protected, it runs as configured again and its es-python runs are billed from then on. Nothing changes on the host, and asking for the state the machine is already in changes nothing. Setting a machine to protected is a 402 when the account cannot add machines yet; setting one to unprotected never is. A 402 that the Billing page settles carries billing_url, and billing_action names the step. off_reason in the answer is unpaid, spend_limit or paused when the switch is on and the machine stays unprotected until that is settled on the Billing page, and empty otherwise. get_all_machines reports the switch at index 22 (true = unprotected), why the machine is unprotected at index 26, and whether it is protected now at index 27.
curl -s -X POST https://eyalsec.com/api/machines/3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41/power/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"on":false}'
{ "public_id": "3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41", "on": false,
"power_changed_at": "2026-10-31T21:05:00Z", "off_reason": "" }
Notes and history
A machine has one note and a history: comments people wrote and what happened to the machine, newest first. These calls do what the Notes panel on the Machines page does; see Notes and history. A machine that is not yours is a 404 on every one of them.
Set the note
PUT /api/machines/{public_id}/note/ replaces the machine's note. It is a write. JSON body: note, up to 500 characters after trimming; an empty note clears it. Longer is a 422.
curl -s -X PUT https://eyalsec.com/api/machines/3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41/note/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"note":"Payments API, production. Owner: Dana."}'
{ "public_id": "3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41", "note": "Payments API, production. Owner: Dana.",
"note_updated_at": "2026-10-26T09:12:00Z" }
Set the environment
PUT /api/machines/{public_id}/environment/ sets the machine's environment. It is a write. JSON body: environment, one of production, staging, test or development (prod, stage and dev work too); an empty value clears it. Any other value is a 422.
curl -s -X PUT https://eyalsec.com/api/machines/3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41/environment/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"environment":"production"}'
{ "public_id": "3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41", "environment": "production" }
Read the history
GET /api/machines/{public_id}/timeline/ returns the history, newest first, 50 entries at a time (limit takes 1 to 200). It is a read. When there are more, next_before holds an id: pass it as before for the next page. It is empty on the last page.
curl -s "https://eyalsec.com/api/machines/3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41/timeline/?limit=2" \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000"
{
"entries": [
{ "id": 812, "kind": "comment", "code": "", "body": "Reinstalled after the upgrade", "repeats": 1,
"author": "dana", "mine": true, "created_at": "2026-10-26T09:14:00Z", "edited_at": null },
{ "id": 811, "kind": "system", "code": "installed", "body": "Installed, build 2026.10.26", "repeats": 1,
"author": "", "mine": false, "created_at": "2026-10-26T09:10:00Z", "edited_at": null }
],
"next_before": "811"
}
kind is comment for what a person wrote and system for what EyalSec recorded. mine says whether you wrote a comment, and so may edit or delete it. A system entry's code is one of created, renamed, os_set, reset, install_started, installed, install_failed, build_changed, clone_seen, config_changed, note_changed, went_silent, reporting_again, turned_off and turned_on. When the same thing happens again within 10 minutes, the entry is updated instead of repeated, and repeats counts the times.
Add, edit and delete comments
POST /api/machines/{public_id}/timeline/ adds a comment and answers 201 with the new entry. PATCH /api/machines/{public_id}/timeline/{id}/ replaces the text of one of your comments and answers with it, edited_at set. DELETE /api/machines/{public_id}/timeline/{id}/ deletes one of your comments and answers 204 with no body. All three are writes. The JSON body of the first two is body, 1 to 2000 characters after trimming (422 otherwise). System entries cannot be edited or deleted; trying is a 404, like an entry that does not exist.
curl -s https://eyalsec.com/api/machines/3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41/timeline/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"body":"Reinstalled after the upgrade"}'
Get the install command
POST /api/get_eyalsec_install_script_data/ issues a one-time install secret for an es-python machine, the same thing the Machines page does when you ask for the install command. It is a write.
POST /api/get_eyalsec_install_script_data/
JSON body: public_id, and attested, which must be true. attested is your confirmation that you are authorized to monitor that machine, the same box the dashboard asks you to tick (see authorization). Optional renew: true asks for a fresh command only if the machine has not started installing; a machine that is pending, installed or failed is then a 409 and nothing is reset (the Machines page uses this when a shown command expires). Optional install_mode (local, local-python, global or global-python) changes the machine's install mode before the secret is issued; leave it out to keep the mode it has. Optional python_version (auto, or a version such as 3.12) changes the machine's Python the same way; a version with no build for the machine's target is refused. Any other value of either is a 422, and the machine is left as it was.
curl -s https://eyalsec.com/api/get_eyalsec_install_script_data/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"public_id":"3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41","attested":true}'
{ "secret": "<single-use-secret>", "script_path": "https://eyalsec.com/install.sh",
"os_type": "ubuntu_24_04_x86_64", "expires_in": 600,
"install_mode": "local", "needs_root": false, "python_version": "3.13" }
The secret works once and expires after 10 minutes; expires_in is the number of seconds it has left, counted by the server. os_type is auto for a machine whose build is detected at install. install_mode is the machine's install mode, python_version its Python (auto until an install decides it), and needs_root is true for global and global-python, whose command must run with sudo. On the machine, the install command posts it to script_path together with the host facts described in What the command reports; the Machines page shows the exact command to run. Errors: 422 when attested is missing or false or the machine has no OS set, 404 for a machine that is not yours, 403 for a product your account does not have, 402 while billing stops the machine (no card or credit, an ended subscription, the spend limit reached): the error says what to do, and nothing is reset.
Reinstall or update
There is no separate reinstall endpoint: reinstalling is installing again. Call the same endpoint; if the machine is installed, pending or failed, it is first reset to created and then given a fresh secret. See Reinstall.
The reset clears the recorded install time, build and clone identity, and cancels any unused install secrets. The machine's name, public_id, configuration and events are kept. The copy already on the machine keeps reporting until the new install actually starts.
Get the uninstall command
POST /api/get_uninstall_script_data/ issues a one-time secret for removing es-python from a machine, the same command the Machines page shows under Uninstall. It is a write.
POST /api/get_uninstall_script_data/
JSON body: public_id.
curl -s https://eyalsec.com/api/get_uninstall_script_data/ \
-H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"public_id":"3f6c1a52-8e0b-4d2a-9c1e-5b7d2f0a9e41"}'
{ "secret": "<single-use-secret>", "script_path": "https://eyalsec.com/uninstall.sh" }
The secret works once and expires quickly. This is for es-python machines only: the command removes es-python and nothing else, so an es-chromium machine is a 422 (delete the machine instead).
Supported targets
GET /api/supported_os_types/ lists the distributions and architectures you can install es-python on. It is public: it needs no key.
GET /api/supported_os_types/
{ "distros": [ { "id": "ubuntu_24_04", "label": "Ubuntu 24.04 LTS",
"archs": ["x86_64", "aarch64"] } ] }
A machine's os_type is a distro id and an arch joined by _, such as ubuntu_24_04_x86_64.
Python versions
GET /api/supported_python_versions/ lists the Python versions you can pick when adding a machine, and the default. It is public: it needs no key.
GET /api/supported_python_versions/?os=ubuntu_24_04_x86_64
{ "versions": ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"], "default": "3.13" }
Without os it lists every version es-python supports. With os it lists only the versions available for that target, which is what POST /api/add_new_machine/ accepts for it, so always pass os before creating a machine. The default is always one of the listed versions: when the usual default is not available for the target, it is the newest one that is. An unknown os is a 422.