Users
Write Users
Create User
POST
`/v1/users`
Required Properties
name
email
Additionally, you can include the following optional properties:
role
orrole_id
: The role to assign to the user. If not provided, the user will be assigned the default role specified in the organization's settings.developer_mode
: A boolean value indicating whether the user has developer mode enabled.dark_mode
: A boolean value indicating whether the user has dark mode enabled on PackageX Dashboard.show_dock
: A boolean value indicating whether the user has the dock visible in the PackageX Dashboard.phone
: The user's phone number. If provided, it will be parsed into a standardized format.onboarded_apps
: An array of app IDs that the user has access to on the PackageX Dashboard.fcm_token
: An array of Firebase Cloud Messaging tokens for the user's push notifications on PackageX Apps.
If the user is assigned the role of user
or admin
, they will also need to be given access to locations. This can be done using the locations API.
Example Request
Update User
To update a user, you'll need to pass the user's ID along with any properties that you want to update.
POST
`/v1/users/:user`
Request Body
The request body should be a JSON object containing the properties you want to update. The following properties can be updated:
name
: The user's full name.email
: The user's email address.role
orrole_id
: The role to assign to the user. If not provided, the user will be assigned the default role specified in the organization's settings.developer_mode
: A boolean value indicating whether the user has developer mode enabled.dark_mode
: A boolean value indicating whether the user has dark mode enabled on PackageX Dashboard.show_dock
: A boolean value indicating whether the user has the dock visible in the PackageX Dashboard.phone
: The user's phone number. If provided, it will be parsed into a standardized format.onboarded_apps
: An array of app IDs that the user has access to on the PackageX Dashboard.fcm_token
: An array of Firebase Cloud Messaging tokens for the user's push notifications on PackageX Apps.metadata
: Additional metadata to associate with the user's profile.notification_events
: An array of notification events the user wants to update.
Example Request
Update User Locations
To update the locations associated with a user, send a POST request with the ID of the user you want to update. Include the location IDs to add or remove in the request body.
POST
`/v1/users/:user/locations`
Request Body
The request body should be a JSON object containing the following properties:
add
(string or array of strings): The location ID(s) to add to the user. You can provide a single location ID as a string or multiple location IDs as an array of strings.remove
(string or array of strings): The location ID(s) to remove from the user. You can provide a single location ID as a string or multiple location IDs as an array of strings.