Reference: Gateway examples for Discover
Tanium Gateway provides a GraphQL API integration point for Tanium solutions, including Discover. Discover queries and mutations retrieve information about Discover labels and interfaces, create or delete labels, or update labels applied to interfaces.
For more information about how to view additional Gateway example syntax, see Reference: Filter syntax and Reference: Discover examples.
Discover query filter syntax
Discover queries that request labels or interfaces using discoverLabels or discoverInterfaces support the path and value filter fields.
For more information on syntax, see FieldFilter in the Documentation Explorer pane of the query explorer.
Single column
You can filter on field values. Define a filter object using one of the following syntaxes:
discoverInterfaces(filter:
{
path: "field-path",
op: "operator-value",
value: "field-value"
}
)
discoverLabels(filter:
{
path: "field-path",
op: "operator-value",
value: "field-value"
}
)
Use dot notation for sub-fields not at the root level.
For example, the following query retrieves labels with a createdTime value greater than 2023-01-01 and returns the labels:
query exampleGetLabels {
discoverLabels(filter: {path: "createdTime", op: GT, value: "2023-01-01"}) {
edges {
node {
name
type
createdTime
modifiedTime
}
}
}
}
Multiple columns
You can filter on multiple Discover-related columns. Define a filter object using one of the following syntaxes:
discoverInterfaces(filter:
{any: boolean,
filters: [
{path: "field-path-1", op: "operator-1", value: "filter-value-1"},
{path: "field-path-2", op: "operator-2", value: "filter-value-2"},
{path: "field-path-n", op: "operator-n", value: "filter-value-n"}
]
}
)
discoverLabels(filter:
{any: boolean,
filters: [
{path: "field-path-1", op: "operator-1", value: "filter-value-1"},
{path: "field-path-2", op: "operator-2", value: "filter-value-2"},
{path: "field-path-n", op: "operator-n", value: "filter-value-n"}
]
}
)
Use dot notation for sub-fields not at the root level.
For example, the following query retrieves interfaces associated with the label Example_label and an osPlatform of Linux, and returns matching interfaces:
query exampleGetInterfaces {
discoverInterfaces(
filter: {any: false, filters: [{path: "labels.name", op: EQ, value: "Example_label"}, {path: "osPlatform", op: EQ, value: "Linux"}]}
) {
edges {
node {
id
labels
osPlatform
}
}
}
}
Add Discover labels to Discover interfaces
(mutation.discoverInterfaceAddLabel)
The discoverInterfaceAddLabel mutation requires Discover and the Discover Tag write permission.
The following mutation manually adds one or more standard labels to one or more specified interfaces. This mutation does not support automatic evaluation to apply labels.
mutation exampleAddInterfaceLabel($labelNames: [String!]!, $interfaceIDs: [ID!]!) {
discoverInterfaceAddLabel(input: {names: $labelNames, interfaceIDs: $interfaceIDs}) {
success
error {
message
}
cursor
}
}
Include the interface variables in the Variables panel or in your variables dictionary:
{
"labelNames": [
"example_label",
"example_label_2"
],
"interfaceIDs": [
12345,
67890
]
}
Example response:
{
"data": {
"discoverInterfaceAddLabel": {
"success": true,
"error": null,
"cursor": null
}
}
}
If your mutation request returns a cursor, the label is not yet added to the interfaces that you specify. You can pass the cursor as input to a subsequent discoverInterfaceAddLabel mutation to determine the status of the initial request.
mutation exampleAddInterfaceLabel($labelNames: [String!]!, $interfaceIDs: [ID!]!) {
discoverInterfaceAddLabel(
input: {
labelNames: $labelNames,
interfaceIDs: $interfaceIDs
cursor: "Mg=="
}
) {
success
error {
message
}
cursor
}
}
Create a Discover label
(mutation.discoverLabelCreate)
The discoverLabelCreate mutation requires Discover and the Discover Tag Write permission. If you define at least one Discover location, this also requires the Discover Location Permissions Write permission.
The following mutation creates a standard-type label.
mutation exampleCreateInterfaceLabel($labelName: String!) {
discoverLabelCreate(input: {name: $labelName}) {
label {
name
type
createdTime
modifiedTime
}
error {
message
}
}
}
Include the name variable in the Variables panel or in your variables dictionary:
{
"labelName": "Example_label"
}
Example response:
{
"data": {
"discoverLabelCreate": {
"label": {
"name": "Example_label",
"type": "STANDARD",
"createdTime": "2023-03-29T13:42:22.760Z",
"modifiedTime": "2023-03-29T13:42:22.760Z"
},
"error": null
}
}
}
Delete a Discover label by name
(mutation.discoverLabelDelete)
The discoverLabelDelete mutation requires Discover and the Discover Tag write permission. If you define at least one Discover location, this also requires the Discover Location Permissions write permission.
The following mutation deletes a label. If you delete a label, the label is removed from all the related interfaces.
mutation exampleDeleteInterfaceLabel($labelName: String!) {
discoverLabelDelete(ref: {name: $labelName}) {
name
error {
message
}
}
}
Include the name variable in the Variables panel or in your variables dictionary:
{
"labelName": "Example_label"
}
Example response:
{
"data": {
"discoverLabelDelete": {
"name": "Example_label",
"error": null
}
}
}
Get a Discover interface by ID
(query.discoverInterface)
The discoverInterface query requires Discover and the Discover Asset read permission. If you define at least one Discover location, this also requires either the User Group read permission (returns only matching interfaces to which the user group membership allows access) or the Discover Location Permissions write permission (returns all matching interfaces).
The following query retrieves the Discover interface with the ID of 123.
query exampleGetSpecificInterface($id: ID!) {
discoverInterface(ref: {id: $id}) {
id
macAddress
manufacturer
locallyAdministeredMacAddress
hostnames
ipAddresses
labels {
name
type
createdTime
modifiedTime
}
osPlatform
openPorts
discoveryMethods
lastSeenTime
computerId
natIPAddresses
osGeneration
profiles {
name
}
firstSeenTime
firstManagedTime
lastManagedTime
lastDiscoveredTime
isManaged
isUnmanageable
isIgnored
satellites {
id
name
}
}
}
Include the ID variable in the Variables panel or in your variables dictionary:
{
"id": "123"
}
Example response:
{
"data": {
"discoverInterface": {
"id": "123",
"macAddress": "01-23-45-67-89-AB",
"manufacturer": "Microsoft Corporation",
"locallyAdministeredMacAddress": false,
"hostnames": [
"USB-81.lan.oxfordcs.com"
],
"ipAddresses": [
"192.2.2.0"
],
"labels": [
{
"name": "M11_Unmanaged_not_Unmanageable",
"type": "AUTOMATIC",
"createdTime": "2022-03-15T13:08:37.177Z",
"modifiedTime": "2022-03-15T13:08:37.177Z"
},
{
"name": "Client Install Pending Fixed",
"type": "AUTOMATIC",
"createdTime": "2024-06-25T17:39:34.843Z",
"modifiedTime": "2024-06-25T17:39:34.843Z"
},
{
"name": "cM_4351_repro",
"type": "AUTOMATIC",
"createdTime": "2024-09-30T17:33:10.861Z",
"modifiedTime": "2024-09-30T17:33:10.861Z"
},
{
"name": "dain_test",
"type": "STANDARD",
"createdTime": "2024-11-21T18:44:53.944Z",
"modifiedTime": "2024-11-21T18:44:53.944Z"
}
],
"osPlatform": "Windows",
"openPorts": [
135,
139,
445,
3389,
5357,
49152,
49153,
49154,
49155,
49156,
49167
],
"discoveryMethods": [
"ARP",
"CONNECTED",
"PING",
"NMAP"
],
"lastSeenTime": "2026-03-25T18:39:06.401Z",
"computerId": null,
"natIPAddresses": [
"198.50.20.200"
],
"osGeneration": null,
"profiles": [
{
"name": "Bad CIDR profile"
},
{
"name": "FXF - Discover Test"
},
{
"name": "SS-NMAP-HomeLab"
}
],
"firstSeenTime": "2022-09-28T14:16:10.000Z",
"firstManagedTime": null,
"lastManagedTime": null,
"lastDiscoveredTime": "2026-03-25T18:39:06.397Z",
"isManaged": false,
"isUnmanageable": false,
"isIgnored": false,
"satellites": []
}
}
}
Get multiple Discover interfaces
(query.discoverInterfaces)
The discoverInterfaces query requires Discover and the Discover Asset read permission. If you define at least one Discover location, this also requires either the User Group read permission (returns only matching interfaces to which the user group membership allows access) or the Discover Location Permissions write permission (returns all matching interfaces).
The following query retrieves the first 2 Discover interfaces.
query exampleGetInterfaces($first: Int) {
discoverInterfaces(first: $first) {
edges {
node {
id
macAddress
manufacturer
locallyAdministeredMacAddress
hostnames
ipAddresses
labels {
name
type
createdTime
modifiedTime
}
osPlatform
openPorts
discoveryMethods
lastSeenTime
computerId
natIPAddresses
osGeneration
profiles {
name
}
firstSeenTime
firstManagedTime
lastManagedTime
lastDiscoveredTime
isManaged
isUnmanageable
isIgnored
satellites {
id
name
}
}
}
}
}
Include the pagination variable in the Variables panel or in your variables dictionary:
{
"first": 2
}
Example response:
{
"data": {
"discoverInterfaces": {
"edges": [
{
"node": {
"id": "1234",
"macAddress": "01-23-45-67-89-AB",
"manufacturer": "VMware, Inc.",
"locallyAdministeredMacAddress": false,
"hostnames": [],
"ipAddresses": [
"192.0.20.10"
],
"labels": [
{
"name": "Example label 1",
"type": "AUTOMATIC",
"createdTime": "2020-05-20T14:48:30.259Z",
"modifiedTime": "2025-07-07T19:58:02.976Z"
},
{
"name": "Example label 2",
"type": "AUTOMATIC",
"createdTime": "2022-03-15T13:08:37.177Z",
"modifiedTime": "2022-03-15T13:08:37.177Z"
},
{
"name": "Example label 3",
"type": "STANDARD",
"createdTime": "2026-03-17T13:10:32.462Z",
"modifiedTime": "2026-03-17T13:10:32.462Z"
}
],
"osPlatform": "Windows",
"openPorts": null,
"discoveryMethods": [
"ARP",
"CONNECTED",
"PING",
"NMAP",
"SATELLITE_NMAP",
"NDP"
],
"lastSeenTime": "2026-03-25T18:39:06.401Z",
"computerId": null,
"natIPAddresses": [
"198.50.100.10"
],
"osGeneration": "10",
"profiles": [
{
"name": "Example profile 1"
},
{
"name": "Example profile 2"
},
{
"name": "Example profile 3"
}
],
"firstSeenTime": "2021-07-20T01:28:49.000Z",
"firstManagedTime": "2023-08-14T12:09:41.000Z",
"lastManagedTime": "2024-01-12T16:47:20.796Z",
"lastDiscoveredTime": "2026-03-25T16:39:05.325Z",
"isManaged": false,
"isUnmanageable": false,
"isIgnored": false,
"satellites": [
{
"id": "b58a6c1a-79c6-46e5-903d-7975974ef349",
"name": "satellite-ubuntu24-intel-test1"
}
]
}
},
{
"node": {
"id": "4567",
"macAddress": "CD-EF-01-23-45-67",
"manufacturer": "VMware, Inc.",
"locallyAdministeredMacAddress": false,
"hostnames": [],
"ipAddresses": [
"192.10.20.30"
],
"labels": [
{
"name": "Example label 2",
"type": "AUTOMATIC",
"createdTime": "2022-03-15T13:08:37.177Z",
"modifiedTime": "2022-03-15T13:08:37.177Z"
},
{
"name": "Example label 4",
"type": "AUTOMATIC",
"createdTime": "2024-03-28T19:05:55.605Z",
"modifiedTime": "2024-03-28T19:05:55.605Z"
},
{
"name": "Example label 5",
"type": "AUTOMATIC",
"createdTime": "2024-06-25T17:39:34.843Z",
"modifiedTime": "2024-06-25T17:39:34.843Z"
}
],
"osPlatform": "Windows",
"openPorts": [
22,
135,
139,
445,
3389,
5357
],
"discoveryMethods": [
"ARP",
"CONNECTED",
"PING",
"NMAP",
"NDP"
],
"lastSeenTime": "2026-03-25T18:39:06.401Z",
"computerId": null,
"natIPAddresses": [
"20.70.20.190"
],
"osGeneration": "10",
"profiles": [
{
"name": "Example profile 2"
},
{
"name": "Example profile 4"
},
{
"name": "Example profile 5"
}
],
"firstSeenTime": "2022-08-05T16:48:40.000Z",
"firstManagedTime": null,
"lastManagedTime": null,
"lastDiscoveredTime": "2026-03-25T18:39:06.397Z",
"isManaged": false,
"isUnmanageable": false,
"isIgnored": false,
"satellites": []
}
}
]
}
}
}
Get a Discover label by name
(query.discoverLabel)
The discoverLabel query requires Discover and the Discover Asset read permission.
The following query retrieves the Discover label with the name of Example_label.
query exampleGetSpecificLabel($name: String!) {
discoverLabel(ref: {name: $name}) {
name
type
createdTime
modifiedTime
interfaceCounts {
managed
unmanaged
total
unmanageable
}
}
}
Include the name variable in the Variables panel or in your variables dictionary:
{
"name": "Example_label"
}
Example response:
{
"data": {
"discoverLabel": {
"name": "Example label 1",
"type": "AUTOMATIC",
"createdTime": "2024-07-23T18:51:58.230Z",
"modifiedTime": "2024-07-23T18:51:58.230Z",
"interfaceCounts": {
"managed": 0,
"unmanaged": 0,
"total": 0,
"unmanageable": 0
}
}
}
}
Get multiple Discover labels
(query.discoverLabels)
The discoverLabels query requires Discover and the Discover Asset read permission.
The following query retrieves the first 2 Discover labels.
query exampleGetLabels($first: Int) {
discoverLabels(first: $first) {
edges {
node {
name
type
createdTime
interfaceCounts {
managed
unmanaged
total
unmanageable
}
modifiedTime
}
}
}
}
Include the pagination variable in the Variables panel or in your variables dictionary:
{
"first": 2
}
Example response:
{
"data": {
"discoverLabels": {
"edges": [
{
"node": {
"name": "Example label 1",
"type": "AUTOMATIC",
"createdTime": "2024-07-23T18:51:58.230Z",
"interfaceCounts": {
"managed": 0,
"unmanaged": 0,
"total": 0,
"unmanageable": 0
},
"modifiedTime": "2024-07-23T18:51:58.230Z"
}
},
{
"node": {
"name": "Example label 2",
"type": "AUTOMATIC",
"createdTime": "2020-05-20T14:48:30.268Z",
"interfaceCounts": {
"managed": 0,
"unmanaged": 0,
"total": 0,
"unmanageable": 0
},
"modifiedTime": "2020-05-20T14:48:30.268Z"
}
}
]
}
}
}
Remove Discover labels from Discover interfaces
(mutation.discoverInterfaceRemoveLabel)
The discoverInterfaceRemoveLabel mutation requires Discover and the Discover Tag write permission.
The following mutation manually removes one or more standard labels from one or more specified interfaces.
mutation exampleRemoveInterfaceLabel($labelNames: [String!]!, $interfaceIDs: [ID!]!) {
discoverInterfaceRemoveLabel(input: {names: $labelNames, interfaceIDs: $interfaceIDs}) {
success
error {
message
}
cursor
}
}
Include the interface variables in the Variables panel or in your variables dictionary:
{
"labelNames": [
"example_label",
"example_label_2"
],
"interfaceIDs": [
12345,
67890
]
}
Example response:
{
"data": {
"discoverInterfaceRemoveLabel": {
"success": true,
"error": null,
"cursor": null
}
}
}
If your mutation request returns a cursor, the label is not yet removed from the interfaces that you specify. You can pass the cursor as input to a subsequent discoverInterfaceRemoveLabel mutation to determine the status of the initial request.
mutation exampleRemoveInterfaceLabel($labelNames: [String!]!, $interfaceIDs: [ID!]!) {
discoverInterfaceRemoveLabel(
input: {
labelNames: $labelNames,
interfaceIDs: $interfaceIDs
cursor: "Mg=="
}
) {
success
error {
message
}
cursor
}
}