# listIntegrations

Every integration on the app's Integrations page and whether it is CONNECTED, in one read: currentUser.connectedEmailIntegrations (the key owner's own Google/Microsoft mailboxes; email is per person, so a teammate's mailbox is not here), oauthQuery.slackIntegrationStatus, Facebook Lead Ads through the key owner's own Facebook account (oauthQuery.listFacebookPages: Lead Ads is CONNECTED only when a Page has connected: true, the way the card reads it; facebookAccountConnected is just the account sign-in, and a null page list means Facebook did not answer), organizationQuery.getOrganization callTools / smrtPhone / enzo / readyMode (the dialers; a connected Enzo or ReadyMode lists its campaigns), directMailConnectionQuery.list (Lob, PostGrid, OLC: state ACTIVE | PENDING_VERIFICATION | DISCONNECTED, authHealth; rows outlive a disconnect, so an empty list means no account was ever connected), and phoneEnrichmentQuery.providers (phone enrichment such as Trestle: connectionStatus ACTIVE | NOT_CONNECTED | REVOKED | UNVERIFIED). Zapier, incoming webhooks and API keys are not listed. To connect anything, send the user the link from getIntegrationSetupUrls: connecting needs their own login. Organization admins only.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "listIntegrations", "variables": {...} }`
- Scope: `ADMIN`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

None.

## Response (data, an example)

```json
{
  "currentUser": {
    "id": "<ID>",
    "connectedEmailIntegrations": [
      {
        "provider": "GMAIL",
        "email": "…",
        "isDefaultForSending": true
      }
    ]
  },
  "oauthQuery": {
    "slackIntegrationStatus": {
      "connected": true,
      "teamId": "…"
    },
    "facebookAccountConnected": true,
    "listFacebookPages": [
      {
        "id": "…",
        "name": "…",
        "connected": true
      }
    ]
  },
  "organizationQuery": {
    "getOrganization": {
      "id": "<ID>",
      "callToolsIntegrationStatus": {
        "connected": true
      },
      "smrtPhoneIntegrationStatus": {
        "connected": true
      },
      "enzo": {
        "connected": true,
        "campaignConfigs": [
          {
            "id": "<ID>",
            "campaignName": "…"
          }
        ]
      },
      "readyMode": {
        "connected": true,
        "campaignConfigs": [
          {
            "id": "<ID>",
            "campaignName": "…"
          }
        ]
      }
    }
  },
  "directMailConnectionQuery": {
    "list": [
      {
        "id": "<ID>",
        "provider": "OPEN_LETTER_CONNECT",
        "label": "…",
        "state": "PENDING_VERIFICATION",
        "authHealth": "UNVERIFIED"
      }
    ]
  },
  "phoneEnrichmentQuery": {
    "providers": [
      {
        "provider": {
          "key": "…",
          "displayName": "…"
        },
        "connectionStatus": "NOT_CONNECTED"
      }
    ]
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "listIntegrations",
    "variables": {}
  }'
```
