HTTP API¶
XPARO has three HTTP interfaces. Everything on this page was run against an XPARO server; the responses shown are real.
Address |
Signs in with |
For |
|---|---|---|
|
the secret key or the robot’s credential, in the address |
Robots: get the project sync, send any robot message. |
|
|
Robots: upload recordings. |
|
your XPARO username and password |
Your own scripts: read project data. |
All addresses start with https://xparo.in.
Robot API¶
GET returns the same project sync a robot receives when its WebSocket
connects:
curl https://xparo.in/chatbot_api/<secret-key>/<project-id>/
{"title": "Hospital Delivery Bot", "status": true, "aiml": "...", "custom_aiml": {...},
"maps": "...", "custom_maps": {...}, "Sets": "...", "custom_Sets": {...}, "properties": "...",
"custom_tasks": {...}, "custom_node_files": {...}, "System": ""}
POST takes one JSON message, exactly as it would be sent over the
WebSocket (see Message catalogue), and returns the server’s reply, {} when
there is none. This is how xparo_ros sends its heartbeat:
curl -X POST -H "Content-Type: application/json" \
-d '{"ROBOT_HEARTBEAT": {"device_id": "my-robot-0001"}}' \
https://xparo.in/chatbot_api/<key>/<project-id>/
{}
Things to know:
A handled message answers 201. Errors have their own status and an
{"error": "..."}body:Status
Meaning
400
The body isn’t one JSON object (invalid JSON, a string, an array, an empty body,
ROBOT_HEARTBEATthat isn’t{"device_id": ...}), it holds no robot message (an unknown key, or a dashboard message such asGET_robots_list), orADD_robots_infois missing a field.403
Wrong, frozen or deleted secret key (or robot credential).
404
Unknown project id, or, signed with the secret key, a
ROBOT_HEARTBEATfor adevice_idthat isn’t a robot of this project (it registers withADD_robots_infofirst).405
PUT,PATCHorDELETE.Signed with a robot’s credential,
ROBOT_HEARTBEATis always that robot’s: itsdevice_idisn’t checked, so a wrong one still answers 201. Signed with the secret key, a heartbeat for a robot that signs in with its own credential, or a retired one, answers 201 too but is ignored: it doesn’t keep that robot Online.HTTP is one way: the robot asks, the server answers. Dashboard commands (Run now, terminal, teleop, files…) cannot reach a robot this way; they need the WebSocket (Connection protocol).
Uploading recordings¶
xparo_ros uploads ROS bag files here (see ROS bag recording). The
token is the REST_API_TOKEN the server sends in reply to
ADD_robots_info.
curl -H "Authorization: Token <REST_API_TOKEN>" \
-F "bag_file=@rosbag2_2026_10_06-08_30_00_0.mcap.zstd" \
-F "robot_id=my-robot-0001" \
-F 'data={"note": "test"}' \
https://xparo.in/api/upload_rosbag/
{"status":"success","message":"File rosbag2_2026_10_06-08_30_00_0.mcap.zstd saved","db_id":"9d022794-bec6-48e1-8adf-ef0d0f78a2ff","robot_id":"my-robot-0001"}
robot_id is the robot’s device_id; data is an optional JSON
object stored with the file. The token belongs to the robot it was sent to:
its uploads are always filed under that robot (robot_id in the answer),
whatever robot_id the request names. The file appears in Database →
Sensors.
Status |
Meaning |
|---|---|
201 |
Stored. |
400 |
No |
402 |
The project is out of storage credits. Uploads pause until you top up; existing data is kept. |
403 |
No token ( |
404 |
No robot with that |
Reading project data from a script¶
/get_project_data/-/<project-id>/ lets a script read what the dashboard
shows, signing in with your XPARO username and password (HTTP Basic). It
takes a form field data holding the same JSON the dashboard sends; the
answer is under u → project ID.
import json
import requests
SERVER = "https://xparo.in"
PROJECT_ID = "<your-project-id>"
AUTH = ("<your-username>", "<your-password>")
def ask(key, payload):
data = json.dumps({"p": {PROJECT_ID: {key: payload}}})
reply = requests.post(f"{SERVER}/get_project_data/-/{PROJECT_ID}/",
data={"data": data}, auth=AUTH, timeout=30)
reply.raise_for_status()
return reply.json()["u"][PROJECT_ID]
for task in ask("GET_services", {})["services"]:
print(task["id"], task["title"], task["status"])
history = ask("GET_Task_history_database", {"current_page": 1})["task_history"]
print(history["totalRecords"], "runs saved")
for run in history["records"]:
out = run["fields"]["output_data"]
print(run["fields"]["created_at"], out.get("outcome"), f"{out.get('duration_s', 0):.1f}s")
Output:
3dffb995-298e-4335-a0a9-b38aecc396fa Deliver medicine development
2 runs saved
2026-10-06T02:30:03.340Z failed 0.3s
2026-10-06T02:29:47.379Z success 11.9s
curl -u '<your-username>:<your-password>' \
--data-urlencode 'data={"p": {"<project-id>": {"GET_Task_history_database": {"current_page": 1}}}}' \
https://xparo.in/get_project_data/-/<project-id>/
{"u": {"<project-id>": {"task_history": {"records": [...], "totalRecords": 2,
"currentPage": 1, "pageSize": 10, "columns": ["id", "type", "created_at"]}}}}
GET_services lists the project’s tasks; GET_Task_history_database
returns saved task runs, 10 per page.
Your robots, and which are online:
GET_robots_liveness(payload{}) answers every robot you can see, with whether it is online, whether it can take a run or a command now (is_reachable: online and on a live connection; a robot that only posts over plain HTTP is online but not reachable) and when the server last heard from it:{"u": {"<project-id>": {"robots_liveness": [ {"id": "<robot-id>", "is_online": true, "is_reachable": true, "last_seen": "2026-11-02T10:15:04.120000+00:00"}]}}}GET_robots_list(payload{"current_page": 1}) gives their details, 10 per page, newest first, underrobots:id,unique_id(the device ID),title(its label),hostname,is_online,updated_at,retired_at,locations, the OS, CPU and disk fields fromADD_robots_info,ros_distroandxparo_git_commit.
Both list only the robots your access covers; a Client doesn’t get IP or MAC addresses.
Status |
Meaning |
|---|---|
201 |
Answered (the reply is under |
400 |
|
403 |
No username and password, or a wrong one; you aren’t a member of
that project (any more); or your role doesn’t allow that message
( |
405 |
Anything but |
429 |
Sign-in is paused: the same lock as the sign-in page (see
Security and your data). After 10 wrong
passwords for one account from one network within 15 minutes, that
network is refused for that account until those 15 minutes are up,
even with the right password; and after 20 wrong passwords in total
within 15 minutes from networks the account hasn’t signed in from in
the last 90 days, all such networks are refused the same way
(networks it signed in from in that time keep working). Resetting
your password lifts both at once. Separately,
after 50 wrong passwords from one network within 15 minutes, for any
accounts, that network is refused for every account until those 15
minutes are up; a password reset doesn’t lift that one. The
|
RUN_TASK starts a task, with the same rules as Run now on the
dashboard: you need Edit access to Tasks or Robots (a Viewer gets 403), and
it is sent only to the robots your access covers. The answer says where it
went; the result arrives later in Task history:
curl -u '<your-username>:<your-password>' \
--data-urlencode 'data={"p": {"<project-id>": {"RUN_TASK": {"task_id": "<task-id>"}}}}' \
https://xparo.in/get_project_data/-/<project-id>/
{"run_task": {"ok": true, "task_id": "<task-id>", "sent_to": ["MR-0001"], "offline": [],
"note": "The result is reported by the robot: see Task history, or /xparo/task_result on the robot."}}
An unknown task answers {"run_task": {"ok": false, "error": "Unknown task_id"}}.
To give one run its own values, add override_params: its keys are the
names of the task’s params (the ones under Params in the task form),
and a param you leave out uses its default. Only the RUN_TASK part of the
data above changes:
{"RUN_TASK": {"task_id": "<task-id>", "override_params": {"room": "ward_C_3"}}}
A param reaches the tree through an input mapped From task param to it
(see Tasks (Step 2)). A key that isn’t one of the task’s params is
ignored without an error (the answer is still "ok": true), so check the
spelling against the task form. Values are passed on as you send them, with no
type check.
Cancelling (CANCEL_TASK) needs the dashboard’s live session. On the robot
itself you can also start a task by publishing on
/xparo/run_task.
Reports¶
The PDF report and Excel buttons on the project’s Dashboard page
(/api/download-report/pdf/<project-slug>/ and .../excel/...) need a
signed-in browser session. They are not available to scripts.