Bulk Create Staff
POST /external/v1/staff/bulk
Creates multiple staff members in a single request. Each member is created with a user account and assigned to a company, branch, and job role.
Request Body
Send a JSON array of staff objects:
[
{
"firstName": "John",
"lastName": "Doe",
"userName": "johndoe",
"email": "john.doe@example.com",
"phone": "+2341234567890",
"gender": "male",
"countryId": "country-uuid",
"assignedBranchId": "branch-uuid-1",
"jobRoleId": "role-uuid-1",
"privilege": 3
},
{
"firstName": "Jane",
"lastName": "Smith",
"userName": "janesmith",
"email": "jane.smith@example.com",
"phone": "+2349876543210",
"gender": "female",
"countryId": "country-uuid",
"assignedBranchId": "branch-uuid-1",
"jobRoleId": "role-uuid-2",
"privilege": 3,
"skillSetIds": ["skill-uuid-1", "skill-uuid-2"]
}
]
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
firstName | string | Yes | First name |
lastName | string | Yes | Last name |
userName | string | Yes | Unique username |
email | string | Yes | Email address |
phone | string | Yes | Phone number (with country code) |
gender | string | Yes | "male" or "female" |
countryId | string | Yes | Country ID |
assignedBranchId | string | Yes | Branch/location to assign the member to |
jobRoleId | string | Yes | Job role ID (UUID or symbol) |
privilege | number | Yes | Permission level: 1 = Super Admin, 2 = Admin, 3 = Member |
skillSetIds | string[] | No | Array of skill set IDs to assign |
Response
{
"message": "Task completed",
"success": 2,
"failed": 0,
"total": 2,
"err": []
}
Response Fields
| Field | Type | Description |
|---|---|---|
message | string | Status message |
success | number | Count of successfully created members |
failed | number | Count of failed creations |
total | number | Total items processed |
err | array | Details for each failure (see below) |
Error Entry Format
When a member fails to be created, the err array contains:
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"status": "failed",
"reason": "User with this email already exists"
}
Example
curl -X POST "https://api.suprsync.com/external/v1/staff/bulk" \
-H "x-api-key: api_your_client_id" \
-H "x-api-secret: sec_your_client_secret" \
-H "Content-Type: application/json" \
-d '[
{
"firstName": "John",
"lastName": "Doe",
"userName": "johndoe",
"email": "john.doe@example.com",
"phone": "+2341234567890",
"gender": "male",
"countryId": "country-uuid",
"assignedBranchId": "branch-uuid",
"jobRoleId": "role-uuid",
"privilege": 3
}
]'
Notes
- Members are processed in batches of 3. Large payloads are handled sequentially.
- Each successfully created member receives a welcome email.
- If a user with the same email already exists, that entry will appear in the
errarray. - Use the Locations endpoint to get valid
assignedBranchIdvalues. - Use the Job Roles endpoint to get valid
jobRoleIdvalues.