$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Dynamics 365intermediateNew

D365 Dataverse API

Share

Interact with Dataverse Web API for CRUD and batch operations

Works with OpenClaude

You are a Dynamics 365 developer. The user wants to interact with Dataverse Web API to perform CRUD operations and batch requests.

What to check first

  • Verify your Dynamics 365 environment URL (e.g., https://yourorg.crm.dynamics.com)
  • Confirm you have an Azure AD app registration with user_impersonation permission for Dataverse
  • Check your client ID, tenant ID, and client secret are available for authentication
  • Run a test REST call to https://yourorg.api.dynamics.com/api/data/v9.2/ to verify API connectivity

Steps

  1. Authenticate to Azure AD using your app registration credentials to get an access token via the OAuth 2.0 client credentials flow
  2. Set the authorization header with the bearer token and Content-Type: application/json for all requests
  3. For create operations, POST to https://yourorg.api.dynamics.com/api/data/v9.2/{table_name} with the entity object in the request body
  4. For read operations, GET from the same endpoint with query parameters like $select, $filter, $orderby, and $top to retrieve specific records
  5. For update operations, PATCH to https://yourorg.api.dynamics.com/api/data/v9.2/{table_name}({id}) with only the fields you want to change
  6. For delete operations, send a DELETE request to the full entity URI with the record ID
  7. For batch operations, POST to https://yourorg.api.dynamics.com/api/data/v9.2/$batch with multipart content containing multiple requests in a single payload
  8. Parse the response status codes (201 for create, 200 for read/update, 204 for delete, 200 for batch) and handle errors with detailed error messages from error.innererror.message

Code

const https = require('https');

class DataverseClient {
  constructor(orgUrl, clientId, clientSecret, tenantId) {
    this.orgUrl = orgUrl;
    this.clientId = clientId;
    this.clientSecret = clientSecret;
    this.tenantId = tenantId;
    this.accessToken = null;
    this.tokenExpiry = null;
  }

  async getAccessToken() {
    if (this.accessToken && new Date() < this.tokenExpiry) {
      return this.accessToken;
    }

    const tokenUrl = `https://login.microsoftonline.com/${this.tenantId}/oauth2/v2.0/token`;
    const body = new URLSearchParams({
      client_id: this.clientId,
      client_secret: this.clientSecret,
      scope: `${this.orgUrl}/.default`,
      grant_type: 'client_credentials'
    });

    return new Promise((resolve, reject) => {
      const request = https.request(tokenUrl,

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryDynamics 365
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
dynamics365dataverseapi

Install command:

curl -o ~/.claude/skills/d365-dataverse-api.md https://clskills.in/skills/dynamics365/d365-dataverse-api.md

Related Dynamics 365 Skills

Other Claude Code skills in the same category — free to download.

Want a Dynamics 365 skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.