Update workspace donor intelligence subscription metadata
Requires the donor_intelligence feature and route permissions. Every client_id route is restricted to the authenticated organization, including platform administrators using workspace routes. Stored profiles are filtered against current email-privacy state; obsolete privacy snapshots are concealed. Legacy wealth-insights URLs are equivalent aliases. Sets the workspace module to paid using supplied or existing payment/metadata/expiry values. A later annual expiry may grant included-plan renewal credits. This operation changes subscription/capacity state; it does not itself charge a payment card.
curl --request POST \
--url https://api.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expires_at": "2023-11-07T05:31:56Z",
"client_payment_id": 123,
"metadata": {}
}
'import requests
url = "https://api.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription"
payload = {
"expires_at": "2023-11-07T05:31:56Z",
"client_payment_id": 123,
"metadata": {}
}
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({expires_at: '2023-11-07T05:31:56Z', client_payment_id: 123, metadata: {}})
};
fetch('https://api.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription', 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.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription",
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([
'expires_at' => '2023-11-07T05:31:56Z',
'client_payment_id' => 123,
'metadata' => [
]
]),
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.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription"
payload := strings.NewReader("{\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"client_payment_id\": 123,\n \"metadata\": {}\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.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"client_payment_id\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription")
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 \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"client_payment_id\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Saved successfully.",
"data": {
"subscription": {
"id": 123,
"client_id": 123,
"module": "<string>",
"plan_type": "<string>",
"status": "<string>",
"client_payment_id": 123,
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"metadata": {}
},
"ai_capacity_renewal_grant": {
"id": 123,
"client_id": 123,
"user_id": 123,
"entry_type": "<string>",
"action_type": "<string>",
"credit_delta": 123,
"balance_after_credits": 123,
"amount_cents": 123,
"currency": "<string>",
"source_type": "<string>",
"source_id": "<string>",
"run_id": 123,
"expires_at": "2023-11-07T05:31:56Z",
"pricing_version": "<string>",
"idempotency_key": "<string>",
"stripe_payment_intent_id": "<string>",
"note": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"metadata_json": {}
}
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"status": "error",
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"status": "error",
"message": "<string>",
"code": "<string>",
"errors": {}
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Client id.
Body
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
curl --request POST \
--url https://api.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expires_at": "2023-11-07T05:31:56Z",
"client_payment_id": 123,
"metadata": {}
}
'import requests
url = "https://api.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription"
payload = {
"expires_at": "2023-11-07T05:31:56Z",
"client_payment_id": 123,
"metadata": {}
}
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({expires_at: '2023-11-07T05:31:56Z', client_payment_id: 123, metadata: {}})
};
fetch('https://api.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription', 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.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription",
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([
'expires_at' => '2023-11-07T05:31:56Z',
'client_payment_id' => 123,
'metadata' => [
]
]),
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.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription"
payload := strings.NewReader("{\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"client_payment_id\": 123,\n \"metadata\": {}\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.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"client_payment_id\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/donors/{client_id}/wealth-insights/subscription")
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 \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"client_payment_id\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Saved successfully.",
"data": {
"subscription": {
"id": 123,
"client_id": 123,
"module": "<string>",
"plan_type": "<string>",
"status": "<string>",
"client_payment_id": 123,
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"metadata": {}
},
"ai_capacity_renewal_grant": {
"id": 123,
"client_id": 123,
"user_id": 123,
"entry_type": "<string>",
"action_type": "<string>",
"credit_delta": 123,
"balance_after_credits": 123,
"amount_cents": 123,
"currency": "<string>",
"source_type": "<string>",
"source_id": "<string>",
"run_id": 123,
"expires_at": "2023-11-07T05:31:56Z",
"pricing_version": "<string>",
"idempotency_key": "<string>",
"stripe_payment_intent_id": "<string>",
"note": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"metadata_json": {}
}
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"status": "error",
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"status": "error",
"message": "<string>",
"code": "<string>",
"errors": {}
}