import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/documents/bulk-set-collection/"
payload = {
"collection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"filter": {
"status": "active",
"collection": "<string>",
"search": "<string>",
"path_prefix": "<string>",
"content_type": "<string>",
"min_size_mb": 123,
"max_size_mb": 123,
"min_pages": 123,
"max_pages": 123,
"modified_before": "2023-12-25",
"modified_after": "2023-12-25",
"failure_reason": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collection_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
document_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
filter: {
status: 'active',
collection: '<string>',
search: '<string>',
path_prefix: '<string>',
content_type: '<string>',
min_size_mb: 123,
max_size_mb: 123,
min_pages: 123,
max_pages: 123,
modified_before: '2023-12-25',
modified_after: '2023-12-25',
failure_reason: '<string>'
}
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/documents/bulk-set-collection/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/documents/bulk-set-collection/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"filter": {
"status": "active",
"collection": "<string>",
"search": "<string>",
"path_prefix": "<string>",
"content_type": "<string>",
"min_size_mb": 123,
"max_size_mb": 123,
"min_pages": 123,
"max_pages": 123,
"modified_before": "2023-12-25",
"modified_after": "2023-12-25",
"failure_reason": "<string>"
}
}
'{
"moved": 123,
"skipped": 123,
"extraction_flows_to_rerun": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
]
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Move multiple documents to a collection
Move active documents into a collection, or out to “Default”, in one request:
either up to 200 named by document_ids, or up to 1000 selected by a filter
(send exactly one of the two). A filter skips documents already in the target, so
repeating a move is a no-op. Sets the collection foreign key and swaps the
mirrored ["tag", slug] pair on each document so retrieval/extraction filters
follow the move. Requires project admin permission.
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/documents/bulk-set-collection/"
payload = {
"collection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"filter": {
"status": "active",
"collection": "<string>",
"search": "<string>",
"path_prefix": "<string>",
"content_type": "<string>",
"min_size_mb": 123,
"max_size_mb": 123,
"min_pages": 123,
"max_pages": 123,
"modified_before": "2023-12-25",
"modified_after": "2023-12-25",
"failure_reason": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collection_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
document_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
filter: {
status: 'active',
collection: '<string>',
search: '<string>',
path_prefix: '<string>',
content_type: '<string>',
min_size_mb: 123,
max_size_mb: 123,
min_pages: 123,
max_pages: 123,
modified_before: '2023-12-25',
modified_after: '2023-12-25',
failure_reason: '<string>'
}
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/documents/bulk-set-collection/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/documents/bulk-set-collection/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"filter": {
"status": "active",
"collection": "<string>",
"search": "<string>",
"path_prefix": "<string>",
"content_type": "<string>",
"min_size_mb": 123,
"max_size_mb": 123,
"min_pages": 123,
"max_pages": 123,
"modified_before": "2023-12-25",
"modified_after": "2023-12-25",
"failure_reason": "<string>"
}
}
'{
"moved": 123,
"skipped": 123,
"extraction_flows_to_rerun": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
]
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Authorizations
Use Authorization: Bearer <token>. The token is either a user token / OAuth access
token, or a service-account API key (cfk_...). A key is valid on every endpoint and
acts as its service account, an organization member with per-store permissions.
Refused keys answer 403 with Invalid API key., API key revoked.,
API key expired. or API key disabled..