---
schema_version: "1"
id: 3cbb5f8bc7ba86a921ccfb14c22e8b47c0e3ef04a8f57af49f2d8502cc77dc6c
title: Connect in Apex
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/connectAPI_overview.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectAPI_overview.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 208b5bb73315f042525d73f1c9f6144a294bf8fd5a76844c47aa832b030d005e
description: Use Connect in Apex to develop custom experiences in Salesforce. Connect in Apex provides programmatic access to B2B Commerce, CMS managed content, Experience Cloud sites, topics, and more. Create Apex pages that display Chatter feeds, post feed items with mentions and topics, and update user and group photos. Create triggers that update Chatter feeds.
---
# Connect in Apex

Use Connect in Apex to develop custom experiences in Salesforce. Connect in Apex provides programmatic access to B2B Commerce, CMS managed content, Experience Cloud sites, topics, and more. Create Apex pages that display Chatter feeds, post feed items with mentions and topics, and update user and group photos. Create triggers that update Chatter feeds.

Many Connect REST API resource actions are exposed as static methods on Apex classes in the ConnectApi namespace. These methods use other ConnectApi classes to input and return information. The ConnectApi namespace is referred to as _Connect in Apex._

In Apex, you can access some Connect data using SOQL queries and objects. However, it’s simpler to expose data in ConnectApi classes, and data is localized and structured for display. For example, instead of making several calls to access and assemble a feed, you can do it with a single call.

Connect in Apex methods execute in the context of the user executing the methods. The code has access to whatever the context user has access to. It doesn’t run in system mode.

For Connect in Apex reference information, see [ConnectApi Namespace](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_classes_connect_api.htm).

- **[Connect in Apex Examples](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_examples.htm)**  
    Use these examples to perform common tasks with Connect in Apex.
- **[Connect in Apex Features](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_features.htm)**  
    This topic describes which classes and methods to use to work with common Connect in Apex features.
- **[Using ConnectApi Input and Output Classes](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_inputs_outputs.htm)**  
    Some classes in the ConnectApi namespace contain static methods that access Connect REST API data. The ConnectApi namespace also contains input classes to pass as parameters and output classes that calls to the static methods return.
- **[Understanding Limits for ConnectApi Classes](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connect_api_limits.htm)**  
    Limits for methods in the ConnectApi namespace are different than the limits for other Apex classes.
- **[Packaging ConnectApi Classes](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connect_api_packaging.htm)**  
    If you include ConnectApi classes in a package, be aware of Chatter dependencies.
- **[Serializing and Deserializing ConnectApi Objects](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_serialization.htm)**  
    When ConnectApi output objects are serialized into JSON, the structure is similar to the JSON returned from Connect REST API. When ConnectApi input objects are deserialized from JSON, the format is also similar to Connect REST API.
- **[ConnectApi Versioning and Equality Checking](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_versioning.htm)**  
    Versioning in ConnectApi classes follows specific rules that are different than the rules for other Apex classes.
- **[Casting ConnectApi Objects](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_casting.htm)**  
    It may be useful to downcast some ConnectApi output objects to a more specific type.
- **[Wildcards](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/intro_wildcards.htm)**  
    Use wildcard characters to match text patterns in Connect REST API and Connect in Apex searches.
- **[Testing ConnectApi Code](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectAPI_TestingApex.htm)**  
    Like all Apex code, Connect in Apex code requires test coverage.
- **[Differences Between ConnectApi Classes and Other Apex Classes](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_differences.htm)**  
    Note these additional differences between ConnectApi classes and other Apex classes.