SalesOS

Documents

Document management and storage

Get all indexed documents from the database

GET
/v1/documents

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

curl -X GET "https://api.salesos.org/v1/documents" \
  -H "Authorization: Bearer <token>"

Merge a template with one record and store the PDF against it.

POST
/v1/documents/generate

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/documents/generate" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{}'

List templates

GET
/v1/documents/templates

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Query Parameters

entityTypestring
curl -X GET "https://api.salesos.org/v1/documents/templates?entityType=%3Cstring%3E" \
  -H "Authorization: Bearer <token>"

{}

Create template

POST
/v1/documents/templates

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/documents/templates" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{}'

List placeholders

GET
/v1/documents/templates/placeholders

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Query Parameters

entityTypeRequiredstring
curl -X GET "https://api.salesos.org/v1/documents/templates/placeholders?entityType=%3Cstring%3E" \
  -H "Authorization: Bearer <token>"

Get template

GET
/v1/documents/templates/{templateId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

templateIdRequiredstring
curl -X GET "https://api.salesos.org/v1/documents/templates/<string>" \
  -H "Authorization: Bearer <token>"

Update template

PATCH
/v1/documents/templates/{templateId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired

Path Parameters

templateIdRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X PATCH "https://api.salesos.org/v1/documents/templates/<string>" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{}'

Delete template

DELETE
/v1/documents/templates/{templateId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

templateIdRequiredstring
curl -X DELETE "https://api.salesos.org/v1/documents/templates/<string>" \
  -H "Authorization: Bearer <token>"

Generated documents for one record (owner-or-admin on the record).

GET
/v1/documents/generated

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Query Parameters

entityTypeRequiredstring
entityIdRequiredstring
curl -X GET "https://api.salesos.org/v1/documents/generated?entityType=%3Cstring%3E&entityId=%3Cstring%3E" \
  -H "Authorization: Bearer <token>"

Download generated

GET
/v1/documents/generated/{docId}/download

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

docIdRequiredstring
curl -X GET "https://api.salesos.org/v1/documents/generated/<string>/download" \
  -H "Authorization: Bearer <token>"

Delete generated

DELETE
/v1/documents/generated/{docId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

docIdRequiredstring
curl -X DELETE "https://api.salesos.org/v1/documents/generated/<string>" \
  -H "Authorization: Bearer <token>"

Document processing capabilities Returns information about OCR, table extraction, and other features

GET
/v1/documents/capabilities

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

curl -X GET "https://api.salesos.org/v1/documents/capabilities" \
  -H "Authorization: Bearer <token>"

{}

Get a single document by ID

GET
/v1/documents/{id}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring
curl -X GET "https://api.salesos.org/v1/documents/<string>" \
  -H "Authorization: Bearer <token>"

{}

Delete a document with cascade effect Removes the document and its search index.

DELETE
/v1/documents/{id}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring
curl -X DELETE "https://api.salesos.org/v1/documents/<string>" \
  -H "Authorization: Bearer <token>"

Upload and index a new document The document is stored and indexed for search and the assistant.

POST
/v1/documents/upload

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Query Parameters

addSummarystring
addDescriptionstring
useOcrstring
extractTablesstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/documents/upload?addSummary=%3Cstring%3E&addDescription=%3Cstring%3E&useOcr=%3Cstring%3E&extractTables=%3Cstring%3E" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>"

Extract text and tables from a document using OCR This provides raw extraction without tree structure indexing

POST
/v1/documents/extract

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Query Parameters

includeTablesstring
outputFormatstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/documents/extract?includeTables=%3Cstring%3E&outputFormat=%3Cstring%3E" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>"

{}

Check indexing status and update database

GET
/v1/documents/{id}/status

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring
curl -X GET "https://api.salesos.org/v1/documents/<string>/status" \
  -H "Authorization: Bearer <token>"

{}