POST
/
v1
/
users
/
update

Use this API to update user metadata based on various filters such as organization ID, document ID, and user IDs. You can use these filters in various combinations to get the desired results. The user metadata such as name, email etc can be updated.

Endpoint

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

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. Update users in a specific organization

{
  "data": {
    "organizationId": "yourOrganizationId",
    "users": [
      {
        "userId": "yourUserId1",
        "name": "User Name",
        "email": "user@email.com"
      }
    ]
  }
}

2. Update users in a specific document within an organization

{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "users": [
      {
        "userId": "yourUserId1",
        "name": "User Name",
        "email": "user@email.com"
      }
    ]
  }
}

Response

Success Response

{
  "result": {
    "status": "success",
    "message": "User(s) processed successfully.",
    "data": {
      "yourUserId1": {
        "success": true,
        "id": "7d87015b055a168b098cf05b870e40ff",
        "message": "User updated."
      }
    }
  }
}

Some User(s) Not Found

{
  "result": {
    "status": "success",
    "message": "User(s) processed successfully.",
    "data": {
      "yourUserId1": {
        "success": true,
        "id": "7d87015b055a168b098cf05b870e40ff",
        "message": "User updated."
      },
      "yourUserId2": {
        "success": false,
        "id": "ad22d93b49ad990d2b3d582d08d7768a",
        "message": "User does not exist."
      }
    }
  }
}

Failure Response

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