SmaCH
SmaCH API

Organization membership and roles (super-admin or organization administrator)


Add a member or set their role

PUT
https://api.smach.science
/organizations/{alias}/members/{userId}

Attaches the user to the organization if needed and grants the given role

Add a member or set their role › path Parameters

alias
​string · required
userId
​string · required

Add a member or set their role › Request Body

Role to grant to a member
role
​string · enum · required
Enum values:
administrator
viewer

Add a member or set their role › Responses

Unknown organization or user

A member of an organization with their role
id
​string
email
​string
firstName
​string
lastName
​string
enabled
​boolean
emailVerified
​boolean

Whether the person confirmed the address; false while the invitation is pending

role
​string · enum
Enum values:
administrator
viewer

Remove a member from the organization

DELETE
https://api.smach.science
/organizations/{alias}/members/{userId}

Remove a member from the organization › path Parameters

alias
​string · required
userId
​string · required

Remove a member from the organization › Responses

Member removed

No data returned

List an organization's members with their role

GET
https://api.smach.science
/organizations/{alias}/members

Follow the Link header to page through the collection. X-Total-Count is absent when a search narrows the list, because Keycloak cannot count members matching a search.

List an organization's members with their role › path Parameters

alias
​string · required

List an organization's members with their role › query Parameters

page
​integer · int32 · min: 0

0-indexed page number

Default: 0
size
​integer · int32 · min: 1 · max: 200

Page size

Default: 50
search
​string

Free-text search. The fields it matches are documented per endpoint.

sort
​string

Sort field, prefixed with '-' for descending (e.g. -createdAt). Only present on endpoints whose backing store supports sorting.

List an organization's members with their role › Responses

A page of results

A member of an organization with their role
id
​string
email
​string
firstName
​string
lastName
​string
enabled
​boolean
emailVerified
​boolean

Whether the person confirmed the address; false while the invitation is pending

role
​string · enum
Enum values:
administrator
viewer

Invite a person into the organization

POST
https://api.smach.science
/organizations/{alias}/members

Creates the account and emails the invitation (valid three days) when no account holds the email; otherwise attaches the existing account, whose owner already has a password. The answer is the same either way.

Invite a person into the organization › path Parameters

alias
​string · required

Invite a person into the organization › Request Body

A person to bring into the organization with a role
email
​string · email · minLength: 1 · required

Email, also used as the username

role
​string · enum · required

Role to grant in the organization

Enum values:
administrator
viewer
firstName
​string

Given name, used when the account is created

lastName
​string

Family name, used when the account is created

locale
​string · pattern: [a-z]{2,3}(-[A-Z]{2}…

Language of the emails and the login page, used when the account is created

Invite a person into the organization › Responses

Member added

A member of an organization with their role
id
​string
email
​string
firstName
​string
lastName
​string
enabled
​boolean
emailVerified
​boolean

Whether the person confirmed the address; false while the invitation is pending

role
​string · enum
Enum values:
administrator
viewer

Email the invitation again to a member

POST
https://api.smach.science
/organizations/{alias}/members/{userId}/invitation

For a member who has not accepted the invitation yet

Email the invitation again to a member › path Parameters

alias
​string · required
userId
​string · required

Email the invitation again to a member › Responses

Email sent

No data returned

Count an organization's members

GET
https://api.smach.science
/organizations/{alias}/members/count

Always the unfiltered total: Keycloak's count endpoint takes no filter

Count an organization's members › path Parameters

alias
​string · required

Count an organization's members › Responses

Unknown organization

Number of resources matching the filters
count
​integer · int64