API and command line
On this page
- Tokens
- Requests and answers
- Errors
- Limits
- Stability
- What's changed since
- Webhooks
- Who you are
- Shifts
- Exceptions
- Hours for a pay period
- ACD time for pay
- People
- Forecasts
- Schedule periods
- Coverage
- Adherence
- The floor now
- Intraday
- Time off
- Time off from your HR system
- Balances from your HR system
- People from your HR system
- Holidays
- Agent states
- Volumes
- AI assistants (MCP)
- On the server
Your own scripts and AI agents can do what you do in Erlangly, with your role: read schedules, forecasts, coverage, adherence and the floor, ask for and decide time off, and send volumes. An ACD, or a script in front of one, sends agent states and volumes with a connection's token. It's JSON over HTTPS, at your Erlangly's address with /api/v1 after it.
curl
curl -H "Authorization: Bearer $ERLANGLY_TOKEN" "$ERLANGLY/api/v1/me"Python
import os
import requests
erlangly = requests.Session()
erlangly.headers["Authorization"] = f"Bearer {os.environ['ERLANGLY_TOKEN']}"
url = os.environ["ERLANGLY"] # like https://wfm.example.com
me = erlangly.get(f"{url}/api/v1/me", timeout=30)
me.raise_for_status()
print(me.json()["name"])C#
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;
var url = Environment.GetEnvironmentVariable("ERLANGLY")!; // like https://wfm.example.com
var token = Environment.GetEnvironmentVariable("ERLANGLY_TOKEN");
var erlangly = new HttpClient { BaseAddress = new Uri(url) };
erlangly.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var me = await erlangly.GetFromJsonAsync<JsonElement>("/api/v1/me");
Console.WriteLine(me.GetProperty("name").GetString());JavaScript
const url = process.env.ERLANGLY // like https://wfm.example.com
const headers = { Authorization: `Bearer ${process.env.ERLANGLY_TOKEN}` }
const answer = await fetch(`${url}/api/v1/me`, { headers })
if (!answer.ok) throw new Error(`Erlangly answered ${answer.status}`)
const me = await answer.json()
console.log(me.name)PowerShell
$headers = @{ Authorization = "Bearer $env:ERLANGLY_TOKEN" }
$me = Invoke-RestMethod "$env:ERLANGLY/api/v1/me" -Headers $headers
$me.nameRust
// Cargo.toml: reqwest = { version = "0.13", features = ["blocking", "json"] }, serde_json = "1"
use serde_json::Value;
use std::env;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let url = env::var("ERLANGLY")?; // like https://wfm.example.com
let token = env::var("ERLANGLY_TOKEN")?;
let erlangly = reqwest::blocking::Client::new();
let answer = erlangly
.get(format!("{url}/api/v1/me"))
.bearer_auth(&token)
.send()?;
let me: Value = answer.error_for_status()?.json()?;
println!("{}", me["name"].as_str().unwrap_or_default());
Ok(())
}The examples read your Erlangly's address and a token from ERLANGLY and ERLANGLY_TOKEN. Python's use Requests (pip install requests); C#'s are a console app's Program.cs (dotnet new console, .NET 8 or later); JavaScript's run on Node.js 18 or later, saved as .mjs files; PowerShell's on PowerShell 7.2 or later; Rust's name the crates they use at the top, for your Cargo.toml.
For whole jobs put together from these endpoints, with examples to run (a nightly HR sync, hours for payroll and billing, and webhooks for building access and chat), see Automating Erlangly.
On this page: tokens, requests and answers, errors, limits, stability, what's changed since, webhooks; the endpoints for who you are, shifts, exceptions, hours for a pay period, ACD time for pay, people, forecasts, schedule periods, coverage, adherence, the floor now, intraday, time off, time off from your HR system, balances from your HR system, people from your HR system, holidays, agent states and volumes; AI assistants; and the server's command.
Tokens
Every request carries a token: Authorization: Bearer and the token. There are three kinds.
A personal token acts as you, with your role. Make one under Your account (your name, bottom left), with the code from your authenticator app if you use two-factor authentication, or else your password (if you must sign in with single sign-on, neither); it's shown once, and starts erl_. When you make it, you choose:
| Choice | What it means |
|---|---|
| Only read, or change things too | A token only reads unless you make it able to change things: anything but GET answers 403 (401 for sending volumes, as for a wrong token). Changing things means asking for and deciding time off, and, for planners and admins, sending volumes, importing from your HR system and sending back its IDs. |
| When it expires | After 30 days, 90 days or a year; 30 days at most when you must sign in with single sign-on. |
| Personal details | Other people's email addresses, ACD IDs, time-off notes and balances, and exceptions' reasons are left out, unless an admin makes the token to include them, for scripts like an HR sync. Your own are always in. A token stops including them once its maker isn't an admin. |
A token stops working when it expires, when you or an admin revoke it (Your account, or Settings → AI agents, where admins see everyone's), when its person can no longer sign in, and when their password is reset. Changing your password under Your account can revoke your tokens too.
What a token changes is in the audit trail under your name, with the token's name.
What each role can reach, as in Erlangly itself (staff means supervisors, planners and admins):
| Endpoints | Agents | Staff |
|---|---|---|
| Who you are | Themselves | Themselves |
| Shifts, exceptions, hours, time off, holidays | Their own | Everyone's |
| A person | Themselves | Anyone |
| People, forecasts, schedule periods, coverage, adherence, the floor, intraday | No | Yes |
| Deciding time off | No | Yes, but never their own |
| Sending volumes | No | Planners and admins |
| Importing time off and balances from your HR system, and sending back its IDs | No | Planners and admins |
| Importing people from your HR system | No | Planners and admins who see all clients |
With several clients, a token sees what its person sees in Erlangly. For a supervisor or planner an admin has limited to some clients, that's only those clients' lines of business, schedules, forecasts and people: another client's record answers 404, as one that doesn't exist does, lists and totals leave it out, and another client's line or client, named in a request, reads as none. A shared person's shifts for other clients and overtime outside a shift for another client's line still name that client and line. They ask for, decide and change someone's time off only for days the person is on one of their clients' lines of business: otherwise deciding or changing it answers 403 and asking for it 422, saying so, and naming no other client.
An integration's token is your organization's, for one of its own systems that should keep working whoever leaves: an HR sync, a payroll export, building access. An admin makes it under Settings → Integrations, after entering their password again, and the code from their authenticator app if they use two-factor authentication (an admin who must sign in with single sign-on signs in to your identity provider again instead, which must say it was within the last 10 minutes: each provider's step); it's shown once, and starts erl_. Every admin is emailed when one is made, changed, renewed or revoked, and a week before it expires.
- It acts as a user of its own, named after the integration, who is a planner but can't sign in. It sees all clients, or only the ones the admin chose, as a planner limited to some clients does. What it changes is in the audit trail under its name, “with the integration”.
- It can use only the endpoints its abilities open, and nothing else, reading included. For now it can read, with or without people's personal details (email addresses, ACD IDs, time-off notes and balances, and exceptions' reasons), and import time off and balances from your HR system, for which the admin gives the HR system's short name, like
workday(time off and balances from your HR system). It keeps that name when it's given a new token. It can also import people from your HR system, joiners and leavers (people from your HR system), if it sees all clients. - It expires after 30 days, 90 days or a year, chosen when it's made. A new token for it, under Settings → Integrations, replaces the old one at once and keeps everything else. It doesn't stop when the admin who made it leaves, nor within 30 days when single sign-on is required. Revoking it stops it at once.
- AI assistants can't use one over MCP. Make a personal token for those.
| Endpoints | An integration's token |
|---|---|
| Who you are, shifts, exceptions, hours, holidays, people and a person, forecasts, schedule periods, coverage, adherence, the floor, intraday, time off | With read |
| Importing time off and balances, applying an import and reading what it did, sending back HR's ID for time off | With import time off and balances |
| Importing people, applying an import and reading what it did | With import people, and all clients |
| Asking for time off, deciding time off, agent states, volumes | No: 403 (401 for agent states and volumes, as for a wrong token) |
Who you are says "integration": true, the token's abilities and its HR system's short name, hr_source (null until it has one), for an integration's token, and "integration": false for the others. The abilities are read, personal_details, import_time_off (time off and balances) and import_people.
A connection's token is for an ACD, or a script in front of one, that sends agent states and volumes. Make it under Settings → Connections → Add a connection → Another ACD, or a script; it's shown once. It can only send those two, and reads nothing.
Requests and answers
- Send what a
POSTcarries as JSON, in UTF-8, withContent-Type: application/json: a body that isn't valid UTF-8 JSON answers400. Answers are JSON. - Dates look like
2026-10-05. Without one, it's today in your organization's time zone. - Times are ISO 8601 with their offset from UTC: a shift's and time off's in the person's time zone, a forecast's in the line of business's, coverage's in its schedule's (the client's), the floor's in your organization's, and intraday's in the line of business's (your organization's for all lines).
- A line of business (
lob) is its code, likeBILLING, or its ID; one that doesn't exist answers400(shifts give none). Volumes take its code or name. People, forecasts, periods and the rest are by ID. - With several clients, two of them can have a line of business with the same code. Then the code alone answers
422, naming the clients: addclient, the client's code, likelob=BILLING&client=ACME, or give the line's ID. A code only one client has needs nothing more, and only the clients your token sees count. - Percentages are 0 to 100.
- The examples here are cut short where you see …
Errors
An error is { "error": "…" }, with an HTTP status that says what went wrong. The message is written for people and may change: go by the status.
| Status | When | For example |
|---|---|---|
400 | A parameter is missing, or isn't what's expected, or the body isn't valid UTF-8 JSON | from must be a date like 2026-10-05; The request body must be JSON |
401 | No token, or it has expired or been revoked | A token is needed, and it mustn't have expired or been revoked: a personal one is made under Your account, an integration's under Settings → Integrations |
403 | Your role can't do that, the token only reads, an integration's token can't use that endpoint, or Erlangly isn't activated on this install yet (agent states and volumes still come in) | Only supervisors, planners and admins can do that; An integration can't use this endpoint |
404 | There's no such record | Not found |
409 | Another request is applying or undoing that import: read how far it got with GET | Another request is applying or undoing it: read where it got to with GET /api/v1/imports/31 |
410 | An after cursor is more than 30 days old, from before Erlangly's data was restored from a backup or an upgrade rolled back, or from before an admin changed the clients the token's user sees, made them an agent or staff, or gave the token personal details or took them away: read everything again | This cursor is more than 30 days old, and changes after it may be gone: … |
413 | Too much at once (limits) | The request is over 2 MB: send smaller batches |
422 | What you sent can't be saved: problems, when it's there, lists why. Or a lob code is more than one client's: add client | The time off wasn't saved |
429 | Too many requests | Too many requests: slow down |
500 | An import stopped partway as it was applied: what it applied stays, and asking for its application again carries on. Otherwise, something went wrong in Erlangly | It stopped at line 502, with 500 rows still to apply. What it applied stays: … |
The two endpoints for a connection's token answer a missing or wrong token (or, for volumes, a personal token that can't send them) with 401, a WWW-Authenticate header and the plain text HTTP Token: Access denied.
Limits
- 600 requests a minute from one address to each endpoint (a list and its records count together), before the token is checked, so wrong tokens count too; then
429until the minute is up, withRetry-After: 60. AI assistants over MCP have 300 a minute for each token. An integration's token also has 600 a minute of its own, across every endpoint. A token also has a limit of its own on the two endpoints a connection uses: 600 requests a minute of agent states for a connection's token, and 60 of volumes for a connection's token or a planner's or admin's personal one. - 2 MB a request. A bigger body is refused before it's read, with
413. That fits the biggest batch either way. - Batches: 500 agent states, and 5,000 volume intervals, a request (
413over that). An import of time off or balances takes up to 5,000 rows, and of people up to 1,000 (422over that). - Date ranges: shifts and intraday 31 days at a time; exceptions, hours, holidays and adherence 62 (
400over that). - Lists: forecasts give the newest 100, and schedule periods the newest 50; narrow them down with their parameters. People and time off give them all, time off from a day on with
since. - Changes: 500 a page with
after, kept 30 days.
Stability
v1 won't break. Changes to it are additions: new endpoints, new fields in answers, and new parameters that are optional. So read answers in a way that ignores fields you don't know. Nothing in v1 is renamed, removed or made to mean something else without being announced first in What's new, as a deprecation, with what to use instead.
What's changed since
A script that keeps another system in step with Erlangly, like a badge system, an HR system or night-shift transport, doesn't need to read whole weeks again to find what changed. Shifts, exceptions, people and time off answer what's changed since it last asked.
- Read everything once, as usual:
/shifts?from=…&to=…or/exceptions?from=…&to=…for the days you keep,/people, or/time_off_requests?include_past=1(on a large floor, from a year back, say, withsince). The answer ends withnext, a cursor taken just before the read. - From then on, ask with
after:/shifts?after=and the cursor answers the shifts that changed since, each as it is now, and inremovedthe IDs of those deleted, or no longer yours to see. Keep the newnextfor the next time. Whilemoreis true, there's another page: ask again with itsnextright away.
GET /api/v1/shifts?after=IjEyMzQuMTc5MTkwNzIwMCI--87f36652b9b7215f2d56219a7ec8156bad0d2c9b75bb671e5c41432ab0b8f6da
{ "shifts": [ { "id": 381, "person": { … }, "lob": { … }, "starts_at": "2026-10-06T10:00:00-03:00", … } ],
"removed": [377], "more": false, "next": "IjEyNDAuMTc5MTkwNzI2MCI--7b6306df80bef52d69ffb57e7a235442b8526a24d57c5f9e10208d61cebdff2b" }
A script that keeps another system in step: the first time it reads the next 31 days, then only what's changed, page by page, and keeps the cursor for its next run. After a 410, or a 400 for its cursor (as after Erlangly was restored without its secret key), it reads everything again: drop from your system what that read no longer has.
curl
# The first time: read the days you keep, and keep the cursor the answer ends with
curl -sf -H "Authorization: Bearer $ERLANGLY_TOKEN" \
"$ERLANGLY/api/v1/shifts?from=2026-11-02&to=2026-12-02" > shifts.json &&
jq -r .next shifts.json > erlangly-cursor.txt
# From then on: what changed since. While "more" is true, ask again with the new cursor straight away
curl -sf -H "Authorization: Bearer $ERLANGLY_TOKEN" \
"$ERLANGLY/api/v1/shifts?after=$(cat erlangly-cursor.txt)" > changes.json &&
jq -r .next changes.json > erlangly-cursor.txtPython
import os
import pathlib
from datetime import date, timedelta
import requests
erlangly = requests.Session()
erlangly.headers["Authorization"] = f"Bearer {os.environ['ERLANGLY_TOKEN']}"
url = os.environ["ERLANGLY"]
saved = pathlib.Path("erlangly-cursor.txt")
today = date.today()
everything = {"from": today.isoformat(), "to": (today + timedelta(days=30)).isoformat()}
def read(params):
answer = erlangly.get(f"{url}/api/v1/shifts", params=params, timeout=60)
# a cursor over 30 days old (410), or Erlangly restored without its secret key (400): read everything again
if "after" in params and answer.status_code in (400, 410):
return None
answer.raise_for_status()
return answer.json()
cursor = saved.read_text().strip() if saved.exists() else None
while True:
page = (read({"after": cursor}) if cursor else None) or read(everything)
for shift in page["shifts"]:
# add or update it in your system, by ID
print("keep", shift["id"], shift["person"]["name"], shift["starts_at"])
for shift_id in page.get("removed", []):
print("remove", shift_id)
cursor = page["next"]
if not page.get("more"):
break
saved.write_text(cursor)C#
using System.Net;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;
var url = Environment.GetEnvironmentVariable("ERLANGLY")!; // like https://wfm.example.com
var token = Environment.GetEnvironmentVariable("ERLANGLY_TOKEN");
var erlangly = new HttpClient { BaseAddress = new Uri(url) };
erlangly.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
const string saved = "erlangly-cursor.txt";
var today = DateOnly.FromDateTime(DateTime.Today);
var everything = $"/api/v1/shifts?from={today:yyyy-MM-dd}&to={today.AddDays(30):yyyy-MM-dd}";
var cursor = File.Exists(saved) ? File.ReadAllText(saved).Trim() : null;
while (true)
{
var changed = cursor is null ? null : await Read($"/api/v1/shifts?after={Uri.EscapeDataString(cursor)}");
var page = changed ?? (await Read(everything))!.Value;
foreach (var shift in page.GetProperty("shifts").EnumerateArray())
// add or update it in your system, by ID
Console.WriteLine($"keep {shift.GetProperty("id")} {shift.GetProperty("starts_at")}");
if (page.TryGetProperty("removed", out var removed))
foreach (var id in removed.EnumerateArray()) Console.WriteLine($"remove {id}");
cursor = page.GetProperty("next").GetString()!;
if (!(page.TryGetProperty("more", out var more) && more.GetBoolean())) break;
}
File.WriteAllText(saved, cursor);
async Task<JsonElement?> Read(string path)
{
using var answer = await erlangly.GetAsync(path);
// A cursor over 30 days old (410), or Erlangly restored without its secret key (400): read everything again
if (path != everything && answer.StatusCode is HttpStatusCode.Gone or HttpStatusCode.BadRequest) return null;
answer.EnsureSuccessStatusCode();
return await answer.Content.ReadFromJsonAsync<JsonElement>();
}JavaScript
import { existsSync, readFileSync, writeFileSync } from "node:fs"
const url = process.env.ERLANGLY
const headers = { Authorization: `Bearer ${process.env.ERLANGLY_TOKEN}` }
const saved = "erlangly-cursor.txt"
const day = (ahead) => { // 2026-11-02, here
const date = new Date(Date.now() + ahead * 86400000)
const two = (n) => String(n).padStart(2, "0")
return `${date.getFullYear()}-${two(date.getMonth() + 1)}-${two(date.getDate())}`
}
const everything = { from: day(0), to: day(30) }
async function read(params) {
const answer = await fetch(`${url}/api/v1/shifts?${new URLSearchParams(params)}`, { headers })
// a cursor over 30 days old (410), or Erlangly restored without its secret key (400): read everything again
if (params.after && [400, 410].includes(answer.status)) return null
if (!answer.ok) throw new Error(`Erlangly answered ${answer.status}`)
return answer.json()
}
let cursor = existsSync(saved) ? readFileSync(saved, "utf8").trim() : null
while (true) {
const page = (cursor ? await read({ after: cursor }) : null) ?? await read(everything)
// add or update each in your system, by ID
for (const shift of page.shifts) console.log("keep", shift.id, shift.starts_at)
for (const id of page.removed ?? []) console.log("remove", id)
cursor = page.next
if (!page.more) break
}
writeFileSync(saved, cursor)PowerShell
$headers = @{ Authorization = "Bearer $env:ERLANGLY_TOKEN" }
$saved = "erlangly-cursor.txt"
$from = (Get-Date).ToString("yyyy-MM-dd")
$to = (Get-Date).AddDays(30).ToString("yyyy-MM-dd")
$everything = "$env:ERLANGLY/api/v1/shifts?from=$from&to=$to"
function Read-Shifts($address) {
$page = Invoke-RestMethod $address -Headers $headers `
-SkipHttpErrorCheck -StatusCodeVariable status
# A cursor over 30 days old (410), or Erlangly restored without its secret key (400): read everything again
if ($address -ne $everything -and $status -in 400, 410) { return $null }
if ($status -ge 400) { throw "Erlangly answered $status" }
$page
}
$cursor = if (Test-Path $saved) { (Get-Content $saved -Raw).Trim() }
do {
$after = if ($cursor) { [uri]::EscapeDataString($cursor) }
$page = if ($after) { Read-Shifts "$env:ERLANGLY/api/v1/shifts?after=$after" }
if (-not $page) { $page = Read-Shifts $everything }
# add or update each in your system, by ID
foreach ($shift in $page.shifts) {
"keep $($shift.id) $($shift.starts_at.ToString("o"))"
}
foreach ($id in $page.removed) { "remove $id" }
$cursor = $page.next
} while ($page.more)
Set-Content $saved $cursorRust
// Cargo.toml: reqwest = { version = "0.13", features = ["blocking", "json", "query"] },
// serde_json = "1", chrono = "0.4"
use reqwest::{StatusCode, blocking::Client};
use serde_json::Value;
use std::{env, fs};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let url = env::var("ERLANGLY")?;
let token = env::var("ERLANGLY_TOKEN")?;
let erlangly = Client::new();
let saved = "erlangly-cursor.txt";
let today = chrono::Local::now().date_naive();
let everything = [
("from", today.to_string()),
("to", (today + chrono::Days::new(30)).to_string()),
];
let read = |query: &[(&str, String)]| -> Result<Option<Value>, reqwest::Error> {
let answer = erlangly
.get(format!("{url}/api/v1/shifts"))
.bearer_auth(&token)
.query(query)
.send()?;
// A cursor over 30 days old (410), or Erlangly restored without its secret key (400):
// read everything again
let cursor_refused = [StatusCode::GONE, StatusCode::BAD_REQUEST].contains(&answer.status());
if query[0].0 == "after" && cursor_refused {
return Ok(None);
}
Ok(Some(answer.error_for_status()?.json()?))
};
let mut cursor = fs::read_to_string(saved)
.ok()
.map(|text| text.trim().to_string());
loop {
let changed = match &cursor {
Some(after) => read(&[("after", after.clone())])?,
None => None,
};
let page = match changed {
Some(page) => page,
None => read(&everything)?.ok_or("Erlangly refused the days")?,
};
for shift in page["shifts"].as_array().into_iter().flatten() {
// add or update it in your system, by ID
println!(
"keep {} {}",
shift["id"],
shift["starts_at"].as_str().unwrap_or_default()
);
}
for id in page["removed"].as_array().into_iter().flatten() {
println!("remove {id}");
}
cursor = page["next"].as_str().map(String::from);
if page["more"] != true {
break;
}
}
if let Some(cursor) = cursor {
fs::write(saved, cursor)?;
}
Ok(())
}- Every change counts, by hand or in bulk: a schedule published, a draft used or taking over from a day, a swap, breaks evened out, a leaver's shifts removed, a schedule period deleted, an exception recorded, decided, changed or removed, time off asked for, decided or imported, a person's details, lines of business, ACD IDs, contract or availability, or the name of their team or site, and renaming a client, a line of business, an activity type or a time-off type, or changing whether a type is paid or counts as absence (what hasn't ended, or ended in the last 31 days). Days gone by too, when someone corrects them.
- So do the changes those make elsewhere. A published shift added, moved or removed changes the time off over it (its
daysandconflicting_shift_ids), and the paid minutes of the person's shift before or after it when overtime runs between them, so those come too. A shift moved to another line of business or client brings its exceptions whosebillablechanges. - So do people's lines, balance names and time zones. A person's
lobsare their lines today, so they come again on the day one starts or ends for them, within the hour after midnight in your organization's time zone, and when a client they work for on all its lines gains or loses a line (the sample data's too), has one switched off or on, or has one moved to another client. Renaming a time-off type brings the people with a balance of it. Times are given in each person's time zone, so a new one, theirs or their site's, brings their shifts, exceptions and time off (what hasn't ended, or ended in the last 31 days). - Settings that aren't records don't come: changing your organization's time zone, or who decides time off (which says whose balances a person's token gets), changes answers without changing any record, so read everything again after one. A person's name on shifts, exceptions and time off is as it is now: a new name comes with
/people, not with each of those. - Only published shifts, as the full read gives: a draft is never in it until it's used. Approving, canceling or changing time off changes the shifts under it (their
under_time_offand minutes), so they come too, as does making a kind of time off paid or unpaid, and an exception over a shift. A shift's breaks and approved exceptions are part of it. - Only approved exceptions, as the full read gives: one that's declined, or waiting for a decision, is in
removed. - A shift swapped to someone else changes for the person it goes to, and is removed for the one it leaves, when an agent reads their own or with
person_id. - Oldest first, 500 changes a page. A record changed more than once comes once, as it is now. Apply what comes by ID: a change made while you read everything comes again after its cursor, rather than being missed, and seeing it twice does no harm.
- A cursor is good for 30 days. An older one answers
410: read everything again, and go on from thenextthat gives. So does one given before Erlangly's data was restored from a backup or an upgrade rolled back, as changes made since the backup may be lost, however many changes come after the restore. Keep it as it's given: it's signed, so one Erlangly didn't give, or that's been changed, answers400. One from 0.8.242, before cursors were signed, answers410: read everything again. So do it on a400after Erlangly's data was restored without its secret key (on a new server, say): every cursor answers400then, as they're signed with that key. - Each endpoint goes on from its own cursors. The
nextof/peopleis for/people: given to another endpoint, it answers400. One an older Erlangly gave goes on from any, as it did. - Personal details: when an admin gives an integration personal details or takes them away, or a person's token stops including them as its maker is no longer an admin, a cursor given before answers
410, as what the answers hold has changed: read everything again, and go on from thenextthat gives. - With
after, shifts and exceptions takeperson_id(staff), and nothing else:from,to,lobandtypeanswer400, as dostatus,include_pastandsincefor time off andstatusfor people. Agents get their own, as always. - With several clients, someone limited to some clients gets changes to those clients' shifts, and to the people, exceptions and time off they see, removals included. Their people's shifts for other clients come only with the days. Someone who stops working for their clients is in
removedfor people, with their exceptions and time off: when the line they worked on there is removed or moved, or the day their staff stop seeing them, 90 days after it ended, within the hour after midnight in your organization's time zone. Someone who starts working for one comes as a change, with their exceptions and time off. When an admin changes the clients the token's user sees, switches them to or from All clients, or changes them from an agent to staff or back, a cursor given before answers410: read everything again, and go on from thenextthat gives.
Webhooks
Instead of asking every few minutes what's changed, a system can be told. An admin adds its address under Settings → Integrations and picks what it's told about; Erlangly then posts an event to it as each change is made, read from the same log as what's changed since. Automating Erlangly has a receiver to start from, for building access.
| Picked as | Events |
|---|---|
| Someone's shifts changed | shifts.changed: one for each person a change touches, whatever it was (a hand edit, a schedule published or withdrawn, a draft taking over, breaks evened out, a swap, time off), with the days it touched. |
| Time off decided or canceled | time_off.decided when it's approved or declined, and time_off.canceled when it's canceled; time_off.changed for any later change, to its days, its kind or a shift under it. HR booking it again, on other days or as another kind, approves it again: it comes as time_off.decided. Time off asked for and not yet decided isn't an event. |
| An exception decided | exception.decided when it's approved or declined, or when an agent reports it, for a kind that counts at once (like sickness on a new install). One that labor law holds for a supervisor even so, as it does an agent's overtime that breaks a rule, is exception.decided when they approve or decline it. exception.changed for any later change, a supervisor noting one that counted included. One waiting for a decision isn't an event. |
| A person added, changed or left | person.added once, when they're added; person.left when their leaving is recorded, or moved to another day, which can be weeks before the day they leave; person.changed for anything else, not leaving after all included. |
POST https://hooks.example.com/erlangly
webhook-id: msg_3_48211_1793260799482117
webhook-timestamp: 1793260800
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
Content-Type: application/json
{"type": "shifts.changed", "person_id": 12, "dates": ["2026-10-27", "2026-10-28"]}
{"type": "time_off.decided", "time_off_request_id": 5, "person_id": 12, "dates": ["2026-11-02"]}
{"type": "exception.decided", "exception_id": 9, "person_id": 12, "dates": ["2026-10-27"]}
{"type": "person.left", "person_id": 12}
- Thin events: each says what happened and to whom, with IDs and dates only, never names, times or notes. Read the rest from the API with an integration's token, so what that token may see is what the system learns. Dates are the days a change touched, in your organization's time zone, as shifts takes
fromandto. Something deleted says"removed": true, with the type it had:time_off.canceled,exception.decidedorperson.left. Something no longer the webhook's to see, as its person stopped working for the webhook's clients, says"removed": truetoo, astime_off.changed,exception.changedorperson.changed. - Its type says what the change did, and each comes once: time off approved, then canceled, comes as
time_off.decided, thentime_off.canceled, even when both go after your system was down. Act on what the API says now. Ignore an event type you don't know: more may come. - Answer within 10 seconds, in one of two ways. Handle the event, then answer with any 2xx, or with a 5xx if you couldn't, to have it sent again, as the guide's receiver does. Or answer 2xx at once and keep the work in a queue of your own, so it isn't lost if your system stops before it's done: an event that was answered isn't sent again. Anything but 2xx, a timeout, a refused connection or a redirect is a failure: redirects aren't followed, and what you answer isn't read, only its status code is kept.
- A failed event is sent again with the same
webhook-id, after 1, 4, 16, 64 and 256 minutes, then every 6 hours, and nothing after it goes until it does. Drop an id you've seen: each is made from the change and when it was made, so no other event is given it, even after Erlangly's data is restored from a backup. Events go one at a time to each address, and mostly in the order the changes were made, but that isn't promised: read the current state from the API rather than relying on the order. - After 3 days of failing, the webhook is turned off and every admin is emailed. Turned back on, it catches up with what changed meanwhile, up to 30 days; after longer it starts from now, so read everything again.
- With several clients, a webhook can be limited to some of them, as an integration's token can, and is told only of their shifts and the people, time off and exceptions their staff see.
- A test: Send a test on the webhook's page posts
{"type": "test", "webhook_id": 3}, signed like the others, and shows what the address answered: 5 a minute to each host and port, however many webhooks send there.
Addresses
- https, to a public address. Erlangly looks the name up as it sends each event, checks every address it has, and connects to the address it checked, with the name for the certificate, so a name can't be pointed somewhere else in between.
- Never the server's own addresses or Erlangly's container's, loopback, link-local, the cloud metadata services (169.254.169.254, and fd00:ec2::254, fd20:ce::254 and 100.100.100.200 even in a range the operator allows) and Azure's host address 168.63.129.16, IPv4 written as IPv6, multicast or reserved addresses, nor an address written as a single number or in octal or hex.
- A private address on your own network, for an internal badge or HR system, only on a server you run, and only in a range its operator allows with
erlangly webhooks allow 10.20.0.0/16(on the server): inside 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10 or fc00::/7, no wider than /16 (/48 for IPv6), never holding the server's own addresses. An admin in Erlangly can't widen it. There, plain http is allowed too, anderlangly webhooks catrusts your internal certificate authority for webhooks, besides the usual ones. Each change is in the audit trail. - No outbound proxy yet: a network that needs one can't send webhooks until there is.
Checking the signature
Each event is signed as Standard Webhooks sign them, so their libraries for most languages check it. The signing secret, whsec_…, is shown once, when the webhook is added. webhook-signature is v1, and the base64 HMAC-SHA256 of the id, the timestamp and the body joined by dots, keyed with the bytes the secret's base64 part decodes to. Check it against the body exactly as it came, and drop an event more than 5 minutes old:
Python
import base64
import hashlib
import hmac
import time
def from_erlangly(secret, headers, body): # body: the request's bytes, exactly as they came
# An old one, sent again by someone else
if abs(time.time() - int(headers["webhook-timestamp"])) > 300:
return False
key = base64.b64decode(secret.removeprefix("whsec_")) # the secret's base64 part, as bytes
signed = f"{headers['webhook-id']}.{headers['webhook-timestamp']}.".encode() + body
expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()) # in base64
return any(hmac.compare_digest(signature.removeprefix("v1,").encode(), expected)
for signature in headers["webhook-signature"].split())C#
using System.Security.Cryptography;
using System.Text;
// body: the request's bytes, exactly as they came
static bool FromErlangly(string secret, string id, string timestamp, string signatures,
byte[] body)
{
// An old one, sent again by someone else
var age = DateTimeOffset.UtcNow.ToUnixTimeSeconds() - long.Parse(timestamp);
if (Math.Abs(age) > 300) return false;
var key = Convert.FromBase64String(secret.Replace("whsec_", "")); // the base64 part, as bytes
var signed = Encoding.UTF8.GetBytes($"{id}.{timestamp}.").Concat(body).ToArray();
var expected = Encoding.ASCII.GetBytes(Convert.ToBase64String(HMACSHA256.HashData(key, signed)));
return signatures.Split(' ').Select(signature => Encoding.ASCII.GetBytes(signature.Replace("v1,", "")))
.Any(given => CryptographicOperations.FixedTimeEquals(given, expected));
}JavaScript
import { createHmac, timingSafeEqual } from "node:crypto"
// body: the request's Buffer, exactly as it came
export function fromErlangly(secret, headers, body) {
const id = headers["webhook-id"], timestamp = headers["webhook-timestamp"]
// An old one, sent again by someone else (or no time at all)
const age = Date.now() / 1000 - Number(timestamp)
if (!(Math.abs(age) <= 300)) return false
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64") // the secret's base64 part, as bytes
const expected = createHmac("sha256", key).update(`${id}.${timestamp}.`).update(body).digest()
return headers["webhook-signature"].split(" ").some((signature) => {
const given = Buffer.from(signature.replace(/^v1,/, ""), "base64")
return given.length === expected.length && timingSafeEqual(given, expected)
})
}PowerShell
# $body: the request's bytes, exactly as they came
function Test-FromErlangly([string] $secret, [hashtable] $headers, [byte[]] $body) {
$timestamp = $headers["webhook-timestamp"]
# An old one, sent again by someone else
$age = [DateTimeOffset]::UtcNow.ToUnixTimeSeconds() - [long] $timestamp
if ([math]::Abs($age) -gt 300) { return $false }
$key = [Convert]::FromBase64String(($secret -replace '^whsec_')) # the base64 part, as bytes
$start = [Text.Encoding]::UTF8.GetBytes("$($headers['webhook-id']).$timestamp.")
$signed = [byte[]] ($start + $body)
$hmac = [Security.Cryptography.HMACSHA256]::HashData($key, $signed)
$expected = [Text.Encoding]::ASCII.GetBytes([Convert]::ToBase64String($hmac))
foreach ($signature in $headers["webhook-signature"] -split " ") {
$given = [Text.Encoding]::ASCII.GetBytes(($signature -replace '^v1,'))
if (Test-SameBytes $given $expected) { return $true }
}
$false
}
# Compares every byte, so how long it takes doesn't tell how much was right
function Test-SameBytes([byte[]] $given, [byte[]] $expected) {
if ($given.Length -ne $expected.Length) { return $false }
$difference = 0
for ($i = 0; $i -lt $given.Length; $i++) {
$difference = $difference -bor ($given[$i] -bxor $expected[$i])
}
$difference -eq 0
}Rust
// Cargo.toml: hmac = "0.13", sha2 = "0.11", base64 = "0.23"
use base64::{Engine, engine::general_purpose::STANDARD};
use hmac::{Hmac, KeyInit, Mac};
use sha2::Sha256;
use std::time::{SystemTime, UNIX_EPOCH};
// body: the request's bytes, exactly as they came
fn from_erlangly(secret: &str, id: &str, timestamp: &str, signatures: &str, body: &[u8]) -> bool {
let now = SystemTime::now()
.duration_since(UNIX_EPOCH)
.map_or(0, |since| since.as_secs() as i64);
// An old one, sent again by someone else
if timestamp
.parse::<i64>()
.map_or(true, |sent| (now - sent).abs() > 300)
{
return false;
}
// The base64 part, as bytes
let Ok(key) = STANDARD.decode(secret.trim_start_matches("whsec_")) else {
return false;
};
signatures
.split(' ')
.filter_map(|signature| STANDARD.decode(signature.trim_start_matches("v1,")).ok())
.any(|given| {
let mut mac = Hmac::<Sha256>::new_from_slice(&key).expect("HMAC takes any key");
mac.update(format!("{id}.{timestamp}.").as_bytes());
mac.update(body);
mac.verify_slice(&given).is_ok() // in constant time
})
}Ruby
require "openssl"
def from_erlangly?(secret, headers, body)
id, timestamp, signatures = headers.values_at("webhook-id", "webhook-timestamp", "webhook-signature")
return false if (Time.now.to_i - timestamp.to_i).abs > 300 # an old one, sent again by someone else
key = secret.delete_prefix("whsec_").unpack1("m0") # the secret's base64 part, as bytes
expected = [ OpenSSL::HMAC.digest("SHA256", key, "#{id}.#{timestamp}.#{body}") ].pack("m0") # in base64
signatures.split.any? { |signature| signature.start_with?("v1,") && OpenSSL.secure_compare(signature.delete_prefix("v1,"), expected) }
endA new secret, made on the webhook's page if the old one may have been seen, is shown once too. For 24 hours the old one signs each event as well, as a second signature in the same header, so change your system over within the day without missing an event. A server restored without its secret key loses webhooks' secrets, as it does the mail and sign-in secrets: the webhook says so, sends nothing, and asks for a new one.
Who you are
GET /api/v1/me: the person the token acts as, and who they are on the roster (person is null for someone who isn't on it). Anyone.
{ "id": 4, "name": "Tanya Graham", "email_address": "tanya@example.com", "role": "agent",
"person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" }, "integration": false }
Shifts
GET /api/v1/shifts: published shifts that start on the days asked for, earliest first, with what's in them: breaks, lunches and the like, and the approved exceptions recorded on them. Agents get their own; staff get everyone's. Each shift names its client: the one it was worked for, which it keeps if its line of business later moves to another client.
Shifts for other clients. Someone limited to some clients also gets shifts_for_other_clients: when the people they see work for a client they don't, as their schedule shows it, so a script knows they aren't free then, and whom to ask. Each gives only the person, its starts_at and ends_at, and the name of its client and lob: no ID, activities, time off or minutes, and the other client's schedule, lines and people stay a 404. They're published shifts that start on the days asked for, one person's with person_id, none with lob, and they don't come with after: read the days again to see them change. Anyone who sees every client has every shift in shifts, and no shifts_for_other_clients.
Time off over a shift. Approved time off lies over the shifts it lands on, and they stay on the schedule: a day wholly off still has its shift. So under_time_off says "whole" when approved time off covers all of a shift, "part" when it covers some, and null when none does, and time_off_ids lists that time off (more than one can lie over a shift). A script counting days or hours worked, like a badge or payroll system, should leave out a shift that's wholly under time off, and count only the rest of one that's partly under it. Approving or canceling time off changes its shifts, so after gives them.
Paid minutes scheduled. paid_minutes_scheduled is the schedule's paid time on a shift: the shift, less its unpaid activities (lunch, say) and the unpaid exceptions in it (late, absent, unpaid sick), with overtime over it, including what runs on before or after it, up to the person's next shift. It's what the schedule planned, for comparing with your time clock, badges or ACD log-ins and to plan by, never hours worked: pay what your own record of hours worked says, as the law where your people work requires.
Time off wins: a minute under approved time off counts as time off, whatever was planned or recorded for it, breaks and meetings included, and is in paid_time_off_minutes or unpaid_time_off_minutes, as its kind is paid or not (Settings → Time off). Each minute counts once. Exceptions count by their times, whichever shift they were recorded on, so publishing a schedule again doesn't change them. Overtime wholly outside a shift, or on a day off, is on no shift: it's in exceptions.
activities are the shift's own: its breaks, lunches and the like, and the approved exceptions recorded on it. An exception recorded on another shift or on none, like overtime running on from the shift before, isn't among them, though its minutes over the shift count in paid_minutes_scheduled: exceptions gives them all. Each activity says whether its kind counts_as_absence, as chosen under Settings → Exceptions, for your own attendance rules, and whether it's billable: whether the client pays for its time, as chosen under Settings → Activities and Settings → Exceptions when it was scheduled or recorded (changing the setting applies to what's scheduled from then on). Your organization's own activities, like internal PCI training, aren't; their time is still on the shift's line of business.
| Parameter | What it is |
|---|---|
from | The first day; today if it's left out. |
to | The last day, at most 30 days after from (31 days in all); from if it's left out. |
person_id | One person's shifts (staff). |
lob | One line of business's shifts (and client, when two clients have its code). |
after | Instead of the days: the shifts changed since a cursor, and those removed (what's changed since). |
GET /api/v1/shifts?from=2026-10-06&to=2026-10-06
{ "shifts": [
{ "id": 381,
"person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" },
"lob": { "id": 2, "code": "BILLING", "name": "Billing" },
"client": { "id": 1, "code": "DEFAULT", "name": "Red Shore Solutions" },
"starts_at": "2026-10-06T09:00:00-03:00", "ends_at": "2026-10-06T17:00:00-03:00",
"under_time_off": null, "time_off_ids": [],
"paid_minutes_scheduled": 330, "paid_time_off_minutes": 0, "unpaid_time_off_minutes": 0,
"activities": [
{ "type": "LUNCH", "name": "Lunch", "starts_at": "2026-10-06T12:00:00-03:00",
"ends_at": "2026-10-06T12:30:00-03:00", "paid": false, "counts_as_absence": false, "billable": true },
{ "type": "SICK", "name": "Sick", "starts_at": "2026-10-06T15:00:00-03:00",
"ends_at": "2026-10-06T17:00:00-03:00", "paid": false, "counts_as_absence": true, "billable": true } ] } ],
"next": "IjEyMzQuMTc5MTkwNzIwMCI--87f36652b9b7215f2d56219a7ec8156bad0d2c9b75bb671e5c41432ab0b8f6da" }
For someone limited to some clients, with Tanya working for another client on Wednesday:
GET /api/v1/shifts?from=2026-10-05&to=2026-10-11
{ "shifts": [ { "id": 381, … } ],
"shifts_for_other_clients": [
{ "person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" },
"client": { "name": "Globex" }, "lob": { "name": "Claims" },
"starts_at": "2026-10-07T09:00:00-03:00", "ends_at": "2026-10-07T17:00:00-03:00" } ],
"next": "…" }
Exceptions
GET /api/v1/exceptions: approved exceptions that start on the days asked for, earliest first: sick, late, absent, overtime, voluntary time off and the rest, as recorded under Exceptions. Agents get their own; staff get everyone's. It's for payroll and attendance scripts, so it includes what shifts can't show: overtime wholly before or after a shift, or on a day off.
shift_idis the published shift it was recorded on, andnullfor one outside a shift, or whose shift has since been removed (republished, say).paid,counts_as_absenceandbillableare as on a shift's activities: whether it's paid, whether its kind counts as absence (Settings → Exceptions), and whether the client pays for its time, as its kind was set when it was recorded.lobandclientare the line of business overtime outside a shift was worked for, and the client that line was for then;nullfor any other exception, whose time is on its shift's line.reasoncan be health information, like why someone was sick, so it's there only for your own, or with personal details.
| Parameter | What it is |
|---|---|
from | The first day; today if it's left out. |
to | The last day, at most 61 days after from (62 days in all, enough for a month or a pay period); from if it's left out. |
person_id | One person's exceptions (staff). |
type | One kind, by its code, like OT or SICK; one that isn't an exception's answers 400. |
after | Instead of the days: the exceptions changed since a cursor, and those removed or no longer approved (what's changed since). |
GET /api/v1/exceptions?from=2026-10-01&to=2026-10-31
{ "exceptions": [
{ "id": 907,
"person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" },
"shift_id": 381, "type": "SICK", "name": "Sick",
"starts_at": "2026-10-06T15:00:00-03:00", "ends_at": "2026-10-06T17:00:00-03:00",
"paid": false, "counts_as_absence": true, "billable": true, "lob": null, "client": null },
{ "id": 915,
"person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" },
"shift_id": null, "type": "OT", "name": "Overtime",
"starts_at": "2026-10-10T09:00:00-03:00", "ends_at": "2026-10-10T13:00:00-03:00",
"paid": true, "counts_as_absence": false, "billable": true,
"lob": { "id": 2, "code": "BILLING", "name": "Billing" },
"client": { "id": 1, "code": "DEFAULT", "name": "Red Shore Solutions" } } ],
"next": "IjEyMzQuMTc5MTkwNzIwMCI--87f36652b9b7215f2d56219a7ec8156bad0d2c9b75bb671e5c41432ab0b8f6da" }
With several clients, someone limited to some clients gets the exceptions of the people they see. Overtime for another client's line is named with that client, as the Exceptions page names it, and an exception on another client's shift has no shift_id for them.
Hours for a pay period
GET /api/v1/hours: each person's minutes for a pay period, as the schedule has them, added up for you: one row a person, by last name. It's for payroll and billing scripts that would otherwise add up every shift and exception themselves. Agents get their own; staff get everyone's they see, or one person's.
Like paid minutes scheduled on shifts, these are what the schedule planned, for comparing with your time clock, badges or ACD log-ins, never hours worked: pay what your own record of hours worked says, as the law where your people work requires.
| Parameter | What it is |
|---|---|
from | The first day, each person's own: midnight to midnight in their time zone. Today, where your organization is, if it's left out. |
to | The last day, at most 61 days after from (62 days in all, enough for a month or a pay period); from if it's left out. |
person_id | One person's hours (staff). Someone you can't see answers no rows, as on shifts. |
days | start (if it's left out): a shift counts whole on the day it starts, as the schedule shows it. split: its minutes count on the day they fall on, split at midnight. |
split | client: a row for each client each person worked for, and one for time no client has. |
| Field | What it is |
|---|---|
paid_minutes_scheduled | The shifts' paid time, as on shifts, with paid overtime outside any shift (on a day off, say). |
overtime_minutes | Overtime, on shifts and outside any, paid or not. It's a part of the other figures, not added to them: paid overtime is also in paid_minutes_scheduled, and unpaid overtime in unpaid_exception_minutes. |
unpaid_exception_minutes | Unpaid exceptions, like late, absent or unpaid sick, and unpaid overtime. |
paid_time_off_minutes, unpaid_time_off_minutes | Approved time off over the shifts, as its kind is paid or not; time_off gives each kind's minutes. |
holiday_minutes | The paid minutes on the person's holidays. |
billable_minutes, not_billable_minutes | The paid minutes the client pays for, and those it doesn't, as each activity or exception was set when it was scheduled or recorded. |
minutes_in_adherence | For scorecards and incentives, not pay: as adherence gives them, rounded down to the minute as there; the other figures are rounded to the nearest minute. |
GET /api/v1/hours?from=2026-10-01&to=2026-10-31
{ "from": "2026-10-01", "to": "2026-10-31", "days": "start", "split": null,
"rows": [
{ "person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" },
"paid_minutes_scheduled": 9480, "overtime_minutes": 240, "unpaid_exception_minutes": 120,
"paid_time_off_minutes": 480, "unpaid_time_off_minutes": 0, "holiday_minutes": 0,
"billable_minutes": 9240, "not_billable_minutes": 240, "minutes_in_adherence": 8486,
"time_off": [ { "type": "VACATION", "name": "Vacation", "paid": true, "minutes": 480 } ] } ] }
How the minutes are counted:
- Days are each person's own, in their time zone, as on shifts and time off, so a period's first day starts at midnight where each person is. By
days=start, a shift that starts on the period's last day counts whole, and one that started the day before the period not at all. Bydays=split, only the minutes inside the period count. - Holiday minutes are those that fall on the holiday's date where the person is, so a shift across midnight is split there, whichever way the days are counted.
- Outside a shift, only overtime counts; any other exception counts only within its shift, as on shifts.
- Only people with time in the period have a row.
- Each row's minutes are rounded once, so they can differ by a minute from adding up each shift's on shifts.
minutes_in_adherencefollows adherence: it's counted by your organization's days and time zone, not the person's, whateverdayssays, and split by client, each interval goes to the client of the shift it fell in.
Split by client, a shift's minutes go to the client it was worked for, and the overtime on it with them. Overtime outside a shift goes to the client of the line of business it names; else to the client of the person's nearest shift that day; else to none. Time off bills nobody, so it's on the row with no client (client is null), last of each person's rows.
Someone limited to some clients gets the people they see, and of them only the time on their clients' shifts and overtime, with the time off over those shifts. Overtime with no client is theirs only for people who work only for their clients, as adherence counts it.
How long it takes: by person, a 62-day period of a 500-person floor answers in about a second. Split by client takes about as long as adherence split by client, plus about half a second, as its minutes in adherence come from that report: a few seconds for a big floor.
ACD time for pay
GET /api/v1/acd_time: the ACD's own record of each person's time, by person and day, for pay scripts on floors that pay from ACD log-ins. Up to 62 days. Agents get their own; staff get everyone's they see, or one person's. It's the ACD's record, never hours worked: whether it's what someone is owed is for your payroll, by the law where they work. Logged-in time isn't all hours worked, and paying employees only for their time on the phones breaks labor law in most places. Erlangly never changes this time: needs_review says what looks wrong, for your own payroll adjustments process.
| Parameter | What it is |
|---|---|
from | The first day, each person's own: midnight to midnight in their time zone. Today, where your organization is, if it's left out. |
to | The last day, at most 61 days after from (62 days in all); from if it's left out. |
person_id | One person's time (staff). Someone you can't see answers no rows. |
days | start (if it's left out): time in an interval that overlaps one of the person's published shifts counts on the day that shift starts; time outside any shift on the calendar day it fell on. split: every minute on the calendar day it fell on. |
| Field | What it is |
|---|---|
logged_in_minutes | Everything except logged off: on_phone_minutes plus break_and_aux_minutes. |
on_phone_minutes | Available, on a contact and after-contact work, as Intraday's on the phones counts it: available_minutes, on_contact_minutes and after_contact_minutes. |
break_and_aux_minutes | Logged in but off the phones: on a break, in an aux code, or logged in with no other state. |
no_data_minutes | Time Erlangly can't account for: time in a status code nobody has mapped, and scheduled time with no state at all, as when a feed stopped. |
paid_minutes_scheduled | What hours gives for this person and day, the same way, to compare with. |
unaccounted_minutes | Paid scheduled time on the phones with no ACD time behind it, for your payroll adjustments process to check: never time someone owes or wasn't working. It covers only time already counted, from calculated_from to calculated_through. Paid meetings and training off the phones don't count. no_data_minutes says why some of it is unaccounted, so the two can overlap. |
needs_review | The reasons this row looks wrong, as a list: long_stretch, logged in for over 16 hours unbroken, at 15-minute precision, on a stretch touching this day (probably a missed log-out); no_data, the row has no_data_minutes, so the figure may be low; unmapped_status, time in a status code nobody has mapped, no data until it's mapped under Settings → Connections, and mapping it corrects the past; unaccounted_time, unaccounted_minutes is 15 or more, while the field always shows the real figure. |
GET /api/v1/acd_time?from=2026-10-01&to=2026-10-15
{ "from": "2026-10-01", "to": "2026-10-15", "days": "start",
"calculated_through": "2026-10-20T13:45:00Z", "calculated_from": "2026-09-01T00:00:00Z",
"rows": [
{ "person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" }, "date": "2026-10-01",
"logged_in_minutes": 482, "on_phone_minutes": 451, "available_minutes": 121, "on_contact_minutes": 300, "after_contact_minutes": 30,
"break_and_aux_minutes": 31, "no_data_minutes": 0, "paid_minutes_scheduled": 450, "unaccounted_minutes": 0, "needs_review": [] } ] }
- Run it a day or two after a pay period ends. States can come in late, and mapping a code corrects the past, so a day just over can still change.
calculated_throughis the last closed interval counted;calculated_fromsays how far back history has been filled in (just after an upgrade it's filled in in the background, newest first). - A row exists for any person and day with ACD time or paid scheduled time, so a whole missed day shows up, with all of it unaccounted. Each figure is whole minutes from that day's exact seconds; logged-in minutes are the sum of the parts, exactly, and a person's days add up to the same minutes with either
days. - Days are each person's own, in their time zone, and a 15-minute interval is the smallest unit: a minute can't be placed more finely than that, so shift premiums that need exact timestamps need your ACD's own report.
- Accuracy depends on the connection: a push feed sends each change, and a connector that polls the ACD can only see changes as often as it polls. An install that only imports interval summaries has no ACD time here: connect the ACD, or send it agent states through the API.
- Someone limited to some clients gets only the days the person is with one of their clients, and
paid_minutes_scheduledandunaccounted_minutescount only their clients' time, as hours does. An integration needs its Read ability, and AI assistants can't use it.
People
GET /api/v1/people: everyone on the roster, by last name (staff). status is active or inactive, to give only those; agent says whether they take contacts; lobs are the codes of their lines of business today, so after gives someone again on the day one starts or ends for them. With personal details, each also has email, and external_ids: their agent ID on each ACD connection, by the connection's source key, shown on its page (its name in lower case with underscores when it was made), like { "genesys_cloud": "4411" }; and their time_off_balances (balances), for those whose time off the token's user decides. With after, those changed since a cursor, and those removed (what's changed since): someone whose balances an import changed is among them.
Leaving: once someone's recorded as leaving, left_on is their first day not working, and keep_schedule_until the last day their schedule is kept to; both are null otherwise. Leaving doesn't change their status: that's active or inactive, as for long leave.
{ "people": [
{ "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham", "status": "active",
"employment_type": "full_time", "agent": true, "left_on": null, "keep_schedule_until": null,
"team": "Team Tulloch", "site": "Charlottetown", "lobs": ["BILLING"] } ],
"next": "IjEyMzQuMTc5MTkwNzIwMCI--87f36652b9b7215f2d56219a7ec8156bad0d2c9b75bb671e5c41432ab0b8f6da" }
GET /api/v1/people/:id: one person in detail: their contracts (weekly and daily hours as decimals in quotes, like "37.5"), their availability (ends_next_day for one that runs past midnight, like 22:00 to 06:00; binding when it's a must, not a preference), and their time off from now on, as in time off. Staff, or the person themselves. With personal details (your own are always in), and for someone whose time off you decide, time_off_balances too: each kind's balance as your HR system reports it, with hours_approved_here_since (balances).
{ "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham", "status": "active",
"employment_type": "full_time", "agent": true, "left_on": null, "keep_schedule_until": null,
"team": "Team Tulloch", "site": "Charlottetown", "time_zone": "America/Halifax", "lobs": ["BILLING"],
"contracts": [ { "starts_on": "2026-01-01", "ends_on": null, "min_weekly_hours": "37.5",
"max_weekly_hours": "40.0", "max_daily_hours": null, "days_per_week": 5,
"consecutive_days_off": null } ],
"availability": [ { "day": "Monday", "from": "08:00", "to": "16:00", "ends_next_day": false,
"binding": false, "starts_on": null, "ends_on": null } ],
"time_off": [] }
Forecasts
GET /api/v1/forecasts: forecasts, the latest first, at most 100 (staff). Narrow them down with lob, date (those covering that day) and status (draft, published or archived).
GET /api/v1/forecasts?lob=BILLING&date=2026-10-06
{ "forecasts": [
{ "id": 7, "name": "Billing October", "status": "published", "starts_on": "2026-10-05",
"ends_on": "2026-10-11", "lob": { "id": 2, "code": "BILLING", "name": "Billing" } } ] }
GET /api/v1/forecasts/:id: one day of a forecast, interval by interval: date is the day, its first day if it's left out (400 outside the forecast).
Each interval has the contacts and handle time forecast, the agents needed on the phone and with shrinkage, and the service level and occupancy they give where the line's way of planning works them out (email and tickets have no service level). Agents are null where there's no handle time to work them out from, or where they'd be more than 100,000 at once.
contacts_waitingis for email and tickets planned to a response time within opening hours: what's still waiting at the end of the interval (null otherwise).agents_from_clientis true where the agents needed are the client's own figure, imported with the forecast, rather than worked out from contacts: there,contactsandaht_secondsare null unless the client gave them, and service level and occupancy are null.
GET /api/v1/forecasts/7?date=2026-10-06
{ "id": 7, "name": "Billing October", "status": "published", "starts_on": "2026-10-05",
"ends_on": "2026-10-11", "lob": { "id": 2, "code": "BILLING", "name": "Billing" },
"date": "2026-10-06",
"intervals": [
{ "starts_at": "2026-10-06T10:00:00-03:00", "contacts": 40.0, "aht_seconds": 300,
"agents_on_phone": 17.0, "agents_with_shrinkage": 21.3, "agents_from_client": false,
"service_level": 80.0, "occupancy": 78.344, "contacts_waiting": null } ] }
Schedule periods
GET /api/v1/schedule_periods: schedule periods, the latest first, at most 50 (staff); date gives those covering that day. GET /api/v1/schedule_periods/:id gives one.
Each has its drafts (discarded ones left out) and which of them is the schedule (schedule_draft_id, null until one is). A draft's generation is pending, running, complete or failed. Once it's generated, it has its coverage: the hours needed, those not met and those over, its shifts and the agents in them. With nothing needed (no published forecast for its days, or one without handle time), coverage_pct is null and note says why.
{ "schedule_periods": [
{ "id": 3, "name": "October", "status": "published", "starts_on": "2026-10-05",
"ends_on": "2026-10-11", "client": "Red Shore Solutions", "schedule_draft_id": 9,
"drafts": [
{ "id": 9, "label": "Draft 9", "status": "promoted", "generation": "complete",
"coverage_pct": 96.5, "required_hours": 1680.0, "unmet_hours": 58.5, "over_hours": 12.0,
"shifts": 214, "agents_scheduled": 43 } ] } ] }
Coverage
GET /api/v1/coverage: a day's agents needed and scheduled every 15 minutes, as on the schedule's page (staff). For each schedule period covering the day, it gives its schedule, or its latest draft before there's one. The day runs from 06:00 to 22:00, earlier or later to fit the shifts and what's needed, and the whole day once a shift crosses midnight.
| Parameter | What it is |
|---|---|
date | The day; today if it's left out. |
lob | One line of business, and only its client's periods (and client, when two clients have its code). |
draft_id | A draft instead of the schedule. |
Each interval's state is under (fewer than 90% of the agents needed), short (90% to 100%), ok, over (more than 125%, or anyone scheduled when nobody's needed) or none (nobody needed and nobody scheduled).
GET /api/v1/coverage?date=2026-10-06&lob=BILLING
{ "date": "2026-10-06", "lob": "BILLING",
"schedules": [
{ "schedule_period": { "id": 3, "name": "October", "status": "published" },
"draft": { "id": 9, "label": "Draft 9", "status": "promoted" },
"intervals": [
{ "starts_at": "2026-10-06T06:00:00-03:00", "agents_needed": 4.0, "agents_scheduled": 3, "state": "under" },
{ "starts_at": "2026-10-06T06:15:00-03:00", "agents_needed": 4.0, "agents_scheduled": 4, "state": "ok" } ] } ] }
Adherence
GET /api/v1/adherence: how closely people followed the published schedule, by person, team, line of business or client, lowest first, with the total (staff). Each interval counts for the line of business of the published shift it fell in, and so for that line's client. Overtime outside a shift that names a line of business counts for that line, and for the client the line had when the overtime was put on it, as a shift keeps the client it was worked for; where a shift is published over it later, the shift's line wins.
| Parameter | What it is |
|---|---|
from, to | The days, 62 at most: a month's invoice or a pay period in one call. |
by | person (if it's left out), team, lob or client. |
split | With by=person or by=team: client or lob gives a row for each client (or line of business) a person or team worked on, and one for their time outside a shift. |
client | Only the time on that client's lines of business, by its code or ID (with lob, the client whose line it is). |
lob | Only the time on that line of business, by its code or ID. |
team, person_id | Only that team's people, or that person, by ID. |
Each row names who or what it's for, with its ID, as names can repeat; that's null for people with no team, or time outside a shift. Rows by line of business, by client and split rows name their client too; on an install with one client, it's the same on every row. Split rows come by name, each person's or team's together.
scheduled_minutes,in_adherence_minutes,out_of_adherence_minutesandunknown_minutes(no data from the ACD): all the scheduled time, breaks, meetings and training included.productive_scheduled_minutesandproductive_in_adherence_minutes: the same over the time scheduled on the phones, as each kind of activity says. Nesting is off the phones on a new install, as it mostly is; an older install keeps it on the phones until you change it (how). They'renullwhere any of the time was scored before 0.8.121, which didn't keep them, rather than a smaller number.approximateistruewhere some of the time was worked out from your ACD's summaries of each interval rather than each change of state.absences, by person: how many approved exceptions and time off of kinds that count as absence the person had on those days. Split, it's on each person's first row andnullon the rest, so adding them up counts each once; the total has them all.
GET /api/v1/adherence?from=2026-10-01&to=2026-10-31&by=person&split=client
{ "from": "2026-10-01", "to": "2026-10-31", "by": "person", "split": "client",
"total": { "name": "Everyone", "adherence_pct": 91.2, "scheduled_minutes": 25200,
"in_adherence_minutes": 22982, "out_of_adherence_minutes": 2218, "unknown_minutes": 0,
"productive_scheduled_minutes": 21300, "productive_in_adherence_minutes": 19650,
"approximate": false, "absences": 3 },
"rows": [
{ "name": "Tanya Graham", "adherence_pct": 88.4, "scheduled_minutes": 9600,
"in_adherence_minutes": 8486, "out_of_adherence_minutes": 1114, "unknown_minutes": 0,
"productive_scheduled_minutes": 8160, "productive_in_adherence_minutes": 7190,
"approximate": false,
"person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" }, "absences": 1,
"client": { "id": 2, "code": "ACME", "name": "Acme" } } ] }
Which minutes a client is billed for, or an agent paid for, is for your contract to say, not Erlangly: scheduled time, productive time, or the time in adherence. Each row gives them all, and the time with no ACD data apart, for your script to choose. Someone limited to some clients gets only the time on their clients' lines, and by=client lists only those clients.
The floor now
GET /api/v1/floor: the wallboard as it is now: who's in which state and for how long, what their schedule says, and who's out of adherence (staff). Give lob, team (a team's ID; the answer names it) or only_out=true to narrow it down.
states counts everyone shown by their state's code (OFFLINE for someone scheduled but logged off, UNKNOWN for a code not mapped yet); each agent's state is in words. Their alarm is warning or danger once they've been in after-call work, a break or lunch longer than its alarm time, null otherwise.
{ "at": "2026-10-06T12:03:00-03:00", "lob": null, "team": null,
"logged_in": 38, "scheduled_now": 40, "out_of_adherence": 3, "adherence_pct": 92.5,
"states": { "ON_CALL": 29, "AVAILABLE": 6, "BREAK": 3, "OFFLINE": 2 },
"agents": [
{ "person_id": 12, "name": "Tanya Graham", "state": "Break", "minutes_in_state": 3,
"scheduled": "break", "out_of_adherence": false, "alarm": null } ] }
Intraday
GET /api/v1/intraday: how the floor did against the plan, as on the Intraday page (staff): the forecast against the contacts that came, handle time and abandons, and agents needed, scheduled and on the phones, with their occupancy. For one line of business (lob), or all of them if it's left out, over from to to, 31 days at most.
It gives a summary, each of the days, and every interval with anything in it, at its local time with the offset (the line of business's, or your organization's for all lines); agent figures there are agent hours, and an interval also has its agents on average. actual_contacts_to is when the latest contacts that came in end.
Where your ACD sends contacts answered, answered and answer_rate_pct (answered, of the contacts offered) show them; where it sends contacts answered in target too, service_level_pct is the measured service level, on the basis the line's service target counts (the contacts offered, the contacts answered, or the contacts offered less short abandons), and service_level_target_pct is the target, weighted the same way. answered_in_target and service_level_contacts are what it's worked out from: the contacts answered within the target time, and the contacts it's out of; add them up over a client's lines for that client's service level.
Where there's no measured service level, expected_service_level_pct is what Erlang C expects from the contacts that came, their handle time and the agents on the phones; it's null where a measured one exists, and for lines not planned with Erlang C (chat, email and tickets). Each is null where nothing was sent.
Over the time people were scheduled on the phones, agent_hours_in_adherence and agent_hours_out_of_adherence are the hours in and out of adherence, and adherence_pct the share in; an interval also has agents_in_adherence and agents_out_of_adherence, on average. They're null where nobody was scheduled on the phones, and for intervals scored before 0.8.121.
agent_hours_needed_with_shrinkage (and an interval's agents_needed_with_shrinkage) is needed grossed up by the line's shrinkage plan; shrinkage_plan_pct is that plan, and shrinkage_actual_pct the paid time (shifts, less breaks and lunches) that wasn't productive in adherence, null where adherence isn't known.
Where the line's contract measures line adherence, line_adherence_pct is productive as a share of needed productive, and line_adherence_intervals_passed_pct the share of measured intervals that passed; both are null otherwise.
GET /api/v1/intraday?from=2026-10-06&lob=BILLING
{ "from": "2026-10-06", "to": "2026-10-06", "lob": "BILLING", "interval_minutes": 15,
"actual_contacts_to": "2026-10-06T18:00:00-03:00",
"summary": { "contacts_forecast": 2140.0, "contacts": 2203, "aht_seconds_forecast": 305,
"aht_seconds": 311, "abandons": 41, "answered": 2162, "answer_rate_pct": 98.1,
"service_level_pct": 82.4, "service_level_target_pct": 80.0, "agent_hours_needed": 182.5,
"agent_hours_scheduled": 190.0, "agent_hours_on_phones": 176.3, "occupancy_pct": 81.2,
"agent_hours_in_adherence": 168.4, "agent_hours_out_of_adherence": 14.1, "adherence_pct": 92.3,
"agent_hours_needed_with_shrinkage": 222.6, "shrinkage_plan_pct": 18.0, "shrinkage_actual_pct": 21.4 },
"days": [ { "date": "2026-10-06", "contacts_forecast": 2140.0, "contacts": 2203, … } ],
"intervals": [
{ "starts_at": "2026-10-06T09:00:00-03:00", "contacts_forecast": 52.0, "contacts": 55,
"aht_seconds_forecast": 300, "aht_seconds": 296, "abandons": 1, "answered": 54,
"answer_rate_pct": 98.2, "service_level_pct": 79.6, "service_level_target_pct": 80.0,
"agent_hours_needed": 5.6, "agent_hours_scheduled": 6.0, "agent_hours_on_phones": 5.5,
"occupancy_pct": 82.0, "agents_needed": 22.4, "agents_scheduled": 24.0,
"agents_on_phones": 22.0, "agent_hours_in_adherence": 5.3, "agent_hours_out_of_adherence": 0.4,
"adherence_pct": 93.0, "agents_in_adherence": 21.2, "agents_out_of_adherence": 1.6,
"agent_hours_needed_with_shrinkage": 6.8, "agents_needed_with_shrinkage": 27.3,
"shrinkage_plan_pct": 18.0, "shrinkage_actual_pct": 19.8 } ] }
Time off
GET /api/v1/time_off_requests: time off that hasn't ended yet, earliest first. Agents get their own; staff get everyone's. status is submitted (waiting for a decision), approved, rejected or cancelled, to give only those. note and review_note are there for your own, or with personal details. paid says whether its kind is paid, as Settings → Time off shows. counts_as_absence says whether its kind counts as absence, as chosen under Settings → Time off, for your own attendance rules. With after, those changed since a cursor, past or to come, and those removed (what's changed since).
Time off that has ended. include_past=1 (or true) gives what has ended too: all of it, however much there is, in one answer; 0 or false is the same as leaving it out. since, a date like 2025-11-01, gives what ends on that day or later, ended or not, the day in your organization's time zone: on a large floor, a sync's first read can go back a year, say, rather than to the start, as the nightly HR sync does. With include_past, since says how far back.
Conflicting shifts. conflicting_shift_ids are the published shifts it covers, the ones its days count, while it's waiting or approved. A shift on a schedule that isn't published yet isn't among them, as shifts doesn't give it. For someone limited to some clients, they're the shifts on those clients' schedules, and conflicting_shifts_for_other_clients says how many more it covers for other clients.
For your HR system. type_name is its kind's name in Erlangly; what your HR system calls each kind is set under Settings → Time off, and an import can name it so, in hr_type (balances). hr_reference and hr_source are your HR system's ID for it and that system's short name, once it came from there or its ID was sent back (time off from your HR system), else null. Time off an import adds, changes or cancels comes with after as any change does.
Minutes on each day. days says how many minutes time off counts on each day: the published shift it covers, on the day that shift starts in the person's time zone (a night shift is the day it began). A day off under it, or a day with no shift published, counts nothing and isn't listed, so time off approved after a schedule is published, on a day with no shift, has none. It's there while it's waiting (what it would count if approved) or approved, and empty once declined or canceled. Someone limited to some clients gets only their clients' shifts here. Balances are your HR system's, and Erlangly shows them as it reports them (balances).
{ "time_off_requests": [
{ "id": 51, "status": "submitted", "all_day": true, "note": "Visit", "review_note": null,
"person": { "id": 12, "employee_number": "RS-1001", "name": "Tanya Graham" },
"type": "VACATION", "type_name": "Vacation", "hr_reference": null, "hr_source": null,
"paid": true, "counts_as_absence": false, "starts_at": "2026-10-12T00:00:00-03:00", "ends_at": "2026-10-14T00:00:00-03:00",
"description": "Vacation, Mon, Oct 12 to Tue, Oct 13, 2026",
"days": [ { "date": "2026-10-12", "minutes": 480 }, { "date": "2026-10-13", "minutes": 480 } ], "conflicting_shift_ids": [ 402, 403 ] } ],
"next": "IjEyMzQuMTc5MTkwNzIwMCI--87f36652b9b7215f2d56219a7ec8156bad0d2c9b75bb671e5c41432ab0b8f6da" }
Two spellings. Canceled time off has the status cancelled, as v1 has always spelled it, and status=cancelled asks for it (status=canceled matches nothing). Everywhere else it's canceled: an import's action and counts, and the webhook event time_off.canceled. A row sent to an import can have either spelling in its status.
POST /api/v1/time_off_requests: ask for time off, with a token that can change things. It answers 201 with the request, as { "time_off_request": { … } }.
| Parameter | What it is |
|---|---|
type | The kind of time off, by its code, like VACATION. A wrong one answers 422, listing the codes there are. |
first_day | The first day off (needed). |
last_day | The last day off; first_day if it's left out. |
from, to | Times like 13:00, for part of a day: from from on the first day to to on the last. Without both, it's whole days. |
note | For whoever decides it. |
person_id | Staff: enter it for someone else, approved at once where you decide their time off (never your own); otherwise it waits like any request. |
POST /api/v1/time_off_requests
{ "type": "VACATION", "first_day": "2026-10-12", "last_day": "2026-10-13", "note": "Visit" }
201 { "time_off_request": { "id": 52, "status": "submitted", … } }
POST /api/v1/time_off_requests
{ "type": "HOLIDAY", "first_day": "2026-10-12" }
422 { "error": "The time off wasn't saved", "problems": ["type must be one of VACATION, PERSONAL, SICK, …"] }
Asking for it from a script, with a token that can change things:
curl
curl -X POST "$ERLANGLY/api/v1/time_off_requests" \
-H "Authorization: Bearer $ERLANGLY_TOKEN" -H "Content-Type: application/json" \
-d '{ "type": "VACATION", "first_day": "2026-11-16", "last_day": "2026-11-17", "note": "Visit" }'Python
import os
import requests
erlangly = requests.Session()
erlangly.headers["Authorization"] = f"Bearer {os.environ['ERLANGLY_TOKEN']}"
url = os.environ["ERLANGLY"]
asked = {"type": "VACATION", "first_day": "2026-11-16", "last_day": "2026-11-17", "note": "Visit"}
answer = erlangly.post(f"{url}/api/v1/time_off_requests", json=asked, timeout=30)
if answer.status_code == 422: # not saved, and why
refused = answer.json()
print("Not saved:", "; ".join(refused.get("problems") or [refused["error"]]))
else:
answer.raise_for_status()
print("Asked for:", answer.json()["time_off_request"]["id"])C#
using System.Net;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;
var url = Environment.GetEnvironmentVariable("ERLANGLY")!; // like https://wfm.example.com
var token = Environment.GetEnvironmentVariable("ERLANGLY_TOKEN");
var erlangly = new HttpClient { BaseAddress = new Uri(url) };
erlangly.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var asked = new { type = "VACATION", first_day = "2026-11-16", last_day = "2026-11-17",
note = "Visit" };
using var answer = await erlangly.PostAsJsonAsync("/api/v1/time_off_requests", asked);
if (answer.StatusCode == HttpStatusCode.UnprocessableEntity) // not saved, and why
{
var refused = await answer.Content.ReadFromJsonAsync<JsonElement>();
var why = refused.TryGetProperty("problems", out var problems)
? string.Join("; ", problems.EnumerateArray().Select(p => p.GetString()))
: refused.GetProperty("error").GetString();
Console.WriteLine("Not saved: " + why);
}
else
{
answer.EnsureSuccessStatusCode();
var saved = await answer.Content.ReadFromJsonAsync<JsonElement>();
Console.WriteLine($"Asked for: {saved.GetProperty("time_off_request").GetProperty("id")}");
}JavaScript
const url = process.env.ERLANGLY
const headers = { Authorization: `Bearer ${process.env.ERLANGLY_TOKEN}`, "Content-Type": "application/json" }
const asked = { type: "VACATION", first_day: "2026-11-16", last_day: "2026-11-17", note: "Visit" }
const answer = await fetch(`${url}/api/v1/time_off_requests`,
{ method: "POST", headers, body: JSON.stringify(asked) })
if (answer.status === 422) { // not saved, and why
const { problems, error } = await answer.json()
console.log("Not saved:", (problems ?? [error]).join("; "))
} else {
if (!answer.ok) throw new Error(`Erlangly answered ${answer.status}`)
const { time_off_request } = await answer.json()
console.log("Asked for:", time_off_request.id)
}PowerShell
$headers = @{ Authorization = "Bearer $env:ERLANGLY_TOKEN" }
$asked = @{ type = "VACATION"; first_day = "2026-11-16"; last_day = "2026-11-17"; note = "Visit" }
$answer = Invoke-RestMethod "$env:ERLANGLY/api/v1/time_off_requests" -Method Post `
-Headers $headers -ContentType "application/json" -Body ($asked | ConvertTo-Json) `
-SkipHttpErrorCheck -StatusCodeVariable status
# 422: not saved, and why
if ($status -eq 422) {
$why = if ($answer.problems) { $answer.problems -join "; " } else { $answer.error }
"Not saved: $why"
}
elseif ($status -ge 400) { throw "Erlangly answered $status" }
else { "Asked for: $($answer.time_off_request.id)" }Rust
// Cargo.toml: reqwest = { version = "0.13", features = ["blocking", "json"] }, serde_json = "1"
use reqwest::{StatusCode, blocking::Client};
use serde_json::{Value, json};
use std::env;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let url = env::var("ERLANGLY")?;
let token = env::var("ERLANGLY_TOKEN")?;
let asked = json!({
"type": "VACATION", "first_day": "2026-11-16", "last_day": "2026-11-17", "note": "Visit"
});
let answer = Client::new()
.post(format!("{url}/api/v1/time_off_requests"))
.bearer_auth(&token)
.json(&asked)
.send()?;
if answer.status() == StatusCode::UNPROCESSABLE_ENTITY {
// not saved, and why
let refused: Value = answer.json()?;
let problems: Vec<&str> = refused["problems"]
.as_array()
.into_iter()
.flatten()
.filter_map(Value::as_str)
.collect();
let why = if problems.is_empty() {
refused["error"].as_str().unwrap_or_default().to_string()
} else {
problems.join("; ")
};
println!("Not saved: {why}");
} else {
let saved: Value = answer.error_for_status()?.json()?;
println!("Asked for: {}", saved["time_off_request"]["id"]);
}
Ok(())
}POST /api/v1/time_off_requests/:id/approval and /rejection, with an optional note: decide a request that's waiting (staff, with a token that can change things). It answers with the request. Your own answers 403, as does one you don't decide where an admin leaves time off to team leads or planners (Settings → Organization); the error says who decides it. One that isn't waiting answers 404.
Time off from your HR system
Leave booked in your HR system comes in as the time-off import page takes a spreadsheet: sent and previewed, then applied, then read back. Use an integration's token that can import time off, or the personal token of a planner or admin, made to change things. AI assistants can't import. Each row carries your HR system's own ID for the leave, its hr_reference, so sending the same rows again is always safe:
- The same reference again changes that time off to match: its kind, its days or times, its note. Sent with
"status": "canceled", it cancels it. - References are your HR system's, under its short name, the
hr_source: an integration's is the one an admin gave it under Settings → Integrations, and its rows can't name another; a personal token's rows name it inhr_source, or the request insource. A row with a reference but no source is refused, as it could never be matched again. - Leave from your HR system comes in approved, as it was approved there. It isn't checked against labor rules again, and no supervisor is asked. It's refused where it overlaps other time off the person has, unless the same file cancels or moves that one.
- When the two disagree: leave sent again unchanged, though it was canceled or declined in Erlangly since, stays as it is here, and the import lists it as a
conflictfor your HR system to settle. Leave whose days or kind changed in your HR system is booked again as it has it. - People are told, as when a planner enters their time off, of leave added, booked again or canceled, unless it's all in the past. Not on the first load from an HR system (the first time-off import from that
hr_sourcethat's applied, or without one, the first by that token's user), which would tell everyone at once about leave they know of. - Only the columns it reads are kept, and the file goes a week after it came in. Once it can't be undone, 30 days after it came, so do its rows, with the names, dates and notes in them; its counts, the time off and its line in the audit trail stay. That's one line, naming the integration or person and how many it added, changed and canceled.
- Undoing it, on the import's page, works for the latest time-off import only: it removes what it added and puts back what it changed or canceled. Time off someone changed in Erlangly since is left as it is, and listed. People are told of what it puts back or removes, as they were told of the import.
- Days and times are read strictly:
first_dayandlast_dayin theYYYY-MM-DDform, andfromandtoon the 24-hour clock, like13:00(or13:00:00). A row with another form is refused, as 01/05/2027 could be January or May. Leave from someone's leaving day on isn't booked: leaving covers it, and its row isunchanged, with a note.
POST /api/v1/imports: preview an import, changing nothing. It answers 201 with what each row would do. A file without a column it needs, or with more than 5,000 rows (1,000 for people), answers 422 with the problems.
| Parameter | What it is |
|---|---|
kind | What it imports (needed): time_off, balances for balances, or people for people. |
rows | The rows, each an object with the import page's columns: employee_number, type (a kind's code or name, like VACATION) or hr_type (what your HR system calls it, like Annual leave, as said under Settings → Time off for that HR system), and first_day (needed); last_day; from and to for part of a day; note; hr_reference; hr_source; and status, approved (or empty) or canceled. A canceled row needs only employee_number and hr_reference. Other fields are dropped, not kept. |
csv | Instead of rows: a CSV file's text with those columns, as the import page takes it. For time off, it needs the type (or hr_type) and first_day columns even when every row cancels, empty in those rows. |
source | A personal token's: the HR system's short name for rows that don't name one. |
filename | What the import page calls it. |
force | People only: true sends again a file refused as a broken export, once a person has checked it. Its application takes it too. Only true is force ("true" or "1" in a query string): false or none isn't, and any other value, like PowerShell's False, answers 400. Force a request didn't need isn't kept. |
An Idempotency-Key header, any text up to 255 characters, makes a request sent again answer as the first did, with the import it made (as it is now), instead of making a second. The same key with another request answers 422: a body that differs in any way, or another kind, source, force, filename or csv in the query string. Keys last as long as their import.
POST /api/v1/imports/:id/application: apply it. It answers with what it did. Asked again once it's applied, it answers the same; an import undone since answers 422. It applies 500 rows at a time, each 500 on their own, so it never keeps the rest of Erlangly waiting. If it stops partway, those before stay applied, the import is partly_applied, and it answers 500 with error saying the line it stopped at: ask for its application again to carry on, or send the rows again, which matches what's there by reference. An import whose file was cleared, a week after it came, can't be applied (422): send its rows again. While another request is applying or undoing it, it answers 409: read how far it got with GET.
A people import is checked against the guard against a broken export again as it's applied, with the people imports from HR applied since its preview. One it refuses then answers 422, saying why in error, and changes nothing, until its application is asked for with { "force": true }.
GET /api/v1/imports/:id: what an import did, or would do. Only imports sent over the API, erlangly timeoff import, erlangly balances import or erlangly people import. An integration reads and applies only its own, and so does someone limited to some clients. A balance import's descriptions, which say each balance, are null without personal details, and its left_on_undo leaves them out.
Employee numbers match in upper or lower case, in every kind: rs-1001 is RS-1001. Where two people's numbers differ only in case, from before numbers matched so, a row is the one whose number it has exactly, and one in a third case is refused, as it could be either.
An import's status is previewed, applied, partly_applied or undone; counts are how many rows add, change, cancel or leave time off unchanged, are conflicts, or are refused (problems); first_load says, once a time-off import is applied, whether it was the first load from its HR system, which told nobody (it's null for balances and people). Each of its rows has its line (the header is line 1, so rows[0] is line 2), its action (added, updated, canceled, unchanged or conflict; null when it's refused) and its errors. A row for someone the token's user doesn't see (an integration or planner limited to some clients) is refused as if there were nobody with that employee number.
details_cleared is true once an import's rows are cleared, with the names, dates, balances and notes in them: 30 days after it came, once it can't be undone (a later import of its kind was applied, or it was undone or never applied). Its rows are empty then, and its counts stay.
POST /api/v1/imports
Idempotency-Key: workday-2026-11-01
{ "kind": "time_off", "rows": [
{ "employee_number": "RS-1001", "type": "VACATION", "first_day": "2026-11-09", "last_day": "2026-11-13", "hr_reference": "LV-20417" },
{ "employee_number": "RS-1002", "hr_reference": "LV-20388", "status": "canceled" } ] }
201 { "import": { "id": 31, "kind": "time_off", "status": "previewed", "source": "workday", "filename": "time off from the API",
"created_at": "2026-11-01T02:00:04-04:00", "applied_at": null, "undone_at": null,
"counts": { "added": 1, "updated": 0, "canceled": 1, "unchanged": 0, "conflicts": 0, "problems": 0 },
"first_load": null, "stopped_at_line": null, "file_cleared": false, "details_cleared": false,
"rows": [
{ "line": 2, "hr_reference": "LV-20417", "person": "Tanya Graham", "action": "added", "description": "Vacation, Mon, Nov 9 to Fri, Nov 13, 2026", "note": null, "applied": false, "errors": [] },
{ "line": 3, "hr_reference": "LV-20388", "person": "Rohan Francis", "action": "canceled", "description": "Personal day, Thu, Nov 12, 2026", "note": null, "applied": false, "errors": [] } ] } }
POST /api/v1/imports/31/application
200 { "import": { "id": 31, "status": "applied", "first_load": false, … } }
PATCH /api/v1/time_off_requests/:id with hr_reference: once your HR system has recorded leave approved in Erlangly, send back its ID for it, so its next import matches that time off rather than refusing it as an overlap or adding a second. An integration's goes under its own source; a personal token names it in source. null takes it off. Time off with another HR system's reference answers 422. It answers with the time off.
PATCH /api/v1/time_off_requests/52
{ "hr_reference": "LV-20502" }
200 { "time_off_request": { "id": 52, "hr_reference": "LV-20502", "hr_source": "workday", … } }
A nightly sync reads what Erlangly approved, changed or canceled since its last cursor (/time_off_requests?after=…), records it in your HR system and sends its IDs back, then imports the leave booked there, and its balances. Automating Erlangly has the whole script.
Balances from your HR system
Your HR system keeps each person's time-off balances and works out what they earn; Erlangly reads them and shows them, never adding to them or taking from them. A balance shows when someone asks for time off (“Vacation: 32 h left, as of Oct 23.”), to whoever decides their request, with what was approved in Erlangly after that day (“Vacation: 32 h left as of Oct 23; 8 h approved here since.”), on their page for those who decide their time off, and here. It's never a limit: a request past it is asked for and decided as any other, as employers' own rules on borrowing ahead differ.
Balances come in through the same imports, with kind balances: previewed, then applied (500 rows at a time, carrying on where it stopped, as there), then read back, with an Idempotency-Key answering a request sent again as the first did. The same tokens can send them: an integration's that can import time off and balances, or the personal token of a planner or admin, made to change things. AI assistants can't import.
- In hours, fractions too (
7.5), and below zero where your HR system lets people borrow ahead. A file in days is refused: how many hours a day of leave is differs, so Erlangly doesn't guess. - As of a day, the day your HR system worked it out, which is shown with it. A day after tomorrow is refused (tomorrow is taken, for time zones ahead of yours).
- Each import replaces the balances of the people and kinds it carries, from its HR system. Someone a file leaves out keeps their last balance, with its old date, so a nightly file can't drift. A row as of an earlier day than the balance Erlangly has from that HR system is refused, so a file sent late doesn't put an older balance back.
- By HR system: an integration's balances go under its short name; a personal token names it in
source, which balances need. Two HR systems' balances of a kind are kept apart, and shown with their names. - Its kind is
type, a kind's code in Erlangly, as it's written there, likeVACATION, or its name; orhr_type, what your HR system calls it, likeAnnual leave, once a planner or admin has said which kind that is under Settings → Time off, for that HR system. Withouttype, anhr_typethat's a kind's own name here needs no mapping. - Approved here since (
hours_approved_here_since) counts time off of that kind approved in Erlangly after the balance's day, as minutes on each day count it: the published shifts it covers. Leave that came from the same HR system is its own, so it isn't counted. Time off approved before its schedule is published has no shifts under it yet, so it has no hours: it's listed by its days instead, inapproved_here_since_unscheduled, until it does.
Rows have employee_number, type or hr_type, balance_hours (with a decimal point, like 7.5, and a comma only between thousands, like 1,250.5: 7,5 is refused) and as_of (YYYY-MM-DD). Other fields are dropped, not kept. Each of the import's rows has its action, added, updated or unchanged, and a description of the balance it brings in. Only the latest balance import can be undone, from its page in Erlangly (linked from the audit trail), which puts each balance back as it was.
POST /api/v1/imports
Idempotency-Key: balances-2026-10-24
{ "kind": "balances", "rows": [
{ "employee_number": "RS-1001", "type": "VACATION", "balance_hours": 32, "as_of": "2026-10-23" },
{ "employee_number": "RS-1002", "hr_type": "Annual leave", "balance_hours": 7.5, "as_of": "2026-10-23" } ] }
201 { "import": { "id": 32, "kind": "balances", "status": "previewed", "source": "workday", …,
"counts": { "added": 1, "updated": 1, "canceled": 0, "unchanged": 0, "conflicts": 0, "problems": 0 },
"rows": [
{ "line": 2, "person": "Tanya Graham", "action": "added", "description": "Vacation: 32 h, as of Oct 23, 2026", "applied": false, "errors": [], … },
{ "line": 3, "person": "Rohan Francis", "action": "updated", "description": "Vacation: 7.5 h, as of Oct 23, 2026", "applied": false, "errors": [], … } ] } }
On a person (GET /api/v1/people/:id), with personal details:
"time_off_balances": [
{ "type": "VACATION", "type_name": "Vacation", "hr_type_name": "Annual leave", "hours": 32.0,
"as_of": "2026-10-23", "source": "workday", "hours_approved_here_since": 8.0,
"approved_here_since_unscheduled": [ { "first_day": "2026-11-23", "last_day": "2026-11-27" } ] } ]
People from your HR system
Your HR system's joiners, moves and leavers come in through the same imports, with kind people: previewed, then applied (25 people at a time, as each is saved with all it changes, carrying on where it stopped, as there), then read back, with an Idempotency-Key answering a request sent again as the first did. Use an integration's token that can import people, or the personal token of a planner or admin, made to change things. Either must see all clients, as a file from HR can name anyone: one limited to some clients answers 403. AI assistants can't import.
- As the people import page has it: people are matched by
employee_number, in upper or lower case; a new number adds someone (withfirst_nameandlast_name), kept as it's sent, a known one changes them, and a blank or missing field leaves what's there. Rows have the import page's columns:email,site,team,employment_type,hired_on,status,lobswitheffective_date, contract hours,acd_id,fixed_day_off,labor_rules, andleft_on. Other fields are dropped, not kept. Nobody is invited to sign in. - Leavers:
left_onis their first day not working, as your HR system has it (YYYY-MM-DD). They're recorded as leaving on it, as from their page: they come off your license from that day, their time off from then is canceled, and their schedule is kept under Attrition to the end of that week, or only to that day, as an admin sets under Settings → Organization; later shifts are removed. The same date again changes nothing. Another date moves it: they're recorded as staying, then leaving on the new date.inactivewithout a date makes someone inactive, as for long leave. Someone who left before they were ever in Erlangly isn't added. - No date leaves leaving alone: a row without
left_on, or with it empty, never cancels a leaving, whatever the other rows have. Your HR system can set a leaving date or move it, but not take one away, as a planner may record someone leaving first, and cancels it in Erlangly if they aren't leaving after all. - Old leaving dates: for someone whose
statusisactive, aleft_ongone by, or before their hire date, is an old one HR kept, as a rehire's is: it's skipped, its row'snotesays so, and the rest of the row goes in. - Staff: a
left_onfor someone who signs in as staff, a supervisor, planner or admin, isn't recorded, whoever sends it: the row'snotesays so,staff_leaving_skippedlists them, with their line, and an admin records it on their page in Erlangly. - Leaving dates refused: otherwise, one before their hire date; and one more than 7 days back unless the request says
"force": true, as recording it would cancel their past time off from then on and put their past shifts under Attrition, unpaid. The row's error says how much. The date Erlangly has already never needsforce. - Seats: rows that free a seat (leaving, or made inactive) go first, so new hires anywhere in the request can take them. Your license's limit holds: a row that would need a seat when none is left is refused, and says so.
- Up to 1,000 people a request, so each is previewed and applied well inside the web server's 30 seconds. A bigger one answers
422before anything is tried. For a bigger floor, send only the people who changed since the last sync, or split the file. - A broken export: a request that, within a day, would make more than a tenth of your active people, and at least 10, leave or go inactive, leave earlier than recorded (a
left_onmoved to an earlier day; a later one doesn't count), or come off a line of business they're scheduled on (lobsthat end a line they have shifts on from then, which go) answers422, saying what it counts. Someone it does more than one of those to counts once. Active people are those not leaving already, and those the request changes. - Within a day: what the people imports from HR applied in the last 24 hours did counts with the request, each person once, so a file in parts is checked as one; one that needed
forceisn't counted again. If it's right, send it again with"force": true. It's checked again when the import is applied, with the imports applied since its preview: its application then answers422with the same reason, until it's asked for with{ "force": true }. - The record: one line in the audit trail, naming the integration or person and how many it added, changed and recorded as leaving, besides each leaving, as when it's recorded by hand. The file goes a week after it came in, and its rows' details 30 days after, once it can't be undone. Undoing it, on the import's page, works for the latest people import only, and puts leaving back as it was; shifts removed for a leaver don't come back. Who it adds, changes or records as leaving comes with
/people?after=as any change does.
Each of the import's rows has its action, added, updated, leaving (recorded as leaving, or on a new date) or unchanged, and a note with what else changes, like a move or their schedule; counts add leaving, and staying, which is 0 now that imports don't cancel a leaving.
POST /api/v1/imports
Idempotency-Key: people-2026-11-01
{ "kind": "people", "rows": [
{ "employee_number": "RS-2001", "first_name": "Kemar", "last_name": "Reid", "team": "Team Tulloch", "hired_on": "2026-11-09", "lobs": "BILLING" },
{ "employee_number": "RS-1001", "left_on": "2026-11-13" } ] }
201 { "import": { "id": 33, "kind": "people", "status": "previewed", …,
"counts": { "added": 1, "updated": 0, "canceled": 0, "unchanged": 0, "conflicts": 0, "problems": 0, "leaving": 1, "staying": 0 },
"rows": [
{ "line": 2, "person": "Kemar Reid", "action": "added", "note": null, "applied": false, "errors": [], … },
{ "line": 3, "person": "Tanya Graham", "action": "leaving", "note": "Leaves on November 13, 2026; their schedule is kept to November 15, 2026, under Attrition", "applied": false, "errors": [], … } ] } }
422 { "error": "The import wasn't previewed", "problems": [ "This file would make 30 of your 212 active people leave or go inactive and 12 come off a line of business they're scheduled on. …" ] }
Holidays
GET /api/v1/holidays: public holidays on the days asked for, by date, for payroll's holiday premiums. Staff get the holidays of every jurisdiction whose labor law applies to someone here (your organization's, a site's or a person's), or, limited to some clients, to someone they see, and with person_id, one person's: those of the law that applies to them, their own, else their site's, else your organization's. Agents get their own. origin is pack for one from a rule pack, and local for one added under Settings → Labor rules.
| Parameter | What it is |
|---|---|
from | The first day; today if it's left out. |
to | The last day, at most 61 days after from (62 days in all); from if it's left out. |
person_id | One person's holidays (staff, or the person themselves). |
GET /api/v1/holidays?from=2026-12-01&to=2027-01-31&person_id=12
{ "holidays": [
{ "date": "2026-12-25", "name": "Christmas Day", "jurisdiction": { "code": "CA-PE", "name": "Prince Edward Island" }, "origin": "pack" },
{ "date": "2026-12-26", "name": "Boxing Day", "jurisdiction": { "code": "CA-PE", "name": "Prince Edward Island" }, "origin": "pack" },
{ "date": "2027-01-01", "name": "New Year's Day", "jurisdiction": { "code": "CA-PE", "name": "Prince Edward Island" }, "origin": "pack" } ] }
Agent states
POST /api/v1/agent_state_events: your ACD's agent states, as they change, for adherence and the wallboard, with a connection's token. Connecting your ACD says how to set it up.
POST /api/v1/agent_state_events
Authorization: Bearer <the connection's token>
Content-Type: application/json
{ "events": [
{ "agent_ref": "4411", "occurred_at": "2026-10-06T14:03:11Z",
"state": "ON_CALL", "reason_code": null, "event_id": "abc-1" } ] }
| Field | What it is |
|---|---|
agent_ref | The agent's ID in your ACD, linked to a person on the connection's page or in the people import (needed). |
occurred_at | When the state began, ISO 8601 with its offset (needed). A time in the future counts as now. |
state | One of Erlangly's states, AVAILABLE, ON_CALL, ACW, BREAK, AUX or OFFLINE (or LOGGED_IN, for a login that doesn't say what they're doing), or your ACD's own code, mapped on the connection's page (needed). |
reason_code | The ACD's reason, like a break's or an aux code's, if it has one. |
event_id | Your ID for the change, so sending it again is safe. Without one, the agent, time, state and reason make it. |
Up to 500 events a request, each field 255 characters at most; a bare list of events works too. Each event gets its own result, in order (with the event_id Erlangly made, for an event sent without one), and counts adds them up:
{ "results": [
{ "event_id": "abc-1", "status": "applied", "error": null },
{ "event_id": "abc-2", "status": "invalid", "error": "agent_ref 9999 isn't linked to anyone yet" },
{ "event_id": "abc-3", "status": "unmapped", "error": "state NOT_READY isn't mapped yet" } ],
"counts": { "applied": 1, "invalid": 1, "unmapped": 1 } }
| Status | What happened |
|---|---|
applied | Kept, and the agent is in that state now. |
duplicate | Already had it, by its event_id: not kept twice. |
out_of_order | Older than the agent's latest state: kept for adherence, but it doesn't move their state back. |
unchanged | Not kept: OFFLINE for someone logged in on another connection that's still sending. Logged in anywhere counts. |
unmapped | Kept, but its code isn't mapped yet, so it counts as no ACD data until it is. Once it's mapped, the last 7 days in it are scored again. |
invalid | Not kept: error says why, like an agent_ref nobody is linked to yet (it's listed on New on your ACD to match) or a time that isn't ISO 8601. |
A body that isn't JSON answers 400, and more than 500 events 413. Send events late rather than not at all: adherence for the intervals they fall in is scored again at the next quarter hour, up to a week back.
Send batches, up to 500 events a request, rather than one event at a time. A connection's token can make 600 requests a minute here, and one address 600 as well, wrong tokens included: over that the answer is 429 with Retry-After: 60. Nothing in a batch answered 429 is kept, so wait for the minute and send it again.
Volumes
POST /api/v1/volume_intervals: contacts, handle time and abandons per interval, for forecasting, as the volume import takes them. With a connection's token, for the lines of business it doesn't get from another connection, or a planner's or admin's personal token that can change things (for a planner limited to some clients, only their clients' lines: a row for another's is refused as no such line). What a personal token sends is in the audit trail under its person's name, with the token's.
POST /api/v1/volume_intervals
{ "intervals": [
{ "lob": "BILLING", "interval_start": "2026-10-06T08:00:00-03:00",
"contacts": 42, "aht_seconds": 312.5, "abandons": 1, "answered": 41, "answered_in_target": 33 } ] }
200 { "intervals": 1 }
| Field | What it is |
|---|---|
lob or queue | The line of business, by code or name, or an ACD queue's ID (needed when two clients share a code). |
acd_source | With a personal token, the connection a queue is on, by its name, where queues on two connections share the ID. A connection's token needs none: it can't name another connection's queue. |
interval_start | The interval's start; without an offset, in the line of business's time zone (needed). |
contacts | Contacts offered, a whole number (needed). |
aht_seconds | Average handle time: without it a forecast has contacts but can't work out the agents they need. |
abandons | Contacts abandoned, a whole number. |
answered | Contacts answered, a whole number, no more than contacts: Intraday's answer rate. |
answered_in_target | Contacts answered within the service target's time, no more than answered: Intraday's measured service level. |
short_abandons | Contacts abandoned within the short-abandon time, for a line whose service target leaves them out. |
target_seconds, short_abandon_seconds | The times your ACD counted with, in seconds, so Intraday can say when they differ from the line's service target. |
- Up to 5,000 intervals a request, and 2 MB: send history a week of one line of business at a time, with all its queues. Over either answers
413, saying so. - A token can make 60 requests a minute here, and one address 600, wrong tokens included: over that the answer is
429withRetry-After: 60. Wait for the minute and send the request again. - Each request sets a line of business's figures for its intervals, so sending one again is safe. Send all a line's queues for an interval in the same request: a queue sent on its own would replace the others'.
- All or nothing: if any interval has a problem, none is kept, and
422lists each, by its place in the list, from 0:
422 { "problems": [ { "index": 1, "errors": ["There's no line of business called “NOPE”."] } ] }
The volume import has the rest of the rules, like rows that repeat.
AI assistants (MCP)
Claude, ChatGPT, Copilot and other AI assistants that speak MCP can connect to Erlangly and answer questions like “are we short on Billing tomorrow morning?”, “who's out of adherence right now?” or “what's waiting for my approval?”.
- An admin turns it on under Settings → AI agents, which shows the address to use (your Erlangly's address with
/mcpon the end). - In Claude, ChatGPT and others, add a connector with that address: the assistant sends you to sign in to Erlangly (with your password, or with SSO), then asks what it may do: only read, or also ask for, approve and turn down time off.
It reads what the API reads, as you: an assistant can answer “how many hours did each agent work on Acme last month, and how much of it in adherence?” from adherence by person, split by client.
Publishing a schedule stays with a person in Erlangly. You can disconnect it any time under Your account, and resetting your password disconnects it too. What it changes is in the audit trail under your name, marked as done by an assistant, with its name.
Developer tools can use a personal token instead:
claude mcp add --transport http erlangly https://wfm.example.com/mcp --header "Authorization: Bearer erl_…"
Assistants that run in a vendor's cloud (claude.ai, ChatGPT) can only reach an Erlangly that's on the internet; desktop and command-line assistants only need to reach it from your computer. Each token can make 300 requests a minute.
On the server
erlangly schedule [DATE] [--lob CODE] [--json]
erlangly hours FROM TO [--split client] [--days split] [--csv]
erlangly acd-time FROM TO [--days split] [--csv]
erlangly volumes import FILE.csv
erlangly timeoff [--all]
erlangly timeoff approve|decline ID [NOTE]
erlangly timeoff import FILE.csv [--source NAME] [--yes]
erlangly balances import FILE.csv --source NAME [--yes]
erlangly people import FILE.csv [--source NAME] [--force] [--yes]
erlangly webhooks
erlangly webhooks allow|disallow RANGE
erlangly webhooks ca FILE.pem|off
These act as your first admin, and what they change is in the audit trail. erlangly timeoff import takes a CSV export of leave from your HR system, with the import page's columns, and says what it would add, change and cancel, and which lines to fix; with --yes it imports it, as the API's imports do, matching by HR reference under the --source name (or each row's hr_source). erlangly balances import takes your HR system's balances, in hours, with the API's columns (balances), under the --source name, and imports them with --yes. erlangly people import takes your HR system's people, with the people import page's columns and left_on (people from your HR system), and imports them with --yes; one that would make too many people leave, leave earlier or come off a line they're scheduled on within a day needs --force.
erlangly webhooks lists the webhooks and what they may reach. erlangly webhooks allow 10.20.0.0/16 lets them reach a private range on your network, for an internal system (addresses); disallow stops it. erlangly webhooks ca your-ca.pem trusts your internal certificate authority for webhooks, besides the usual ones, and ca off stops. Each checks what it's given, saves it in /etc/erlangly/erlangly.conf (WEBHOOK_PRIVATE_RANGES, WEBHOOK_CA_FILE), restarts Erlangly and notes the change in the audit trail. With Docker Compose, set WEBHOOK_PRIVATE_RANGES and this server's own addresses, WEBHOOK_HOST_ADDRESSES, in its environment yourself; for your certificate authority, mount its certificate into the container and set WEBHOOK_CA_FILE to its path there, as the compose.yml shows. Without WEBHOOK_HOST_ADDRESSES no range is used, as one could hold them, and Settings → System says so.
erlangly schedule --json gives each shift's under_time_off, time_off_ids, paid_minutes_scheduled, paid_time_off_minutes and unpaid_time_off_minutes, as shifts do. erlangly hours prints everyone's hours for a pay period, up to 62 days, with the API's names for each figure, and --csv gives them as a spreadsheet, a column for each kind of time off. erlangly acd-time prints the ACD's record of each person's time by day, in the API's names, and --csv gives it as a spreadsheet.