Add database user

Adds a new user to the database.

Request

POST https://www.activityinfo.org/resources/databases/{databaseId}/users

Request body

application/json

object
email 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
grants array[object] Additional permissions to grant to the user. required

Successful response

application/json

object
databaseId string required
userId string required
version integer required
email string required
name string required
inviteTime float required
activationStatus string Values:
NO_ACCOUNT
The email has no account in the system
PENDING
The user has been invited to access a database, or started signing up for a free trial, but has not confirmed their account.
ACTIVE
The user has activated their account and accepted the terms of service.
INACTIVE
The user no longer has access to any databases, nor do they have an active trial or billing account.
CLOSED
The user has requested the closure of their account.
required
deliveryStatus string Values:
UNKNOWN
No record of email delivery is available for this user.
OK
Email has been successfully delivered to this user.
HARD_BOUNCE
Attempts to email this user failed with a "hard bounce," meaning that the account does not exist, or the domain is not accepting email.
SPAM_COMPLAINT
Attempts to email this user were rejected as spam by their mail server. No additional attempt will be made to send email to this user.
MANUAL_SUPPRESSION
Mail to this address have been manually blocked by ActivityInfo support staff.
required
lastLoginTime float required
role object required
grants array[object] required

Error responses

Status Code Error Code Description
400 CANNOT_ADD_OWNER The owner of a database cannot be added as a user.
400 CANNOT_ADD_SELF You cannot add yourself to a database.
400 DATABASE_NOT_FOUND A database with this id could not be found
400 INVALID_LOCALE The requested locale is invalid or not available.
400 INVALID_ROLE_PARAMETERS The role parameters must be a JSON object including a value for each of the role parameters.
400 ROLE_NOT_FOUND A role with the requested id could not be found in this database.
400 USER_ALREADY_ADDED A user with this email address has already been added to the database.
401 AUTHENTICATION_REQUIRED The request must be authenticated
402 BILLING_ACCOUNT_CLOSED The billing account associated with this database has been closed and so no additional users can be added.
402 BILLING_ACCOUNT_SUSPENDED The billing account associated with this database has been suspended so no additional users can be added.
402 USER_LIMIT_EXCEEDED The user limit of the billing account associated with this database has been exceeded so no additional users can be added.
403 PERMISSION_DENIED You do not have sufficient permission to add a user to this database.
Next item
Add form