Create a correction draft for a submitted check
Requires the participation feature, programs_view and access to this organization-owned program. Requires participation_submit or participation_configure and access to the check’s site/cohort. Only the latest submitted revision may be corrected and its series must not already have a draft. Clones the roster and evidence into a new draft with revision incremented and new observation IDs; the original stays submitted until correction submission. The organization-wide key replays only the matching source check. Returns 201 when created or 200 for replay. source_note defaults to the original when omitted or null.
curl --request POST \
--url https://api.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"source_note": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections"
payload = {
"idempotency_key": "<string>",
"source_note": "<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({idempotency_key: '<string>', source_note: '<string>'})
};
fetch('https://api.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections', 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/programs/{program_id}/participation/sessions/{session_id}/corrections",
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([
'idempotency_key' => '<string>',
'source_note' => '<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.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"source_note\": \"<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.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"source_note\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections")
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 \"idempotency_key\": \"<string>\",\n \"source_note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"program_id": 123,
"scheduled_for": "2023-12-25",
"revision": 123,
"supersedes_session_id": 123,
"lock_version": 123,
"partial_reason": "<string>",
"source_note": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"void_reason": "<string>",
"available_new_entrants_count": 123,
"period": {
"id": 123,
"name": "<string>"
},
"site": {
"id": 123,
"name": "<string>"
},
"cohort": {
"id": 123,
"name": "<string>"
},
"session_type": "roster_verification",
"status": "draft",
"series_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_evidence_source": "official_record",
"counts": {
"expected": 123,
"seen": 123,
"confirmed_enrolled": 123,
"unresolved": 123,
"not_checked": 123,
"not_expected": 123,
"new_entrant": 123
},
"observations": [
{
"id": 123,
"entity_id": 123,
"gratona_id": 123,
"display_name": "<string>",
"is_archived": true,
"thumbnail_url": "<string>",
"site_name": "<string>",
"cohort_name": "<string>",
"expected_in_roster": true,
"is_new_entrant": true,
"reason_code": "<string>",
"note": "<string>",
"effective_on": "2023-12-25",
"destination_program_site_id": 123,
"destination_program_cohort_id": 123,
"destination_recipient_placement_id": 123,
"follow_up": {
"id": 123,
"due_date": "2023-12-25"
},
"encounter_status": "seen",
"enrollment_confirmation": "confirmed_enrolled",
"evidence_source": "official_record"
}
]
}{
"id": 123,
"program_id": 123,
"scheduled_for": "2023-12-25",
"revision": 123,
"supersedes_session_id": 123,
"lock_version": 123,
"partial_reason": "<string>",
"source_note": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"void_reason": "<string>",
"available_new_entrants_count": 123,
"period": {
"id": 123,
"name": "<string>"
},
"site": {
"id": 123,
"name": "<string>"
},
"cohort": {
"id": 123,
"name": "<string>"
},
"session_type": "roster_verification",
"status": "draft",
"series_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_evidence_source": "official_record",
"counts": {
"expected": 123,
"seen": 123,
"confirmed_enrolled": 123,
"unresolved": 123,
"not_checked": 123,
"not_expected": 123,
"new_entrant": 123
},
"observations": [
{
"id": 123,
"entity_id": 123,
"gratona_id": 123,
"display_name": "<string>",
"is_archived": true,
"thumbnail_url": "<string>",
"site_name": "<string>",
"cohort_name": "<string>",
"expected_in_roster": true,
"is_new_entrant": true,
"reason_code": "<string>",
"note": "<string>",
"effective_on": "2023-12-25",
"destination_program_site_id": 123,
"destination_program_cohort_id": 123,
"destination_recipient_placement_id": 123,
"follow_up": {
"id": 123,
"due_date": "2023-12-25"
},
"encounter_status": "seen",
"enrollment_confirmation": "confirmed_enrolled",
"evidence_source": "official_record"
}
]
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Path Parameters
Body
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Response
Existing matching correction request replayed.
curl --request POST \
--url https://api.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"source_note": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections"
payload = {
"idempotency_key": "<string>",
"source_note": "<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({idempotency_key: '<string>', source_note: '<string>'})
};
fetch('https://api.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections', 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/programs/{program_id}/participation/sessions/{session_id}/corrections",
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([
'idempotency_key' => '<string>',
'source_note' => '<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.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"source_note\": \"<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.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"source_note\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/programs/{program_id}/participation/sessions/{session_id}/corrections")
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 \"idempotency_key\": \"<string>\",\n \"source_note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"program_id": 123,
"scheduled_for": "2023-12-25",
"revision": 123,
"supersedes_session_id": 123,
"lock_version": 123,
"partial_reason": "<string>",
"source_note": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"void_reason": "<string>",
"available_new_entrants_count": 123,
"period": {
"id": 123,
"name": "<string>"
},
"site": {
"id": 123,
"name": "<string>"
},
"cohort": {
"id": 123,
"name": "<string>"
},
"session_type": "roster_verification",
"status": "draft",
"series_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_evidence_source": "official_record",
"counts": {
"expected": 123,
"seen": 123,
"confirmed_enrolled": 123,
"unresolved": 123,
"not_checked": 123,
"not_expected": 123,
"new_entrant": 123
},
"observations": [
{
"id": 123,
"entity_id": 123,
"gratona_id": 123,
"display_name": "<string>",
"is_archived": true,
"thumbnail_url": "<string>",
"site_name": "<string>",
"cohort_name": "<string>",
"expected_in_roster": true,
"is_new_entrant": true,
"reason_code": "<string>",
"note": "<string>",
"effective_on": "2023-12-25",
"destination_program_site_id": 123,
"destination_program_cohort_id": 123,
"destination_recipient_placement_id": 123,
"follow_up": {
"id": 123,
"due_date": "2023-12-25"
},
"encounter_status": "seen",
"enrollment_confirmation": "confirmed_enrolled",
"evidence_source": "official_record"
}
]
}{
"id": 123,
"program_id": 123,
"scheduled_for": "2023-12-25",
"revision": 123,
"supersedes_session_id": 123,
"lock_version": 123,
"partial_reason": "<string>",
"source_note": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"void_reason": "<string>",
"available_new_entrants_count": 123,
"period": {
"id": 123,
"name": "<string>"
},
"site": {
"id": 123,
"name": "<string>"
},
"cohort": {
"id": 123,
"name": "<string>"
},
"session_type": "roster_verification",
"status": "draft",
"series_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primary_evidence_source": "official_record",
"counts": {
"expected": 123,
"seen": 123,
"confirmed_enrolled": 123,
"unresolved": 123,
"not_checked": 123,
"not_expected": 123,
"new_entrant": 123
},
"observations": [
{
"id": 123,
"entity_id": 123,
"gratona_id": 123,
"display_name": "<string>",
"is_archived": true,
"thumbnail_url": "<string>",
"site_name": "<string>",
"cohort_name": "<string>",
"expected_in_roster": true,
"is_new_entrant": true,
"reason_code": "<string>",
"note": "<string>",
"effective_on": "2023-12-25",
"destination_program_site_id": 123,
"destination_program_cohort_id": 123,
"destination_recipient_placement_id": 123,
"follow_up": {
"id": 123,
"due_date": "2023-12-25"
},
"encounter_status": "seen",
"enrollment_confirmation": "confirmed_enrolled",
"evidence_source": "official_record"
}
]
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}