2026-02-25 12:21:53 +03:30
{
"info" : {
"name" : "Farm AI Assistant" ,
"schema" : "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" ,
2026-03-27 18:18:31 +03:30
"description" : "Farm AI Assistant API. Context, chat send, chat list/create, message history, and chat delete."
2026-02-25 12:21:53 +03:30
} ,
"item" : [
{
"name" : "Get farm context (GET)" ,
"request" : {
"method" : "GET" ,
"header" : [ { "key" : "Content-Type" , "value" : "application/json" } ] ,
"url" : "{{baseUrl}}/api/farm-ai-assistant/context/" ,
2026-03-27 18:18:31 +03:30
"description" : "Returns static farm context for the context bar."
2026-02-25 12:21:53 +03:30
} ,
"response" : [
{
"name" : "Success" ,
"status" : "OK" ,
"code" : 200 ,
"body" : "{\n \"status\": \"success\",\n \"data\": {\n \"soilType\": \"Loamy\",\n \"waterEC\": \"1.2 dS/m\",\n \"selectedCrop\": \"Tomato\",\n \"growthStage\": \"Flowering\",\n \"lastIrrigationStatus\": \"2 days ago\"\n }\n}"
}
]
} ,
{
2026-03-27 18:18:31 +03:30
"name" : "List chats (GET)" ,
"request" : {
"method" : "GET" ,
"header" : [ { "key" : "Content-Type" , "value" : "application/json" } ] ,
"url" : "{{baseUrl}}/api/farm-ai-assistant/chats/" ,
"description" : "Returns only chat id and message count for the current user."
} ,
"response" : [
{
"name" : "Success" ,
"status" : "OK" ,
"code" : 200 ,
"body" : "{\n \"status\": \"success\",\n \"data\": [\n {\n \"id\": \"conv-123\",\n \"message_count\": 4\n },\n {\n \"id\": \"conv-456\",\n \"message_count\": 2\n }\n ]\n}"
}
]
} ,
{
"name" : "Create chat (POST)" ,
2026-02-25 12:21:53 +03:30
"request" : {
"method" : "POST" ,
"header" : [ { "key" : "Content-Type" , "value" : "application/json" } ] ,
"body" : {
"mode" : "raw" ,
2026-03-27 18:18:31 +03:30
"raw" : "{\n \"title\": \"New chat\"\n}"
} ,
"url" : "{{baseUrl}}/api/farm-ai-assistant/chats/" ,
"description" : "Creates a new empty chat for the current user."
} ,
"response" : [
{
"name" : "Created" ,
"status" : "Created" ,
"code" : 201 ,
"body" : "{\n \"status\": \"success\",\n \"data\": {\n \"id\": \"conv-789\",\n \"message_count\": 0\n }\n}"
}
]
} ,
{
"name" : "Get chat messages (GET)" ,
"request" : {
"method" : "GET" ,
"header" : [ { "key" : "Content-Type" , "value" : "application/json" } ] ,
"url" : "{{baseUrl}}/api/farm-ai-assistant/chats/conv-123/messages/" ,
"description" : "Returns all user and assistant messages for one chat."
} ,
"response" : [
{
"name" : "Success" ,
"status" : "OK" ,
"code" : 200 ,
"body" : "{\n \"status\": \"success\",\n \"data\": {\n \"conversation_id\": \"conv-123\",\n \"messages\": [\n {\n \"message_id\": \"msg-user-001\",\n \"conversation_id\": \"conv-123\",\n \"role\": \"user\",\n \"content\": \"What is the best irrigation plan for tomato?\",\n \"sections\": [],\n \"images\": [],\n \"created_at\": \"2025-01-01T08:00:00Z\"\n },\n {\n \"message_id\": \"msg-001\",\n \"conversation_id\": \"conv-123\",\n \"role\": \"assistant\",\n \"content\": \"Here is the recommended plan.\",\n \"sections\": [\n {\n \"type\": \"recommendation\",\n \"title\": \"Irrigation Plan\",\n \"icon\": \"droplet\",\n \"frequency\": \"3 times per week\",\n \"amount\": \"15 liters per plant\",\n \"timing\": \"Early morning\",\n \"expandableExplanation\": \"Loamy soil holds moisture well, so moderate frequency is enough.\"\n }\n ],\n \"images\": [],\n \"created_at\": \"2025-01-01T08:00:05Z\"\n }\n ]\n }\n}"
}
]
} ,
{
"name" : "Send chat message (POST)" ,
"request" : {
"method" : "POST" ,
"header" : [ { "key" : "Content-Type" , "value" : "application/json" } ] ,
"body" : {
"mode" : "raw" ,
"raw" : "{\n \"conversation_id\": \"conv-123\",\n \"content\": \"What is the best irrigation plan for tomato?\",\n \"farm_context\": {\n \"soilType\": \"Loamy\",\n \"waterEC\": \"1.2 dS/m\",\n \"selectedCrop\": \"Tomato\",\n \"growthStage\": \"Flowering\",\n \"lastIrrigationStatus\": \"2 days ago\"\n }\n}"
2026-02-25 12:21:53 +03:30
} ,
"url" : "{{baseUrl}}/api/farm-ai-assistant/chat/" ,
2026-03-27 18:18:31 +03:30
"description" : "Sends a user message and returns a structured assistant reply."
} ,
"response" : [
{
"name" : "Success" ,
"status" : "OK" ,
"code" : 200 ,
"body" : "{\n \"status\": \"success\",\n \"data\": {\n \"message_id\": \"msg-001\",\n \"conversation_id\": \"conv-123\",\n \"content\": \"Here is the recommended plan.\",\n \"sections\": [\n {\n \"type\": \"recommendation\",\n \"title\": \"Irrigation Plan\",\n \"icon\": \"droplet\",\n \"frequency\": \"3 times per week\",\n \"amount\": \"15 liters per plant\",\n \"timing\": \"Early morning\",\n \"expandableExplanation\": \"Loamy soil holds moisture well, so moderate frequency is enough.\"\n },\n {\n \"type\": \"list\",\n \"title\": \"Important Notes\",\n \"icon\": \"leaf\",\n \"items\": [\n \"Avoid watering at noon\",\n \"Check leaf stress every two days\"\n ]\n },\n {\n \"type\": \"warning\",\n \"title\": \"Heat Alert\",\n \"icon\": \"warning\",\n \"content\": \"Increase irrigation if temperature rises above 35°C.\"\n }\n ]\n }\n}"
}
]
} ,
{
"name" : "Delete chat (DELETE)" ,
"request" : {
"method" : "DELETE" ,
"header" : [ { "key" : "Content-Type" , "value" : "application/json" } ] ,
"url" : "{{baseUrl}}/api/farm-ai-assistant/chats/conv-123/" ,
"description" : "Deletes one chat and all messages inside it."
2026-02-25 12:21:53 +03:30
} ,
"response" : [
{
"name" : "Success" ,
"status" : "OK" ,
"code" : 200 ,
2026-03-27 18:18:31 +03:30
"body" : "{\n \"status\": \"success\",\n \"data\": {\n \"conversation_id\": \"conv-123\"\n }\n}"
2026-02-25 12:21:53 +03:30
}
]
}
] ,
"variable" : [ { "key" : "baseUrl" , "value" : "http://localhost:8000" } ]
}