curl --request PUT \
--url https://getunblocked.com/api/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "Password Reset Guide",
"body": "To reset your password, visit ...",
"uri": "https://my.company.com/apollo/ticket/123456"
}
'import requests
url = "https://getunblocked.com/api/v1/documents"
payload = {
"collectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "Password Reset Guide",
"body": "To reset your password, visit ...",
"uri": "https://my.company.com/apollo/ticket/123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collectionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: 'Password Reset Guide',
body: JSON.stringify('To reset your password, visit ...'),
uri: 'https://my.company.com/apollo/ticket/123456'
})
};
fetch('https://getunblocked.com/api/v1/documents', 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://getunblocked.com/api/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'collectionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => 'Password Reset Guide',
'body' => 'To reset your password, visit ...',
'uri' => 'https://my.company.com/apollo/ticket/123456'
]),
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://getunblocked.com/api/v1/documents"
payload := strings.NewReader("{\n \"collectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"Password Reset Guide\",\n \"body\": \"To reset your password, visit ...\",\n \"uri\": \"https://my.company.com/apollo/ticket/123456\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://getunblocked.com/api/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"Password Reset Guide\",\n \"body\": \"To reset your password, visit ...\",\n \"uri\": \"https://my.company.com/apollo/ticket/123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getunblocked.com/api/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"Password Reset Guide\",\n \"body\": \"To reset your password, visit ...\",\n \"uri\": \"https://my.company.com/apollo/ticket/123456\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": 400
}{
"status": 400
}{
"status": 400
}Put Document
Use this endpoint to create or update a document for a given collection.
Documents are unique by uri across your organization.
If the document for uri does not exist, it will be created.
If the document for uri exists, it will be updated.
On success, an ID for the created or updated document will be returned.
Documents created or updated may take up to a minute to be available for use.
curl --request PUT \
--url https://getunblocked.com/api/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "Password Reset Guide",
"body": "To reset your password, visit ...",
"uri": "https://my.company.com/apollo/ticket/123456"
}
'import requests
url = "https://getunblocked.com/api/v1/documents"
payload = {
"collectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "Password Reset Guide",
"body": "To reset your password, visit ...",
"uri": "https://my.company.com/apollo/ticket/123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collectionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: 'Password Reset Guide',
body: JSON.stringify('To reset your password, visit ...'),
uri: 'https://my.company.com/apollo/ticket/123456'
})
};
fetch('https://getunblocked.com/api/v1/documents', 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://getunblocked.com/api/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'collectionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => 'Password Reset Guide',
'body' => 'To reset your password, visit ...',
'uri' => 'https://my.company.com/apollo/ticket/123456'
]),
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://getunblocked.com/api/v1/documents"
payload := strings.NewReader("{\n \"collectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"Password Reset Guide\",\n \"body\": \"To reset your password, visit ...\",\n \"uri\": \"https://my.company.com/apollo/ticket/123456\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://getunblocked.com/api/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"Password Reset Guide\",\n \"body\": \"To reset your password, visit ...\",\n \"uri\": \"https://my.company.com/apollo/ticket/123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://getunblocked.com/api/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"Password Reset Guide\",\n \"body\": \"To reset your password, visit ...\",\n \"uri\": \"https://my.company.com/apollo/ticket/123456\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": 400
}{
"status": 400
}{
"status": 400
}Authorizations
The API key to authenticate requests. Obtainable from the web dashboard.
Body
The ID of the collection where the document will be added.
A short title for the document in plain text.
"Password Reset Guide"
The body of the document. Structured formats like Markdown or JSON are preferred for better AI-powered answers.
The body can be provided as:
- Plain text (recommended) - Will be automatically compressed for storage
- Pre-compressed gzip + base64 encoded text (optional) - For large documents or bandwidth optimization
Maximum request size including all fields: 10MB
"To reset your password, visit ..."
A URL of the original source document that uniquely identifies the document. These will be used in answer references to link back to the original source.
"https://my.company.com/apollo/ticket/123456"
Response
OK
The ID of a resource that can be retrieved from the service.