curl --request POST \
--url https://sandbox.circularo.com/api/v2/folders/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"folderIds": [
"97cfb9de-92dd-413a-b5e7-175eff7506d6"
],
"includeAttachments": false,
"includeSubmittedFiles": false,
"scope": "shared"
}
'import requests
url = "https://sandbox.circularo.com/api/v2/folders/export"
payload = {
"folderIds": ["97cfb9de-92dd-413a-b5e7-175eff7506d6"],
"includeAttachments": False,
"includeSubmittedFiles": False,
"scope": "shared"
}
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({
folderIds: ['97cfb9de-92dd-413a-b5e7-175eff7506d6'],
includeAttachments: false,
includeSubmittedFiles: false,
scope: 'shared'
})
};
fetch('https://sandbox.circularo.com/api/v2/folders/export', 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://sandbox.circularo.com/api/v2/folders/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'folderIds' => [
'97cfb9de-92dd-413a-b5e7-175eff7506d6'
],
'includeAttachments' => false,
'includeSubmittedFiles' => false,
'scope' => 'shared'
]),
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://sandbox.circularo.com/api/v2/folders/export"
payload := strings.NewReader("{\n \"folderIds\": [\n \"97cfb9de-92dd-413a-b5e7-175eff7506d6\"\n ],\n \"includeAttachments\": false,\n \"includeSubmittedFiles\": false,\n \"scope\": \"shared\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://sandbox.circularo.com/api/v2/folders/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"folderIds\": [\n \"97cfb9de-92dd-413a-b5e7-175eff7506d6\"\n ],\n \"includeAttachments\": false,\n \"includeSubmittedFiles\": false,\n \"scope\": \"shared\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v2/folders/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"folderIds\": [\n \"97cfb9de-92dd-413a-b5e7-175eff7506d6\"\n ],\n \"includeAttachments\": false,\n \"includeSubmittedFiles\": false,\n \"scope\": \"shared\"\n}"
response = http.request(request)
puts response.read_body{
"fileId": "s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj",
"finishedAt": "2024-11-02T09:15:30.000Z",
"id": "0b6cba54-3d40-4d1c-8bff-41d2d0f93cf3",
"isEmpty": false,
"queuedAt": "2024-11-02T09:15:30.000Z",
"startedAt": "2024-11-02T09:15:30.000Z",
"status": "completed",
"type": "folder"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 422,
"type": "VALIDATION:IDEMPOTENCY_KEY_REUSED",
"message": "Idempotency-Key reused with a different request",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 429,
"type": "SYSTEM:RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Export folders
POST /folders/export
Exports folders and their whole subtrees as a single ZIP archive, preserving the folder structure. Select the folders with folderIds — find them via GET /folders — or supply none to export the entire tree given by scope. The archive contains the files of every document you can access in the selected subtrees, optionally together with their attachments and recipient-submitted files. One export covers a single folder tree.
The export runs in the background: this endpoint returns an export job immediately — poll GET /exports/{id} until it completes, then download the archive via GET /files/{id}/content using the returned fileId. An export covers at most 10000 records, counting the folders themselves alongside the documents in them.
Response headers
Idempotency-Replayed— Present only on a replay: the request was recognized as a retry of an earlier one by itsIdempotency-Key, and this is the stored response of that original request.
curl --request POST \
--url https://sandbox.circularo.com/api/v2/folders/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"folderIds": [
"97cfb9de-92dd-413a-b5e7-175eff7506d6"
],
"includeAttachments": false,
"includeSubmittedFiles": false,
"scope": "shared"
}
'import requests
url = "https://sandbox.circularo.com/api/v2/folders/export"
payload = {
"folderIds": ["97cfb9de-92dd-413a-b5e7-175eff7506d6"],
"includeAttachments": False,
"includeSubmittedFiles": False,
"scope": "shared"
}
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({
folderIds: ['97cfb9de-92dd-413a-b5e7-175eff7506d6'],
includeAttachments: false,
includeSubmittedFiles: false,
scope: 'shared'
})
};
fetch('https://sandbox.circularo.com/api/v2/folders/export', 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://sandbox.circularo.com/api/v2/folders/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'folderIds' => [
'97cfb9de-92dd-413a-b5e7-175eff7506d6'
],
'includeAttachments' => false,
'includeSubmittedFiles' => false,
'scope' => 'shared'
]),
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://sandbox.circularo.com/api/v2/folders/export"
payload := strings.NewReader("{\n \"folderIds\": [\n \"97cfb9de-92dd-413a-b5e7-175eff7506d6\"\n ],\n \"includeAttachments\": false,\n \"includeSubmittedFiles\": false,\n \"scope\": \"shared\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://sandbox.circularo.com/api/v2/folders/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"folderIds\": [\n \"97cfb9de-92dd-413a-b5e7-175eff7506d6\"\n ],\n \"includeAttachments\": false,\n \"includeSubmittedFiles\": false,\n \"scope\": \"shared\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v2/folders/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"folderIds\": [\n \"97cfb9de-92dd-413a-b5e7-175eff7506d6\"\n ],\n \"includeAttachments\": false,\n \"includeSubmittedFiles\": false,\n \"scope\": \"shared\"\n}"
response = http.request(request)
puts response.read_body{
"fileId": "s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj",
"finishedAt": "2024-11-02T09:15:30.000Z",
"id": "0b6cba54-3d40-4d1c-8bff-41d2d0f93cf3",
"isEmpty": false,
"queuedAt": "2024-11-02T09:15:30.000Z",
"startedAt": "2024-11-02T09:15:30.000Z",
"status": "completed",
"type": "folder"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 422,
"type": "VALIDATION:IDEMPOTENCY_KEY_REUSED",
"message": "Idempotency-Key reused with a different request",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 429,
"type": "SYSTEM:RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Headers
A unique key that makes a create request safe to retry. Generate a fresh value for each distinct operation. If a retry with the same key arrives while the original is still being processed you get a conflict; once it has completed you get the original result back instead of creating a duplicate, and reusing the key with a different request body is rejected. Stored results are retained for a limited time, after which a retry executes the request again.
1 - 255"6b8f0f2e-9d3a-4c1e-bf7a-2f1d9c0a1b23"
Body
The selection of folders to export and the options controlling what the export archive contains.
Export exactly these folders. All of them must belong to the same folder tree. A folder nested inside another selected folder is covered by it; the remaining folders must sit at the same depth of the tree. Omit to export an entire tree. folderIds cannot be combined with scope.
11^[A-Za-z0-9_-]+$["97cfb9de-92dd-413a-b5e7-175eff7506d6"]
Response
The export was queued. Returns the export job to poll.
An export job: what it covers, its current status, timing, and — once completed — the identifier of the resulting ZIP archive.
Identifier of the resulting ZIP archive once the export has completed. Download it via GET /files/{id}/content. Null until the export completes, and for an empty export.
1^[a-z0-9]+$"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj"
Current status of the export.
queued: The export is waiting to be processed.processing: The export file is being generated.completed: The export has finished. When it produced a file,fileIdpoints to it.failed: The export failed. Create a new export to retry.
queued, processing, completed, failed "completed"
What the export covers.
documents: An export of documents selected by search filters.folder: An export of selected folders and their subtrees, or of a whole folder tree.account: An export of the data belonging to your account.
documents, folder, account "folder"