Alerts
An alert is a fault //SCHEMA found in your catalog that only you can correct: a file refused at intake, bytes that contradict the hash their delivery declared, a console upload //SCHEMA could not match to one track. It is the console's Inbox, and the same list is here.
- One alert per condition. Seeing the same problem again — a
redelivery refused for the same reason — moves
lastSeenAtandoccurrencesrather than adding an alert. - Blocking alerts hold something: the release stays
pendinguntil the problem is fixed. Warnings hold nothing. - Alerts close themselves when the problem is fixed — the right file
lands at the same path, or is uploaded on the track — and are kept
afterwards, so
alerts(status: RESOLVED)answers "what was wrong with this release last month". fixandrelatedare typed targets with ids you can query, not URLs.
Titles, descriptions and target labels quote text your senders wrote, such as filenames. Render them as text, never as markup.
- queryalerts
- queryalertCounts
- mutationdismissAlert
- mutationmarkAlertsRead
The Alert object#
A problem in your catalog that only you can fix.
Attributes
alertPkInt!Unique identifier.kindAlertKind!What kind of problem; see AlertKind.severityAlertSeverity!BLOCKINGwhen something is held until it is fixed,WARNINGwhen nothing is.titleString!One line. Quotes text your senders wrote; render it as text.descriptionString!What //SCHEMA saw, why it matters, and what to do. Quotes text your senders wrote; render it as text.fixAlertTarget!The thing that most likely needs correcting.raisedAtDateTime!When it was first raised.lastSeenAtDateTime!When the problem was last observed.occurrencesInt!How many times it has been observed.readBoolean!Whether the signed-in person has read it. Alwaysfalsefor an API key.dismissableBoolean!Whether dismissAlert may close it.- When it closed, if it has.
- How it closed, if it has.
- The note given when it was dismissed.
- The Message that raised it, when there was one.
The AlertTarget object#
Something an alert links to. Typed, with ids, rather than a URL.
Attributes
kindAlertTargetKind!What it points at.- The release, for
RELEASEandTRACK. - The track, for
TRACK. - The delivery, for
DELIVERY. labelString!A name for the link, such as a track's title and ISRC. Quotes text your senders wrote.
The AlertKind enum#
What kind of problem an alert is.
Values
FILE_REJECTEDA delivered file was refused — today, an audio master that is not lossless. Fixed when a lossless file lands at the same path, or is uploaded on the track.HASH_MISMATCHA file's bytes contradict the hash its delivery declared, so the track was failed rather than promoted. Fixed when the right bytes arrive.AMBIGUOUS_CLAIMA console delivery could not tell which file dropped ahead of it belongs to a track, and took none. Fixed when the track has its file.
The AlertSeverity enum#
Whether something is held because of an alert.
Values
BLOCKINGSomething is held — a release stayspending— until it is fixed.WARNINGNothing is held, but the catalog is wrong or will degrade.
The AlertStatus enum#
Which alerts to list.
Values
OPENNot yet resolved.RESOLVEDFixed, dismissed or superseded.
The AlertResolution enum#
How an alert closed.
Values
FIXEDThe problem cleared.DISMISSEDSomeone decided it needs no fix.SUPERSEDEDWhat it was about was deleted.
The AlertTargetKind enum#
What an AlertTarget points at.
Values
RELEASEA release.TRACKA track on a release.DELIVERYA delivered message.DELIVERIESYour deliveries in general, for a problem with no release yet — a file refused before any delivery named it.
List alerts#
Your catalog's alerts, one page at a time. Open alerts list blocking ones first, then the most recently seen; resolved alerts list the most recently resolved first.
Arguments
OPEN(the default) orRESOLVED.kindAlertKindOnly alerts of this AlertKind.releasePkIntOnly alerts about this release.firstIntAt most this many, up to 200. Defaults to 50.afterStringThe previous page'sendCursor.
Returns
An AlertConnection.
query {
alerts(first: 1) {
nodes {
alertPk
kind
severity
title
fix {
kind
releasePk
resourcePk
label
}
occurrences
}
endCursor
hasNextPage
}
}curl https://api.schema.fm/graphql \
-H "Authorization: Bearer $SCHEMA_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'EOF'
{
"query": "query {\n alerts(first: 1) {\n nodes {\n alertPk\n kind\n severity\n title\n fix {\n kind\n releasePk\n resourcePk\n label\n }\n occurrences\n }\n endCursor\n hasNextPage\n }\n}"
}
EOFconst res = await fetch("https://api.schema.fm/graphql", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SCHEMA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `
query {
alerts(first: 1) {
nodes {
alertPk
kind
severity
title
fix {
kind
releasePk
resourcePk
label
}
occurrences
}
endCursor
hasNextPage
}
}
`,
}),
});
const { data, errors } = await res.json();{
"data": {
"alerts": {
"nodes": [
{
"alertPk": 311,
"kind": "FILE_REJECTED",
"severity": "BLOCKING",
"title": "“A1.mp3” was refused: it is not a lossless master",
"fix": {
"kind": "TRACK",
"releasePk": 812,
"resourcePk": 4471,
"label": "Night Ferry (ISRC USS1Z2600042)"
},
"occurrences": 2
}
],
"endCursor": null,
"hasNextPage": false
}
}
}Count open alerts#
How many alerts are open, how many of those are blocking, and how many the signed-in person has not read. The console's nav badge is blocking.
Arguments
None.
Returns
An AlertCounts.
query {
alertCounts {
open
blocking
unread
}
}curl https://api.schema.fm/graphql \
-H "Authorization: Bearer $SCHEMA_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'EOF'
{
"query": "query {\n alertCounts {\n open\n blocking\n unread\n }\n}"
}
EOFconst res = await fetch("https://api.schema.fm/graphql", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SCHEMA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `
query {
alertCounts {
open
blocking
unread
}
}
`,
}),
});
const { data, errors } = await res.json();{
"data": {
"alertCounts": {
"open": 3,
"blocking": 2,
"unread": 3
}
}
}Dismiss an alert#
Close an open alert without fixing it, with a note saying why. Only an alert whose dismissable is true can be dismissed; a blocking alert is closed by its fix. A dismissed alert stays dismissed when the same problem is seen again.
Arguments
- The alert.
- Why it needs no fix. Required, and kept with the alert.
Returns
The dismissed Alert.
mutation {
dismissAlert(alertPk: 318, note: "Archival recording; the cutoff is in the source.") {
alertPk
resolution
dismissNote
}
}curl https://api.schema.fm/graphql \
-H "Authorization: Bearer $SCHEMA_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'EOF'
{
"query": "mutation {\n dismissAlert(alertPk: 318, note: \"Archival recording; the cutoff is in the source.\") {\n alertPk\n resolution\n dismissNote\n }\n}"
}
EOFconst res = await fetch("https://api.schema.fm/graphql", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SCHEMA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `
mutation {
dismissAlert(alertPk: 318, note: "Archival recording; the cutoff is in the source.") {
alertPk
resolution
dismissNote
}
}
`,
}),
});
const { data, errors } = await res.json();{
"data": {
"dismissAlert": {
"alertPk": 318,
"resolution": "DISMISSED",
"dismissNote": "Archival recording; the cutoff is in the source."
}
}
}Mark alerts read#
Mark alerts read for the signed-in person. Sessions only — an API key has no read state, and the call is refused. Ids that are not your catalog's alerts are ignored.
Arguments
- The alerts, up to 500.
Returns
How many were newly marked read.
mutation {
markAlertsRead(alertPks: [311, 312])
}curl https://api.schema.fm/graphql \
-H "Authorization: Bearer $SCHEMA_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'EOF'
{
"query": "mutation {\n markAlertsRead(alertPks: [311, 312])\n}"
}
EOFconst res = await fetch("https://api.schema.fm/graphql", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SCHEMA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `
mutation {
markAlertsRead(alertPks: [311, 312])
}
`,
}),
});
const { data, errors } = await res.json();{
"data": {
"markAlertsRead": 2
}
}