curl --request POST \
--url http://localhost:3333/v1/people/bulk \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"members": [
{
"userId": "usr_abc123def456",
"role": "admin",
"department": "it",
"isActive": true,
"fleetDmLabelId": 123
},
{
"userId": "usr_def456ghi789",
"role": "member",
"department": "hr",
"isActive": true
}
]
}
'{
"created": [
{
"id": "mem_abc123def456",
"organizationId": "org_abc123def456",
"userId": "usr_abc123def456",
"role": "member",
"createdAt": "2024-01-01T00:00:00Z",
"department": "it",
"isActive": true,
"fleetDmLabelId": 123,
"user": {
"id": "usr_abc123def456",
"name": "John Doe",
"email": "john.doe@company.com",
"emailVerified": true,
"image": "https://example.com/avatar.jpg",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T00:00:00Z",
"lastLogin": "2024-01-15T12:00:00Z"
}
}
],
"errors": [
{
"index": 2,
"userId": "usr_xyz789abc123",
"error": "User user2@example.com is already a member of this organization"
}
],
"summary": {
"total": 2,
"successful": 1,
"failed": 1
},
"authType": "api-key",
"authenticatedUser": {
"id": "usr_admin123",
"email": "admin@company.com"
}
}Bulk adds multiple members to the authenticated organization. Each member must have a valid user ID that exists in the system. Members who already exist in the organization or have invalid data will be skipped with error details returned. Supports both API key authentication (X-API-Key header) and session authentication (cookies + X-Organization-Id header).
curl --request POST \
--url http://localhost:3333/v1/people/bulk \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"members": [
{
"userId": "usr_abc123def456",
"role": "admin",
"department": "it",
"isActive": true,
"fleetDmLabelId": 123
},
{
"userId": "usr_def456ghi789",
"role": "member",
"department": "hr",
"isActive": true
}
]
}
'{
"created": [
{
"id": "mem_abc123def456",
"organizationId": "org_abc123def456",
"userId": "usr_abc123def456",
"role": "member",
"createdAt": "2024-01-01T00:00:00Z",
"department": "it",
"isActive": true,
"fleetDmLabelId": 123,
"user": {
"id": "usr_abc123def456",
"name": "John Doe",
"email": "john.doe@company.com",
"emailVerified": true,
"image": "https://example.com/avatar.jpg",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T00:00:00Z",
"lastLogin": "2024-01-15T12:00:00Z"
}
}
],
"errors": [
{
"index": 2,
"userId": "usr_xyz789abc123",
"error": "User user2@example.com is already a member of this organization"
}
],
"summary": {
"total": 2,
"successful": 1,
"failed": 1
},
"authType": "api-key",
"authenticatedUser": {
"id": "usr_admin123",
"email": "admin@company.com"
}
}API key for authentication
Organization ID (required for session auth, optional for API key auth)
Bulk member creation data
Array of members to create
Show child attributes
User ID to associate with this member
"usr_abc123def456"
Role for the member
"admin"
Member department
none, admin, gov, hr, it, itsm, qms "it"
Whether member is active
true
FleetDM label ID for member devices
123
[
{
"userId": "usr_abc123def456",
"role": "admin",
"department": "it",
"isActive": true,
"fleetDmLabelId": 123
},
{
"userId": "usr_def456ghi789",
"role": "member",
"department": "hr",
"isActive": true
}
]Bulk member creation completed
Successfully created members
Show child attributes
Member ID
"mem_abc123def456"
Organization ID this member belongs to
"org_abc123def456"
User ID associated with member
"usr_abc123def456"
Member role
"admin"
When the member was created
"2024-01-01T00:00:00Z"
Member department
none, admin, gov, hr, it, itsm, qms "it"
Whether member is active
true
FleetDM label ID for member devices
123
User information
Show child attributes
User ID
"usr_abc123def456"
User name
"John Doe"
User email
"john.doe@company.com"
Whether email is verified
true
User profile image URL
"https://example.com/avatar.jpg"
When the user was created
"2024-01-01T00:00:00Z"
When the user was last updated
"2024-01-15T00:00:00Z"
Last login time
"2024-01-15T12:00:00Z"
Members that failed to be created with error details
Show child attributes
Index in the original array where the error occurred
2
User ID that failed to be added
"usr_abc123def456"
Error message explaining why the member could not be created
"User user@example.com is already a member of this organization"
How the request was authenticated
api-key, session Was this page helpful?