web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to Create multiple entity record using the Web API?

(0) ShareShare
ReportReport
Posted on by 1,088
Hi, according to MS documentation

Create an entity record using the Web API

the sample for create an account like this 
POST [Organization URI
/api/data/v9.0/accounts HTTP/1.1 Content-Type: application/json; charset=utf-8 OData-MaxVersion: 4.0 OData-Version: 4.0 Accept: application/json

{
    "name": "Sample Account"
}


but i can't send an array like this
[{
    "name": "Sample Account1"
},

{
    "name": "Sample Account2"
},

{
    "name": "Sample Account3"
}...]


How to do that? Thanks.
I have the same question (0)
  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Pablo,

    We need to use "orgURL/api/data/v9.1/$batch" to insert multiple records in single request.

    Here is an example with Postman:

    4278.PNG

    Body:

    Clofly123 is a unique identifier of the request body, d291f184-3d87-44a2-b12d-6fc13a4d4d9c is a randomly generated GUID.

    You can change them to your own string or guid.

    --batch_Clofly123
    Content-Type: multipart/mixed; boundary=changeset_d291f184-3d87-44a2-b12d-6fc13a4d4d9c
    
    --changeset_d291f184-3d87-44a2-b12d-6fc13a4d4d9c
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    Content-ID: 1
    
    POST https://company.crm5.dynamics.com/api/data/v9.1/accounts HTTP/1.1
    Content-Type: application/json
    
    {
        "name":"aaa"
    }
    
    --changeset_d291f184-3d87-44a2-b12d-6fc13a4d4d9c
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    Content-ID: 2
    
    POST https://company.crm5.dynamics.com/api/data/v9.1/accounts HTTP/1.1
    Content-Type: application/json
    
    {
        "name":"An account"
    }
    
    --changeset_d291f184-3d87-44a2-b12d-6fc13a4d4d9c--
    --batch_Clofly123--

    Headers:

    Content-Transfer-Encoding: binary

    Content-Type: multipart/mixed; boundary=changeset_d291f184-3d87-44a2-b12d-6fc13a4d4d9c

    234.PNG

    Result(success):

    The status code is 200, and it will return batchresponse text in its response message.

    3264.PNG

    Please refer to following links for more details about batch operation:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/execute-batch-operations-using-web-api

    https://nuxulu.com/2019/10/15/Insert-multiple-records-in-single-request-using-Odata-from-Postman.html

    Regards,

    Clofly

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 151

#2
ManoVerse Profile Picture

ManoVerse 149 Super User 2026 Season 1

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 66 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans