Restore user

Restore a deleted database user

Request

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

Successful response

application/json

object
revertedAuditLogEventId string required
restoredUser object required

Error responses

Status Code Error Code Description
200 REVERTED
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 ROLE_DELETED The user was previously assigned a role that has since been deleted. This user cannot be restored.
400 USER_ACCOUNT_CLOSED This user has closed their ActivityInfo user account and cannot be added to databases again.
400 USER_ALREADY_RESTORED The user has already been restored or re-added to the database.
400 USER_NEVER_HAD_ROLE This user never had access to this 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 AUDIT_NOT_AUTHORIZED You do not have the "AUDIT" permission and so cannot restore deleted users.
403 PERMISSION_DENIED You do not have sufficient permission to restore a user with these permissions.
404 DATABASE_NOT_FOUND

Example

curl -X POST https://www.activityinfo.org/resources/databases/ck8oykh8m5/users/432201/restore \
  -u anything:APITOKEN
Next item
Revert database update