Aprovar a associação a uma organização
RegistosPOST /organization-links/{linkID}/approve
Approve an organization link as the tenant owner and grant scoped access
Activates a pending request from another organization to administer this tenant, recording the approver and the grants given; grants map a role to scopes and only admin: accounts:read, finance: billing:read, analyst: portfolio:read and support: support:read are accepted. Only a staff member with the owner role in the linked tenant may approve; others get 403. Returns 400 for invalid grants or a link that is not pending, and 429 when the organization's plan account limit is reached; the decision is audited.
Parâmetros
linkIDID of the pending organization link request for the caller's tenant.
Corpo application/json
grants
Devolve
200 Owner consent recorded and link activated
Mostrar atributos
idorganization_idtenant_idtenant_nametenant_slugstateum de
pending_consent,active,removal_pending,removed,ownedconsent_approved_byconsent_approved_atadded_bynotice_period_untilgrants
Permissões business:organization:read · Funções: admin, analyst, billing_clerk, customer_service, field_reader, field_supervisor, finance, operations, owner, viewer
curl -X POST "$BUSINESS_API/organization-links/{linkID}/approve" \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"grants": {
"key": [
{
"accounts": "read"
}
]
}
}'
# Sem comando CLI equivalente; use cURL ou HTTP directo.
const res = await fetch("$BUSINESS_API/organization-links/{linkID}/approve", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"grants": {
"key": [
{
"accounts": "read"
}
]
}
})
});
const data = await res.json();
import requests
res = requests.post(
"$BUSINESS_API/organization-links/{linkID}/approve",
headers={
"Authorization": "Bearer sk_test_..."
},
json={
"grants": {
"key": [
{
"accounts": "read"
}
]
}
}
)
data = res.json()
body := strings.NewReader(`{
"grants": {
"key": [
{
"accounts": "read"
}
]
}
}`)
req, _ := http.NewRequest("POST", "$BUSINESS_API/organization-links/{linkID}/approve", body)
req.Header.Set("Authorization", "Bearer sk_test_...")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
{
"id": "org_2BfeY3PegjBaQbr8EdxWUjNy4BN",
"organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
"tenant_name": "Ana Matsinhe",
"tenant_slug": "tenant slug",
"state": "pending_consent",
"consent_approved_by": "consent approved by",
"consent_approved_at": "2026-11-19T09:30:00Z",
"added_by": "added by",
"notice_period_until": "2026-11-19T09:30:00Z",
"grants": {
"key": [
"value"
]
}
}