Adds an existing WordPress user to a space, approves their pending join request, or changes the role they already hold.
user_id is required and must resolve to a real user; their community profile is created on the fly. role accepts member, moderator or admin and falls back to member. The behaviour depends on the existing pivot: no membership adds one, a pending one is approved, and an active one has its role updated — or is rejected if the role is unchanged. The response message differs in each case.
Endpoint
Method:
POSTPath:
/spaces/{spaceSlug}/membersEdition: Core
Controller:
SpaceController@addMemberRoute source:
fluent-community/app/Http/Routes/api.php:19Controller source:
fluent-community/app/Http/Controllers/SpaceController.phpRequires the
can_add_memberpermission in this space.
Live sample
The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.
POST Add Space Member
Adds an existing WordPress user to a space, approves their pending join request, or changes the role they already hold.
Controller: SpaceController@addMember
Route source: fluent-community/app/Http/Routes/api.php:19
Authorizations
WordPress Application Passwords — use Basic auth with username:application_password.
Parameters
Path Parameters
SpaceSlug extracted from the URL path.
Request Body
Responses
Successful response