Use Connect REST API for Chatter, feeds, communities, and CMS content instead of querying underlying SObjects. NOT for custom business object CRUD — use integration/graphql-api-patterns.
Scanned 9/6/2026
Install to Claude Code
npx -y skills add PranavNagrecha/AwesomeSalesforceSkills --skill connect-rest-api-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Connect Rest Api Patterns?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/pranavnagrecha-connect-rest-api-patterns)More formats (shields.io, HTML) on the badges page.
---
name: connect-rest-api-patterns
description: "Use Connect REST API for Chatter, feeds, communities, and CMS content instead of querying underlying SObjects. NOT for custom business object CRUD — use integration/graphql-api-patterns."
category: integration
salesforce-version: "Spring '25+"
well-architected-pillars:
- Reliability
- Performance
triggers:
- "connect rest api chatter"
- "post feed item api"
- "experience cloud cms api"
- "connect api salesforce"
tags:
- connect-rest
- chatter
- cms
inputs:
- "feature area (Chatter, CMS, Communities)"
- "required payload"
outputs:
- "REST call examples + Apex ConnectApi equivalents"
dependencies: []
version: 1.1.0
author: Pranav Nagrecha
updated: 2026-08-01
---
# Connect REST API Patterns
Connect REST API exposes Chatter feeds, CMS content, Experience Cloud, and moderation APIs with richer shapes and side-effects than raw SObject access. Use it when the business operation is 'post a feed item with mentions' or 'publish CMS content' rather than 'insert FeedItem row'.
## Adoption Signals
Chatter posts with mentions / rich text, CMS content authoring, community moderation, reports filters at scale.
- Required when the standard REST/SOAP APIs would force the consumer to assemble Chatter feed elements by hand.
- Required for Experience Cloud surfaces where the same payload feeds both UI rendering and external clients.
## Recommended Workflow
1. Identify the Connect resource (`/connect/communities/{id}/chatter/feed-elements`).
2. Prefer `ConnectApi` Apex namespace over REST when inside Apex — same capability, better typing.
3. Pagination via `nextPageUrl` — don't compute offsets manually.
4. Authenticate with Named Credential + OAuth for external callers.
5. Test with low-privilege users to catch perm gaps before go-live.
## Key Considerations
- Connect API respects sharing; raw SObject queries as System Admin can mask issues.
- Response payloads are verbose; request only the fields you need via `?include` where supported.
- CMS endpoints require Experience Cloud license.
- Chatter posts via Connect create notifications — posting from a trigger can cascade.
## Worked Examples (see `references/examples.md`)
- *Post feed item with mention* — Notify record owner
- *CMS content publish* — Publish a Knowledge article
## Common Gotchas (see `references/gotchas.md`)
- **Missing community context** — Post appears in wrong feed.
- **Sharing mismatch** — Integration user can't post on behalf of another.
- **Verbose payload bloat** — Response 500kB.
## Top LLM Anti-Patterns (full list in `references/llm-anti-patterns.md`)
- Inserting FeedItem directly when mentions matter
- Manual pagination math
- Missing community context
## Official Sources Used
- Apex REST & Callouts — https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts.htm
- Named Credentials — https://help.salesforce.com/s/articleView?id=sf.named_credentials_about.htm
- Connect REST API — https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/
- Private Connect — https://help.salesforce.com/s/articleView?id=sf.private_connect_overview.htm
- Bulk API 2.0 — https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/
- Pub/Sub API — https://developer.salesforce.com/docs/platform/pub-sub-api/guide/intro.html
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!