curl --request POST \
--url https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invitationToken": "<string>",
"disclosuresAcceptedVersion": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newPassword": "<string>"
}
'import requests
url = "https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance"
payload = {
"invitationToken": "<string>",
"disclosuresAcceptedVersion": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newPassword": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invitationToken: '<string>',
disclosuresAcceptedVersion: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
newPassword: '<string>'
})
};
fetch('https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance', 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.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invitationToken' => '<string>',
'disclosuresAcceptedVersion' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'newPassword' => '<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.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance"
payload := strings.NewReader("{\n \"invitationToken\": \"<string>\",\n \"disclosuresAcceptedVersion\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"newPassword\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invitationToken\": \"<string>\",\n \"disclosuresAcceptedVersion\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"newPassword\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invitationToken\": \"<string>\",\n \"disclosuresAcceptedVersion\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"newPassword\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"disclosureRequirement": "NOT_REQUIRED",
"status": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Accept with disclosures
One transaction. When the organization requires disclosures and the submitted version is absent or no longer the version in force, nothing is written and the user is not activated, so the half-completed state of accepting and then failing to activate cannot occur. The requirement and the version in force are resolved from the invited user’s organization, never from the request. Requires an application actor token, as accepting an invitation already does.
Token types: APP
curl --request POST \
--url https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invitationToken": "<string>",
"disclosuresAcceptedVersion": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newPassword": "<string>"
}
'import requests
url = "https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance"
payload = {
"invitationToken": "<string>",
"disclosuresAcceptedVersion": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newPassword": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invitationToken: '<string>',
disclosuresAcceptedVersion: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
newPassword: '<string>'
})
};
fetch('https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance', 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.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invitationToken' => '<string>',
'disclosuresAcceptedVersion' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'newPassword' => '<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.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance"
payload := strings.NewReader("{\n \"invitationToken\": \"<string>\",\n \"disclosuresAcceptedVersion\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"newPassword\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invitationToken\": \"<string>\",\n \"disclosuresAcceptedVersion\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"newPassword\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/identity/v1/users/{userId}/invitation-acceptance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invitationToken\": \"<string>\",\n \"disclosuresAcceptedVersion\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"newPassword\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"disclosureRequirement": "NOT_REQUIRED",
"status": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Authorizations
Application (M2M) OAuth2 access token (client credentials).
Path Parameters
The user being activated.
Body
Invitation acceptance details.
Completing an invitation: activating the user and, when their organization requires it, recording their acceptance of the disclosures they were shown.
The invitation token from the invitation email. Required, and it must resolve to the user in the route: the route id is the caller's to choose, so the token is what makes it trustworthy.
The disclosure version the caller was shown, from GET /identity/v1/disclosures.
Required when the organization requires disclosures, and rejected unless it is still the
version in force, so a publish landing between display and accept is not recorded as
agreement to text the caller never saw. Ignored when the organization does not require them.
Password to set while activating, when the flow collects one.
Response
The user was activated.
The result of completing an invitation.
The requirement resolved for the user's organization during the operation, so the caller knows whether an acceptance was recorded without resolving the settings chain again.
NOT_REQUIRED, REQUIRED The user's status after activation.
Was this page helpful?