Title: Multiple Categories via API
Last modified: January 7, 2025

---

# Multiple Categories via API

 *  Resolved [jormarques](https://wordpress.org/support/users/jormarques/)
 * (@jormarques)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/multiple-categories-via-api/)
 * Hi,
 * What is the process to update 2 categories for the post (Parent ID and ID)? In
   the documentation there is only reference to Post_category and 1 only. I have
   tried using the same principle of the WordPress REST API standards and it does
   not work. So would be great to allow to post with parent category and child.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * (@stiofansisland)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/multiple-categories-via-api/#post-18229890)
 * Hello,
 * You would simply make it an array:
 *     ```wp-block-code
       $request_params = array(	'title' => 'The London Eye',	'status' => 'publish',	'post_category' => array(		81,		80,		82	),	'default_category' => 81,	'city' => 'London'	...);
       ```
   
 * Thanks,
 * Stiofan
 *  Thread Starter [jormarques](https://wordpress.org/support/users/jormarques/)
 * (@jormarques)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/multiple-categories-via-api/#post-18229980)
 * Hi,
 * I did send as an array, but I get the following error in the REST api response:
   post_category[0] is not of type integer.
 * **params**: {
 * **title**: Hotel Sleep Nice,
 * **post_category**:  [10,2],
    -  This reply was modified 1 year, 5 months ago by [jormarques](https://wordpress.org/support/users/jormarques/).
 *  Thread Starter [jormarques](https://wordpress.org/support/users/jormarques/)
 * (@jormarques)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/multiple-categories-via-api/#post-18230006)
 * Mea culpa actually guys.I was not pushing as integer actually. It is working 
   now. Thanks :).
 *  Plugin Author [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * (@stiofansisland)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/multiple-categories-via-api/#post-18230105)
 * Awesome! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Multiple Categories via API’ is closed to new replies.

 * ![](https://ps.w.org/geodirectory/assets/icon-256x256.jpg?rev=2778361)
 * [GeoDirectory - WP Business Directory Plugin and Classified Listings Directory](https://wordpress.org/plugins/geodirectory/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geodirectory/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geodirectory/)
 * [Active Topics](https://wordpress.org/support/plugin/geodirectory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geodirectory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geodirectory/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/multiple-categories-via-api/#post-18230105)
 * Status: resolved