How do you add members to a community programmatically using the Add Member API?
Who is this for and why it matters
Use this API when you want to programmatically add users to a community, enabling them to participate and engage within your Community Media Network.
This matters because:
- It enables scalable user onboarding across communities
- It supports automated growth workflows (invites, campaigns, onboarding flows)
- It ensures users can immediately access and interact with content
If you're building onboarding journeys, invite systems, or growth integrations, this API is essential.
What does the Add Member API do?
This API allows you to:
- Add users as members of one or more communities
- Support different onboarding flows like:
- Direct join
- Invite-based onboarding
- Single-tap join
- Approval-based access
It acts as the entry point for user participation within communities.
API Details
- URL: /api/thirdparty/community/add_users
- Method: POST
- Authentication Required: Yes (Bearer Token)
Before you begin
1. Authenticate your request
Generate a gn-access-token using the Authentication API.
Pass it in the header: Authorization - Bearer <gn-access-token>
2. Ensure users and communities exist
You must have:
- Valid user identifiers
- Valid community references
Request Structure
{
"onboarding_communities": "any",
"communities": "any",
"single_tap_join": "any",
"invite_members": "any",
"join_request_approved": "any",
"users": "any"
}Field-level understanding
- onboarding_communities - Communities assigned during onboarding
- communities - Target communities where users will be added
- single_tap_join - Enables instant join without friction
- invite_members - Invite-based onboarding flow
- join_request_approved - Approve pending join requests
- users - List or identifiers of users being added
What happens on success?
Success Condition
If the request is valid:
- Users are successfully added as community members
- They gain access to participate and engage
Response Code 200 OK
{
"code": 200,
"message": "XXXX-[Members Added]",
"data": {
"members_added": [
{
"member_id": "c2fd91a1-faf8-48a8-9b3e-b2248c8acf21",
"name": null,
"bio": null,
"nickname": null,
"phone": "91943724335",
"is_brand_system_user": false,
"is_avatar": true,
"profile_image": "alien",
"profile_image_s": "",
"profile_image_m": "",
"profile_image_l": ""
},
{
"member_id": "bd7608b7-5c0b-4fcc-9799-5944de1b6f5d",
"name": null,
"bio": null,
"nickname": null,
"phone": "34684433270",
"is_brand_system_user": false,
"is_avatar": true,
"profile_image": "smiling_face_with_horns",
"profile_image_s": "",
"profile_image_m": "",
"profile_image_l": ""
}
]
}
}Important
- Each object in members_added contains a member_id, which uniquely identifies the added member
- These members can now access, engage, and contribute within the community
Error Handling
1. Bad Request
Condition: Invalid or malformed request data
Response Code: 400 Bad Request
{
"code": "1099",
"message": "An unexpected error occurred processing the request",
"data": {}
}2. Not Found
Condition: Community or resource does not exist
Response Code: 404 Not Found
{
"code": "5218",
"message": "The community you are looking for is no longer available.",
"data": {}
}3. Precondition Failed
Condition: Required conditions or criteria are not met
Response Code: 412 Precondition Failed
{
"code": "5166",
"message": "XXXX-[Invalid Use of API]",
"data": {}
}Best Practices
- Validate users before adding them to communities
- Choose the right onboarding flow (invite vs direct join vs approval)
- Avoid duplicate additions of the same user
- Ensure proper access control and moderation setup post onboarding
- Handle API errors and retries gracefully
What to do next
After adding members:
- Assign roles (moderators/admins) if needed
- Add them to groups for deeper engagement
- Start driving content participation via video and discussions
- Integrate onboarding with campaigns or lifecycle journeys