The Saturation API makes it easy to bring your projects and budgets into your own apps or workflows. In this guide, youβll grab an API key, make your first request, and start building in just a few minutes.
Base URL
https://api.saturation.io/api/v1- Log into Saturation and open your workspace
- Head to Settings β API Keys
- Click Generate New API Key
- Copy it right away and store it safely (in
.envor your secret manager)
Add your API key to the request headers:
X-API-Key: your-api-key-hereExample (cURL):
curl "https://api.saturation.io/api/v1/projects" \
-H "X-API-Key: $SATURATION_API_KEY"Example (JavaScript):
const API_BASE = 'https://api.saturation.io/api/v1';
const headers = {
'X-API-Key': process.env.SATURATION_API_KEY,
'Content-Type': 'application/json'
};
const list = await fetch(`${API_BASE}/projects`, { headers });
const data = await list.json();
console.log('Projects:', data.projects);π GET /projects returns { projects: Project[] }.
Every project has its own budget. You can:
GET /projects/:projectId/budgetβ fetch the budgetPOST /projects/:projectId/budgetβ add budget linesGET /projects/:projectId/budget/accountsβ list accounts
Example (JavaScript):
const API = 'https://api.saturation.io/api/v1';
const headers = {
'X-API-Key': process.env.SATURATION_API_KEY,
'Content-Type': 'application/json'
};
const projectId = '<your-project-id>';
await fetch(`${API}/projects/${projectId}/budget`, {
method: 'POST',
headers,
body: JSON.stringify({
lines: [
{
type: 'line',
accountId: '1000',
description: 'Paid Social Ads',
phaseData: {
estimate: {
quantity: 1,
rate: 25000
}
}
},
{
type: 'subtotal',
description: 'Campaign Subtotal',
color: 'indigo'
}
]
})
});401 Unauthorizedβ Invalid or missing API key403 Forbiddenβ Workspace access restricted404 Not Foundβ Project or resource not found429 Too Many Requestsβ Slow down; retry after a delay
- Keep your API key safe (server-side only)
- Use a secret manager or
.envfile - Rotate keys regularly
- Use pagination for big lists
- Prefer
idMode='user'for human readable IDs like accounting codes - Always handle non-200 responses
Weβve got you covered. Reach out anytime: support@saturation.io
β¨ Thatβs it! Youβre ready to explore the API and start building.