curl --request POST \
--url https://{your-subdomain}.neetokb.com/api/external/v2/attachments \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"url": "https://example.com/diagram.png",
"content_base64": "<string>",
"filename": "diagram.png",
"content_type": "image/png"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/diagram.png',
content_base64: '<string>',
filename: 'diagram.png',
content_type: 'image/png'
})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/attachments"
payload = {
"url": "https://example.com/diagram.png",
"content_base64": "<string>",
"filename": "diagram.png",
"content_type": "image/png"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "abcd1234efgh5678ijkl",
"filename": "logo.png",
"content_type": "image/png",
"byte_size": 20480,
"checksum": "Y2hlY2tzdW0xMjM0NQ==",
"created_at": "2023-11-07T05:31:56Z",
"service_name": "amazon",
"signed_id": "<string>",
"blob_url": "https://spinkart.neetokb.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/logo.png",
"attachable_html": "<string>"
}{
"error": "File size exceeds the maximum limit of 50 MB."
}Upload attachment
Upload a file (such as an image, PDF, or document) and get back a link you can use inside an article, so you don’t have to embed the full file directly in the article’s content, which makes articles large and slow to load. Send the file as multipart file, or send a JSON body with either a public https url or content_base64 with filename. For CLI sessions, this needs the Modify articles permission. For images, the response also includes attachable_html: the image already formatted as ready-to-paste code that you can add straight into the article’s html_content. Any file you upload but never use in an article is removed automatically.
curl --request POST \
--url https://{your-subdomain}.neetokb.com/api/external/v2/attachments \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"url": "https://example.com/diagram.png",
"content_base64": "<string>",
"filename": "diagram.png",
"content_type": "image/png"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/diagram.png',
content_base64: '<string>',
filename: 'diagram.png',
content_type: 'image/png'
})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/attachments"
payload = {
"url": "https://example.com/diagram.png",
"content_base64": "<string>",
"filename": "diagram.png",
"content_type": "image/png"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "abcd1234efgh5678ijkl",
"filename": "logo.png",
"content_type": "image/png",
"byte_size": 20480,
"checksum": "Y2hlY2tzdW0xMjM0NQ==",
"created_at": "2023-11-07T05:31:56Z",
"service_name": "amazon",
"signed_id": "<string>",
"blob_url": "https://spinkart.neetokb.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/logo.png",
"attachable_html": "<string>"
}{
"error": "File size exceeds the maximum limit of 50 MB."
}file, or send a JSON body with a public url or content_base64 and filename.
{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
Give exactly one source, either url or content_base64 with filename.
Public https URL of the file to fetch.
"https://example.com/diagram.png"
Base64-encoded file bytes. Requires filename.
Name of the file. Required with content_base64.
"diagram.png"
MIME type of the file. Optional with content_base64.
"image/png"
Response
Created - File uploaded successfully
"abcd1234efgh5678ijkl"
"logo.png"
"image/png"
20480
"Y2hlY2tzdW0xMjM0NQ=="
"amazon"
Signed identifier of the uploaded file. You do not pass it directly to the article API; it is embedded as data-blob-id inside attachable_html. To use the file in an article, insert attachable_html (or a blob_url <img> tag) into the article's html_content.
Hosted URL of the uploaded file. Use it as the src of an <img> tag in the article HTML. This URL is stable and does not expire; it stays valid as long as the file is used in an article.
"https://spinkart.neetokb.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/logo.png"
Editor-ready image markup for images; null for non-image files. Insert it directly into the article's html_content.