Create User
Used to create a new user account in the system with various user attributes and organization memberships.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://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
| Field | Type | Description |
|---|---|---|
| Content-Type | application/json | Data type, must be application/json. |
| x-blocks-key | string | Project key for authentication. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| language | string | No | User's preferred language (e.g., en-US). |
| tags | array | No | Tags for categorizing the user. |
| string | Yes | User's email address. | |
| userName | string | Yes | Unique username for the account. |
| phoneNumber | string | No | User's phone number. |
| password | string | Yes | User's password. |
| salutation | string | No | Salutation (e.g., Mr., Ms., Dr.). |
| firstName | string | No | User's first name. |
| lastName | string | No | User's last name. |
| mailPurpose | string | No | Purpose of account creation email. |
| userPassType | integer | No | User password type (0-based). |
| userCreationType | integer | No | Type of user creation (0-based). |
| varifiedType | integer | No | Verification type (0-based). |
| platform | string | No | Platform where user is created (e.g., web, mobile). |
| profileImageUrl | string | No | URL of user's profile image. |
| profileImageId | string | No | ID of the profile image. |
| userMfaType | integer | No | MFA type for the user (0-based). |
| mfaEnabled | boolean | No | Whether MFA is enabled for the user. |
| allowedLogInType | array | No | Allowed login types (0-based). |
| memberships | array | No | Organization memberships with roles and permissions. |
| projectKey | string | No | The project key associated with the user. |
| organizationId | string | No | The organization ID for the user. |
Membership Object
| Field | Type | Description |
|---|---|---|
| organizationId | string | ID of the organization. |
| roles | array | Roles assigned to the user in the org. |
| permissions | array | Permissions 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
| Field | Type | Description |
|---|---|---|
| itemId | string | Unique user identifier. |
| string | User's email address. | |
| userName | string | User's username. |
| firstName | string | User's first name. |
| lastName | string | User's last name. |
| active | boolean | Whether the user is active. |
| isVarified | boolean | Whether the email is verified. |
| mfaEnabled | boolean | Whether MFA is enabled. |
| memberships | array | User's organization memberships. |