[wp-trac] [WordPress Trac] #60895: Add batch support to users REST API WP_REST_Users_Controller

WordPress Trac noreply at wordpress.org
Fri Apr 5 13:54:35 UTC 2024


#60895: Add batch support to users REST API WP_REST_Users_Controller
-------------------------+------------------------------
 Reporter:  alexminza    |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  REST API     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------

Comment (by alexminza):

 This PR https://github.com/WordPress/wordpress-develop/pull/6364 enables
 batch users operations like for example creating multiple users in a
 single batch request:

 {{{#!sh
 curl --location 'http://localhost:8080/wp-json/batch/v1' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Basic ##REDACTED##' \
 --data-raw '{
     "requests": [
         {
             "method": "POST",
             "path": "/wp/v2/users",
             "body": {
                 "username": "testuser1",
                 "email": "testuser1 at localhost.local",
                 "password": "##REDACTED##"
             }
         },
         {
             "method": "POST",
             "path": "/wp/v2/users",
             "body": {
                 "username": "testuser2",
                 "email": "testuser2 at localhost.local",
                 "password": "##REDACTED##"
             }
         }
     ]
 }'
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60895#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list