# Connections

A `Connection` represents an established, active communications pathway with a foreign agent whom the cloud agent has connected to via successful completion of a [connection exchange](/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/aries-interop-profile-aip/connection-exchanges.md).

## View connections

View established connections, with pagination and filtering options. Returns a `nextToken` which can be passed into the same query in order to fetch subsequent pages.

```graphql
query MyQuery {
  connections(
    page: {
      nextToken: null
    }
    filter: {}
  ) {
    items {
      id
      alias
    }
    nextToken
  }
}
```

Alternatively, view a single connection, referenced by its unique ID.

```graphql
query MyQuery {
  connection(
    connectionId: "001fe530-3562-41d6-a631-3df9c7ae1f38"
  ) {
    id
    alias
  }
}
```

## Delete a connection

Delete an established connection. Any basic messages associated with the connection are also deleted.

```graphql
mutation MyMutation {
  deleteConnection(
    connectionId: "001fe530-3562-41d6-a631-3df9c7ae1f38"
  )
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sudoplatform.com/guides/decentralized-identity/cloud-agent/cloud-agent-admin-api/connections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
