Skip to content

companyRAG API

The companyRAG Indexer exposes an HTTP API for managing files, collections, indexing jobs and data sources programmatically. It allows content to be ingested into companyRAG automatically, for example from an existing document management system or through a nightly sync.

This page covers the essentials: authentication, base URL and error handling. The endpoint reference is generated from the OpenAPI specification. It covers the most important endpoints; some newer endpoints and fields are not included yet.

All endpoints require authentication via an API key. The key is sent in the Authorization header as a Bearer token:

Authorization: Bearer rag_a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890

Administrators create API keys in companyRAG under API Keys. They have the format rag_ followed by a 64-character hex string and always act on behalf of the person who created them.

The API also accepts an access_token cookie. That path exists as a fallback for browser clients already signed in to companyRAG; integrations and scripts should use the Bearer token.

The API is available under the domain of your CompanyGPT instance:

https://COMPANY.company-gpt.com/companygpt/rag/api

COMPANY is a placeholder for the subdomain of your environment. You can read it from the browser address bar while the companyRAG UI is open. If your environment uses a custom domain, append /companygpt/rag/api to that domain.

Errors are mostly returned as a JSON object with an error field:

{
"error": "Error message description"
}

A few endpoints return a plain-text body instead; these are noted on the respective endpoint in the reference.

StatusMeaning
400 Bad RequestInvalid request parameters
401 UnauthorizedMissing or invalid authentication
403 ForbiddenInsufficient permissions
404 Not FoundResource not found
409 ConflictConflict with the current state of the resource, such as a job that cannot be retried in its current status, or a share change that would leave a collection without an owner
500 Internal Server ErrorServer-side error

The endpoints are grouped by area in the reference:

  • Files – upload, list, retrieve, delete and reindex files.
  • Jobs – monitor, retry, cancel and clean up indexing jobs.
  • Collections – create, update and delete collections and manage their shares.
  • Ingest – ingest structured datasets row by row (up to 10,000 rows per call) and truncate tables.
  • Sources – configure and synchronize data sources such as SharePoint, Nextcloud, Google Drive, GitHub, WebDAV, FTP or web crawl.
  • Admin – API Keys – list, create and revoke API keys (administrators only).