curl --request POST \
--url https://prod-api.raisedonors.com/api/Segment/query \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": "<string>",
"skip": 123,
"take": 123,
"sortBy": "createdate",
"descending": true,
"includeDetails": true,
"groups": [
{
"conditions": [
{
"parameter": "<string>",
"value": "<string>",
"secondaryValue": "<string>",
"values": [
"<string>"
]
}
]
}
],
"selectedColumns": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: '<string>',
skip: 123,
take: 123,
sortBy: 'createdate',
descending: true,
includeDetails: true,
groups: [
{
conditions: [
{
parameter: '<string>',
value: '<string>',
secondaryValue: '<string>',
values: ['<string>']
}
]
}
],
selectedColumns: ['<string>']
})
};
fetch('https://prod-api.raisedonors.com/api/Segment/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-api.raisedonors.com/api/Segment/query"
payload = {
"filter": "<string>",
"skip": 123,
"take": 123,
"sortBy": "createdate",
"descending": True,
"includeDetails": True,
"groups": [{ "conditions": [
{
"parameter": "<string>",
"value": "<string>",
"secondaryValue": "<string>",
"values": ["<string>"]
}
] }],
"selectedColumns": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://prod-api.raisedonors.com/api/Segment/query");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"filter\": \"<string>\",\n \"skip\": 123,\n \"take\": 123,\n \"sortBy\": \"createdate\",\n \"descending\": true,\n \"includeDetails\": true,\n \"groups\": [\n {\n \"conditions\": [\n {\n \"parameter\": \"<string>\",\n \"value\": \"<string>\",\n \"secondaryValue\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"selectedColumns\": [\n \"<string>\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod-api.raisedonors.com/api/Segment/query",
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([
'filter' => '<string>',
'skip' => 123,
'take' => 123,
'sortBy' => 'createdate',
'descending' => true,
'includeDetails' => true,
'groups' => [
[
'conditions' => [
[
'parameter' => '<string>',
'value' => '<string>',
'secondaryValue' => '<string>',
'values' => [
'<string>'
]
]
]
]
],
'selectedColumns' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://prod-api.raisedonors.com/api/Segment/query")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": \"<string>\",\n \"skip\": 123,\n \"take\": 123,\n \"sortBy\": \"createdate\",\n \"descending\": true,\n \"includeDetails\": true,\n \"groups\": [\n {\n \"conditions\": [\n {\n \"parameter\": \"<string>\",\n \"value\": \"<string>\",\n \"secondaryValue\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"selectedColumns\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.raisedonors.com/api/Segment/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": \"<string>\",\n \"skip\": 123,\n \"take\": 123,\n \"sortBy\": \"createdate\",\n \"descending\": true,\n \"includeDetails\": true,\n \"groups\": [\n {\n \"conditions\": [\n {\n \"parameter\": \"<string>\",\n \"value\": \"<string>\",\n \"secondaryValue\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"selectedColumns\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyconst url = 'https://prod-api.raisedonors.com/api/Segment/query';
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: '<string>',
skip: 123,
take: 123,
sortBy: 'createdate',
descending: true,
includeDetails: true,
groups: [
{
conditions: [
{
parameter: '<string>',
value: '<string>',
secondaryValue: '<string>',
values: ['<string>']
}
]
}
],
selectedColumns: ['<string>']
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"items": [
{
"id": 5120,
"campaignId": 88,
"campaignName": "Year-End Giving 2025",
"name": "Year-End Email",
"description": "Email appeal segment for the year-end campaign.",
"code": "YE25-EMAIL",
"externalIdentifier": "ye25-email",
"totalDonors": 268,
"totalGifts": 301,
"totalGiftAmount": "$56,290.00",
"averageGiftAmount": "$187.01",
"medianGiftAmount": "$100.00",
"highestGiftAmount": "$1,000.00",
"totalVisitors": 3820,
"conversionRate": "7.9%",
"createdDateTime": "2025-10-15T09:05:00Z",
"modifiedDateTime": "2025-11-15T08:00:00Z"
},
{
"id": 5121,
"campaignId": 88,
"campaignName": "Year-End Giving 2025",
"name": "Year-End Direct Mail",
"description": "Direct mail appeal segment for the year-end campaign.",
"code": "YE25-DM",
"externalIdentifier": "ye25-dm",
"totalDonors": 144,
"totalGifts": 166,
"totalGiftAmount": "$31,050.00",
"averageGiftAmount": "$187.05",
"medianGiftAmount": "$75.00",
"highestGiftAmount": "$2,500.00",
"totalVisitors": 2022,
"conversionRate": "8.2%",
"createdDateTime": "2025-10-15T09:07:00Z",
"modifiedDateTime": "2025-11-15T08:00:00Z"
}
],
"total": 2
}{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"groups[0].conditions[0].parameter": [
"'donorEmail' is not a valid parameter for this query type. Call Get Query Options for the parameters this query type supports."
]
},
"instance": "/api/Segment/query"
}{
"type": "https://tools.ietf.org/html/rfc7235#section-3.1",
"title": "Unauthorized",
"status": 401,
"detail": "The Authorization header is missing, malformed, or carries a token that is expired or revoked.",
"instance": "/api/Segment/query"
}Query Segments
Searches segments with the query builder and returns a paginated list of matches.
curl --request POST \
--url https://prod-api.raisedonors.com/api/Segment/query \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": "<string>",
"skip": 123,
"take": 123,
"sortBy": "createdate",
"descending": true,
"includeDetails": true,
"groups": [
{
"conditions": [
{
"parameter": "<string>",
"value": "<string>",
"secondaryValue": "<string>",
"values": [
"<string>"
]
}
]
}
],
"selectedColumns": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: '<string>',
skip: 123,
take: 123,
sortBy: 'createdate',
descending: true,
includeDetails: true,
groups: [
{
conditions: [
{
parameter: '<string>',
value: '<string>',
secondaryValue: '<string>',
values: ['<string>']
}
]
}
],
selectedColumns: ['<string>']
})
};
fetch('https://prod-api.raisedonors.com/api/Segment/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-api.raisedonors.com/api/Segment/query"
payload = {
"filter": "<string>",
"skip": 123,
"take": 123,
"sortBy": "createdate",
"descending": True,
"includeDetails": True,
"groups": [{ "conditions": [
{
"parameter": "<string>",
"value": "<string>",
"secondaryValue": "<string>",
"values": ["<string>"]
}
] }],
"selectedColumns": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://prod-api.raisedonors.com/api/Segment/query");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"filter\": \"<string>\",\n \"skip\": 123,\n \"take\": 123,\n \"sortBy\": \"createdate\",\n \"descending\": true,\n \"includeDetails\": true,\n \"groups\": [\n {\n \"conditions\": [\n {\n \"parameter\": \"<string>\",\n \"value\": \"<string>\",\n \"secondaryValue\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"selectedColumns\": [\n \"<string>\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod-api.raisedonors.com/api/Segment/query",
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([
'filter' => '<string>',
'skip' => 123,
'take' => 123,
'sortBy' => 'createdate',
'descending' => true,
'includeDetails' => true,
'groups' => [
[
'conditions' => [
[
'parameter' => '<string>',
'value' => '<string>',
'secondaryValue' => '<string>',
'values' => [
'<string>'
]
]
]
]
],
'selectedColumns' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://prod-api.raisedonors.com/api/Segment/query")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": \"<string>\",\n \"skip\": 123,\n \"take\": 123,\n \"sortBy\": \"createdate\",\n \"descending\": true,\n \"includeDetails\": true,\n \"groups\": [\n {\n \"conditions\": [\n {\n \"parameter\": \"<string>\",\n \"value\": \"<string>\",\n \"secondaryValue\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"selectedColumns\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.raisedonors.com/api/Segment/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": \"<string>\",\n \"skip\": 123,\n \"take\": 123,\n \"sortBy\": \"createdate\",\n \"descending\": true,\n \"includeDetails\": true,\n \"groups\": [\n {\n \"conditions\": [\n {\n \"parameter\": \"<string>\",\n \"value\": \"<string>\",\n \"secondaryValue\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"selectedColumns\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyconst url = 'https://prod-api.raisedonors.com/api/Segment/query';
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: '<string>',
skip: 123,
take: 123,
sortBy: 'createdate',
descending: true,
includeDetails: true,
groups: [
{
conditions: [
{
parameter: '<string>',
value: '<string>',
secondaryValue: '<string>',
values: ['<string>']
}
]
}
],
selectedColumns: ['<string>']
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"items": [
{
"id": 5120,
"campaignId": 88,
"campaignName": "Year-End Giving 2025",
"name": "Year-End Email",
"description": "Email appeal segment for the year-end campaign.",
"code": "YE25-EMAIL",
"externalIdentifier": "ye25-email",
"totalDonors": 268,
"totalGifts": 301,
"totalGiftAmount": "$56,290.00",
"averageGiftAmount": "$187.01",
"medianGiftAmount": "$100.00",
"highestGiftAmount": "$1,000.00",
"totalVisitors": 3820,
"conversionRate": "7.9%",
"createdDateTime": "2025-10-15T09:05:00Z",
"modifiedDateTime": "2025-11-15T08:00:00Z"
},
{
"id": 5121,
"campaignId": 88,
"campaignName": "Year-End Giving 2025",
"name": "Year-End Direct Mail",
"description": "Direct mail appeal segment for the year-end campaign.",
"code": "YE25-DM",
"externalIdentifier": "ye25-dm",
"totalDonors": 144,
"totalGifts": 166,
"totalGiftAmount": "$31,050.00",
"averageGiftAmount": "$187.05",
"medianGiftAmount": "$75.00",
"highestGiftAmount": "$2,500.00",
"totalVisitors": 2022,
"conversionRate": "8.2%",
"createdDateTime": "2025-10-15T09:07:00Z",
"modifiedDateTime": "2025-11-15T08:00:00Z"
}
],
"total": 2
}{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"groups[0].conditions[0].parameter": [
"'donorEmail' is not a valid parameter for this query type. Call Get Query Options for the parameters this query type supports."
]
},
"instance": "/api/Segment/query"
}{
"type": "https://tools.ietf.org/html/rfc7235#section-3.1",
"title": "Unauthorized",
"status": 401,
"detail": "The Authorization header is missing, malformed, or carries a token that is expired or revoked.",
"instance": "/api/Segment/query"
}Segment query type to discover the parameters, operators, and result fields available, then send one or more groups of conditions here along with selectedColumns and your paging options.Authorizations
JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"
Body
The query request model.
- Option 1
- Option 2
Request body for advanced query endpoints such as donor and campaign queries.
A free-text search term applied to the results.
The number of records to skip before the first record returned. Use it with take to page through the results.
The maximum number of records to return in this page of results.
Field to sort by (case-insensitive). Valid options: createdate, createddatetime, email, firstname, gifts, giftsum, id, lastname, modifieddatetimeutc, name, phone
createdate, createddatetime, email, firstname, gifts, giftsum, id, lastname, modifieddatetimeutc, name, phone "createdate"
The direction to sort the results. Set to true to sort in descending order.
When true, includes the related records for each item in the response. Not every list has extra records to return, and it can slow down large result sets.
The logical type of query being executed.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 The groups of conditions that make up the query.
Show child attributes
Show child attributes
The list of result columns to return for each item.
Was this page helpful?