API Reference
The GB-FiscalAI API is a REST API that allows programmatic interaction with the system.
Base URL
https://api.gbfiscalai.srv1164291.hstgr.cloud/api/v1Authentication
All requests (except login) require a JWT token.
Getting a Token
bash
curl -X POST /auth/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin@gbfiscalai.gw&password=admin123"Response
json
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "bearer"
}Using the Token
bash
curl -X GET /endpoint \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."Response Format
Success
json
{
"data": { ... },
"message": "Success"
}Error
json
{
"detail": "Error description"
}Paginated List
json
{
"items": [ ... ],
"total": 100,
"page": 1,
"size": 20,
"pages": 5
}HTTP Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad request |
| 401 | Not authenticated |
| 403 | Not authorized |
| 404 | Not found |
| 422 | Invalid data |
| 500 | Server error |
Pagination
List endpoints support pagination:
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | int | 1 | Page number |
| size | int | 20 | Items per page |
bash
GET /declarations?page=2&size=50Filters
Text Search
bash
GET /declarations?search=DEC-2026Specific Filters
bash
GET /declarations?risk_level=high
GET /alerts?status=openRate Limiting
- 100 requests per minute per IP
- 1000 requests per hour per user
Available Endpoints
- Authentication - Login, token, profile
- Declarations - Declarations CRUD
- Alerts - Alert management
- Importers - Importer list
- Import - CSV/Excel import
SDK & Examples
Python
python
import requests
BASE_URL = "https://api.gbfiscalai.srv1164291.hstgr.cloud/api/v1"
# Login
response = requests.post(
f"{BASE_URL}/auth/login",
data={"username": "admin@gbfiscalai.gw", "password": "admin123"}
)
token = response.json()["access_token"]
# Get declarations
headers = {"Authorization": f"Bearer {token}"}
declarations = requests.get(f"{BASE_URL}/declarations", headers=headers)
print(declarations.json())JavaScript
javascript
const BASE_URL = 'https://api.gbfiscalai.srv1164291.hstgr.cloud/api/v1';
// Login
const loginResponse = await fetch(`${BASE_URL}/auth/login`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: 'username=admin@gbfiscalai.gw&password=admin123'
});
const { access_token } = await loginResponse.json();
// Get declarations
const declarations = await fetch(`${BASE_URL}/declarations`, {
headers: { 'Authorization': `Bearer ${access_token}` }
});
console.log(await declarations.json());Support
For questions about the API, contact the technical team.