Skip to content

REST API

All endpoints live under /wp-json/spacebay/v1/ and use standard WordPress cookie authentication with the X-WP-Nonce header.

EndpointMethodWho
/meGETAnyone. Returns the current member or logged_in: false.
/settingsGET, POST, PUTAdministrators.
/auth/loginPOSTVisitors, while the community login pages are on. Returns logged_in with a redirect address, or a second step when an add-on asks for one (the code step of Pro).
/auth/signupPOSTVisitors, while signing up is on.
/auth/forgot, /auth/resetPOSTVisitors. Forgot always gives the same answer, whether the account exists or not.
/auth/social/{provider}, /auth/social/{provider}/callbackGETVisitors, while that provider (google or facebook) is switched on and has its keys; otherwise the route answers 404. The first sends the browser to the provider and takes an optional redirect_to. The second is the address the provider sends the visitor back to; it logs them in (or asks for a second step) and redirects to the portal. These are browser redirects, not JSON calls.
/me/security, /me/passwordGET, PUTLogged-in members. Changing the password needs the current one.
/me/statsGETLogged-in members. Their own activity totals: posts, comments, likes received and joined spaces.
/me/pulseGETLogged-in members. Unread messages and notifications, plus what add-ons add (with Pro, calls ringing for them).
/conversations, /conversations/{id}GET, POST, PATCHMembers in the conversation. POST starts a one-to-one chat or group within the messaging rules; PATCH renames a group or mutes it.
/conversations/{id}/messages, /conversations/{id}/readGET, POSTMembers in the conversation. GET takes before, after and limit.
/conversations/{id}/members, /conversations/{id}/members/{user_id}POST, DELETEGroup owner adds and removes people; anyone can remove themselves.
/messages/{id}DELETEThe author, or a moderator.
/messages/recipients, /me/blocksGET, POSTLogged-in members.
/admin/statsGETAdministrators.
/spacesGET, POSTGET: anyone who can open the community (only spaces they may see). POST: administrators.
/spaces/{id}, /spaces/slug/{slug}GET, PATCH, DELETEGET: people who may see the space. PATCH: space admins. DELETE: administrators.
/spaces/{id}/join, /spaces/{id}/leavePOSTLogged-in members.
/spaces/{id}/membersGET, POSTGET active members: logged-in members who may read the space, while the member directory is on (space admins always). Hidden profiles are left out. Other lists and POST (invite): space admins.
/spaces/{id}/members/{user_id}PATCH, DELETESpace admins.
/space-groups, /space-groups/{id}POST, PATCH, DELETEAdministrators.
/spaces/reorder, /space-groups/reorderPOSTAdministrators. Send ids, a list of IDs in the new order.
/members, /members/{id}GETLogged-in members, when the directory is on.
/feedGETAnyone who can open the community. Only posts in spaces they may read. Filters: space_id, user_id, topic, hashtag, bookmarked, search, orderby. The X-WP-Total header is the exact number of posts; send count_total=false (since 1.0.0, what the portal does) to skip that count on large communities: the header then gives the posts up to this page, plus one when another page follows.
/postsPOSTMembers who may post in the space.
/posts/{id}GET, PATCH, DELETEGET: readers of the space. PATCH and DELETE: the author and space moderators.
/posts/{id}/like, /bookmark, /pinPOSTLike: space members. Save: logged-in readers. Pin: space moderators.
/posts/{id}/commentsGET, POSTGET: readers of the space. POST: space members.
/comments/{id}, /comments/{id}/likePATCH, DELETE, POSTEdit and delete: the author and space moderators. Like: space members.
/mediaPOSTLogged-in members. One image per request in the file field.
/topics, /topics/{id}GET, POST, PATCH, DELETEGET: anyone who can open the community. Changes: administrators.
/me/profileGET, PATCHLogged-in members, for their own profile.
/me/avatar, /me/coverPOST, DELETELogged-in members. POST one image in the file field.
/me/email-preferencesGET, PUTLogged-in members.
/notifications, /notifications/countGETLogged-in members, for their own notifications. Filter: unread.
/notifications/readPOSTLogged-in members. Send ids or all: true.
/reportsPOSTLogged-in members. object_type (post, comment, member, message), object_id, reason, optional note.
/moderation/counts, /moderation/queueGETModerators.
/moderation/queue/{type}/{id}POSTModerators. action: approve or remove.
/moderation/members, /moderation/members/{id}GET, POSTModerators. List pending or suspended members; POST status: active or blocked.
/moderators, /moderators/{id}GET, POST, DELETEAdministrators.
/admin/setupGET, POSTAdministrators. Setup wizard state and starter spaces.
/leaderboardGETLogged-in members, while the leaderboard is on. period: week, month or all; limit up to 50.
/me/pointsGETLogged-in members, their own points history. Paged.
/eventsGET, POSTGET: anyone who can open the community; only events in spaces they may read. Filters: space_id, when (upcoming, past, range), from and to (up to 62 days), rsvp=going, page, per_page. POST: members who may add events in the space.
/events/{id}GET, PATCH, DELETEGET: readers of the space. PATCH and DELETE: the organizer and space moderators.
/events/{id}/cancelPOSTThe organizer and space moderators.
/events/{id}/rsvpPOSTMembers of the space. answer: going, maybe, not_going, or empty to remove it.
/events/{id}/attendeesGETReaders of the space. answer: going or maybe. Paged.
/searchGETAnyone who can open the community. Parameters: q (2 to 100 characters), type (all, posts, spaces, members), page.

These endpoints exist only while SpaceBay Pro is active. They use the same /wp-json/spacebay/v1/ base.

EndpointMethodWho
/auth/two-factor, /auth/two-factor/status, /auth/two-factor/sendPOSTVisitors in the code step of a login.
/me/two-factor, /me/two-factor/app, /me/two-factor/email, /me/two-factor/confirm, /me/two-factor/backup-codesPOST, DELETELogged-in members, for their own account. Every change except confirm needs the current password.
/members/{id}/two-factorDELETEAdministrators who may edit that user.
/conversations/{id}/calls, /calls/{id}, /calls/{id}/join|decline|leave, /calls/{id}/signalsGET, POSTPeople invited to the call, while calls are on.
/profile-fieldsGET, PUTGET: logged-in members. PUT: administrators.
/members/{id}/badgesPOSTAdmins and community moderators. badge (key) and on (true to give, false to take away).
/members/{id}/pointsPOSTCommunity managers. points (−10,000 to 10,000, not 0) and an optional note.
/shop/products, /shop/products/{id}, /shop/featured, /shop/sellers/{id}GETAnyone who can open the community, while shops are on. Only published products of open shops; sellers and admins also see their pending and rejected products.
/shop/me, /shop/requestGET, POSTLogged-in members, for their own shop.
/shop/products, /shop/products/{id}, /shop/mediaPOST, DELETESellers with an open shop, for their own products (sellers can delete their own products when the shop is closed), and community managers.
/shop/admin/summary, /shop/admin/sellers, /shop/admin/sellers/{id}, /shop/admin/products, /shop/admin/products/{id}/review, /shop/admin/products/{id}/placementGET, POSTCommunity managers.