Skip to content

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/v1

Authentication

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

CodeMeaning
200Success
201Created
400Bad request
401Not authenticated
403Not authorized
404Not found
422Invalid data
500Server error

Pagination

List endpoints support pagination:

ParameterTypeDefaultDescription
pageint1Page number
sizeint20Items per page
bash
GET /declarations?page=2&size=50

Filters

bash
GET /declarations?search=DEC-2026

Specific Filters

bash
GET /declarations?risk_level=high
GET /alerts?status=open

Rate Limiting

  • 100 requests per minute per IP
  • 1000 requests per hour per user

Available Endpoints

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.

Ministry of Finance - Guinea-Bissau