List media variant types
curl --request GET \
--url https://api.thehaystack.ai/v2/haystack/media/variantTypes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.thehaystack.ai/v2/haystack/media/variantTypes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thehaystack.ai/v2/haystack/media/variantTypes', 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.thehaystack.ai/v2/haystack/media/variantTypes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.thehaystack.ai/v2/haystack/media/variantTypes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.thehaystack.ai/v2/haystack/media/variantTypes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thehaystack.ai/v2/haystack/media/variantTypes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"variantTypes": [
{
"id": 123,
"name": "Sermon Video",
"contentType": "video",
"indexable": true,
"displayOrder": 123,
"collectionId": 123
}
],
"limit": 123,
"offset": 123,
"page": 123,
"totalRecords": 123,
"totalPages": 123,
"hasMore": true
}Media
List Media Variant Types
Retrieve all media variant types for your organization. Variant types define the different formats of media that can be uploaded (e.g., original video, sermon audio, full service).
GET
/
media
/
variantTypes
List media variant types
curl --request GET \
--url https://api.thehaystack.ai/v2/haystack/media/variantTypes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.thehaystack.ai/v2/haystack/media/variantTypes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thehaystack.ai/v2/haystack/media/variantTypes', 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.thehaystack.ai/v2/haystack/media/variantTypes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.thehaystack.ai/v2/haystack/media/variantTypes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.thehaystack.ai/v2/haystack/media/variantTypes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thehaystack.ai/v2/haystack/media/variantTypes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"variantTypes": [
{
"id": 123,
"name": "Sermon Video",
"contentType": "video",
"indexable": true,
"displayOrder": 123,
"collectionId": 123
}
],
"limit": 123,
"offset": 123,
"page": 123,
"totalRecords": 123,
"totalPages": 123,
"hasMore": true
}Authorizations
Enter your API token from the Haystack dashboard
Query Parameters
Maximum number of records to return (max: 100, default: 50)
Required range:
1 <= x <= 100Number of records to skip for pagination (default: 0)
Required range:
x >= 0Sort order in format 'fieldName,direction' (e.g., 'title,ASC'). Use multiple _orderBy[] parameters for multi-field sorting.
Pattern:
^[a-zA-Z]+,(ASC|DESC)$Include soft-deleted records in the results

