Skip to main content

Create User

Used to create a new user account in the system with various user attributes and organization memberships.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/idp/v1/Iam/Create

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/idp/v1/Iam/Create' \
-H 'Content-Type: application/json' \
-H 'x-blocks-key: YOUR_PROJECT_KEY' \
-d '{
"language": "en-US",
"tags": ["developer", "internal"],
"email": "newuser@example.com",
"userName": "newuser",
"phoneNumber": "+1234567890",
"password": "SecurePassword123!",
"salutation": "Mr.",
"firstName": "John",
"lastName": "Doe",
"mailPurpose": "user_creation",
"userPassType": 0,
"userCreationType": 0,
"varifiedType": 0,
"platform": "web",
"profileImageUrl": "https://example.com/image.jpg",
"profileImageId": "img_123",
"userMfaType": 0,
"mfaEnabled": false,
"allowedLogInType": [0],
"memberships": [
{
"organizationId": "org_123",
"roles": ["admin", "user"],
"permissions": ["read", "write"]
}
],
"projectKey": "YOUR_PROJECT_KEY",
"organizationId": "org_123"
}'

Request Headers

FieldTypeDescription
Content-Typeapplication/jsonData type, must be application/json.
x-blocks-keystringProject key for authentication.

Request Body

FieldTypeRequiredDescription
languagestringNoUser's preferred language (e.g., en-US).
tagsarrayNoTags for categorizing the user.
emailstringYesUser's email address.
userNamestringYesUnique username for the account.
phoneNumberstringNoUser's phone number.
passwordstringYesUser's password.
salutationstringNoSalutation (e.g., Mr., Ms., Dr.).
firstNamestringNoUser's first name.
lastNamestringNoUser's last name.
mailPurposestringNoPurpose of account creation email.
userPassTypeintegerNoUser password type (0-based).
userCreationTypeintegerNoType of user creation (0-based).
varifiedTypeintegerNoVerification type (0-based).
platformstringNoPlatform where user is created (e.g., web, mobile).
profileImageUrlstringNoURL of user's profile image.
profileImageIdstringNoID of the profile image.
userMfaTypeintegerNoMFA type for the user (0-based).
mfaEnabledbooleanNoWhether MFA is enabled for the user.
allowedLogInTypearrayNoAllowed login types (0-based).
membershipsarrayNoOrganization memberships with roles and permissions.
projectKeystringNoThe project key associated with the user.
organizationIdstringNoThe organization ID for the user.

Membership Object

FieldTypeDescription
organizationIdstringID of the organization.
rolesarrayRoles assigned to the user in the org.
permissionsarrayPermissions granted to the user.

Response

Success Response

Returns HTTP status 200 OK on successful user creation.

{
"itemId": "user_123",
"email": "newuser@example.com",
"userName": "newuser",
"firstName": "John",
"lastName": "Doe",
"active": true,
"isVarified": false,
"mfaEnabled": false,
"memberships": [
{
"organizationId": "org_123",
"roles": ["admin", "user"],
"permissions": ["read", "write"]
}
]
}

Response Fields

FieldTypeDescription
itemIdstringUnique user identifier.
emailstringUser's email address.
userNamestringUser's username.
firstNamestringUser's first name.
lastNamestringUser's last name.
activebooleanWhether the user is active.
isVarifiedbooleanWhether the email is verified.
mfaEnabledbooleanWhether MFA is enabled.
membershipsarrayUser's organization memberships.