POST
/
v1
/
users
/
delete

Use this API to remove Users from:

  1. Organization: This will remove their access from all the documents and data in the organization. It will also remove these users from the contact list of the organization.
  2. Document: This will remove their access from the specified document. It will also remove these users from the contact list of the document. If you pass the documentId, then the users will be removed from the document.

Endpoint

POST https://api.velt.dev/v1/users/delete

Headers

x-velt-api-key
string
required

Your API key.

x-velt-auth-token
string
required

Body Example

Params

data
object
required

Example Requests

1. Delete users in a specific organization

{
  "data": {
    "organizationId": "yourOrganizationId",
    "userIds": [
      "yourUserId1"
    ]
  }
}

2. Delete users in a specific document within an organization

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "userIds": [
      "yourUserId1"
    ]
  }
}

Response

Success Response

{
  "result": {
    "status": "success",
    "message": "User(s) deleted successfully.",
    "data": {
      "yourUserId1": {
        "success": true,
        "message": "User removed."
      }
    }
  }
}

User(s) Not Found

{
  "result": {
    "status": "success",
    "message": "User(s) deleted successfully.",
    "data": {
      "yourUserId1": {
        "success": true,
        "message": "User removed."
      },
      {
      "yourUserId2": {
        "success": false,
        "message": "User does not exist."
      }
    }
  }
}

Failure Response

{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}