Base URL
https://intentloop.polsia.app/api
Authentication
All API requests require a Bearer token in the Authorization header.
Authorization: Bearer YOUR_TOKEN
Quick Start
// 1. Login
const res = await fetch('/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: 'you@example.com',
password: 'yourpass'
})
});
const { token } = await res.json();
// 2. Execute a task
const execRes = await fetch('/api/executions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
taskInput: 'Research competitors and summarize'
})
});
const { executionId } = await execRes.json();
// 3. Poll for results
const checkResult = async () => {
const r = await fetch(`/api/executions/${executionId}`, {
headers: { 'Authorization': `Bearer ${token}` }
});
const { execution } = await r.json();
if (execution.status === 'completed') {
console.log(execution.result);
console.log(execution.trace); // Full trace
} else {
setTimeout(checkResult, 1000);
}
};
checkResult();
Endpoints
POST /auth/register |
Create account |
POST /auth/login |
Get auth token |
GET /auth/me |
Get current user |
POST /executions |
Create execution |
GET /executions |
List executions |
GET /executions/:id |
Get execution + trace |