Title: Bulk Insert Posts via REST API
Last modified: July 19, 2023

---

# Bulk Insert Posts via REST API

 *  [presencezach](https://wordpress.org/support/users/presencezach/)
 * (@presencezach)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/bulk-insert-posts-via-rest-api/)
 * I am starting some work with the WordPress REST API to create Posts from Salesforce
   records. I am trying to insert multiple Posts in one API call to avoid using 
   too many API callouts as Salesforce has pretty strict governor limits. The best
   I’ve found so far is the Batch framework within wordpress and have begun experimenting
   with this but I’m looking for more information on how to use this with builtin
   WordPress endpoints.
 * > [REST API Batch Framework in WordPress 5.6](https://make.wordpress.org/core/2020/11/20/rest-api-batch-framework-in-wordpress-5-6/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbulk-insert-posts-via-rest-api%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [dhruvkb](https://wordpress.org/support/users/dhruvkb/)
 * (@dhruvkb)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/bulk-insert-posts-via-rest-api/#post-16937503)
 * The `/wp/v2/posts` endpoint supports batching so to make multiple posts, you 
   can send a POST request to `/wp-json/batch/v1/` with the following structure.
 *     ```wp-block-code
       {
         "requests": [
           {
             "method": "POST",
             "path": "/wp/v2/posts",
             "body": {
               "slug": "slug-1",
               "title": "Title 1",
               "excerpt": "Excerpt 1",
               "content": "Content 1",
               "status": "publish"
             }
           },
           {
             "method": "POST",
             "path": "/wp/v2/posts",
             "body": {
               "slug": "slug-2",
               "title": "Title 2",
               "excerpt": "Excerpt 2",
               "content": "Content 2",
               "status": "publish"
             }
           }
         ]
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Bulk Insert Posts via REST API’ is closed to new replies.

## Tags

 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [dhruvkb](https://wordpress.org/support/users/dhruvkb/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/bulk-insert-posts-via-rest-api/#post-16937503)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
