Skip to main content

IAM

Base path: https://api.seliseblocks.com/iam/v4/iam

All endpoints require x-blocks-key, an authenticated cookie-backed session, and JSON content type for request bodies.

Current user

GET /me

Returns the signed-in profile in data.

List organizations

GET /organizations?Page=0&PageSize=20&Sort.Property=Name&Sort.IsDescending=false

Returns the available organizations in organizations.

Create an organization

POST /organizations/create

{
"name": "Acme Inc",
"description": "Acme Inc workspace",
"defaultRoleForMembers": ["user"],
"defaultPermissionsForMembers": [],
"createdFrom": 1
}

A successful response includes isSuccess and itemId.

List users

POST /users

{
"page": 0,
"pageSize": 50,
"sort": { "property": "email", "isDescending": false },
"filter": {
"email": "",
"name": "",
"userIds": [],
"org_id": "ORGANIZATION_ID"
}
}

The organization boundary is supplied as filter.org_id. The response contains data and totalCount.

Get a user's access

GET /users/{userId}?organizationId={organizationId}

The optional organization query parameter selects the organization-specific access. The response data contains roles and permissions.

Create and invite a user

POST /users/create

{
"email": "ada@example.com",
"userName": "ada@example.com",
"password": "",
"firstName": "Ada",
"lastName": "Lovelace",
"phoneNumber": "",
"organizationId": "ORGANIZATION_ID",
"userPassType": 1,
"userCreationType": 1,
"verifiedType": 1,
"userMfaType": 1,
"mfaEnabled": false,
"allowedLogInType": [1],
"roles": [],
"permissions": [],
"attributes": {}
}

An empty password uses the invitation-and-activation flow.

Deactivate a user

POST /users/deactivate

{ "userId": "USER_ID" }

The example deactivates users rather than hard-deleting them.

List roles

POST /roles

{
"page": 0,
"pageSize": 50,
"sort": { "property": "name", "isDescending": false },
"filter": { "search": "", "slugs": [] }
}

List permissions

POST /permissions

{
"page": 0,
"pageSize": 50,
"sort": { "property": "name", "isDescending": false },
"filter": {},
"roles": []
}

Replace a user's roles and permissions

POST /users/roles-and-permissions

{
"userId": "USER_ID",
"roles": ["admin"],
"permissions": ["clients.read"]
}

Send the complete desired arrays. The operation replaces the current sets rather than appending one item.