# Litmus UNS/UNS - LE, LEM, LUNS API Docs

## Namespace

**POST** `{{uns_url}}/mqtt/gql`

This defines the allowed classes for UNS

For example, `"uns": "enterprise/site/area/productionunit"` means that topics written with this structure should be considered as UNS

### Request Body

**GraphQL Query**

```graphql
query Namespace {
    namespace {
        id
        uns
        filters
        classes {
            name
            items
            minItems
            maxItems
        }
        hierarchyCompiant {
            name
            path
            class
            topics {
                path
                byteCount
                msgCount
                pubRate
                lastSeen
                UNS
                lastVal {
                    timestamp
                    deviceName
                    tagName
                    datatype
                    value
                }
            }
        }
        hierarchyNonCompiant {
            name
            path
            class
            topics {
                path
                byteCount
                msgCount
                pubRate
                lastSeen
                UNS
                lastVal {
                    timestamp
                    deviceName
                    tagName
                    datatype
                    value
                }
            }
        }
    }
}
```

### Response

**Status**: 200 OK

```json
{
    "data": {
        "namespace": {
            "id": "0D0DA0ED-3512-42E4-8AA1-2308B219AFBA",
            "uns": "enterprise/site/area/productionunit",
            "filters": null,
            "classes": [
                {
                    "name": "enterprise",
                    "items": [
                        "abccorp"
                    ],
                    "minItems": 0,
                    "maxItems": 1
                },
                {
                    "name": "site",
                    "items": [
                        "site1",
                        "site2"
                    ],
                    "minItems": 0,
                    "maxItems": 10
                },
                {
                    "name": "area",
                    "items": [
                        "area1"
                    ],
                    "minItems": 0,
                    "maxItems": 10
                },
                {
                    "name": "productionunit",
                    "items": [],
                    "minItems": 0,
                    "maxItems": 0
                }
            ],
            "hierarchyCompiant": {
                "name": "",
                "path": "",
                "class": null,
                "topics": [
                    {
                        "path": "abccorp/site1/area1/productionunit",
                        "byteCount": 638730577,
                        "msgCount": 2488224,
                        "pubRate": 1.0842021724855042e-10,
                        "lastSeen": "2024-03-19 15:16:42 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag500",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag501",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag502",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag503",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag504",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag505",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag506",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag507",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag508",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag509",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag510",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag511",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area1/cell/plc/sensor/tag512",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "UNS",
                        "lastVal": null
                    }
                ]
            },
            "hierarchyNonCompiant": {
                "name": "",
                "path": "",
                "class": null,
                "topics": [
                    {
                        "path": "///",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "Enterprise",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "Enterprise/Site",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "Enterprise/Site/Area/Production",
                        "byteCount": 559899987,
                        "msgCount": 1171739,
                        "pubRate": 1.0842021724855042e-10,
                        "lastSeen": "2024-03-20 22:08:47 UTC",
                        "UNS": "NonUNS",
                        "lastVal": {
                            "timestamp": 0,
                            "deviceName": "",
                            "tagName": "",
                            "datatype": "",
                            "value": ""
                        }
                    },
                    {
                        "path": "EnterpriseOne/Site/Area/Production",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "NCC-1701/Site/Area/Production",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag500",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag501",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag502",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag503",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag504",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag505",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag506",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag507",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "abccorp/site2/area2/cell/plc/sensor/tag508",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "enterprise/site/area/machine",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/gateway",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/port/1",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/port/2",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/port/3",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/port/4",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/port/5",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/port/6",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/port/7",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/config/port/8",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/gateway",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/port/1",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/port/2",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/port/3",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/port/4",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/port/5",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/port/6",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/port/7",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/process/port/8",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/gateway",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/port/1",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/port/2",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/port/3",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/port/4",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/port/5",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/port/6",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/port/7",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    },
                    {
                        "path": "lionx/status/port/8",
                        "byteCount": 0,
                        "msgCount": 0,
                        "pubRate": 0,
                        "lastSeen": "0001-01-01 00:00:00 UTC",
                        "UNS": "NonUNS",
                        "lastVal": null
                    }
                ]
            }
        }
    }
}
```

---

## Account

**POST** `{{uns_url}}/mqtt/gql`

Get accounts that can be used in access control policy (ACL) on the UNS page

### Request Body

**GraphQL Query**

```graphql
query Account {
    account {
        clients {
            id
            connected
            protoLevel
            remote
            lastSeen
        }
        id
        username
        acType
        enabled
        rules {
            id
            path
            perm
        }
    }
}
```

### Response

**Status**: 200 OK

```json
{
    "data": {
        "account": [
            {
                "clients": null,
                "id": "5ACB74CE-FFBF-43B2-87D2-E422931F6035",
                "username": "ide-ui",
                "acType": "General",
                "enabled": true,
                "rules": null,
                "__typename": "Account"
            }
        ]
    }
}
```

---

## Rename Namespace

**POST** `{{uns_url}}/mqtt/gql`

to change class configuration of Unified structure

### Request Body

**GraphQL Query**

```graphql
mutation NamespaceRename($deleteInput: NamespaceDeleteInput!, $createInput: NamespaceCreateInput!) {
    namespaceDelete(input: $deleteInput) {
        id
    }
    namespaceCreate(input: $createInput) {
        root {
            id
            uns
            hierarchyNonCompiant {
                name
                path
                class
            }
            classes {
                name
            }
        }
    }
}
```

**Variables**

```json
{
    "deleteInput": {
        "id": "{{uns_namespace_id}}"
    },
    "createInput": {
        "uns": "enterprise/site/area/productionunit"
    }
}
```

### Response

**Status**: 200 OK

```json
{
    "data": {
        "namespaceDelete": {
            "id": "2AC73680-48CF-4419-B9EA-E7DCB4DC9CDE"
        },
        "namespaceCreate": {
            "root": {
                "id": "9673F355-A1A2-41AC-9236-E28B39B6C426",
                "uns": "enterprise/site/area/productionunit",
                "hierarchyNonCompiant": {
                    "name": "",
                    "path": "",
                    "class": null
                },
                "classes": [
                    {
                        "name": "enterprise"
                    },
                    {
                        "name": "site"
                    },
                    {
                        "name": "area"
                    },
                    {
                        "name": "productionunit"
                    }
                ]
            }
        }
    }
}
```

---

## Update Namespace Rules

**POST** `{{uns_url}}/mqtt/gql`

to change the rules in a configuration of a UNS

### Request Body

**GraphQL Query**

```graphql
mutation NamespaceUpdateRules($input: NamespaceUpdateClassConfigInput!) {
    namespaceUpdateClassConfig(input: $input) {
        classes {
            name
            items
            maxItems
        }
    }
}
```

**Variables**

```json
{
    "input": {
        "id": "{{uns_namespace_rule_id}}",
        "cfg": [
            {
                "items": [
                    "entVal"
                ]
            },
            {
                "items": [
                    "val",
                    "val2"
                ]
            },
            {
                "items": [
                    "2"
                ]
            }
        ]
    }
}
```

### Response

**Status**: 200 OK

```json
{
    "data": {
        "namespaceUpdateClassConfig": {
            "classes": [
                {
                    "name": "enterprise",
                    "items": [
                        "entVal"
                    ],
                    "maxItems": 1
                },
                {
                    "name": "site",
                    "items": [
                        "val",
                        "val2"
                    ],
                    "maxItems": 10
                },
                {
                    "name": "area",
                    "items": [
                        "2"
                    ],
                    "maxItems": 10
                },
                {
                    "name": "productionunit",
                    "items": [],
                    "maxItems": 0
                }
            ]
        }
    }
}
```

---

## Kafka

**POST** `{{uns_url}}/mqtt/gql`

### Request Body

**GraphQL Query**

```graphql
query Kafka {
    kafka {
        pubFilters
        currentCfg {
            Name
            Enabled
            Brokers
            Balancer
            TopicsMapping {
                InTopic
                OutTopic
            }
            Username
            Password
            AuthMethod
            RequireSsl
            TrustedCaChain
            Compression
            RequiredAcks
            WriteTimeoutSec
        }
        status {
            active
        }
    }
}

```

### Response

**Status**: 200 OK

```json
{
    "data": {
        "kafka": {
            "pubFilters": null,
            "currentCfg": {
                "Name": "",
                "Enabled": true,
                "Brokers": [
                    "kafka.kafka.svc.cluster.local:9092"
                ],
                "Balancer": "RoundRobin",
                "TopicsMapping": [
                    {
                        "InTopic": "Litmus/#",
                        "OutTopic": "test"
                    }
                ],
                "Username": "user1",
                "Password": "r9UgUturmG",
                "AuthMethod": "Plain",
                "RequireSsl": false,
                "TrustedCaChain": null,
                "Compression": "Zstd",
                "RequiredAcks": "All",
                "WriteTimeoutSec": 10
            },
            "status": {
                "active": true
            }
        }
    }
}
```

---

## Add Permission to Account

**POST** `{{uns_url}}/mqtt/gql`

for adding topic/permission to an account on UNS

### Request Body

**GraphQL Query**

```graphql
mutation accountAddRules($input: AccountAddRulesInput!) {
    accountAddRules(input: $input) {
        account {
            id
            username
            rules {
                id
                path
                perm
            }
        }
    }
}
```

**Variables**

```json
{
  "input": {
    "acctId": "{{uns_account_id}}",
    "rules": [
      {
        "path": "{{uns_topic}}",
        "perm": "Sub"
      }
    ]
  }
}
```

### Response

**Status**: 200 OK

```json
{
    "data": {
        "accountAddRules": {
            "account": {
                "id": "5ACB74CE-FFBF-43B2-87D2-E422931F6035",
                "username": "ide-ui",
                "rules": [
                    {
                        "id": "4F39EFA4-3A77-473C-906A-361FB2B5CB68",
                        "path": "bh",
                        "perm": "Sub"
                    },
                    {
                        "id": "E2FB1031-C2A8-4F65-B8B4-895F294E7295",
                        "path": "topicName",
                        "perm": "Sub"
                    },
                    {
                        "id": "86887A4B-E5A6-47DA-9AE6-8ABDA303DC4D",
                        "path": "topicName",
                        "perm": "Sub"
                    },
                    {
                        "id": "2A38CD43-DB5D-41BA-A9D7-E13CF347196F",
                        "path": "topicName",
                        "perm": "PubSub"
                    },
                    {
                        "id": "6F9793FB-645A-4DCE-8FD7-ABB213095A55",
                        "path": "topicName",
                        "perm": "PubSub"
                    }
                ]
            }
        }
    }
}
```

---

## Topics

**POST** `{{uns_url}}/mqtt/gql`

### Request Body

**GraphQL Query**

```graphql
query Topics {
    topics {
        path
        byteCount
        msgCount
        pubRate
        lastSeen
        clients
        UNS
    }
}

```

### Response

**Status**: 200 OK

```json
{
    "data": {
        "topics": [
            {
                "path": "Litmus/SantaClara/Simulator/le",
                "byteCount": 255077780255,
                "msgCount": 964699501,
                "pubRate": 1982.199,
                "lastSeen": "2024-08-05 22:27:33 UTC",
                "clients": null,
                "UNS": "NonUNS"
            },
            {
                "path": "spBv1.0/My Devices/NCMD/EoN Name/My Device",
                "byteCount": 14186,
                "msgCount": 346,
                "pubRate": 1.988,
                "lastSeen": "2024-08-07 00:07:32 UTC",
                "clients": null,
                "UNS": "NonUNS"
            },
            {
                "path": "spBv1.0/TempSensor/NBIRTH/Poorvatest",
                "byteCount": 216,
                "msgCount": 4,
                "pubRate": 0.002,
                "lastSeen": "2024-08-07 00:08:28 UTC",
                "clients": null,
                "UNS": "NonUNS"
            }
        ]
    }
}
```

---

