Create a conversion preset
curl --request POST \
--url https://api.occtoo.com/v1/conversion-presets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "thumb",
"displayName": "Thumbnail",
"parameters": {
"mode": "Fit",
"targetSize": 400,
"aspectRatio": "1:1",
"outputFormat": "Webp",
"quality": 80
}
}
'import requests
url = "https://api.occtoo.com/v1/conversion-presets"
payload = {
"id": "thumb",
"displayName": "Thumbnail",
"parameters": {
"mode": "Fit",
"targetSize": 400,
"aspectRatio": "1:1",
"outputFormat": "Webp",
"quality": 80
}
}
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({
id: 'thumb',
displayName: 'Thumbnail',
parameters: {
mode: 'Fit',
targetSize: 400,
aspectRatio: '1:1',
outputFormat: 'Webp',
quality: 80
}
})
};
fetch('https://api.occtoo.com/v1/conversion-presets', 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.occtoo.com/v1/conversion-presets",
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([
'id' => 'thumb',
'displayName' => 'Thumbnail',
'parameters' => [
'mode' => 'Fit',
'targetSize' => 400,
'aspectRatio' => '1:1',
'outputFormat' => 'Webp',
'quality' => 80
]
]),
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.occtoo.com/v1/conversion-presets"
payload := strings.NewReader("{\n \"id\": \"thumb\",\n \"displayName\": \"Thumbnail\",\n \"parameters\": {\n \"mode\": \"Fit\",\n \"targetSize\": 400,\n \"aspectRatio\": \"1:1\",\n \"outputFormat\": \"Webp\",\n \"quality\": 80\n }\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.occtoo.com/v1/conversion-presets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"thumb\",\n \"displayName\": \"Thumbnail\",\n \"parameters\": {\n \"mode\": \"Fit\",\n \"targetSize\": 400,\n \"aspectRatio\": \"1:1\",\n \"outputFormat\": \"Webp\",\n \"quality\": 80\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/conversion-presets")
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 \"id\": \"thumb\",\n \"displayName\": \"Thumbnail\",\n \"parameters\": {\n \"mode\": \"Fit\",\n \"targetSize\": 400,\n \"aspectRatio\": \"1:1\",\n \"outputFormat\": \"Webp\",\n \"quality\": 80\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "thumb",
"displayName": "Thumbnail",
"version": 1,
"parameters": {
"mode": "Fit",
"targetSize": 400,
"aspectRatio": "1:1",
"paddingPercent": null,
"background": null,
"outputFormat": "Webp",
"quality": 80
},
"createdAt": "2026-11-13T10:00:00+00:00",
"updatedAt": "2026-11-13T10:00:00+00:00"
}Conversion presets
Create a conversion preset
Creates a preset at version 1. parameters follow the same rules as the convert endpoint’s.
An id that’s in use answers 409. Reusing the id of a deleted preset creates it again, with version one higher than before.
POST
/
v1
/
conversion-presets
Create a conversion preset
curl --request POST \
--url https://api.occtoo.com/v1/conversion-presets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "thumb",
"displayName": "Thumbnail",
"parameters": {
"mode": "Fit",
"targetSize": 400,
"aspectRatio": "1:1",
"outputFormat": "Webp",
"quality": 80
}
}
'import requests
url = "https://api.occtoo.com/v1/conversion-presets"
payload = {
"id": "thumb",
"displayName": "Thumbnail",
"parameters": {
"mode": "Fit",
"targetSize": 400,
"aspectRatio": "1:1",
"outputFormat": "Webp",
"quality": 80
}
}
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({
id: 'thumb',
displayName: 'Thumbnail',
parameters: {
mode: 'Fit',
targetSize: 400,
aspectRatio: '1:1',
outputFormat: 'Webp',
quality: 80
}
})
};
fetch('https://api.occtoo.com/v1/conversion-presets', 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.occtoo.com/v1/conversion-presets",
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([
'id' => 'thumb',
'displayName' => 'Thumbnail',
'parameters' => [
'mode' => 'Fit',
'targetSize' => 400,
'aspectRatio' => '1:1',
'outputFormat' => 'Webp',
'quality' => 80
]
]),
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.occtoo.com/v1/conversion-presets"
payload := strings.NewReader("{\n \"id\": \"thumb\",\n \"displayName\": \"Thumbnail\",\n \"parameters\": {\n \"mode\": \"Fit\",\n \"targetSize\": 400,\n \"aspectRatio\": \"1:1\",\n \"outputFormat\": \"Webp\",\n \"quality\": 80\n }\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.occtoo.com/v1/conversion-presets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"thumb\",\n \"displayName\": \"Thumbnail\",\n \"parameters\": {\n \"mode\": \"Fit\",\n \"targetSize\": 400,\n \"aspectRatio\": \"1:1\",\n \"outputFormat\": \"Webp\",\n \"quality\": 80\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/conversion-presets")
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 \"id\": \"thumb\",\n \"displayName\": \"Thumbnail\",\n \"parameters\": {\n \"mode\": \"Fit\",\n \"targetSize\": 400,\n \"aspectRatio\": \"1:1\",\n \"outputFormat\": \"Webp\",\n \"quality\": 80\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "thumb",
"displayName": "Thumbnail",
"version": 1,
"parameters": {
"mode": "Fit",
"targetSize": 400,
"aspectRatio": "1:1",
"paddingPercent": null,
"background": null,
"outputFormat": "Webp",
"quality": 80
},
"createdAt": "2026-11-13T10:00:00+00:00",
"updatedAt": "2026-11-13T10:00:00+00:00"
}Authorizations
kindeOAuthbearerAuthapiKey
Body
application/json
Response
The created preset. The Location header holds its URL.
A named set of conversion parameters stored for a tenant.
Was this page helpful?