Update a gallery
curl --request PATCH \
--url https://api.neuraldraft.io/v1/galleries/{slug} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"items": [
{
"url": "https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg",
"alt": "Atelier studio entrance"
}
]
}
'const url = 'https://api.neuraldraft.io/v1/galleries/{slug}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
items: [
{
url: 'https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg',
alt: 'Atelier studio entrance'
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.neuraldraft.io/v1/galleries/{slug}"
payload = {
"name": "<string>",
"items": [
{
"url": "https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg",
"alt": "Atelier studio entrance"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuraldraft.io/v1/galleries/{slug}",
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([
'name' => '<string>',
'items' => [
[
'url' => 'https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg',
'alt' => 'Atelier studio entrance'
]
]
]),
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;
}{
"data": {
"slug": "home-carousel",
"name": "Home carousel",
"items": [
{
"url": "https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg",
"alt": "Atelier studio entrance"
}
],
"items_count": 3,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"type": "https://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}Galleries
Update a gallery
Update name and/or items. items is a full replace — to add,
remove, or reorder, fetch the current array via GET, mutate, then
send the complete new list. Slug is immutable.
PATCH
/
galleries
/
{slug}
Update a gallery
curl --request PATCH \
--url https://api.neuraldraft.io/v1/galleries/{slug} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"items": [
{
"url": "https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg",
"alt": "Atelier studio entrance"
}
]
}
'const url = 'https://api.neuraldraft.io/v1/galleries/{slug}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
items: [
{
url: 'https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg',
alt: 'Atelier studio entrance'
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.neuraldraft.io/v1/galleries/{slug}"
payload = {
"name": "<string>",
"items": [
{
"url": "https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg",
"alt": "Atelier studio entrance"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuraldraft.io/v1/galleries/{slug}",
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([
'name' => '<string>',
'items' => [
[
'url' => 'https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg',
'alt' => 'Atelier studio entrance'
]
]
]),
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;
}{
"data": {
"slug": "home-carousel",
"name": "Home carousel",
"items": [
{
"url": "https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg",
"alt": "Atelier studio entrance"
}
],
"items_count": 3,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"type": "https://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}Authorizations
Project API key. Pass as Authorization: Bearer ndsk_live_.... Manage
keys via /projects/me/api-keys. Test-mode keys use
the ndsk_test_ prefix.
Path Parameters
Pattern:
^[a-z0-9][a-z0-9-]*$Body
application/json
Response
OK
Show child attributes
Show child attributes
⌘I