---
schema_version: "1"
id: 0472551d1614e2e2fe6af1602aa97174b6f88eac2aa85cfdc05081f675d51720
title: ExternalManagedAccount Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_ConnectAPI_ExternalManagedAccount_static_methods.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ExternalManagedAccount_static_methods.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2f0721317dfeeca812a5aca68b2b0559b778e213e6f3a3e3beda55c82c6ef894
description: Get externally managed accounts.These methods are for ExternalManagedAccount. All methods are static.Get externally managed accounts available to the context user across all Experience Cloud sites.Get externally managed accounts available to the context user, including the context user’s account, across all Experience Cloud sites.Get externally managed accounts for a store.Get externally managed accounts, including the context user’s account, for a store.
---
# ExternalManagedAccount Class

Get externally managed accounts.

## Namespace

[ConnectApi](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_connect_api.htm "The ConnectApi namespace (also called Connect in Apex) provides classes for accessing the same data available in Connect REST API. Use Connect in Apex to create custom experiences in Salesforce.")

## ExternalManagedAccount Methods

These methods are for ExternalManagedAccount. All methods are static.

- **[getCommunitiesExternalManagedAccounts(communityId)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ExternalManagedAccount_static_methods.htm#apex_ConnectAPI_ExternalManagedAccount_getCommunitiesExternalManagedAccounts_1)**  
    Get externally managed accounts available to the context user across all Experience Cloud sites.
- **[getCommunitiesExternalManagedAccounts(communityId, includeMyAccount)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ExternalManagedAccount_static_methods.htm#apex_ConnectAPI_ExternalManagedAccount_getCommunitiesExternalManagedAccounts_2)**  
    Get externally managed accounts available to the context user, including the context user’s account, across all Experience Cloud sites.
- **[getExternalManagedAccounts(webstoreId)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ExternalManagedAccount_static_methods.htm#apex_ConnectAPI_ExternalManagedAccount_getExternalManagedAccounts_1)**  
    Get externally managed accounts for a store.
- **[getExternalManagedAccounts(webstoreId, includeMyAccount)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ExternalManagedAccount_static_methods.htm#apex_ConnectAPI_ExternalManagedAccount_getExternalManagedAccounts_2)**  
    Get externally managed accounts, including the context user’s account, for a store.

### getCommunitiesExternalManagedAccounts(communityId)

Get externally managed accounts available to the context user across all Experience Cloud sites.

#### API Version

50.0

#### Requires Chatter

No

#### Signature

public static ConnectApi.ExternalManagedAccountCollectionOutput getCommunitiesExternalManagedAccounts(String communityId)

#### Parameters

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

Regardless of the ID specified, this method returns externally managed accounts available to the context user across all Experience Cloud sites.

#### Return Value

Type: [ConnectApi.ExternalManagedAccountCollectionOutput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_external_managed_account_collection_output.htm "Collection of externally managed accounts.")

### getCommunitiesExternalManagedAccounts(communityId, includeMyAccount)

Get externally managed accounts available to the context user, including the context user’s account, across all Experience Cloud sites.

#### API Version

53.0

#### Requires Chatter

No

#### Signature

public static ConnectApi.ExternalManagedAccountCollectionOutput getCommunitiesExternalManagedAccounts(String communityId, Boolean includeMyAccount)

#### Parameters

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

Regardless of the ID specified, this method returns externally managed accounts available to the context user across all Experience Cloud sites.

includeMyAccount

Type: Boolean

Specifies whether to return the context user’s account (true) or not (false). The default value is false.

#### Return Value

Type: [ConnectApi.ExternalManagedAccountCollectionOutput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_external_managed_account_collection_output.htm "Collection of externally managed accounts.")

### getExternalManagedAccounts(webstoreId)

Get externally managed accounts for a store.

#### API Version

49.0

#### Requires Chatter

No

#### Signature

public static ConnectApi.ExternalManagedAccountCollectionOutput getExternalManagedAccounts(String webstoreId)

#### Parameters

webstoreId

Type: String

ID of the webstore.

#### Return Value

Type: [ConnectApi.ExternalManagedAccountCollectionOutput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_external_managed_account_collection_output.htm "Collection of externally managed accounts.")

### getExternalManagedAccounts(webstoreId, includeMyAccount)

Get externally managed accounts, including the context user’s account, for a store.

#### API Version

53.0

#### Requires Chatter

No

#### Signature

public static ConnectApi.ExternalManagedAccountCollectionOutput getExternalManagedAccounts(String webstoreId, Boolean includeMyAccount)

#### Parameters

webstoreId

Type: String

ID of the webstore.

includeMyAccount

Type: Boolean

Specifies whether to return the context user’s account (true) or not (false). The default value is false.

#### Return Value

Type: [ConnectApi.ExternalManagedAccountCollectionOutput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_external_managed_account_collection_output.htm "Collection of externally managed accounts.")