Example API queries
Looking for the schema?
GraphQL is a self documenting language and you should be able to find everything you need to write simple or complex queries via the documentation provided through graphql playground (see instructions here).
If you require assistance with a query, please reach out to us at [email protected].
Running GraphQL queries in your favorite language
We recommend running these queries in graphql playground to get started (see instructions above), but you can also run them via cURL, javascript, or other methods
Example GraphQL Queries
List your company's user details
query {
viewer {
company {
users {
edges {
node {
name
email
id
}
}
}
}
}
}
List your company's recent incidents
query {
viewer {
company {
incidents {
edges {
node {
id
title
severityLevel {
title
}
status
}
}
}
}
}
}
List your company's tags
query {
viewer {
company {
tags {
edges {
node {
name
id
}
}
}
}
}
}
List all incidents with a specific <TAG_ID>
query {
viewer {
company {
incidents (filter:{includeTags:[<TAG_ID>]}) {
edges {
node {
title
status
}
}
}
}
}
}
List incident comments and status changes
query{
incident (id: "$INCIDENT_ID") {
activity (filter: {includeTypes: ["IncidentActivityComment","IncidentActivityStatus"]}, first: 100) {
edges {
node {
...on IncidentActivityComment {
document {
timeCreated
value(format: MARKDOWN)
}
}
...on IncidentActivityStatus {
timeCreated
status
}
}
}
}
}
}
Create a new incident
mutation {
createIncident(input: {
title: "People know the secret identity of Quailman!"
descriptionDocument: {
format: MARKDOWN
value: "It's *Doug Funny*, but don't tell anyone!"
},
severityLevel: 1
}) {
incident {
id
title
}
}
}
Update an incident's status to CLOSED
mutation {
updateIncident(input: {
patch: {
id: "**$YOUR_INCIDENT_ID**",
status: CLOSED
}
}) {
incident {
id
title
severityLevel {
title
}
status
}
}
}
List the names and emails of all current Oncalls
query {
viewer {
company {
oncalls {
edges {
node {
currentInstance {
oncall {
name
currentInstance {
shift {
contact {
name
email
}
}
}
}
}
}
}
}
}
}
}
List all milestones in an incident
# Write your query or mutation here
query {
incident (id: "$INCIDENT_ID") {
activity (filter: {includeTypes: ["IncidentActivityMilestone"]}, first: 100) {
edges {
node {
...on IncidentActivityMilestone {
actor {
name
}
source
timeCreated
metadata {
timeOccurred
label
}
}
}
}
}
}
Getting Additional Help
Our team is here to help with any custom integration work you may be developing. Contact us at: [email protected] with any questions or via the chat link on all of our pages.
Updated about 2 months ago