dashboard-agent-shifts
Base URL
https://api.example.com
GET
/api/v1
List Shifts
List shifts for the requesting client in the time window.
Parameters
date
any
query
YYYY-MM-DD — single day (UTC)
from
any
query
YYYY-MM-DD — range start (inclusive)
to
any
query
YYYY-MM-DD — range end (inclusive)
actor_id
any
query
role
any
query
Filter by actor role
gap_minutes
integer
query
Gap threshold that splits one shift into two
Responses
200Successful Response422Validation Error
curl -X GET 'https://api.example.com/api/v1' \
-H 'Authorization: Bearer '
import httpx
resp = httpx.get(
"https://api.example.com/api/v1",
headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1", {
method: "GET",
headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.example.com/api/v1", nil)
req.Header.Set("Authorization", "Bearer ")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
GET
/api/v1/detail
Shift Detail
Full detail view for a single shift — hourly histogram + shipped lists. `started_at` and `ended_at` are taken verbatim from the list response; the service re-queries the audit table for the exact window so the caller never needs to round-trip a persisted "shift_id".
Parameters
actor_id
string
query
required
Actor id from the list response
started_at
string
query
required
ISO-8601 UTC of shift start
ended_at
string
query
required
ISO-8601 UTC of shift end
Responses
200Successful Response422Validation Error
curl -X GET 'https://api.example.com/api/v1/detail' \
-H 'Authorization: Bearer '
import httpx
resp = httpx.get(
"https://api.example.com/api/v1/detail",
headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/detail", {
method: "GET",
headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/detail", nil)
req.Header.Set("Authorization", "Bearer ")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
GET
/api/v1/export.csv
Export Shifts Csv
One row per shift in the window. Billing- and spreadsheet-friendly.
Parameters
date
any
query
from
any
query
to
any
query
actor_id
any
query
role
any
query
gap_minutes
integer
query
Responses
200Successful Response422Validation Error
curl -X GET 'https://api.example.com/api/v1/export.csv' \
-H 'Authorization: Bearer '
import httpx
resp = httpx.get(
"https://api.example.com/api/v1/export.csv",
headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/export.csv", {
method: "GET",
headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/export.csv", nil)
req.Header.Set("Authorization", "Bearer ")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
GET
/api/v1/digest-settings
Get Digest Settings
Return the tenant's current digest cadence + last-sent timestamp.
Responses
200Successful Response
curl -X GET 'https://api.example.com/api/v1/digest-settings' \
-H 'Authorization: Bearer '
import httpx
resp = httpx.get(
"https://api.example.com/api/v1/digest-settings",
headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/digest-settings", {
method: "GET",
headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/digest-settings", nil)
req.Header.Set("Authorization", "Bearer ")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
PATCH
/api/v1/digest-settings
Update Digest Settings
Change the tenant's digest cadence. Resets last_sent_at when cadence changes so the next eligible tick fires immediately.
Responses
200Successful Response422Validation Error
curl -X PATCH 'https://api.example.com/api/v1/digest-settings' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
-d '{
"cadence": "string"
}'
import httpx
resp = httpx.patch(
"https://api.example.com/api/v1/digest-settings",
headers={"Authorization": "Bearer ", "Content-Type": "application/json"},
json={"cadence": "string"},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/digest-settings", {
method: "PATCH",
headers: { "Authorization": "Bearer ", "Content-Type": "application/json" },
body: JSON.stringify({"cadence": "string"})
});
const data = await resp.json();
console.log(data);
package main
import (
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"cadence": "string"}`)
req, _ := http.NewRequest("PATCH", "https://api.example.com/api/v1/digest-settings", body)
req.Header.Set("Authorization", "Bearer ")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
Request body
{"cadence":"string"}
GET
/api/v1/anomalies
List Anomalies
Per-client anomaly findings (last 7 days vs 30-day baseline).
Responses
200Successful Response
curl -X GET 'https://api.example.com/api/v1/anomalies' \
-H 'Authorization: Bearer '
import httpx
resp = httpx.get(
"https://api.example.com/api/v1/anomalies",
headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/anomalies", {
method: "GET",
headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/anomalies", nil)
req.Header.Set("Authorization", "Bearer ")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
Ask AI