Upload an image from a URL
curl --request POST \
--url https://{your-subdomain}.neetoform.com/api/external/v2/images \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"url": "https://example.com/files/banner.png",
"filename": "hero.png"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/files/banner.png', filename: 'hero.png'})
};
fetch('https://{your-subdomain}.neetoform.com/api/external/v2/images', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetoform.com/api/external/v2/images"
payload = {
"url": "https://example.com/files/banner.png",
"filename": "hero.png"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"signed_id": "eyJfcmFpbHMiOnsiZGF0YSI6MTIzfX0--abc123",
"filename": "hero.png",
"content_type": "image/png",
"byte_size": 153
}
Images
Upload an image from a URL
Store an image that is already published on the web. NeetoForm fetches it from the url and returns a signed_id. Pass the signed_id as background_image when you create or update a theme.
The address must use https, be reachable without credentials, and point to a public host. At most 2 redirects are followed. The image must be a PNG, JPEG, GIF or SVG of 1 MB or smaller. A signed_id works only in the workspace that created it.
To upload a file from your machine, use Reserve an image upload. See Upload a theme background image for the full flow.
POST
/
images
Upload an image from a URL
curl --request POST \
--url https://{your-subdomain}.neetoform.com/api/external/v2/images \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"url": "https://example.com/files/banner.png",
"filename": "hero.png"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/files/banner.png', filename: 'hero.png'})
};
fetch('https://{your-subdomain}.neetoform.com/api/external/v2/images', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetoform.com/api/external/v2/images"
payload = {
"url": "https://example.com/files/banner.png",
"filename": "hero.png"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"signed_id": "eyJfcmFpbHMiOnsiZGF0YSI6MTIzfX0--abc123",
"filename": "hero.png",
"content_type": "image/png",
"byte_size": 153
}
Replace
Learn how to find your subdomain in Workspace subdomain.
{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Body
application/json
Response
Created - Image stored successfully