Adds a new user to the database.
Request
POST https://www.activityinfo.org/resources/databases/{databaseId}/users
Request body
application/json
object | |||
string | The email of the user to add | required | |
name | string | The name of the user to add. This is only used in the email invitation to the user if there is no existing ActivityInfo account with this email address. | required |
locale | string | The locale to use when sending an email invite to the user. | required |
role | object | The role to assign to the user. | required |
roleId | string | The id of the role assigned to this user. | required |
roleParameters | object | The values of the parameters defined for this role. | required |
roleResources | array[string] | The resources (database, folder, forms, or subforms) to which the role's permissions are to apply. | required |
grants | array[object] | Additional permissions to grant to the user. | required |
resourceId | string | required | |
operations | array[string] | required |
Successful response
application/json
object | |||
databaseId | string | required | |
userId | string | required | |
version | integer | required | |
string | required | ||
name | string | required | |
inviteTime | float | required | |
activationStatus | string | Values:
|
required |
deliveryStatus | string | Values:
|
required |
lastLoginTime | float | required | |
role | object | required | |
roleId | string | The id of the role assigned to this user. | required |
roleParameters | object | The values of the parameters defined for this role. | required |
roleResources | array[string] | The resources (database, folder, forms, or subforms) to which the role's permissions are to apply. | required |
grants | array[object] | required | |
resourceId | string | required | |
operations | array[string] | required |
Error responses
Status Code | Error Code | Description |
---|---|---|
400 | CANNOT_ |
The owner of a database cannot be added as a user. |
400 | CANNOT_ |
You cannot add yourself to a database. |
400 | DATABASE_ |
A database with this id could not be found |
400 | INVALID_ |
The requested locale is invalid or not available. |
400 | INVALID_ |
The role parameters must be a JSON object including a value for each of the role parameters. |
400 | ROLE_ |
A role with the requested id could not be found in this database. |
400 | USER_ |
A user with this email address has already been added to the database. |
401 | AUTHENTICATION_ |
The request must be authenticated |
402 | BILLING_ |
The billing account associated with this database has been closed and so no additional users can be added. |
402 | BILLING_ |
The billing account associated with this database has been suspended so no additional users can be added. |
402 | USER_ |
The user limit of the billing account associated with this database has been exceeded so no additional users can be added. |
403 | PERMISSION_ |
You do not have sufficient permission to add a user to this database. |