# API for getting active connections by device

**URL:** <https://forum.remote.it/t/api-for-getting-active-connections-by-device/916>\
**Category:** Developers\
**Created:** [September 2, 2023, 4:58am UTC](https://forum.remote.it/t/api-for-getting-active-connections-by-device/916 "2023-09-02T04:58:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanf55](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.remote.it/ryanf55/32/368_2.png) [@ryanf55](https://forum.remote.it/u/ryanf55)\
**Post date:** [September 2, 2023, 4:58am UTC](https://forum.remote.it/t/api-for-getting-active-connections-by-device/916/1 "2023-09-02T04:58:25Z")

</div>

I just started using the GraphQL API, in python.

I would like to accomplish the following:

- Given a device name, find the ID (solved)
- Given a device ID, return all available services for that device
- Given a device ID, return any active connections. I am looking to get the SSH proxy address and port

There does not seem to be support for connections other than creating/deleting them (a GraphQL mutation).

> **[Connections](https://docs.remote.it/developer-tools/api/usage/usage-examples)**

I would like to read the current list of connections (a GraphQL query).

If I create a connection in the Web UI, there doesn’t seem a way to get the connection information in the GraphQL API.

---

<div class="post-metadata">

**Author:** ![bstrech](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.remote.it/bstrech/32/266_2.png) [@bstrech](https://forum.remote.it/u/bstrech)\
**Post date:** [September 8, 2023, 1:36am UTC](https://forum.remote.it/t/api-for-getting-active-connections-by-device/916/2 "2023-09-08T01:36:07Z")

</div>

We have documentation and an insomnia collection with sample queries available on this page:

> **[Using Developer Tools](https://docs.remote.it/developer-tools/api/using-developer-tools)**
>
> There are multiple developer tool IDEs such as Insomnia, Postman, and Altair. Here are examples using Insomnia and Postman.

We are constantly adding to our API. You can explore the schema in Insomnia using the schema tool and if you find you would like a specific example, please post here.

---

<div class="post-metadata">

**Author:** ![ryanf55](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.remote.it/ryanf55/32/368_2.png) [@ryanf55](https://forum.remote.it/u/ryanf55)\
**Post date:** [September 8, 2023, 3:46am UTC](https://forum.remote.it/t/api-for-getting-active-connections-by-device/916/3 "2023-09-08T03:46:41Z")

</div>

Thanks! Using insomnia’s space+enter hinting is working well. So far I have this query:

```auto
query {
	login {
 		devices {
		  items {
				protocol
				name
				services {
					title
					enabled
					endpoint {
						state
					}
				}
			}
		}
	}
}

```

I’m looking for the proxy address like so. Which fields do I need to query to get the proxy host and proxy port?  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/remote/original/1X/1801b7841fab91c059b9ee338cd3d9eaacf323ce.png)
