Add New Sub-Organization Member
This endpoint adds a new user to a specific sub-organization by providing the sub-organization ID. It allows you to set up the user's basic information, assign their role, and associate them with an organization. The user's email and password for login can also be configured.
HTTP Method and URL
| Method | URL |
|---|---|
| POST | {{host}}/api/v2/sub-organizations/:subOrganizationUuid/members?user_type=ENTERPRISE_API |
Authentication Requirements
This endpoint requires authentication. Include a valid bearer token in the Authorization header:
Authorization: Bearer {USER-TOKEN}
Path and Query Parameters
Path Parameter:
subOrganizationUuid(string, required): The unique identifier of the sub-organization to which the user will be added.
Query Parameter:
user_type(string, required): Must be set toENTERPRISE_API.
Request Body
The request body must be sent as multipart/form-data. The following fields are supported (array notation is used for batch addition, but typically only one user is added per request):
| Field | Type | Required | Description |
|---|---|---|---|
| data[0][email] | string | Yes | Email address of the new user |
| data[0][first_name] | string | Yes | First name of the user |
| data[0][last_name] | string | Yes | Last name of the user |
| data[0][role] | string | Yes | Role to assign (e.g., Member) |
| data[0][organization] | object | Yes | Organization details (JSON string) |
| data[0][organization_id] | string | Yes | Sub-organization UUID |
| data[0][company] | string | No | Company name |
| data[0][job_title] | string | No | Job title |
| data[0][country] | string | No | Country |
| data[0][middle_name] | string | No | Middle name |
| data[0][password] | string | No | Password for the new user |
Example Request
POST {{host}}/api/v2/sub-organizations/f91ce8d3-81ac-437a-bc5b-cffabb333cfa/members?user_type=ENTERPRISE_API
Authorization: Bearer {USER-TOKEN}
Content-Type: multipart/form-data
Form Data:
data[0][email]: [email protected]
data[0][first_name]: frist
data[0][last_name]: test
data[0][role]: Member
data[0][organization]: {"id":140,"sub_organization_type_name":"Department"}
data[0][organization_id]: f91ce8d3-81ac-437a-bc5b-cffabb333cfa
Example Successful Response
{
"success": true,
"message": "User added successfully.",
"data": {
"user_id": "...",
"email": "[email protected]",
"first_name": "frist",
"last_name": "test",
"role": "Member"
}
}
Error Responses
-
400 Bad Request: Missing or invalid parameters. -
401 Unauthorized: Invalid or missing authentication token. -
409 Conflict: User already exists in the sub-organization. -
500 Internal Server Error: Unexpected server error.
Usage Notes
-
Ensure the
subOrganizationUuidis valid and the authenticated user has permission to add members. -
The
organizationfield should be a valid JSON string representing organization details. -
Password is optional; if not provided, the user may receive an email to set their password.
-
For batch addition, increment the index in
data[n][...]for each user.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
