Reassign a sponsorship recipient
Moves the donor relationship and linked type1 commitments to a visible available recipient, including another accessible program. Preserves payment amounts/frequency/method/billing anchors; updates designation/funding and recipient availability. Locks block concurrent billing and recheck donor, target capacity and duplicates. The reasoned contract uses expected version plus UUID retry fingerprint; an identical retry returns replayed=true. Presence of target_entity_id selects older controls semantics: entity_id defaults from it, reason/notes/effective-time/version/retry inputs are ignored and a compact sponsorship result is returned. Controls mode requires lifecycle controls and can reject missing reasons when reason selection is required.
curl --request POST \
--url https://api.gratona.com/v1/admin/sponsorships/{donor_entity_id}/reassign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_id": 42,
"transition_type": "reassigned",
"expected_version": 1,
"idempotency_key": "d38103d8-1e8b-47ab-ae04-7e1f8a3bc727",
"payment_continuity_confirmed": true,
"reason_code": "donor_requested_change",
"notes": "Donor requested another recipient.",
"effective_at": "2026-10-20T12:00:00Z"
}
'import requests
url = "https://api.gratona.com/v1/admin/sponsorships/{donor_entity_id}/reassign"
payload = {
"entity_id": 42,
"transition_type": "reassigned",
"expected_version": 1,
"idempotency_key": "d38103d8-1e8b-47ab-ae04-7e1f8a3bc727",
"payment_continuity_confirmed": True,
"reason_code": "donor_requested_change",
"notes": "Donor requested another recipient.",
"effective_at": "2026-10-20T12:00:00Z"
}
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({
entity_id: 42,
transition_type: 'reassigned',
expected_version: 1,
idempotency_key: 'd38103d8-1e8b-47ab-ae04-7e1f8a3bc727',
payment_continuity_confirmed: true,
reason_code: 'donor_requested_change',
notes: 'Donor requested another recipient.',
effective_at: '2026-10-20T12:00:00Z'
})
};
fetch('https://api.gratona.com/v1/admin/sponsorships/{donor_entity_id}/reassign', 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/sponsorships/{donor_entity_id}/reassign",
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([
'entity_id' => 42,
'transition_type' => 'reassigned',
'expected_version' => 1,
'idempotency_key' => 'd38103d8-1e8b-47ab-ae04-7e1f8a3bc727',
'payment_continuity_confirmed' => true,
'reason_code' => 'donor_requested_change',
'notes' => 'Donor requested another recipient.',
'effective_at' => '2026-10-20T12:00:00Z'
]),
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/sponsorships/{donor_entity_id}/reassign"
payload := strings.NewReader("{\n \"entity_id\": 42,\n \"transition_type\": \"reassigned\",\n \"expected_version\": 1,\n \"idempotency_key\": \"d38103d8-1e8b-47ab-ae04-7e1f8a3bc727\",\n \"payment_continuity_confirmed\": true,\n \"reason_code\": \"donor_requested_change\",\n \"notes\": \"Donor requested another recipient.\",\n \"effective_at\": \"2026-10-20T12:00:00Z\"\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/sponsorships/{donor_entity_id}/reassign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_id\": 42,\n \"transition_type\": \"reassigned\",\n \"expected_version\": 1,\n \"idempotency_key\": \"d38103d8-1e8b-47ab-ae04-7e1f8a3bc727\",\n \"payment_continuity_confirmed\": true,\n \"reason_code\": \"donor_requested_change\",\n \"notes\": \"Donor requested another recipient.\",\n \"effective_at\": \"2026-10-20T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/sponsorships/{donor_entity_id}/reassign")
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 \"entity_id\": 42,\n \"transition_type\": \"reassigned\",\n \"expected_version\": 1,\n \"idempotency_key\": \"d38103d8-1e8b-47ab-ae04-7e1f8a3bc727\",\n \"payment_continuity_confirmed\": true,\n \"reason_code\": \"donor_requested_change\",\n \"notes\": \"Donor requested another recipient.\",\n \"effective_at\": \"2026-10-20T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Commitment successfully reassigned.",
"replayed": false,
"event": {
"id": 42,
"subject_type": "recipient",
"subject_id": 42,
"correlation_id": "Example",
"aggregate_version": 42,
"donor_entity_id": 42,
"donor_id": 42,
"from_entity_id": 42,
"entity_id": 42,
"from_program_id": 42,
"program_id": 42,
"reason_definition_id": 42,
"actor_user_id": 42,
"donor_name": "Example",
"from_recipient_name": "Example",
"recipient_name": "Example",
"from_program_name": "Example",
"program_name": "Example",
"reason_code": "Example",
"reason_label": "Example",
"notes": "Example",
"currency": "Example",
"actor_name": "Example",
"source": "Example",
"transition_type": "started",
"reason_context_key": "recipient.archive",
"amount": "25.00",
"metadata": {
"recipient_started_at": "2026-10-20T12:00:00Z",
"from_recipient_started_at": "2026-10-20T12:00:00Z",
"commitment_id": 42,
"frequency": 42,
"method": 42,
"request_fingerprint": "sha256-hash",
"payment_continuity_confirmed": false,
"affected_sponsorship_count": 42,
"recipient_exit_event_id": 42
},
"effective_at": "2026-10-20T12:00:00Z",
"created_at": "2026-10-20T12:00:00Z",
"delivery": {
"status": "pending",
"attempts": 0,
"processed_at": "2026-10-20T12:00:00Z"
}
},
"sponsorship": {
"id": 42,
"donor_id": 42,
"entity_id": 42,
"program_id": 42,
"lifecycle_version": 42,
"amount": "25.00"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"error": "Conflict",
"error_code": "SPONSORSHIP_LIFECYCLE_VERSION_CONFLICT",
"message": "Reload and review the sponsorship again.",
"expected_version": 42,
"current_version": 42
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Record ID in the authenticated organization.
42
Body
- Option 1
- Option 2
Replacement active visible recipient in an accessible program.
x >= 142
Supported transition.
reassigned "reassigned"
Current sponsorship lifecycle_version.
x >= 11
Stable retry UUID for this exact reassignment command.
"d38103d8-1e8b-47ab-ae04-7e1f8a3bc727"
Must be accepted; confirms existing payments continue for the replacement recipient.
true
Active context reason; required by catalog policy where configured.
100"donor_requested_change"
Context note; required for reasons configured to need notes.
2000"Donor requested another recipient."
Business effective time; defaults now.
"2026-10-20T12:00:00Z"
Response
Reassign a sponsorship recipient completed.
curl --request POST \
--url https://api.gratona.com/v1/admin/sponsorships/{donor_entity_id}/reassign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_id": 42,
"transition_type": "reassigned",
"expected_version": 1,
"idempotency_key": "d38103d8-1e8b-47ab-ae04-7e1f8a3bc727",
"payment_continuity_confirmed": true,
"reason_code": "donor_requested_change",
"notes": "Donor requested another recipient.",
"effective_at": "2026-10-20T12:00:00Z"
}
'import requests
url = "https://api.gratona.com/v1/admin/sponsorships/{donor_entity_id}/reassign"
payload = {
"entity_id": 42,
"transition_type": "reassigned",
"expected_version": 1,
"idempotency_key": "d38103d8-1e8b-47ab-ae04-7e1f8a3bc727",
"payment_continuity_confirmed": True,
"reason_code": "donor_requested_change",
"notes": "Donor requested another recipient.",
"effective_at": "2026-10-20T12:00:00Z"
}
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({
entity_id: 42,
transition_type: 'reassigned',
expected_version: 1,
idempotency_key: 'd38103d8-1e8b-47ab-ae04-7e1f8a3bc727',
payment_continuity_confirmed: true,
reason_code: 'donor_requested_change',
notes: 'Donor requested another recipient.',
effective_at: '2026-10-20T12:00:00Z'
})
};
fetch('https://api.gratona.com/v1/admin/sponsorships/{donor_entity_id}/reassign', 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/sponsorships/{donor_entity_id}/reassign",
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([
'entity_id' => 42,
'transition_type' => 'reassigned',
'expected_version' => 1,
'idempotency_key' => 'd38103d8-1e8b-47ab-ae04-7e1f8a3bc727',
'payment_continuity_confirmed' => true,
'reason_code' => 'donor_requested_change',
'notes' => 'Donor requested another recipient.',
'effective_at' => '2026-10-20T12:00:00Z'
]),
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/sponsorships/{donor_entity_id}/reassign"
payload := strings.NewReader("{\n \"entity_id\": 42,\n \"transition_type\": \"reassigned\",\n \"expected_version\": 1,\n \"idempotency_key\": \"d38103d8-1e8b-47ab-ae04-7e1f8a3bc727\",\n \"payment_continuity_confirmed\": true,\n \"reason_code\": \"donor_requested_change\",\n \"notes\": \"Donor requested another recipient.\",\n \"effective_at\": \"2026-10-20T12:00:00Z\"\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/sponsorships/{donor_entity_id}/reassign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity_id\": 42,\n \"transition_type\": \"reassigned\",\n \"expected_version\": 1,\n \"idempotency_key\": \"d38103d8-1e8b-47ab-ae04-7e1f8a3bc727\",\n \"payment_continuity_confirmed\": true,\n \"reason_code\": \"donor_requested_change\",\n \"notes\": \"Donor requested another recipient.\",\n \"effective_at\": \"2026-10-20T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/sponsorships/{donor_entity_id}/reassign")
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 \"entity_id\": 42,\n \"transition_type\": \"reassigned\",\n \"expected_version\": 1,\n \"idempotency_key\": \"d38103d8-1e8b-47ab-ae04-7e1f8a3bc727\",\n \"payment_continuity_confirmed\": true,\n \"reason_code\": \"donor_requested_change\",\n \"notes\": \"Donor requested another recipient.\",\n \"effective_at\": \"2026-10-20T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Commitment successfully reassigned.",
"replayed": false,
"event": {
"id": 42,
"subject_type": "recipient",
"subject_id": 42,
"correlation_id": "Example",
"aggregate_version": 42,
"donor_entity_id": 42,
"donor_id": 42,
"from_entity_id": 42,
"entity_id": 42,
"from_program_id": 42,
"program_id": 42,
"reason_definition_id": 42,
"actor_user_id": 42,
"donor_name": "Example",
"from_recipient_name": "Example",
"recipient_name": "Example",
"from_program_name": "Example",
"program_name": "Example",
"reason_code": "Example",
"reason_label": "Example",
"notes": "Example",
"currency": "Example",
"actor_name": "Example",
"source": "Example",
"transition_type": "started",
"reason_context_key": "recipient.archive",
"amount": "25.00",
"metadata": {
"recipient_started_at": "2026-10-20T12:00:00Z",
"from_recipient_started_at": "2026-10-20T12:00:00Z",
"commitment_id": 42,
"frequency": 42,
"method": 42,
"request_fingerprint": "sha256-hash",
"payment_continuity_confirmed": false,
"affected_sponsorship_count": 42,
"recipient_exit_event_id": 42
},
"effective_at": "2026-10-20T12:00:00Z",
"created_at": "2026-10-20T12:00:00Z",
"delivery": {
"status": "pending",
"attempts": 0,
"processed_at": "2026-10-20T12:00:00Z"
}
},
"sponsorship": {
"id": 42,
"donor_id": 42,
"entity_id": 42,
"program_id": 42,
"lifecycle_version": 42,
"amount": "25.00"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"error": "Conflict",
"error_code": "SPONSORSHIP_LIFECYCLE_VERSION_CONFLICT",
"message": "Reload and review the sponsorship again.",
"expected_version": 42,
"current_version": 42
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}