curl --request PUT \
--url https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allow_counterparty_access": true
}
'import requests
url = "https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}"
payload = { "allow_counterparty_access": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({allow_counterparty_access: true})
};
fetch('https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}', 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://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allow_counterparty_access' => true
]),
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://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}"
payload := strings.NewReader("{\n \"allow_counterparty_access\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allow_counterparty_access\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allow_counterparty_access\": true\n}"
response = http.request(request)
puts response.read_body{
"tenant_id": "<string>",
"principal_id": "<string>",
"tenancy_role": "account_admin",
"api_functional_role": "tenant_owner",
"principal_type": "human",
"allow_counterparty_access": true,
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "validation_error",
"message": "Request body failed schema validation.",
"details": [
{
"path": "/subject_id",
"message": "subject_id is required."
}
]
}
}{
"error": {
"code": "unauthorized",
"message": "Authentication required."
}
}{
"error": {
"code": "forbidden",
"message": "Owner or grant required."
}
}{
"error": {
"code": "validation_error",
"message": "Request body failed schema validation.",
"details": [
{
"path": "/subject_id",
"message": "subject_id is required.",
"code": "invalid_type"
}
],
"request_id": "req_01j2k3m4n5"
}
}Add or Update Principal
Creates or updates a principal’s roles and flags within the tenant.
Uses PATCH semantics — omitted fields are left unchanged.
Requires account_admin tenancy role.
At least one of tenancy_role, api_functional_role, allow_counterparty_access,
or principal_type must be supplied.
allow_counterparty_access: true may only be set by a caller whose own
principal_type is human. Service account and AI agent callers are rejected
with 422. Revoking (setting false) has no human-caller requirement.
api_functional_role: tenant_owner may only be assigned to principals
with principal_type: human.
curl --request PUT \
--url https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allow_counterparty_access": true
}
'import requests
url = "https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}"
payload = { "allow_counterparty_access": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({allow_counterparty_access: true})
};
fetch('https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}', 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://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allow_counterparty_access' => true
]),
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://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}"
payload := strings.NewReader("{\n \"allow_counterparty_access\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allow_counterparty_access\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tally-platform-api-xwka6vu2kq-ue.a.run.app/v1/tenants/{tenant_id}/principals/{principal_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allow_counterparty_access\": true\n}"
response = http.request(request)
puts response.read_body{
"tenant_id": "<string>",
"principal_id": "<string>",
"tenancy_role": "account_admin",
"api_functional_role": "tenant_owner",
"principal_type": "human",
"allow_counterparty_access": true,
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "validation_error",
"message": "Request body failed schema validation.",
"details": [
{
"path": "/subject_id",
"message": "subject_id is required."
}
]
}
}{
"error": {
"code": "unauthorized",
"message": "Authentication required."
}
}{
"error": {
"code": "forbidden",
"message": "Owner or grant required."
}
}{
"error": {
"code": "validation_error",
"message": "Request body failed schema validation.",
"details": [
{
"path": "/subject_id",
"message": "subject_id is required.",
"code": "invalid_type"
}
],
"request_id": "req_01j2k3m4n5"
}
}Authorizations
Firebase Auth JWT issued by Google Identity Platform.
Obtain a token by signing in at your app domain and calling
firebase.auth().currentUser.getIdToken().
Path Parameters
Tenant identifier.
Principal ID in oidc:{projectId}#{uid} format.
Body
Set to null to remove the tenancy role.
account_admin, billing_admin, account_viewer Set to null to remove the data-access role.
tenant_owner, tenant_admin, tenant_editor, tenant_proposer, tenant_reader Defaults to human on first upsert. Required when registering a service account or AI agent.
human, service_account, ai_agent Grants or revokes counterparty read access for this principal. Setting true requires the caller to have principal_type human.
Response
Principal updated or created.
Account-level role. Controls membership administration (adding/removing principals, billing).
account_admin, billing_admin, account_viewer Data-access role. Controls what the principal may do with subjects and grants. Ranked hierarchy — higher rank implies lower-rank permissions.
tenant_owner, tenant_admin, tenant_editor, tenant_proposer, tenant_reader The kind of principal. Defaults to human. Used to enforce human-only constraints (e.g. tenant_owner, allow_counterparty_access).
human, service_account, ai_agent When true, this principal may call counterparty-facing endpoints (accessible-subjects, grant-path snapshot reads). Defaults to false. May only be set to true by a human account_admin.
active, revoked