Use the Salesforce Connect REST API (Connect API / Chatter) to post a feed item with a file attachment to a record's feed

domain: salesforce.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Salesforce Bulk API 2.0 limits — the full failure-mode walkthrough related to salesforce.com, checked against official docs, with linked verified routes.

Steps

  1. POST /services/data/vXX.0/connect/files/users/me with the binary file content using multipart/form-data to upload the file and obtain a ContentDocument ID
  2. Construct a JSON body with 'feedElementType':'FeedItem', 'subjectId' set to the target record ID, and a 'capabilities.files.items' array containing the ContentDocument ID
  3. POST /services/data/vXX.0/connect/feed-elements to create the feed item with the attachment
  4. Capture the returned 'id' (feed element ID) and poll or subscribe to confirm the item appears in the record feed
  5. Use GET /services/data/vXX.0/connect/feed-elements/{feedElementId} to verify the attachment and body are correct

Known gotchas

Related routes

Use Salesforce Connect REST (Chatter REST API) to post a feed item with a mention and a file attachment to a record feed
developer.salesforce.com · 6 steps · unrated
Use the Salesforce Connect REST API (Chatter REST API) to query record feeds and post rich feed items with inline images
developer.salesforce.com · 6 steps · unrated
Stream records into a Salesforce Data Cloud data stream using the Streaming Ingestion API
developer.salesforce.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans