curl --request PATCH \
--url https://api.custral.com/v1/presentations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{
"kind": "update_element",
"slideId": "<string>",
"elementId": "<string>",
"position": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"style": {},
"content": "<string>"
}
]
}
'import requests
url = "https://api.custral.com/v1/presentations/{id}"
payload = { "operations": [
{
"kind": "update_element",
"slideId": "<string>",
"elementId": "<string>",
"position": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"style": {},
"content": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
kind: 'update_element',
slideId: '<string>',
elementId: '<string>',
position: {x: 123, y: 123, w: 123, h: 123},
style: {},
content: '<string>'
}
]
})
};
fetch('https://api.custral.com/v1/presentations/{id}', 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.custral.com/v1/presentations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
'kind' => 'update_element',
'slideId' => '<string>',
'elementId' => '<string>',
'position' => [
'x' => 123,
'y' => 123,
'w' => 123,
'h' => 123
],
'style' => [
],
'content' => '<string>'
]
]
]),
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.custral.com/v1/presentations/{id}"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"kind\": \"update_element\",\n \"slideId\": \"<string>\",\n \"elementId\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123\n },\n \"style\": {},\n \"content\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.custral.com/v1/presentations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"kind\": \"update_element\",\n \"slideId\": \"<string>\",\n \"elementId\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123\n },\n \"style\": {},\n \"content\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custral.com/v1/presentations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"kind\": \"update_element\",\n \"slideId\": \"<string>\",\n \"elementId\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123\n },\n \"style\": {},\n \"content\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"deck": {
"slides": [
{}
],
"themeId": "<string>"
}
},
"reqId": "req_2a1f9c8e7b6d5"
}Edit a presentation
Move, resize, restyle or retext elements, align them, place an image, rename a slide or set its notes, add or remove slides. A batch that would leave an invalid deck returns presentation_edit_invalid and changes nothing. Operations apply in order and all or nothing; the edit lands live in any open editor. A page of another type returns 404 presentation_not_found; a caller who can only view it gets insufficient_permissions. Requires scope: documents:write.
curl --request PATCH \
--url https://api.custral.com/v1/presentations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{
"kind": "update_element",
"slideId": "<string>",
"elementId": "<string>",
"position": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"style": {},
"content": "<string>"
}
]
}
'import requests
url = "https://api.custral.com/v1/presentations/{id}"
payload = { "operations": [
{
"kind": "update_element",
"slideId": "<string>",
"elementId": "<string>",
"position": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"style": {},
"content": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
kind: 'update_element',
slideId: '<string>',
elementId: '<string>',
position: {x: 123, y: 123, w: 123, h: 123},
style: {},
content: '<string>'
}
]
})
};
fetch('https://api.custral.com/v1/presentations/{id}', 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.custral.com/v1/presentations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
'kind' => 'update_element',
'slideId' => '<string>',
'elementId' => '<string>',
'position' => [
'x' => 123,
'y' => 123,
'w' => 123,
'h' => 123
],
'style' => [
],
'content' => '<string>'
]
]
]),
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.custral.com/v1/presentations/{id}"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"kind\": \"update_element\",\n \"slideId\": \"<string>\",\n \"elementId\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123\n },\n \"style\": {},\n \"content\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.custral.com/v1/presentations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"kind\": \"update_element\",\n \"slideId\": \"<string>\",\n \"elementId\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123\n },\n \"style\": {},\n \"content\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custral.com/v1/presentations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"kind\": \"update_element\",\n \"slideId\": \"<string>\",\n \"elementId\": \"<string>\",\n \"position\": {\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123\n },\n \"style\": {},\n \"content\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"deck": {
"slides": [
{}
],
"themeId": "<string>"
}
},
"reqId": "req_2a1f9c8e7b6d5"
}Authorizations
A Custral API key, created in Settings → Developers → Applications, sent as Authorization: Bearer sk_…. The X-Api-Key header is also accepted and takes precedence. Use a secret key (sk_…) from your server; a publishable key (pk_…) may hold only objects:read and usage:write. Never expose a secret key in a browser.
Path Parameters
Body
Was this page helpful?