Create a gallery
curl --request POST \
--url https://api.neuraldraft.io/v1/galleries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Home carousel",
"slug": "home-carousel",
"items": [
{
"url": "https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg",
"alt": "Atelier studio entrance"
}
]
}
'const url = 'https://api.neuraldraft.io/v1/galleries';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Home carousel',
slug: 'home-carousel',
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"
payload = {
"name": "Home carousel",
"slug": "home-carousel",
"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.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuraldraft.io/v1/galleries",
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([
'name' => 'Home carousel',
'slug' => 'home-carousel',
'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"
}
}Galleries
Create a gallery
Slug is auto-derived from name when omitted. If the derived slug
already exists, -2, -3, … is appended automatically. items
are optional at create time — start empty and add via PATCH.
POST
/
galleries
Create a gallery
curl --request POST \
--url https://api.neuraldraft.io/v1/galleries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Home carousel",
"slug": "home-carousel",
"items": [
{
"url": "https://cdn.neuraldraft.io/galleries/atelier/hero-1.jpg",
"alt": "Atelier studio entrance"
}
]
}
'const url = 'https://api.neuraldraft.io/v1/galleries';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Home carousel',
slug: 'home-carousel',
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"
payload = {
"name": "Home carousel",
"slug": "home-carousel",
"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.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuraldraft.io/v1/galleries",
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([
'name' => 'Home carousel',
'slug' => 'home-carousel',
'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"
}
}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.
Body
application/json
Maximum string length:
255Example:
"Home carousel"
Optional explicit slug. Omit to auto-derive from name. On
collision the server appends -2, -3, … to find a free slug.
Pattern:
^[a-z0-9][a-z0-9-]{0,254}$Example:
"home-carousel"
Maximum array length:
200Show child attributes
Show child attributes
Response
Created
Show child attributes
Show child attributes
⌘I