The destinations query allows you to paginate through all of your destinations per account. It also allows some filtering functionality.
Here's an example:
{
actor {
account(id: YOUR_ACCOUNT_ID) {
aiNotifications {
destinations {
entities {
id
name
}
error {
details
}
}
}
}
}
}
In order to paginate through your destinations, you must request the nextCursor field on your initial query.
With cursor pagination, you continue to make a request through the result set until the nextCursor that is returned from the response comes back empty. This signifies that you reached the end of your results.
Here's an example:
{
actor {
account(id: YOUR_ACCOUNT_ID) {
aiNotifications {
destinations(cursor: "") {
nextCursor
entities {
id
name
}
totalCount
}
}
}
}
}
The code above returns a set of results like this:
So, in your subsequent request, provide the cursor like so, until the cursor is empty:
{
actor {
account(id: YOUR_ACCOUNT_ID) {
aiNotifications {
destinations(cursor: "") {
nextCursor
entities {
id
name
}
totalCount
}
}
}
}
}
The API allows destination queries by name. The name filter returns exact matches and partial matches. It is case insensitive. This will only return the information for the destinations that match the name supplied.
In this example, we want to find destinations with "DevOps" in the name:
The API lets you query by destination type. The following query will return all email destinations on the chosen account:
{
actor {
account(id: YOUR_ACCOUNT_ID) {
aiNotifications {
destinations(filters: {type: EMAIL}) {
entities {
id
name
}
}
}
}
}
}
Create a destination
In order to create a destination, different inputs must be supplied for each destination type. An optional two_way_integration property is available for integrations that allow two-way integration.
When you update a destination, note that you don't need to supply all of the attributes on the destination. For example, you only need to supply the name if you only intend to update the name: