AIIA Integration API
The AIIA API provides seamless integration between your applications and Odoo ERP.
It supports project management, task tracking, and bidirectional synchronization.
Key Features
- Create and update projects with structured task hierarchies
- Retrieve project data including tasks, status, and hours
- Bidirectional sync for real-time data consistency
- Row-level security integration with Odoo
- Comprehensive audit logging
Authentication
All API requests (except health check) require authentication using an API key.
API Key Header
X-AIIA-API-Key: aiia_your_api_key_here
API Key Format
API keys follow the format: aiia_ followed by 43 alphanumeric characters.
Security Context
Each API response includes a security_context object with:
- API key prefix (for identification)
- User permissions (can_read, can_write, can_create, can_delete)
- Odoo RLS status and user context
Usage Examples
cURL - Create Project
curl -X POST https://demo.pvt.aiia.io/aiia/api/v1/project/push \
-H "Content-Type: application/json" \
-H "X-AIIA-API-Key: aiia_your_key_here" \
-d '{
"correlation_id": "example-001",
"project_name": "My Test Project",
"days": [
{
"name": "Day 1: Planning",
"tasks": [
{"name": "Requirements", "hours": 4, "status": "todo"},
{"name": "Design", "hours": 2, "status": "todo"}
]
}
]
}'
Python - Retrieve Project
import httpx
response = httpx.post(
"https://demo.pvt.aiia.io/aiia/api/v1/project/pull",
headers={
"Content-Type": "application/json",
"X-AIIA-API-Key": "aiia_your_key_here"
},
json={
"correlation_id": "pull-001",
"project_name": "My Test Project"
}
)
result = response.json()["result"]
print(f"Project: {result['data']['project_name']}")
print(f"Tasks: {len(result['data']['days'][0]['tasks'])}")
JavaScript - Sync Project
const response = await fetch(
'https://demo.pvt.aiia.io/aiia/api/v1/project/sync',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-AIIA-API-Key': 'aiia_your_key_here'
},
body: JSON.stringify({
correlation_id: 'sync-001',
project_name: 'My Test Project',
days: [/* ... */]
})
}
);
const { result } = await response.json();
console.log('Push:', result.data.push);
console.log('Pull:', result.data.pull);