Sync User Accounts

PUT Request

🚧

Every PUT request to sync resources into Vanta provides a full state of available resources. This means, every resource to be monitored, needs to be sent with every SYNC request, otherwise, when a previously submitted resource is omitted in a subsequent SYNC, Vanta will assume the resource no longer exists.

URL

Sending all the resources for a User Account based resource id, requires making a PUT request to:

https://api.vanta.com/v1/resources/user_account/sync_all

The base url "api.vanta.com" is the same we used to get our access token, but the rest of the path "/v1/resources/user_account/sync_all" is resource type specific and therefore in this case defined only to get resources of type User Account.

📘

Any resources that are created using the Base Resource Type of User Accounts, will use the above endpoint to SYNC all the resources to Vanta.

Parameters

This request does not require any parameters to be sent as part of the URL

Headers

Vanta requires a Bearer Token to be passed in the header of the request, and the expected value is the one obtained during the Authorization process. This is the same authorization process we did to LIST the resources using a GET Request.

Body

This request requires a JSON Object to be sent in the body. This object will contain the resource Id to identify the resources to be sent, and an array of resources.

Each resource in the array, needs to follow the defined schema for that resource id, as configured in the Resources tab in the applications. Reference the Resources section of this guide as a refreshed if needed.

We will continue to use the resource id from the UserAccount resource type we created earlier. Notice the resource id is included in the body of the request, as part of the JSON Object, and not in the URL as a parameter.

Postman will replace the variable {{account_resource_id}} with its corresponding current value as defined in the environment.

Summary

Request TypePUT
URLhttps://api.vanta.com/v1/resources/user_account/sync_all
ParametersN/A
HeadersAuthorization: “Bearer {{token}}”
BodyJSON Object containing the Resource_id and the array of user accounts with the corresponding schema

PUT Response

Response Code

The expected response code for the above request is 200. This means everything has executed correctly. Any other response means there was an issue with the request. Review all the above steps, check the validity of your authorization token and retry your request.

Headers

Response headers can be ignored.

Body

A successful response will consist of a JSON Object with only one property called success with a value of True. This indicates Vanta has successfully received and process your resources.

Summary

Response Code200
HeaderIgnore
BodyJSON Object containing the status of the operation
{
"success": true
}

Check your work by making a new GET Request and confirming the GET Response contains all the resources you have just sent.

👍

We have successfully sent all our resources to Vanta for a given resource id.