{
  "info": {
    "name": "Vaastu Wisdom API",
    "description": "Customer auth, saved Kundlis and the astrology engine (/api/v1/astro/*).\n\n1. Set `base_url` (default http://localhost:8000/api/v1).\n2. Run **Auth > Request OTP**, then **Verify OTP** with the code you receive. The test scripts store `challenge_id` and the bearer `token` automatically.\n3. New customers get a `setup_token` instead; run **Complete profile** to get the normal `token`.\n\nEvery other request uses `{{token}}` as a Bearer token. Responses use the envelope `{success, message, data, errors}`; validation errors return 422. Defaults: timezone Asia/Kolkata, ayanamsa lahiri. All values in the bodies are dummy data (New Delhi, 15 May 1990, 12:00).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:8000/api/v1"
    },
    {
      "key": "token",
      "value": ""
    },
    {
      "key": "setup_token",
      "value": ""
    },
    {
      "key": "challenge_id",
      "value": ""
    },
    {
      "key": "kundli_id",
      "value": "1"
    }
  ],
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Request OTP",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/request-otp",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "request-otp"
              ]
            },
            "description": "Sends a 6-digit OTP to an email address or phone number. Stores `challenge_id` for Verify OTP.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identifier\": \"customer@example.com\",\n  \"device_name\": \"Postman\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const body = pm.response.json();",
                  "if (body.success) { pm.collectionVariables.set('challenge_id', body.data.otp.challenge_id); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Verify OTP",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/verify-otp",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "verify-otp"
              ]
            },
            "description": "Replace `otp` with the code received. Existing customers get `token`; new customers get `setup_token` (`profile_required: true`).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"challenge_id\": \"{{challenge_id}}\",\n  \"otp\": \"123456\",\n  \"device_name\": \"Postman\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const body = pm.response.json();",
                  "if (body.success && body.data && body.data.token) {",
                  "  const key = body.data.profile_required ? 'setup_token' : 'token';",
                  "  pm.collectionVariables.set(key, body.data.token.access_token);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Complete profile",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/complete-profile",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "complete-profile"
              ]
            },
            "description": "New customers only, with the `setup_token`. Send `email` or `phone_number`, whichever was not used to sign in.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"full_name\": \"Aarav Shah\",\n  \"phone_number\": \"+919876543210\",\n  \"birth_date\": \"1990-05-15\",\n  \"birth_time\": \"12:00\",\n  \"place_of_birth\": \"New Delhi\",\n  \"birth_latitude\": 28.6139,\n  \"birth_longitude\": 77.209\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{setup_token}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const body = pm.response.json();",
                  "if (body.success && body.data && body.data.token) {",
                  "  const key = body.data.profile_required ? 'setup_token' : 'token';",
                  "  pm.collectionVariables.set(key, body.data.token.access_token);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Me",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/me",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "me"
              ]
            },
            "description": "The signed-in customer."
          }
        },
        {
          "name": "Logout",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/logout",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "logout"
              ]
            },
            "description": "Revokes the current token only."
          }
        }
      ]
    },
    {
      "name": "Kundlis (saved)",
      "item": [
        {
          "name": "List kundlis",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/kundlis",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "kundlis"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Create kundli",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/kundlis",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "kundlis"
              ]
            },
            "description": "Stores `kundli_id` for the requests below.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"full_name\": \"Aarav Shah\",\n  \"birth_date\": \"1990-05-15\",\n  \"birth_time\": \"12:00\",\n  \"place_of_birth\": \"New Delhi\",\n  \"birth_latitude\": 28.6139,\n  \"birth_longitude\": 77.209\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const body = pm.response.json();",
                  "const kundli = body.data && (body.data.kundli || body.data);",
                  "if (body.success && kundli && kundli.id) { pm.collectionVariables.set('kundli_id', kundli.id); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Show kundli",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/kundlis/{{kundli_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "kundlis",
                "{{kundli_id}}"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Update kundli",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/kundlis/{{kundli_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "kundlis",
                "{{kundli_id}}"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"place_of_birth\": \"Delhi, India\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Kundli chart",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/kundlis/{{kundli_id}}/chart?timezone=Asia/Kolkata&ayanamsa=lahiri",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "kundlis",
                "{{kundli_id}}",
                "chart"
              ],
              "query": [
                {
                  "key": "timezone",
                  "value": "Asia/Kolkata",
                  "description": "IANA timezone, default Asia/Kolkata"
                },
                {
                  "key": "ayanamsa",
                  "value": "lahiri",
                  "description": "see Ayanamsa options"
                }
              ]
            },
            "description": "Full birth chart for a saved Kundli. 422 if the Kundli has no birth date, time or coordinates."
          }
        },
        {
          "name": "Delete kundli",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/kundlis/{{kundli_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "kundlis",
                "{{kundli_id}}"
              ]
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "Astrology",
      "item": [
        {
          "name": "Ayanamsa options",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/astro/ayanamsas",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "astro",
                "ayanamsas"
              ]
            },
            "description": "lahiri, kp_new, kp_old, raman, kp_khullar, sayan, manoj."
          }
        },
        {
          "name": "Kundali (birth chart)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/astro/kundali",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "astro",
                "kundali"
              ]
            },
            "description": "Planets, houses, D1-D60 vargas, Vimshottari dashas, ashtakavarga, Jaimini, friendships, Kalsarpa, drishti. Birth dates 1800-01-01 to 2399-12-31.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"birth_date\": \"1990-05-15\",\n  \"birth_time\": \"12:00\",\n  \"latitude\": 28.6139,\n  \"longitude\": 77.209,\n  \"timezone\": \"Asia/Kolkata\",\n  \"ayanamsa\": \"lahiri\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Kundali PDF report",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/astro/kundali/pdf",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "astro",
                "kundali",
                "pdf"
              ]
            },
            "description": "Returns `application/pdf` (19 pages). Use **Send and Download** to save it.\n\n`lang`: en, hi, ta, bn, ne, zh, ja, es, de, pt, fr, ru, ar, fa, he. `chart_style`: north or south (Tamil is always south). `sex`: Male or Female. Birth dates 1800-03-01 to 2399-12-31.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Aarav Shah\",\n  \"sex\": \"Male\",\n  \"birth_date\": \"1990-05-15\",\n  \"birth_time\": \"12:00\",\n  \"latitude\": 28.6139,\n  \"longitude\": 77.209,\n  \"timezone\": \"Asia/Kolkata\",\n  \"place_name\": \"New Delhi\",\n  \"ayanamsa\": \"lahiri\",\n  \"lang\": \"en\",\n  \"chart_style\": \"north\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Panchang",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/astro/panchang?latitude=28.6139&longitude=77.209&date=2026-10-27&timezone=Asia/Kolkata",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "astro",
                "panchang"
              ],
              "query": [
                {
                  "key": "latitude",
                  "value": "28.6139"
                },
                {
                  "key": "longitude",
                  "value": "77.209"
                },
                {
                  "key": "date",
                  "value": "2026-10-27",
                  "description": "Y-m-d, default today"
                },
                {
                  "key": "timezone",
                  "value": "Asia/Kolkata"
                }
              ]
            },
            "description": "Daily panchang: tithi, nakshatra, yoga, karana, sunrise/sunset, Rahu Kalam, muhurtas, Gowri, Hora, Tyajyam and more."
          }
        },
        {
          "name": "Transits",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/astro/transits?start_date=2026-01-01&end_date=2026-12-31&timezone=Asia/Kolkata&include_signs=true&include_nakshatras=true&include_retrograde=true&include_moon=false&moon_nakshatras=false",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "astro",
                "transits"
              ],
              "query": [
                {
                  "key": "start_date",
                  "value": "2026-01-01"
                },
                {
                  "key": "end_date",
                  "value": "2026-12-31",
                  "description": "at most 1096 days after start"
                },
                {
                  "key": "timezone",
                  "value": "Asia/Kolkata"
                },
                {
                  "key": "include_signs",
                  "value": "true"
                },
                {
                  "key": "include_nakshatras",
                  "value": "true"
                },
                {
                  "key": "include_retrograde",
                  "value": "true"
                },
                {
                  "key": "include_moon",
                  "value": "false"
                },
                {
                  "key": "moon_nakshatras",
                  "value": "false"
                }
              ]
            },
            "description": "Sign and nakshatra ingresses plus retrograde / direct stations. Defaults to one year from today."
          }
        },
        {
          "name": "Muhurta purposes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/astro/muhurta-purposes",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "astro",
                "muhurta-purposes"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Find muhurta",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/astro/muhurta",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "astro",
                "muhurta"
              ]
            },
            "description": "Scores each day 0-100 (at most 120 days). `purpose`: marriage, engagement, griha_pravesh, bhoomi_pujan, property_purchase, vehicle, gold_purchase, business, travel, education, namakarana, annaprashana, medical. `birth_rashi_id` (1-12) and `birth_nakshatra_id` (1-27) are optional.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"purpose\": \"marriage\",\n  \"start_date\": \"2026-11-01\",\n  \"end_date\": \"2026-12-31\",\n  \"latitude\": 28.6139,\n  \"longitude\": 77.209,\n  \"timezone\": \"Asia/Kolkata\",\n  \"birth_rashi_id\": 4,\n  \"birth_nakshatra_id\": 9,\n  \"min_score\": 60,\n  \"limit\": 30\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Festivals",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/astro/festivals?latitude=28.6139&longitude=77.209&year=2026&timezone=Asia/Kolkata",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "astro",
                "festivals"
              ],
              "query": [
                {
                  "key": "latitude",
                  "value": "28.6139"
                },
                {
                  "key": "longitude",
                  "value": "77.209"
                },
                {
                  "key": "year",
                  "value": "2026",
                  "description": "1900-2100, default current year"
                },
                {
                  "key": "timezone",
                  "value": "Asia/Kolkata"
                }
              ]
            },
            "description": "Hindu festival calendar with local timings, puja windows and periods (Navratri, Chaturmas, ...)."
          }
        }
      ]
    }
  ]
}