Configure program participation
Requires the participation feature, programs_view and access to this organization-owned program. Requires participation_configure. Upserts locations, groups and non-overlapping periods; provide period or periods (periods wins if both exist). At most one period may be open. IDs update existing rows; absent IDs match normalized location/group names or period names before creating. Omitted locations/groups remain. Current placements or draft checks prevent deactivation. Required/profile field keys must belong to this program and any assignee must be an active organization user. Returns a fresh overview and increments setup revision; revision conflicts return 422.
curl --request PUT \
--url https://api.gratona.com/v1/admin/programs/{program_id}/participation/setup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sites": [
{
"name": "Main campus",
"cohorts": [
{
"name": "Group A",
"id": 42,
"code": "<string>",
"sort_order": 5000,
"status": "active",
"legacy_values": [
"<string>"
]
}
],
"id": 42,
"code": "<string>",
"status": "active",
"legacy_values": [
"<string>"
]
}
],
"period": {
"name": "2026 term",
"starts_on": "2026-10-20",
"ends_on": "2026-12-31",
"id": 42,
"status": "open"
},
"revision": 2,
"enabled": true,
"default_session_type": "roster_verification",
"allowed_evidence_sources": [],
"site_field_id": 42,
"cohort_field_id": 42,
"required_intake_field_keys": [
"<string>"
],
"profile_ready_field_keys": [
"<string>"
],
"profile_photo_required": true,
"unresolved_check_threshold": 26,
"dropout_review_after_days": 183,
"follow_up_due_days": 183,
"follow_up_assignee_user_id": 42,
"periods": [
{
"name": "2026 term",
"starts_on": "2026-10-20",
"ends_on": "2026-12-31",
"id": 42,
"status": "open"
}
],
"access_scopes": [
{
"group_id": 42,
"site_id": 42,
"cohort_id": 42
}
]
}
'import requests
url = "https://api.gratona.com/v1/admin/programs/{program_id}/participation/setup"
payload = {
"sites": [
{
"name": "Main campus",
"cohorts": [
{
"name": "Group A",
"id": 42,
"code": "<string>",
"sort_order": 5000,
"status": "active",
"legacy_values": ["<string>"]
}
],
"id": 42,
"code": "<string>",
"status": "active",
"legacy_values": ["<string>"]
}
],
"period": {
"name": "2026 term",
"starts_on": "2026-10-20",
"ends_on": "2026-12-31",
"id": 42,
"status": "open"
},
"revision": 2,
"enabled": True,
"default_session_type": "roster_verification",
"allowed_evidence_sources": [],
"site_field_id": 42,
"cohort_field_id": 42,
"required_intake_field_keys": ["<string>"],
"profile_ready_field_keys": ["<string>"],
"profile_photo_required": True,
"unresolved_check_threshold": 26,
"dropout_review_after_days": 183,
"follow_up_due_days": 183,
"follow_up_assignee_user_id": 42,
"periods": [
{
"name": "2026 term",
"starts_on": "2026-10-20",
"ends_on": "2026-12-31",
"id": 42,
"status": "open"
}
],
"access_scopes": [
{
"group_id": 42,
"site_id": 42,
"cohort_id": 42
}
]
}
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({
sites: [
{
name: 'Main campus',
cohorts: [
{
name: 'Group A',
id: 42,
code: '<string>',
sort_order: 5000,
status: 'active',
legacy_values: ['<string>']
}
],
id: 42,
code: '<string>',
status: 'active',
legacy_values: ['<string>']
}
],
period: {
name: '2026 term',
starts_on: '2026-10-20',
ends_on: '2026-12-31',
id: 42,
status: 'open'
},
revision: 2,
enabled: true,
default_session_type: 'roster_verification',
allowed_evidence_sources: [],
site_field_id: 42,
cohort_field_id: 42,
required_intake_field_keys: ['<string>'],
profile_ready_field_keys: ['<string>'],
profile_photo_required: true,
unresolved_check_threshold: 26,
dropout_review_after_days: 183,
follow_up_due_days: 183,
follow_up_assignee_user_id: 42,
periods: [
{
name: '2026 term',
starts_on: '2026-10-20',
ends_on: '2026-12-31',
id: 42,
status: 'open'
}
],
access_scopes: [{group_id: 42, site_id: 42, cohort_id: 42}]
})
};
fetch('https://api.gratona.com/v1/admin/programs/{program_id}/participation/setup', 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/setup",
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([
'sites' => [
[
'name' => 'Main campus',
'cohorts' => [
[
'name' => 'Group A',
'id' => 42,
'code' => '<string>',
'sort_order' => 5000,
'status' => 'active',
'legacy_values' => [
'<string>'
]
]
],
'id' => 42,
'code' => '<string>',
'status' => 'active',
'legacy_values' => [
'<string>'
]
]
],
'period' => [
'name' => '2026 term',
'starts_on' => '2026-10-20',
'ends_on' => '2026-12-31',
'id' => 42,
'status' => 'open'
],
'revision' => 2,
'enabled' => true,
'default_session_type' => 'roster_verification',
'allowed_evidence_sources' => [
],
'site_field_id' => 42,
'cohort_field_id' => 42,
'required_intake_field_keys' => [
'<string>'
],
'profile_ready_field_keys' => [
'<string>'
],
'profile_photo_required' => true,
'unresolved_check_threshold' => 26,
'dropout_review_after_days' => 183,
'follow_up_due_days' => 183,
'follow_up_assignee_user_id' => 42,
'periods' => [
[
'name' => '2026 term',
'starts_on' => '2026-10-20',
'ends_on' => '2026-12-31',
'id' => 42,
'status' => 'open'
]
],
'access_scopes' => [
[
'group_id' => 42,
'site_id' => 42,
'cohort_id' => 42
]
]
]),
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/setup"
payload := strings.NewReader("{\n \"sites\": [\n {\n \"name\": \"Main campus\",\n \"cohorts\": [\n {\n \"name\": \"Group A\",\n \"id\": 42,\n \"code\": \"<string>\",\n \"sort_order\": 5000,\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"id\": 42,\n \"code\": \"<string>\",\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"period\": {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n },\n \"revision\": 2,\n \"enabled\": true,\n \"default_session_type\": \"roster_verification\",\n \"allowed_evidence_sources\": [],\n \"site_field_id\": 42,\n \"cohort_field_id\": 42,\n \"required_intake_field_keys\": [\n \"<string>\"\n ],\n \"profile_ready_field_keys\": [\n \"<string>\"\n ],\n \"profile_photo_required\": true,\n \"unresolved_check_threshold\": 26,\n \"dropout_review_after_days\": 183,\n \"follow_up_due_days\": 183,\n \"follow_up_assignee_user_id\": 42,\n \"periods\": [\n {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n }\n ],\n \"access_scopes\": [\n {\n \"group_id\": 42,\n \"site_id\": 42,\n \"cohort_id\": 42\n }\n ]\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://api.gratona.com/v1/admin/programs/{program_id}/participation/setup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sites\": [\n {\n \"name\": \"Main campus\",\n \"cohorts\": [\n {\n \"name\": \"Group A\",\n \"id\": 42,\n \"code\": \"<string>\",\n \"sort_order\": 5000,\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"id\": 42,\n \"code\": \"<string>\",\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"period\": {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n },\n \"revision\": 2,\n \"enabled\": true,\n \"default_session_type\": \"roster_verification\",\n \"allowed_evidence_sources\": [],\n \"site_field_id\": 42,\n \"cohort_field_id\": 42,\n \"required_intake_field_keys\": [\n \"<string>\"\n ],\n \"profile_ready_field_keys\": [\n \"<string>\"\n ],\n \"profile_photo_required\": true,\n \"unresolved_check_threshold\": 26,\n \"dropout_review_after_days\": 183,\n \"follow_up_due_days\": 183,\n \"follow_up_assignee_user_id\": 42,\n \"periods\": [\n {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n }\n ],\n \"access_scopes\": [\n {\n \"group_id\": 42,\n \"site_id\": 42,\n \"cohort_id\": 42\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/programs/{program_id}/participation/setup")
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 \"sites\": [\n {\n \"name\": \"Main campus\",\n \"cohorts\": [\n {\n \"name\": \"Group A\",\n \"id\": 42,\n \"code\": \"<string>\",\n \"sort_order\": 5000,\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"id\": 42,\n \"code\": \"<string>\",\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"period\": {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n },\n \"revision\": 2,\n \"enabled\": true,\n \"default_session_type\": \"roster_verification\",\n \"allowed_evidence_sources\": [],\n \"site_field_id\": 42,\n \"cohort_field_id\": 42,\n \"required_intake_field_keys\": [\n \"<string>\"\n ],\n \"profile_ready_field_keys\": [\n \"<string>\"\n ],\n \"profile_photo_required\": true,\n \"unresolved_check_threshold\": 26,\n \"dropout_review_after_days\": 183,\n \"follow_up_due_days\": 183,\n \"follow_up_assignee_user_id\": 42,\n \"periods\": [\n {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n }\n ],\n \"access_scopes\": [\n {\n \"group_id\": 42,\n \"site_id\": 42,\n \"cohort_id\": 42\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"feature_enabled": true,
"configured": true,
"program": {
"id": 123,
"name": "<string>"
},
"selected_period_id": 42,
"schedule": {
"cadence": "weekly",
"fixed": true,
"state": "closed",
"as_of": "2026-10-20",
"window_starts_on": "2026-10-20",
"window_ends_on": "2026-10-20",
"next_window_starts_on": "2026-10-20"
},
"settings": {
"enabled": true,
"terminology": "school",
"default_session_type": "roster_verification",
"cadence": "weekly",
"default_evidence_source": "official_record",
"allowed_evidence_sources": [
"official_record"
],
"site_field_id": 42,
"cohort_field_id": 42,
"required_intake_field_keys": [
"<string>"
],
"profile_ready_field_keys": [
"<string>"
],
"profile_photo_required": true,
"unresolved_check_threshold": 123,
"dropout_review_after_days": 123,
"follow_up_due_days": 123,
"follow_up_assignee_user_id": 42,
"revision": 123
},
"periods": [
{
"id": 123,
"name": "<string>",
"starts_on": "2023-12-25",
"ends_on": "2023-12-25",
"status": "draft"
}
],
"sites": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"site_type": "<string>",
"roster_count": 123,
"cohorts": [
{
"id": 123,
"name": "<string>",
"roster_count": 123,
"can_start": true,
"next_check_on": "2023-12-25",
"missed_windows": 123,
"latest_session": {
"id": 123,
"scheduled_for": "2023-12-25",
"seen_count": 123,
"expected_count": 123,
"unresolved_count": 123,
"status": "draft"
},
"completion_status": "complete",
"scheduled_session": {
"id": 123,
"scheduled_for": "2023-12-25",
"seen_count": 123,
"expected_count": 123,
"unresolved_count": 123,
"status": "draft"
},
"schedule_status": "upcoming"
}
]
}
],
"summary": {
"recipients_with_current_placement": 123,
"recipients_without_current_placement": 123,
"draft_sessions": 123,
"unresolved_recipients": 123,
"verified_recipients": 123,
"period_unresolved_recipients": 123,
"new_recipients": 123,
"transferred_recipients": 123,
"withdrawn_recipients": 123,
"incomplete_profiles": 123,
"completed_cohorts": 123,
"expected_cohorts": 123
},
"capabilities": {
"view": true,
"record": true,
"submit": true,
"configure": true,
"scope": {
"restricted": true,
"sites": [
{
"site_id": 123,
"all_cohorts": true,
"cohort_ids": [
123
]
}
]
}
},
"intake_fields": [
{
"id": 123,
"key": "<string>",
"label": "<string>",
"type": "<string>",
"options": "<string>",
"required": true,
"required_for_intake": true,
"title": true,
"option_values": [
"<string>"
],
"placement_source": "site"
}
],
"recipient_creation": {
"program_type": "<string>",
"number_sponsors": [
"<string>"
],
"sponsorship_amounts": [
"<string>"
],
"contribution_levels": [
"<string>"
],
"donation_target": "<string>",
"recipient_portal_enabled": true,
"tags": [
"<string>"
]
},
"configuration": {
"recipient_fields": [
{
"id": 123,
"key": "<string>",
"label": "<string>",
"type": "<string>",
"options": "<string>",
"required": true,
"required_for_intake": true,
"title": true,
"option_values": [
"<string>"
],
"placement_source": "site"
}
],
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"follow_up_assignees": [
{
"id": 123,
"name": "<string>"
}
],
"access_scopes": [
{
"group_id": 123,
"site_id": 123,
"cohort_id": 123
}
],
"sites": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"site_type": "school",
"status": "active",
"legacy_values": [
"<string>"
],
"cohorts": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"sort_order": 123,
"status": "active",
"legacy_values": [
"<string>"
]
}
]
}
]
}
}{
"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.
- Option 1
- Option 2
Response
Configure program participation response.
curl --request PUT \
--url https://api.gratona.com/v1/admin/programs/{program_id}/participation/setup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sites": [
{
"name": "Main campus",
"cohorts": [
{
"name": "Group A",
"id": 42,
"code": "<string>",
"sort_order": 5000,
"status": "active",
"legacy_values": [
"<string>"
]
}
],
"id": 42,
"code": "<string>",
"status": "active",
"legacy_values": [
"<string>"
]
}
],
"period": {
"name": "2026 term",
"starts_on": "2026-10-20",
"ends_on": "2026-12-31",
"id": 42,
"status": "open"
},
"revision": 2,
"enabled": true,
"default_session_type": "roster_verification",
"allowed_evidence_sources": [],
"site_field_id": 42,
"cohort_field_id": 42,
"required_intake_field_keys": [
"<string>"
],
"profile_ready_field_keys": [
"<string>"
],
"profile_photo_required": true,
"unresolved_check_threshold": 26,
"dropout_review_after_days": 183,
"follow_up_due_days": 183,
"follow_up_assignee_user_id": 42,
"periods": [
{
"name": "2026 term",
"starts_on": "2026-10-20",
"ends_on": "2026-12-31",
"id": 42,
"status": "open"
}
],
"access_scopes": [
{
"group_id": 42,
"site_id": 42,
"cohort_id": 42
}
]
}
'import requests
url = "https://api.gratona.com/v1/admin/programs/{program_id}/participation/setup"
payload = {
"sites": [
{
"name": "Main campus",
"cohorts": [
{
"name": "Group A",
"id": 42,
"code": "<string>",
"sort_order": 5000,
"status": "active",
"legacy_values": ["<string>"]
}
],
"id": 42,
"code": "<string>",
"status": "active",
"legacy_values": ["<string>"]
}
],
"period": {
"name": "2026 term",
"starts_on": "2026-10-20",
"ends_on": "2026-12-31",
"id": 42,
"status": "open"
},
"revision": 2,
"enabled": True,
"default_session_type": "roster_verification",
"allowed_evidence_sources": [],
"site_field_id": 42,
"cohort_field_id": 42,
"required_intake_field_keys": ["<string>"],
"profile_ready_field_keys": ["<string>"],
"profile_photo_required": True,
"unresolved_check_threshold": 26,
"dropout_review_after_days": 183,
"follow_up_due_days": 183,
"follow_up_assignee_user_id": 42,
"periods": [
{
"name": "2026 term",
"starts_on": "2026-10-20",
"ends_on": "2026-12-31",
"id": 42,
"status": "open"
}
],
"access_scopes": [
{
"group_id": 42,
"site_id": 42,
"cohort_id": 42
}
]
}
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({
sites: [
{
name: 'Main campus',
cohorts: [
{
name: 'Group A',
id: 42,
code: '<string>',
sort_order: 5000,
status: 'active',
legacy_values: ['<string>']
}
],
id: 42,
code: '<string>',
status: 'active',
legacy_values: ['<string>']
}
],
period: {
name: '2026 term',
starts_on: '2026-10-20',
ends_on: '2026-12-31',
id: 42,
status: 'open'
},
revision: 2,
enabled: true,
default_session_type: 'roster_verification',
allowed_evidence_sources: [],
site_field_id: 42,
cohort_field_id: 42,
required_intake_field_keys: ['<string>'],
profile_ready_field_keys: ['<string>'],
profile_photo_required: true,
unresolved_check_threshold: 26,
dropout_review_after_days: 183,
follow_up_due_days: 183,
follow_up_assignee_user_id: 42,
periods: [
{
name: '2026 term',
starts_on: '2026-10-20',
ends_on: '2026-12-31',
id: 42,
status: 'open'
}
],
access_scopes: [{group_id: 42, site_id: 42, cohort_id: 42}]
})
};
fetch('https://api.gratona.com/v1/admin/programs/{program_id}/participation/setup', 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/setup",
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([
'sites' => [
[
'name' => 'Main campus',
'cohorts' => [
[
'name' => 'Group A',
'id' => 42,
'code' => '<string>',
'sort_order' => 5000,
'status' => 'active',
'legacy_values' => [
'<string>'
]
]
],
'id' => 42,
'code' => '<string>',
'status' => 'active',
'legacy_values' => [
'<string>'
]
]
],
'period' => [
'name' => '2026 term',
'starts_on' => '2026-10-20',
'ends_on' => '2026-12-31',
'id' => 42,
'status' => 'open'
],
'revision' => 2,
'enabled' => true,
'default_session_type' => 'roster_verification',
'allowed_evidence_sources' => [
],
'site_field_id' => 42,
'cohort_field_id' => 42,
'required_intake_field_keys' => [
'<string>'
],
'profile_ready_field_keys' => [
'<string>'
],
'profile_photo_required' => true,
'unresolved_check_threshold' => 26,
'dropout_review_after_days' => 183,
'follow_up_due_days' => 183,
'follow_up_assignee_user_id' => 42,
'periods' => [
[
'name' => '2026 term',
'starts_on' => '2026-10-20',
'ends_on' => '2026-12-31',
'id' => 42,
'status' => 'open'
]
],
'access_scopes' => [
[
'group_id' => 42,
'site_id' => 42,
'cohort_id' => 42
]
]
]),
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/setup"
payload := strings.NewReader("{\n \"sites\": [\n {\n \"name\": \"Main campus\",\n \"cohorts\": [\n {\n \"name\": \"Group A\",\n \"id\": 42,\n \"code\": \"<string>\",\n \"sort_order\": 5000,\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"id\": 42,\n \"code\": \"<string>\",\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"period\": {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n },\n \"revision\": 2,\n \"enabled\": true,\n \"default_session_type\": \"roster_verification\",\n \"allowed_evidence_sources\": [],\n \"site_field_id\": 42,\n \"cohort_field_id\": 42,\n \"required_intake_field_keys\": [\n \"<string>\"\n ],\n \"profile_ready_field_keys\": [\n \"<string>\"\n ],\n \"profile_photo_required\": true,\n \"unresolved_check_threshold\": 26,\n \"dropout_review_after_days\": 183,\n \"follow_up_due_days\": 183,\n \"follow_up_assignee_user_id\": 42,\n \"periods\": [\n {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n }\n ],\n \"access_scopes\": [\n {\n \"group_id\": 42,\n \"site_id\": 42,\n \"cohort_id\": 42\n }\n ]\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://api.gratona.com/v1/admin/programs/{program_id}/participation/setup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sites\": [\n {\n \"name\": \"Main campus\",\n \"cohorts\": [\n {\n \"name\": \"Group A\",\n \"id\": 42,\n \"code\": \"<string>\",\n \"sort_order\": 5000,\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"id\": 42,\n \"code\": \"<string>\",\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"period\": {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n },\n \"revision\": 2,\n \"enabled\": true,\n \"default_session_type\": \"roster_verification\",\n \"allowed_evidence_sources\": [],\n \"site_field_id\": 42,\n \"cohort_field_id\": 42,\n \"required_intake_field_keys\": [\n \"<string>\"\n ],\n \"profile_ready_field_keys\": [\n \"<string>\"\n ],\n \"profile_photo_required\": true,\n \"unresolved_check_threshold\": 26,\n \"dropout_review_after_days\": 183,\n \"follow_up_due_days\": 183,\n \"follow_up_assignee_user_id\": 42,\n \"periods\": [\n {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n }\n ],\n \"access_scopes\": [\n {\n \"group_id\": 42,\n \"site_id\": 42,\n \"cohort_id\": 42\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/programs/{program_id}/participation/setup")
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 \"sites\": [\n {\n \"name\": \"Main campus\",\n \"cohorts\": [\n {\n \"name\": \"Group A\",\n \"id\": 42,\n \"code\": \"<string>\",\n \"sort_order\": 5000,\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"id\": 42,\n \"code\": \"<string>\",\n \"status\": \"active\",\n \"legacy_values\": [\n \"<string>\"\n ]\n }\n ],\n \"period\": {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n },\n \"revision\": 2,\n \"enabled\": true,\n \"default_session_type\": \"roster_verification\",\n \"allowed_evidence_sources\": [],\n \"site_field_id\": 42,\n \"cohort_field_id\": 42,\n \"required_intake_field_keys\": [\n \"<string>\"\n ],\n \"profile_ready_field_keys\": [\n \"<string>\"\n ],\n \"profile_photo_required\": true,\n \"unresolved_check_threshold\": 26,\n \"dropout_review_after_days\": 183,\n \"follow_up_due_days\": 183,\n \"follow_up_assignee_user_id\": 42,\n \"periods\": [\n {\n \"name\": \"2026 term\",\n \"starts_on\": \"2026-10-20\",\n \"ends_on\": \"2026-12-31\",\n \"id\": 42,\n \"status\": \"open\"\n }\n ],\n \"access_scopes\": [\n {\n \"group_id\": 42,\n \"site_id\": 42,\n \"cohort_id\": 42\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"feature_enabled": true,
"configured": true,
"program": {
"id": 123,
"name": "<string>"
},
"selected_period_id": 42,
"schedule": {
"cadence": "weekly",
"fixed": true,
"state": "closed",
"as_of": "2026-10-20",
"window_starts_on": "2026-10-20",
"window_ends_on": "2026-10-20",
"next_window_starts_on": "2026-10-20"
},
"settings": {
"enabled": true,
"terminology": "school",
"default_session_type": "roster_verification",
"cadence": "weekly",
"default_evidence_source": "official_record",
"allowed_evidence_sources": [
"official_record"
],
"site_field_id": 42,
"cohort_field_id": 42,
"required_intake_field_keys": [
"<string>"
],
"profile_ready_field_keys": [
"<string>"
],
"profile_photo_required": true,
"unresolved_check_threshold": 123,
"dropout_review_after_days": 123,
"follow_up_due_days": 123,
"follow_up_assignee_user_id": 42,
"revision": 123
},
"periods": [
{
"id": 123,
"name": "<string>",
"starts_on": "2023-12-25",
"ends_on": "2023-12-25",
"status": "draft"
}
],
"sites": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"site_type": "<string>",
"roster_count": 123,
"cohorts": [
{
"id": 123,
"name": "<string>",
"roster_count": 123,
"can_start": true,
"next_check_on": "2023-12-25",
"missed_windows": 123,
"latest_session": {
"id": 123,
"scheduled_for": "2023-12-25",
"seen_count": 123,
"expected_count": 123,
"unresolved_count": 123,
"status": "draft"
},
"completion_status": "complete",
"scheduled_session": {
"id": 123,
"scheduled_for": "2023-12-25",
"seen_count": 123,
"expected_count": 123,
"unresolved_count": 123,
"status": "draft"
},
"schedule_status": "upcoming"
}
]
}
],
"summary": {
"recipients_with_current_placement": 123,
"recipients_without_current_placement": 123,
"draft_sessions": 123,
"unresolved_recipients": 123,
"verified_recipients": 123,
"period_unresolved_recipients": 123,
"new_recipients": 123,
"transferred_recipients": 123,
"withdrawn_recipients": 123,
"incomplete_profiles": 123,
"completed_cohorts": 123,
"expected_cohorts": 123
},
"capabilities": {
"view": true,
"record": true,
"submit": true,
"configure": true,
"scope": {
"restricted": true,
"sites": [
{
"site_id": 123,
"all_cohorts": true,
"cohort_ids": [
123
]
}
]
}
},
"intake_fields": [
{
"id": 123,
"key": "<string>",
"label": "<string>",
"type": "<string>",
"options": "<string>",
"required": true,
"required_for_intake": true,
"title": true,
"option_values": [
"<string>"
],
"placement_source": "site"
}
],
"recipient_creation": {
"program_type": "<string>",
"number_sponsors": [
"<string>"
],
"sponsorship_amounts": [
"<string>"
],
"contribution_levels": [
"<string>"
],
"donation_target": "<string>",
"recipient_portal_enabled": true,
"tags": [
"<string>"
]
},
"configuration": {
"recipient_fields": [
{
"id": 123,
"key": "<string>",
"label": "<string>",
"type": "<string>",
"options": "<string>",
"required": true,
"required_for_intake": true,
"title": true,
"option_values": [
"<string>"
],
"placement_source": "site"
}
],
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"follow_up_assignees": [
{
"id": 123,
"name": "<string>"
}
],
"access_scopes": [
{
"group_id": 123,
"site_id": 123,
"cohort_id": 123
}
],
"sites": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"site_type": "school",
"status": "active",
"legacy_values": [
"<string>"
],
"cohorts": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"sort_order": 123,
"status": "active",
"legacy_values": [
"<string>"
]
}
]
}
]
}
}{
"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."
}