> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://virtuous.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://virtuous.ferndocs.com/_mcp/server.

# Queries Volunteer Opportunities

POST https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query
Content-Type: application/json

Available starting 3/29/2022

Reference: https://virtuous.ferndocs.com/reference/crm-plus/volunteering/queries-volunteer-opportunities

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.virtuoussoftware.com` (https://api.virtuoussoftware.com, default)
- `{{baseUrl}}api` ({{baseUrl}}api)

## Request

### Body (application/json)

This endpoint expects an object.

- `groups` (list of ApiVolunteerOpportunityQueryPostRequestBodyContentApplicationJsonSchemaGroupsItems, optional)
- `sortBy` (string, optional)
- `descending` (boolean, optional)

## Response

### 200

Ok

- `list` (list of ApiVolunteerOpportunityQueryPostResponsesContentApplicationJsonSchemaListItems, optional)
- `total` (integer, optional)

## Types

### ApiVolunteerOpportunityQueryPostRequestBodyContentApplicationJsonSchemaGroupsItems

- `conditions` (list of ApiVolunteerOpportunityQueryPostRequestBodyContentApplicationJsonSchemaGroupsItemsConditionsItems, optional)

### ApiVolunteerOpportunityQueryPostResponsesContentApplicationJsonSchemaListItems

- `id` (integer, optional)
- `name` (string, optional)
- `url` (string, optional)
- `description` (string, optional)
- `createDateTimeUtc` (string, optional)
- `createdByUser` (string, optional)
- `modifiedDateTimeUtc` (string, optional)
- `modifiedByUser` (string, optional)
- `anytime` (boolean, optional)
- `startDateTime` (string, optional)
- `endDateTime` (string, optional)
- `timeZone` (string, optional)
- `isActive` (boolean, optional)
- `isLocalOnly` (boolean, optional)
- `currentPriority` (string, optional)
- `currentNeed` (integer, optional)
- `preferredNumberOfHours` (integer, optional)
- `anywhere` (boolean, optional)
- `locationName` (string, optional)
- `address1` (string, optional)
- `address2` (string, optional)
- `city` (string, optional)
- `state` (string, optional)
- `postal` (string, optional)
- `country` (string, optional)
- `totalVolunteers` (integer, optional)
- `totalVolunteerHours` (integer, optional)
- `currentNeedFilledPercentage` (integer, optional)
- `hoursFilledPercentage` (integer, optional)
- `volunteerOrganizers` (list of ApiVolunteerOpportunityQueryPostResponsesContentApplicationJsonSchemaListItemsVolunteerOrganizersItems, optional)
- `volunteerOpportunityUrl` (string, optional)
- `volunteerOrganizersUrl` (string, optional)
- `volunteersUrl` (string, optional)
- `customFields` (list of ApiVolunteerOpportunityQueryPostResponsesContentApplicationJsonSchemaListItemsCustomFieldsItems, optional)

### ApiVolunteerOpportunityQueryPostRequestBodyContentApplicationJsonSchemaGroupsItemsConditionsItems

- `parameter` (string, optional)
- `operator` (string, optional)
- `value` (string, optional)
- `secondaryValue` (string, optional)
- `values` (list of string, optional)

### ApiVolunteerOpportunityQueryPostResponsesContentApplicationJsonSchemaListItemsVolunteerOrganizersItems

- `id` (integer, optional)
- `contactId` (integer, optional)
- `contactIndividualId` (integer, optional)
- `displayName` (string, optional)
- `firstName` (string, optional)
- `avatarUrl` (any, optional, nullable)
- `primaryPhone` (string, optional)
- `primaryEmail` (string, optional)
- `contactUrl` (string, optional)
- `volunteerOrganizerUrl` (string, optional)
- `volunteerOpportunityUrl` (string, optional)

### ApiVolunteerOpportunityQueryPostResponsesContentApplicationJsonSchemaListItemsCustomFieldsItems

- `name` (string, optional)
- `value` (string, optional)
- `displayName` (string, optional)

## Examples

**Request**

```json
{
  "groups": [
    {
      "conditions": [
        {
          "parameter": "string",
          "operator": "string",
          "value": "string",
          "secondaryValue": "string",
          "values": [
            "string"
          ]
        }
      ]
    }
  ],
  "sortBy": "string",
  "descending": false
}
```

**Response**

```json
{
  "list": [
    {
      "id": 1,
      "name": "Sunday Soup Kitchen",
      "url": "https://soupkitchen.org/sunday",
      "description": "Come on out to our soup kitchen and pitch in!",
      "createDateTimeUtc": "<dateTime>",
      "createdByUser": "<string>",
      "modifiedDateTimeUtc": "<dateTime>",
      "modifiedByUser": "<string>",
      "anytime": false,
      "startDateTime": "3/27/2022 12:00 PM",
      "endDateTime": "3/27/2022 6:00 PM",
      "timeZone": "US/Arizona",
      "isActive": true,
      "isLocalOnly": true,
      "currentPriority": "Medium",
      "currentNeed": 20,
      "preferredNumberOfHours": 20,
      "anywhere": false,
      "locationName": "Downtown Soup Kitchen",
      "address1": "123 Nowhere Ave",
      "address2": "Suite 200",
      "city": "Phoenix",
      "state": "AZ",
      "postal": "85004",
      "country": "US",
      "totalVolunteers": 0,
      "totalVolunteerHours": 0,
      "currentNeedFilledPercentage": 0,
      "hoursFilledPercentage": 0,
      "volunteerOrganizers": [
        {
          "id": 1,
          "contactId": 122,
          "contactIndividualId": 134,
          "displayName": "Bob Loblaw",
          "firstName": "Bob",
          "avatarUrl": null,
          "primaryPhone": "555-555-5555",
          "primaryEmail": "bob@loblaw.org",
          "contactUrl": "https://api.virtuoussoftware.com/api/Contact/122",
          "volunteerOrganizerUrl": "https://api.virtuoussoftware.com/api/VolunteerOpportunity/1/Organizers/1",
          "volunteerOpportunityUrl": "https://api.virtuoussoftware.com/api/VolunteerOpportunity/1"
        }
      ],
      "volunteerOpportunityUrl": "https://api.virtuoussoftware.com/api/VolunteerOpportunity/1",
      "volunteerOrganizersUrl": "https://api.virtuoussoftware.com/api/VolunteerOpportunity/1/Organizers/1",
      "volunteersUrl": "https://api.virtuoussoftware.com/api/VolunteerOpportunity/1/Volunteers",
      "customFields": [
        {
          "name": "Meal Options",
          "value": "Soup and Salad for Lunch, Pizza for Dinner",
          "displayName": "What meal options will be available?"
        }
      ]
    }
  ],
  "total": 1
}
```

**SDK Code**

```python Volunteering_queriesVolunteerOpportunities_example
import requests

url = "https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query"

payload = {
    "groups": [{ "conditions": [
                {
                    "parameter": "string",
                    "operator": "string",
                    "value": "string",
                    "secondaryValue": "string",
                    "values": ["string"]
                }
            ] }],
    "sortBy": "string",
    "descending": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Volunteering_queriesVolunteerOpportunities_example
const url = 'https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"groups":[{"conditions":[{"parameter":"string","operator":"string","value":"string","secondaryValue":"string","values":["string"]}]}],"sortBy":"string","descending":false}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Volunteering_queriesVolunteerOpportunities_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query"

	payload := strings.NewReader("{\n  \"groups\": [\n    {\n      \"conditions\": [\n        {\n          \"parameter\": \"string\",\n          \"operator\": \"string\",\n          \"value\": \"string\",\n          \"secondaryValue\": \"string\",\n          \"values\": [\n            \"string\"\n          ]\n        }\n      ]\n    }\n  ],\n  \"sortBy\": \"string\",\n  \"descending\": false\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(res)
	fmt.Println(string(body))

}
```

```ruby Volunteering_queriesVolunteerOpportunities_example
require 'uri'
require 'net/http'

url = URI("https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query")

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  \"groups\": [\n    {\n      \"conditions\": [\n        {\n          \"parameter\": \"string\",\n          \"operator\": \"string\",\n          \"value\": \"string\",\n          \"secondaryValue\": \"string\",\n          \"values\": [\n            \"string\"\n          ]\n        }\n      ]\n    }\n  ],\n  \"sortBy\": \"string\",\n  \"descending\": false\n}"

response = http.request(request)
puts response.read_body
```

```java Volunteering_queriesVolunteerOpportunities_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"groups\": [\n    {\n      \"conditions\": [\n        {\n          \"parameter\": \"string\",\n          \"operator\": \"string\",\n          \"value\": \"string\",\n          \"secondaryValue\": \"string\",\n          \"values\": [\n            \"string\"\n          ]\n        }\n      ]\n    }\n  ],\n  \"sortBy\": \"string\",\n  \"descending\": false\n}")
  .asString();
```

```php Volunteering_queriesVolunteerOpportunities_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query', [
  'body' => '{
  "groups": [
    {
      "conditions": [
        {
          "parameter": "string",
          "operator": "string",
          "value": "string",
          "secondaryValue": "string",
          "values": [
            "string"
          ]
        }
      ]
    }
  ],
  "sortBy": "string",
  "descending": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Volunteering_queriesVolunteerOpportunities_example
using RestSharp;

var client = new RestClient("https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"groups\": [\n    {\n      \"conditions\": [\n        {\n          \"parameter\": \"string\",\n          \"operator\": \"string\",\n          \"value\": \"string\",\n          \"secondaryValue\": \"string\",\n          \"values\": [\n            \"string\"\n          ]\n        }\n      ]\n    }\n  ],\n  \"sortBy\": \"string\",\n  \"descending\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Volunteering_queriesVolunteerOpportunities_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "groups": [["conditions": [
        [
          "parameter": "string",
          "operator": "string",
          "value": "string",
          "secondaryValue": "string",
          "values": ["string"]
        ]
      ]]],
  "sortBy": "string",
  "descending": false
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.virtuoussoftware.com/api/VolunteerOpportunity/Query")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```