FileChimp Central API, version 1
API developer guide
For developers connecting a company’s own systems to its FileChimp Central server. The same guide is on every Central server at https://<server>/api-guide.html, and the OpenAPI 3.1 description at /api/v1/openapi.json.
The API needs the API access add-on on Central Plus or Max, and an administrator who turns it on and makes your key.
Search, read and download a company’s indexed documents and emails, and file new ones, from your own systems: an intranet,
a CRM, a scanner, a report. The API runs on the company’s own FileChimp Central server, at
https://<server>/api/v1. It is JSON over HTTPS, described in OpenAPI 3.1 at /api/v1/openapi.json
(import it into Postman, generate a client, or make a Power Automate custom connector from it).
Getting started
- An administrator ticks Allow API access on the dashboard (Company → API access) and makes a key for your system.
The key’s secret (
cfk_…) is shown once: keep it like a password, in your system’s secret store, never in a web page. - Send it on every call:
Authorization: Bearer cfk_…. - Check it works:
GET /api/v1/says which server, which company, and what the key may do.
curl -H "Authorization: Bearer $KEY" -H "X-On-Behalf-Of: pat@contoso.com" https://central.contoso.com/api/v1/
Acting as a person, or as the company
A person key acts for one of the company’s people on each call: put their email address (as the company’s People list has it) in the
X-On-Behalf-Of header. They get exactly what their own Windows permissions let them open, so the same call gives different people
different results. Your system must sign its own users in and send the right address: the server takes its word for who they are. Calls without
the header, or for someone not in the company (or not one the key may act as) are refused.
A company key acts as nobody in particular. It can list locations, count, and file, but never search for, read or download
documents. Send no X-On-Behalf-Of header with it. Counts made with it cover what any signed-in user of the server may read.
What a key may do
| Scope | Calls |
|---|---|
search | GET /search |
documents.read | GET /documents/{id}, GET /documents/{id}/text |
files.read | GET /documents/{id}/file |
locations.read | GET /locations |
counts | GET /counts |
filing.write | GET /destinations, GET /folders, POST /filing, GET /filing/{jobId}, GET /filing/check |
The administrator may also limit a key to some servers, some folders, some people and your system’s own address.
Searching and reading
GET /api/v1/search?q=lease&from=smith&after=2025-01-01&types=pdf,docx&sort=date&limit=25
Filters: q (all the words, unless anyWord=true; "a phrase"; from: and subject: work inside it),
fileName, content, subject, from, to, attachmentName, attachmentContent,
folder (that folder and below, as results show it), types, kind (email, document, image),
hasAttachments, after and before (YYYY-MM-DD). Sort by relevance (default), date,
name, size, sender or subject; page with offset and limit (at most 50).
Each result has an id, its name, kind, folder and path, date (UTC, ISO 8601), size, and for emails subject, from, to and attachment names,
with a snippet showing the matching words in **bold**. Then:
GET /documents/{id}: its details, and its attachments with their own ids.GET /documents/{id}/text?offset=0&max=20000: its text (for an email: headers, body and the text of its attachments), a part at a time: passnextOffsetback asoffset.GET /documents/{id}/file: the original file (or an attachment), streamed;Rangeworks.
Ids. Keep ids exactly as given: they say which server holds the document. An id comes from the file’s path, so it stays the same until the file is moved or renamed; keep the path too, to find it again if it moves.
Several servers. A company may have more than one server with a search. A call searches all those the key may use; each page holds up to
limit results from each, and servers says how many each found (or why one couldn’t answer). Use server= for one.
Still indexing. indexing: true means a server hasn’t finished indexing, so results may be incomplete.
Counts and locations
GET /api/v1/counts?by=month&q=invoice&after=2025-01-01
GET /api/v1/locations
by is extension, kind, folder, sender, month or year; counts take the same filters as search.
Filing
GET /destinationslists where things can be filed: each server’s locations (serverId,id, name).GET /folders?server=…&destination=…&q=12345finds a folder by name (a job or client number), or&path=Clientslists the folders under one.canFile: falsemeans the person may see it but not file into it.POST /filingasmultipart/form-data:server,destination,folder(inside the location, e.g.Clients/Smith), the file infile, and optionallyexternalId(your own id: sending the same one again gives back the first job instead of filing twice) andsubject. An.emlis filed as an email: an email already filed in the company (however it was filed) gives409withcode: already-filedand where it is. The answer is202with ajobId.GET /filing/{jobId}saysqueued,saving,filed(with the names saved) orfailed(with why). The server that owns the location saves it, usually within seconds; if it is offline, the job waits for it.GET /filing/check?messageId=…says whether an email is filed already, and where.
curl -H "Authorization: Bearer $KEY" -H "X-On-Behalf-Of: pat@contoso.com" \
-F server=dev_3f2a… -F destination=projects -F folder="Clients/Smith" -F externalId=crm-48213 \
-F file=@"Lease signed.pdf" https://central.contoso.com/api/v1/filing
Errors and limits
Errors are problem details (application/problem+json, RFC 9457) with a title to show and a code to act on:
| Status | code | Meaning |
|---|---|---|
| 400 | argument, person | A parameter is wrong, or the person header is missing (or sent with a company key). |
| 401 | key | No key, an unknown, expired or revoked key. |
| 402 | licence | The company’s licence doesn’t include API access. |
| 403 | api-off, scope, needs-person, person, address, browser, licence | Switched off; the key may not do this; not for this person; not from this address; not from a web page; search or filing not on the licence. |
| 404 | not-found | No such document (or not one this person may read). |
| 409 | already-filed | The email is filed already. |
| 429 | daily-limit | Too many calls: a burst of 20, then 10 a second, and the key’s daily limit (50,000 at most). Wait and try again (Retry-After when given). |
| 501, 502, 503 | search, offline | A server is too old for the API, couldn’t be reached, or isn’t connected just now. |
Every call (refused or not) is listed for the company’s administrators: when, which key, as whom, what was asked, the answer and your address. Never the text or files you read.
Reaching the server
The API is on the company’s own server, usually reachable from its network (and VPN) only. Run your system there, or ask the company to make the server reachable from outside (then limit your key to your service’s addresses). API keys don’t work from a browser: call the API from your server, not from a web page’s JavaScript.
Versions
This is version 1 (every answer has Central-Api-Version: 1). Within version 1, things are only added: new fields, new calls, new optional
parameters. Ignore fields you don’t know. A change that would break a client becomes /api/v2, with version 1 kept working for at least 12 months.
Servers update on their own schedule, so GET /api/v1/ tells you the server’s version.
Examples
PowerShell
$h = @{ Authorization = "Bearer $env:CENTRAL_KEY"; "X-On-Behalf-Of" = "pat@contoso.com" }
$r = Invoke-RestMethod "https://central.contoso.com/api/v1/search?q=lease&limit=10" -Headers $h
$r.results | Select-Object name, date, path
Invoke-WebRequest "https://central.contoso.com/api/v1/documents/$($r.results[0].id)/file" -Headers $h -OutFile $r.results[0].name
C#
using var http = new HttpClient { BaseAddress = new Uri("https://central.contoso.com/api/v1/") };
http.DefaultRequestHeaders.Authorization = new("Bearer", Environment.GetEnvironmentVariable("CENTRAL_KEY"));
using var req = new HttpRequestMessage(HttpMethod.Get, "search?q=" + Uri.EscapeDataString("lease smith"));
req.Headers.Add("X-On-Behalf-Of", signedInUser.Email);
using var res = await http.SendAsync(req);
res.EnsureSuccessStatusCode();
var found = await res.Content.ReadFromJsonAsync<JsonObject>();
Python
import os, requests
s = requests.Session()
s.headers.update({"Authorization": f"Bearer {os.environ['CENTRAL_KEY']}", "X-On-Behalf-Of": "pat@contoso.com"})
base = "https://central.contoso.com/api/v1"
hits = s.get(f"{base}/search", params={"q": "lease", "kind": "email"}).json()["results"]
with open("Lease.pdf", "rb") as f:
job = s.post(f"{base}/filing", data={"server": hits[0]["serverId"], "destination": "projects", "folder": "Clients/Smith",
"externalId": "crm-48213"}, files={"file": f}).json()
print(s.get(f"{base}/filing/{job['jobId']}").json()["status"])
JavaScript (Node.js, on your server)
const res = await fetch("https://central.contoso.com/api/v1/counts?by=month&q=invoice", {
headers: { Authorization: `Bearer ${process.env.CENTRAL_KEY}` }, // a company key: no person
});
if (!res.ok) throw new Error((await res.json()).title);
const { groups } = await res.json();
