# Accounts

> Read the cloud accounts connected to LevelFour, what each one can do, the modules your organization has, and the work tools it is connected to, and disconnect a work tool.

Source: https://docs.levelfour.ai/resources/accounts


The accounts methods read what is connected to your organization: cloud accounts, what LevelFour can do in each, the modules you have, and the work tools you have linked. Reads take any key. Disconnecting a work tool takes a read-write key. The examples show the Go SDK and plain HTTP.

Connecting a cloud account or a work tool happens in the dashboard, because each one ends in the provider's own consent screen. [Connect Providers](/connectors) and [Integrations](/integrations) walk through them.

## Methods

| Method                                              | Returns                                                         |
| --------------------------------------------------- | --------------------------------------------------------------- |
| [List connected accounts](#list-connected-accounts) | Every cloud account connected to your organization              |
| [List connections](#list-connections)               | What LevelFour can do in each account                           |
| [List modules](#list-modules)                       | The modules your organization has, and their state              |
| [Work tool connections](#work-tool-connections)     | Connected GitHub, GitLab, Jira and Slack, and disconnecting one |

## List connected accounts

Returns the cloud accounts connected to your organization, paginated. `page_size` goes up to 200 and defaults to 50.

**Go**

```go  
accounts, err := client.Accounts.ListConnectedAccounts(ctx,
    &levelfour.ListConnectedAccountsAPIV1AccountsGetRequest{
        PageSize: levelfour.Int(200),
    },
)
```

**HTTP**

```bash  
curl -s "https://api.levelfour.ai/api/v1/accounts?page_size=200" \
  -H "Authorization: Bearer $LEVELFOUR_API_KEY"
```

Each AWS account also reports its [detailed cost data](/connectors/aws/detailed-cost-data) state: whether the export is active, where it delivers, and when LevelFour last read it.

## List connections

Returns, for each connected account, which LevelFour capabilities are ready. A capability reads `true` when it is on, `false` when it needs setup, and `null` when LevelFour could not tell. One that needs setup carries the link that sets it up, such as the stack for [Automated Savings](/connectors/aws/automated-savings).

**Go**

```go  
connections, err := client.Accounts.ListConnections(ctx)
```

**HTTP**

```bash  
curl -s "https://api.levelfour.ai/api/v1/accounts/connections" \
  -H "Authorization: Bearer $LEVELFOUR_API_KEY"
```

## List modules

Returns the modules your organization has, with each one's state (`inactive`, `trial`, `active`, `past_due`, `revoked` or `beta`), plan tier and dates. A module you do not have is why a page or a method is missing for you.

**Go**

```go  
modules, err := client.Accounts.ListCustomerModules(ctx)
```

**HTTP**

```bash  
curl -s "https://api.levelfour.ai/api/v1/accounts/modules" \
  -H "Authorization: Bearer $LEVELFOUR_API_KEY"
```

## Work tool connections

List the work tools connected to your organization. GitHub reports its App installations, and the others their connections.

**Go**

```go  
github, err := client.Accounts.ListGithubInstallations(ctx)
gitlab, err := client.Accounts.ListGitlabConnections(ctx)
jira, err := client.Accounts.ListJiraConnections(ctx)
slack, err := client.Accounts.ListSlackConnections(ctx)
```

**HTTP**

```bash  
curl -s "https://api.levelfour.ai/api/v1/accounts/gitlab/connections" \
  -H "Authorization: Bearer $LEVELFOUR_API_KEY"
```

Disconnecting a GitLab, Jira or Slack connection takes its id from the list. Disconnecting GitLab also removes the webhook LevelFour added, and disconnecting Slack stops the bot answering in that workspace.

**Go**

```go  
_, err := client.Accounts.DisconnectSlackConnection(ctx, "connection_id")
```

**HTTP**

```bash  
curl -s -X DELETE "https://api.levelfour.ai/api/v1/accounts/slack/connections/connection_id" \
  -H "Authorization: Bearer $LEVELFOUR_API_KEY"
```

A GitHub App is removed from GitHub itself. [GitHub](/integrations/github) has the steps.

## Next

* [Providers](/resources/providers) lists the providers you have connected, with provider-scoped reads
* [Integrations](/api-reference/integrations) files a task in a connected work tool, such as a Jira issue from a saving
* [API reference](/api-reference/accounts) is every parameter and response field
