POST
/
v2
/
users
/
get

Use this API to retrieve users based on various filters such as organization ID, document ID, organization user group IDs or user IDs. You can use these filters in various combinations to get the desired users. Some examples are shown below.

Prior to using this API, you must:

  • Deploy v3.0.61 or higher of the Velt SDK.
  • Enable advanced queries option in the console

Endpoint

POST https://api.velt.dev/v2/users/get

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. Get users by organizationId

{
  "data": {
    "organizationId": "yourOrganizationId",
    "pageSize": 1000,
    "pageToken": "pageToken"
  }
}

2. Get users by documentId within an organization

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId"
  }
}

3. Get users by specific user IDs in an organization

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

4. Get users by specific user IDs in the given organization and document

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

5. Get users by organization and organization user group IDs

{
  "data": {
    "organizationId": "yourOrganizationId",
    "organizationUserGroupIds": [
      "yourOrganizationUserGroupId"
    ]
  }
}

6. Get users by organization, organization user group IDs and user IDs

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

Response

Success Response

{
  "result": {
    "status": "success",
    "message": "User(s) retrieved successfully.",
    "data": [
      {
        "email": "userEmail@domain.com",
        "name": "userName",
        "userId": "yourUserId"
      }
    ],
    "pageToken": "pageToken"
  }
}

Failure Response

{
  "error": {
    "message": "Error retrieving user(s).",
    "status": "ERROR_CODE"
  }
}