import requests
import json

url = "http://localhost:8000/fs-ai-asistant/api/workflow/lawrisk/getPermits"
headers = {'Content-Type': 'application/json'}

try:
    payload = {"region": "2c29ca08-efc6-4e2c-abc2-d73685e0bdd1"}
    response = requests.post(url, json=payload, headers=headers)
    print(f"Status Code: {response.status_code}")
    if response.status_code == 200:
        data = response.json()
        print(f"Number of permits: {len(data.get('permits', []))}")
        if data.get('permits'):
            print("First 3 permits:")
            print(json.dumps(data.get('permits')[:3], indent=2, ensure_ascii=False))
    else:
        print(response.text)
except Exception as e:
    print(f"Error: {e}")
