REST API Reference
The backend exposes a compact REST API used primarily by the frontend. Run the backend locally to access the interactive OpenAPI docs at /docs.
Endpoints
GET
/api/v1/node_modules/
Returns all available node models (AutoAPMS manifests and native BehaviorTree.CPP nodes).Response: JSON matching the
NodeModelListPydantic model (see backend models for exact schema).Example excerpt:
json{ "nodes": [ { "node_name": "Error", "class_name": "auto_apms_behavior_tree::ThrowException", "description": "Throws an exception to interrupt behavior tree execution", "package": "auto_apms_behavior_tree", "input_ports": [{"name":message","type":"std::string","default":"","has_default":false}] } ] }
POST
/api/v1/upload/xml
Upload a BehaviorTree XML file. The backend validates that the file is an.xmlfile, ensures it can be decoded as UTF-8, and parses it with a safe XML parser.Example curl:
bashcurl -F "file=@my_tree.xml" http://localhost:8000/api/v1/upload/xmlSuccess response:
json<?xml version="1.0"?> <root main_tree_to_execute="MainTree"> <BehaviorTree ID="MainTree"> <Sequence> <Action ID="SaySomething" message="Hello"/> </Sequence> </BehaviorTree> </root>Warning: Uploaded XML files are limited to 1MB. The backend uses
defusedxmlto parse XML safely.
- GET
/health/Health check. Returns{"status": "healthy"}on HTTP 200.
Notes for developers
- The backend exposes OpenAPI at
/openapi.jsonwhich can be used to generate clients or to inspect request/response schemas. You can also use the interactive docs at/docsto explore the API. - See
auto_apms_studio/backend/app/models/nodes.pyfor the fullNodeModel/NodeModelListschema used by the nodes endpoint.