Restore an earlier version of a document
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/brain/documents/{document_id}/restore \
--header 'Content-Type: application/json' \
--data '
{
"version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({version_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/brain/documents/{document_id}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/brain/documents/{document_id}/restore"
payload = { "version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){}{
"error": "<string>",
"code": "storage_rule_violation",
"violations": [
{
"rule": "<string>",
"message": "<string>",
"limit": "<unknown>",
"actual": "<unknown>"
}
],
"project_id": "<string>",
"refused_by_rules": [
{
"title": "<string>",
"rule": "<string>",
"message": "<string>"
}
]
}Projects
Restore an earlier version of a document
Add an earlier version’s text again as the newest document of its history (#683), indexed like an upload and within the same allowance; the current document becomes a version. Answers 202 with the new document. Not for a document mirrored from a repository (409): change the file there.
POST
/
admin
/
api
/
projects
/
{project_id}
/
brain
/
documents
/
{document_id}
/
restore
Restore an earlier version of a document
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/brain/documents/{document_id}/restore \
--header 'Content-Type: application/json' \
--data '
{
"version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({version_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/brain/documents/{document_id}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/brain/documents/{document_id}/restore"
payload = { "version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){}{
"error": "<string>",
"code": "storage_rule_violation",
"violations": [
{
"rule": "<string>",
"message": "<string>",
"limit": "<unknown>",
"actual": "<unknown>"
}
],
"project_id": "<string>",
"refused_by_rules": [
{
"title": "<string>",
"rule": "<string>",
"message": "<string>"
}
]
}