Alerts API Queries
Alerts API follows the same basic principles as other GraphQL APIs. There are two top-level nodes available: alerts and alert. It's possible to specify custom filters and sort order to retrieve a required subset of Alerts. Larger workflows could benefit from using pagination when the amount of Alerts returned doesn't fit into a single API response.
You may find all entity types defined in Alerts API Reference.

Examples

Find Alerts by Company ID:

1
query findAlerts($id: ID!) {
2
alerts(
3
where: {
4
company: {
5
id: { eq: $id }
6
}
7
}
8
) {
9
id
10
title
11
text
12
company {
13
id
14
displayName
15
}
16
}
17
}
Copied!

Find Alerts by dataset and class

1
query findAlerts($dataset: String!, $class: String!) {
2
alerts(
3
where: {
4
dataset: { eq: $dataset },
5
class: { code: { eq: $class } }
6
}
7
) {
8
id
9
title
10
text
11
dataset
12
class {
13
code
14
label
15
}
16
}
17
}
Copied!

Find Alerts for a particular date range

1
query findAlerts($from: String!, $to: String!) {
2
alerts(
3
where: {
4
publishedAt: {
5
gte: $from
6
lte: $to
7
}
8
}
9
) {
10
id
11
title
12
text
13
company {
14
displayName
15
}
16
publishedAt
17
}
18
}
Copied!

Find a single Alert by its id

1
query findAlert($id: ID) {
2
alert(id: $id) {
3
id
4
title
5
text
6
}
7
}
Copied!
Last modified 8mo ago
Copy link
Contents
Examples