Skip to main content
PATCH
/
trust-centers
/
{slugId}
/
viewers
/
{viewerId}
Update Trust Center viewer
curl --request PATCH \
  --url https://api.vanta.com/v1/trust-centers/{slugId}/viewers/{viewerId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "resourceIds": [
    "<string>"
  ],
  "expirationDate": "2023-11-07T05:31:56Z",
  "isNdaRequired": true,
  "customerTrustAccountId": "<string>"
}
'
import requests

url = "https://api.vanta.com/v1/trust-centers/{slugId}/viewers/{viewerId}"

payload = {
"resourceIds": ["<string>"],
"expirationDate": "2023-11-07T05:31:56Z",
"isNdaRequired": True,
"customerTrustAccountId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resourceIds: ['<string>'],
expirationDate: '2023-11-07T05:31:56Z',
isNdaRequired: true,
customerTrustAccountId: '<string>'
})
};

fetch('https://api.vanta.com/v1/trust-centers/{slugId}/viewers/{viewerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vanta.com/v1/trust-centers/{slugId}/viewers/{viewerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'resourceIds' => [
'<string>'
],
'expirationDate' => '2023-11-07T05:31:56Z',
'isNdaRequired' => true,
'customerTrustAccountId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.vanta.com/v1/trust-centers/{slugId}/viewers/{viewerId}"

payload := strings.NewReader("{\n \"resourceIds\": [\n \"<string>\"\n ],\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isNdaRequired\": true,\n \"customerTrustAccountId\": \"<string>\"\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.vanta.com/v1/trust-centers/{slugId}/viewers/{viewerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resourceIds\": [\n \"<string>\"\n ],\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isNdaRequired\": true,\n \"customerTrustAccountId\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.vanta.com/v1/trust-centers/{slugId}/viewers/{viewerId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resourceIds\": [\n \"<string>\"\n ],\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"isNdaRequired\": true,\n \"customerTrustAccountId\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "a2f7e1b9d0c3f4e5a6c7b8d9",
  "email": "exampleviewer@company.com",
  "name": "Example Viewer",
  "companyName": "Viewer Company, Inc.",
  "resourceIds": null,
  "accessLevel": "FULL_ACCESS",
  "ndaInfo": null,
  "externalServiceAssociations": [
    {
      "service": "SALESFORCE",
      "id": "0032S000062DfqnQBG",
      "objectType": "Salesforce Contact"
    }
  ],
  "creationDate": "2020-01-01T00:00:00.000Z",
  "updatedDate": "2020-01-01T00:00:00.000Z",
  "expirationDate": null,
  "addedByUser": null,
  "customerTrustAccountId": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

slugId
string
required
viewerId
string
required

Body

application/json
accessLevel
enum<string>

Access level for the viewer.

Available options:
FULL_ACCESS,
PARTIAL_ACCESS
resourceIds
string[]

Identifiers for the resources that this viewer should have access to.

expirationDate
string<date-time> | null

The date access should expire for this viewer. Set to null to remove expiration.

isNdaRequired
boolean

Whether to require an NDA for the viewer.

customerTrustAccountId
string | null

ID of a Customer Trust Account to associate with this viewer. Set to null to remove the association. Omit to leave unchanged.

Response

200 - application/json

Ok

id
string
required

Unique identifier for the viewer.

email
string
required

Email of the viewer.

name
string | null
required

Name of the viewer.

companyName
string | null
required

Name of the viewer's company.

resourceIds
string[] | null
required

IDs for the resources this viewer has access to. If null, the viewer has access to all resources on the Trust Center.

accessLevel
enum<string>
required

Access level of the viewer.

Available options:
FULL_ACCESS,
PARTIAL_ACCESS
ndaInfo
object | null
required

NDA-related information for the viewer.

externalServiceAssociations
object[] | null
required

Objects in external services that the viewer is associated with.

creationDate
string<date-time>
required

Date the viewer was created.

updatedDate
string<date-time>
required

Date the viewer was last updated.

expirationDate
string<date-time> | null
required

Expiration date for the viewer's access.

addedByUser
object | null
required

User that shared the Trust Center with this viewer.

customerTrustAccountId
string | null
required

ID of the Customer Trust Account associated with this viewer.