Users
Overview of users API methods
Register User
POST
https://api.codemash.io/:version/membership/users/register
Register a new user to a particular project.
Path Parameters
version
string
A version of the API endpoint.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Request Body
string
User's email address.
password
string
User's password.
displayName
string
User's display name.
firstName
string
User's first name.
lastName
string
User's last name.
roles
array
Roles to give to the newly created user (don't provide any to use default role from settings).
autoLogin
boolean
Should the user be logged in after registering? The default is true.
meta
string
User's meta details as a JSON object.
Membership Settings
There are some settings for user registration inside your dashboard under sections Registration and Verification.
User registers as - if you don't provide roles during registration, the user will be given a selected role in the settings.
Verification by email needed - if this is checked, the user will be unverified until verified through email. Email service needs to be enabled for this option. Also in your template, you have to set a token named @Model.ValidationToken which will be replaced by a verification token.
Invite User
POST
https://api.codemash.io/:version/membership/users/invite
Invites an user to a particular project.
Path Parameters
version
string
A version of the API endpoint.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Request Body
string
User's email address.
displayName
string
User's display name.
firstName
string
User's first name.
lastName
string
User's last name.
roles
array
Roles to give to the newly created user (don't provide any to use default role from settings).
meta
string
User's meta details as a JSON object.
Membership Settings
There are some settings for user invitation inside your dashboard under sections Registration and Invitation.
User registers as - if you don't provide roles during registration, the user will be given a selected role.
Allow invite users - this MUST be checked for invitations to work. Email service needs to be enabled for this option. Also in your template, you have to set a token named @Model.ValidationToken which will be replaced by an invitation token.
Get Users
GET
https://api.codemash.io/:version/membership/users
Gets a list of project users.
Path Parameters
version
string
A version of the API endpoint.
Query Parameters
includePermissions
boolean
Includes permissions to the response.
includeDevices
boolean
Includes devices to the response.
includeMeta
boolean
Includes meta to the response.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Get User
GET
https://api.codemash.io/:version/membership/users/:id
Gets a project user.
Path Parameters
version
string
A version of the API endpoint.
id
string
User's ID.
Query Parameters
IncludeUnreadNotifications
boolean
Includes unread push notifications count.
includePermissions
boolean
Includes permissions to the response.
includeDevices
boolean
Includes devices to the response.
includeMeta
boolean
Includes meta to the response.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Get User (By Email)
GET
https://api.codemash.io/:version/membership/users/by-email
Gets a project user by email.
Path Parameters
version
string
A version of the API endpoint.
Query Parameters
IncludeUnreadNotifications
boolean
Includes unread push notifications count.
includePermissions
boolean
Includes permissions to the response.
includeDevices
boolean
Includes devices to the response.
includeMeta
boolean
Includes meta to the response.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Update profile
PATCH
https://api.codemash.io/:version/membership/users/profile
Updates the user's profile with given parameters. Only the provided values are updated. This request does not update user roles.
Path Parameters
version
string
A version of the API endpoint.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Request Body
unsubscribedNewsTags
array
Marketing email types to unsubscribe from. If value not provided then it's not updated. To delete, pass an empty array.
subscribeToNews
boolean
Should a user receive marketing emails? If value not provided then it's not updated.
timeZone
string
Default user's timezone.
language
string
Default user's language (mainly for notifications).
displayName
string
User's display name.
firstName
string
User's first name.
lastName
string
User's last name.
meta
string
User's meta details as JSON.
Update user
PATCH
https://api.codemash.io/:version/membership/users/:id
Updates user with given parameters. Only the provided values are updated. This request allows us to update user roles.
Path Parameters
version
string
A version of the API endpoint.
id
string
User's ID.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Request Body
unsubscribedNewsTags
array
Marketing email types to unsubscribe from. If value not provided then it's not updated. To delete, pass an empty array.
subscribeToNews
boolean
Should user receive marketing emails? If value not provided then it's not updated.
timeZone
string
Default user's timezone.
language
string
Default user's language (mainly for notifications).
displayName
string
User's display name.
firstName
string
User's first name.
lastName
string
User's last name.
roles
array
Roles to set for a user.
meta
string
User's meta details as JSON.
Delete user
DELETE
https://api.codemash.io/:version/membership/users/:id
Deletes a project user.
Path Parameters
version
string
A version of the API endpoint.
id
string
User's ID.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Block user
PATCH
https://api.codemash.io/:version/membership/users/:id/block
Blocks users from calling any authenticated requests.
Path Parameters
version
string
A version of the API endpoint.
id
string
User's ID.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Unblock user
PATCH
https://api.codemash.io/:version/membership/users/:id/unblock
Unblocks user allowing to call authenticated calls.
Path Parameters
version
string
A version of the API endpoint.
id
string
User's ID.
Headers
Authorization
string
Secret API key which belongs to your project or user. Not required if using cookies with a session ID.
x-cm-projectid
string
Your project's ID. Can be passed as a query parameter.
Last updated