API
GenFarmer API Documentation
Welcome to the GenFarmer API documentation. This guide helps you understand how to interact with the GenFarmer automation system via RESTful APIs.
π§ Overview
GenFarmer provides endpoints to manage Automation Apps, Tasks, and Runs that can be assigned to devices for automation scenarios.
π¦ Base URL
http://127.0.0.1:55554/π Automation APIs
π List Apps
Method:
GETEndpoint:
/automation/apps
cURL Example:
curl -X GET 'http://127.0.0.1:55554/automation/apps?userId=3&page=1&limit=25&order=desc&orderBy=updatedAt'π Get App Details
Method:
GETEndpoint:
/automation/apps/:id
cURL Example:
curl -X GET 'http://127.0.0.1:55554/automation/apps/adoFNVNN6Jwl8FlbZCfni'π§ Update App
Method:
PUTEndpoint:
/automation/apps
cURL Example:
curl -X PUT 'http://127.0.0.1:55554/automation/apps' \
-H 'Content-Type: application/json' \
-d '{"id":"adoFNVNN6Jwl8FlbZCfni","userId":3,"name":"New App","description":"","version":"1.0.0","script":{"flow":{"nodes":[],"edges":[]}}}'β Delete App
Method:
DELETEEndpoint:
/automation/apps
cURL Example:
curl -X DELETE 'http://127.0.0.1:55554/automation/apps' \
-H 'Content-Type: application/json' \
-d '{"ids": ["2ykTiCbEOAYC_5_tR5Wp-"]}'π§Ύ Task APIs
β Create Task
Method:
POSTEndpoint:
/automation/tasks
cURL Example:
curl -X POST 'http://127.0.0.1:55554/automation/tasks' \
-H 'Content-Type: application/json' \
-d '{"appId":"adoFNVNN6Jwl8FlbZCfni","input":[],"userId":3,"name":"test","devices":{"enable":true,"list":[]}}'π List Tasks
Method:
GETEndpoint:
/automation/runs
cURL Example:
curl -X GET 'http://127.0.0.1:55554/automation/runs?userId=3&page=1&limit=25&order=desc&orderBy=createdAt'π Update Task
Method:
PUTEndpoint:
/automation/tasks/:id
cURL Example:
curl -X PUT 'http://127.0.0.1:55554/automation/tasks/uNDVKT_VwhEDuXT3PGUUv' \
-H 'Content-Type: application/json' \
-d '{"id":"uNDVKT_VwhEDuXT3PGUUv","userId":3,"appId":"adoFNVNN6Jwl8FlbZCfni","taskSource":0,"name":"test","input":[],"enableInput":true,"devices":{"enable":true,"list":[{"id":"emulator-5554","serialNo":"00f65a5d","name":"SM-G960N"}]}}'π Assign Devices to Task
Method:
PUTEndpoint:
/automation/tasks/:id/add-devices
cURL Example:
curl -X PUT 'http://127.0.0.1:55554/automation/tasks/uNDVKT_VwhEDuXT3PGUUv/add-devices' \
-H 'Content-Type: application/json' \
-d '{"devices":{"enabled":true,"list":[{"id":"emulator-5554","serialNo":"00f65a5d","name":"SM-G960N"}]}}'π Remove Devices from Task
Method:
PUTEndpoint:
/automation/tasks/:id/remove-devices
π Delete Task
Method:
DELETEEndpoint:
/automation/tasks
cURL Example:
curl -X DELETE 'http://127.0.0.1:55554/automation/tasks' \
-H 'Content-Type: application/json' \
-d '{"ids": ["uNDVKT_VwhEDuXT3PGUUv"]}'π Run APIs
βΆοΈ Create Run
Method:
POSTEndpoint:
/automation/runs
cURL Example:
curl -X POST 'http://127.0.0.1:55554/automation/runs' \
-H 'Content-Type: application/json' \
-d '{"userId":3,"taskId":"uNDVKT_VwhEDuXT3PGUUv","appId":"adoFNVNN6Jwl8FlbZCfni","status":0}'βΆοΈ Execute Run
Method:
PUTEndpoint:
/automation/runs/:id/run
cURL Example:
curl -X PUT 'http://127.0.0.1:55554/automation/runs/xhfjAeUOB5SXC8d5RiK_c/run' \
-H 'Content-Type: application/json' \
-d '{"deviceIds":[]}'π Get Run Output
Method:
GETEndpoint:
/automation/runs/:id/storages
cURL Example:
curl -X GET 'http://127.0.0.1:55554/automation/runs/xhfjAeUOB5SXC8d5RiK_c/storages?page=1&limit=25'π€ Me API
πββοΈ Get Current User
Method:
GETEndpoint:
/backend/auth/me
cURL Example:
curl -X GET 'http://127.0.0.1:55554/backend/auth/me'π Notes
Replace all
:idplaceholders with the actualidof your app, task, or run.The
script.flowfield in Update App allows defining an automation logic visually using nodes and edges.
π₯ Download Postman Collection
π Support
For further help, please contact the GenFarmer support team.
Last updated