Title: Query &#039;post_status&#039; &#8211; WordPress Api V2
Last modified: August 30, 2016

---

# Query 'post_status' – WordPress Api V2

 *  Resolved [CHEWX](https://wordpress.org/support/users/chewx/)
 * (@chewx)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/query-post_status-wordpress-api-v2/)
 * Hi,
 * Using the WordPress API V2 for a mobile app.
 * I have got my custom post types by adding.
 *     ```
       add_action( 'init', 'add_events_to_json_api', 30 );
       function add_events_to_json_api(){
   
           global $wp_post_types;
           $wp_post_types['cpt']->show_in_rest = true;
           $wp_post_types['cpt']->rest_base = 'cpt';
           $wp_post_types['cpt']->rest_controller_class = 'WP_REST_Posts_Controller';
       }
       ```
   
 * This is good but only gets the latest posts. I want to get posts with a status
   of ‘published’.
 * In the docs it says you need to request as a user with edit posts to be able 
   to filter on ‘post_status’.
 * I don’t really want to setup oAuth for this, is it possible to query this server
   side and add it to the API ?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [CHEWX](https://wordpress.org/support/users/chewx/)
 * (@chewx)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/query-post_status-wordpress-api-v2/#post-6481683)
 * Found the docs.
 * [http://v2.wp-api.org/extending/adding/](http://v2.wp-api.org/extending/adding/)

Viewing 1 replies (of 1 total)

The topic ‘Query 'post_status' – WordPress Api V2’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [CHEWX](https://wordpress.org/support/users/chewx/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/query-post_status-wordpress-api-v2/#post-6481683)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
