Execute a Dataverse Web API $batch request to bundle multiple operations in a single HTTP round trip

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

Steps

  1. Compose a multipart/mixed request body with a unique batch boundary string; each individual operation is a MIME part separated by --batch_<boundary>.
  2. For non-atomic read or write operations, add each individual request as a separate MIME part with its own Content-Type: application/http and Content-Transfer-Encoding: binary headers followed by the raw HTTP request line and body.
  3. To make multiple writes atomic (all succeed or all fail), group them inside a changeset part: use --changeset_<boundary> sub-parts within a Content-Type: multipart/mixed; boundary=changeset_<boundary> parent part.
  4. POST the assembled batch to https://<org>.crm.dynamics.com/api/data/v9.2/$batch with Content-Type: multipart/mixed; boundary=batch_<boundary>.
  5. Parse the multipart response body; each sub-response contains its own HTTP status code — a changeset either fully succeeds (all 204s) or fully fails (the changeset part returns a single error response).
  6. Reference the result of an earlier operation within the same batch using the Content-ID header: set Content-ID: 1 on a create operation, then reference it as $1 in a subsequent operation's URL within the same changeset.

Known gotchas

Related routes

Execute a Dynamics 365 Dataverse Web API $batch request with changesets for atomic multi-table writes
dynamics-365 · 5 steps · unrated
Use the Salesforce Composite API to chain dependent DML operations in one HTTP round trip
salesforce.com · 6 steps · unrated
Execute multiple Salesforce operations in a single round trip using the Composite API
developer.salesforce.com · 5 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