Execute a Dynamics 365 Dataverse OData batch request with changesets for atomic multi-table writes

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. Construct a multipart/mixed request body with a batch boundary string; the Content-Type header is multipart/mixed; boundary=batch_<unique-id>
  2. Wrap related write operations (POST, PATCH, DELETE) that must succeed or fail together inside a changeset part: Content-Type: multipart/mixed; boundary=changeset_<unique-id>
  3. Each individual request inside the changeset is a Content-Type: application/http part with its own HTTP verb, relative URL, and JSON body
  4. POST the entire batch to /api/data/vX.X/$batch; Dataverse processes the changeset atomically — if any operation in the changeset fails, all are rolled back
  5. Parse the multipart response: each part maps to the corresponding request, with its own HTTP status code and body — iterate parts in order to correlate responses to requests
  6. To reference a record created earlier in the same changeset by a Content-ID, use $<contentId> in the URL of a later request within the same changeset (e.g., /$1/parentaccountid@odata.bind)

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
Send multiple Dynamics 365 Web API operations in a single OData batch request
learn.microsoft.com · 5 steps · unrated
Synchronise Dataverse records incrementally using change tracking and delta tokens
dynamics-365 · 5 steps · unrated

Give your agent this knowledge — and 15,500+ 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