Documentation sections

Documents

GET

/documents

List documents

Scopes

  • documents:read

Parameters

  • cursorquerystring
  • limitqueryinteger
  • qquerystringFull-text search on names and titles.
  • statusquerypending | no_expiry | valid | expiring | expired | renewed | archived

Responses

  • 200OK
    DocumentPageFields (2)
    • dataarray of DocumentRequired
    • next_cursorstring | nullRequiredPass as cursor for the next page; null on the last page.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
POST

/documents

Create

Scopes

  • documents:write

Parameters

  • Idempotency-KeyheaderstringRequiredStored 24 h per company and key. Same key with a different body returns 422.

Request body

DocumentInput Fields (12)
  • titlestringRequired
  • descriptionstring | null
  • category_idstringRequired
  • lifecyclepending | active | renewed | archived
  • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
  • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
  • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
  • reference_typeoutlet | product | supplier
  • reference_idstring | null
  • renewal_of_idstring | null
  • tagsarray of string
  • external_idstring | nullYour system's id, unique per company.

Responses

  • 201Created
    DocumentFields (19)
    • idstring
    • versionintegerIncrements on every write. Send it back in If-Match.
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • deleted_atstring | null
    • external_idstring | nullYour system's id, unique per company.
    • expiry_statusno_expiry | valid | expiring | expired
    • statuspending | no_expiry | valid | expiring | expired | renewed | archivedDisplayed status: pending, archived, or renewed from lifecycle, otherwise expiry_status.
    • titlestringRequired
    • descriptionstring | null
    • category_idstringRequired
    • lifecyclepending | active | renewed | archived
    • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
    • reference_typeoutlet | product | supplier
    • reference_idstring | null
    • renewal_of_idstring | null
    • tagsarray of string
  • 400Validation failed.
  • 409Version conflict, external_id taken, or a secret that cannot be replayed.
  • 422Semantically invalid, or an Idempotency-Key reused with a different body.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
GET

/documents/{id}

Get

Scopes

  • documents:read

Parameters

  • idpathstringRequired

Responses

  • 200OK
    DocumentFields (19)
    • idstring
    • versionintegerIncrements on every write. Send it back in If-Match.
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • deleted_atstring | null
    • external_idstring | nullYour system's id, unique per company.
    • expiry_statusno_expiry | valid | expiring | expired
    • statuspending | no_expiry | valid | expiring | expired | renewed | archivedDisplayed status: pending, archived, or renewed from lifecycle, otherwise expiry_status.
    • titlestringRequired
    • descriptionstring | null
    • category_idstringRequired
    • lifecyclepending | active | renewed | archived
    • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
    • reference_typeoutlet | product | supplier
    • reference_idstring | null
    • renewal_of_idstring | null
    • tagsarray of string
  • 404Not found. Records of other companies are also reported as not found.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
PATCH

/documents/{id}

Update (partial)

Scopes

  • documents:write

Parameters

  • idpathstringRequired
  • Idempotency-Keyheaderstring
  • If-MatchheaderintegerThe version you last read; 409 version_conflict when it changed.

Request body

DocumentInput Fields (12)
  • titlestringRequired
  • descriptionstring | null
  • category_idstringRequired
  • lifecyclepending | active | renewed | archived
  • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
  • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
  • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
  • reference_typeoutlet | product | supplier
  • reference_idstring | null
  • renewal_of_idstring | null
  • tagsarray of string
  • external_idstring | nullYour system's id, unique per company.

Responses

  • 200OK
    DocumentFields (19)
    • idstring
    • versionintegerIncrements on every write. Send it back in If-Match.
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • deleted_atstring | null
    • external_idstring | nullYour system's id, unique per company.
    • expiry_statusno_expiry | valid | expiring | expired
    • statuspending | no_expiry | valid | expiring | expired | renewed | archivedDisplayed status: pending, archived, or renewed from lifecycle, otherwise expiry_status.
    • titlestringRequired
    • descriptionstring | null
    • category_idstringRequired
    • lifecyclepending | active | renewed | archived
    • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
    • reference_typeoutlet | product | supplier
    • reference_idstring | null
    • renewal_of_idstring | null
    • tagsarray of string
  • 400Validation failed.
  • 404Not found. Records of other companies are also reported as not found.
  • 409Version conflict, external_id taken, or a secret that cannot be replayed.
  • 422Semantically invalid, or an Idempotency-Key reused with a different body.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
DELETE

/documents/{id}

Delete (soft; restorable for 30 days)

Scopes

  • documents:write

Parameters

  • idpathstringRequired
  • Idempotency-Keyheaderstring

Responses

  • 204Deleted
  • 404Not found. Records of other companies are also reported as not found.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
POST

/documents/{id}/restore

Restore within 30 days of deletion

Scopes

  • documents:write

Parameters

  • idpathstringRequired
  • Idempotency-Keyheaderstring

Responses

  • 200OK
    DocumentFields (19)
    • idstring
    • versionintegerIncrements on every write. Send it back in If-Match.
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • deleted_atstring | null
    • external_idstring | nullYour system's id, unique per company.
    • expiry_statusno_expiry | valid | expiring | expired
    • statuspending | no_expiry | valid | expiring | expired | renewed | archivedDisplayed status: pending, archived, or renewed from lifecycle, otherwise expiry_status.
    • titlestringRequired
    • descriptionstring | null
    • category_idstringRequired
    • lifecyclepending | active | renewed | archived
    • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
    • reference_typeoutlet | product | supplier
    • reference_idstring | null
    • renewal_of_idstring | null
    • tagsarray of string
  • 404Not found. Records of other companies are also reported as not found.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
PUT

/documents/by_external_id/{external_id}

Create or replace by your external id

Scopes

  • documents:write

Parameters

  • external_idpathstringRequired
  • Idempotency-Keyheaderstring
  • If-MatchheaderintegerThe version you last read; 409 version_conflict when it changed.

Request body

DocumentInput Fields (12)
  • titlestringRequired
  • descriptionstring | null
  • category_idstringRequired
  • lifecyclepending | active | renewed | archived
  • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
  • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
  • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
  • reference_typeoutlet | product | supplier
  • reference_idstring | null
  • renewal_of_idstring | null
  • tagsarray of string
  • external_idstring | nullYour system's id, unique per company.

Responses

  • 200Updated
    DocumentFields (19)
    • idstring
    • versionintegerIncrements on every write. Send it back in If-Match.
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • deleted_atstring | null
    • external_idstring | nullYour system's id, unique per company.
    • expiry_statusno_expiry | valid | expiring | expired
    • statuspending | no_expiry | valid | expiring | expired | renewed | archivedDisplayed status: pending, archived, or renewed from lifecycle, otherwise expiry_status.
    • titlestringRequired
    • descriptionstring | null
    • category_idstringRequired
    • lifecyclepending | active | renewed | archived
    • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
    • reference_typeoutlet | product | supplier
    • reference_idstring | null
    • renewal_of_idstring | null
    • tagsarray of string
  • 201Created
    DocumentFields (19)
    • idstring
    • versionintegerIncrements on every write. Send it back in If-Match.
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • deleted_atstring | null
    • external_idstring | nullYour system's id, unique per company.
    • expiry_statusno_expiry | valid | expiring | expired
    • statuspending | no_expiry | valid | expiring | expired | renewed | archivedDisplayed status: pending, archived, or renewed from lifecycle, otherwise expiry_status.
    • titlestringRequired
    • descriptionstring | null
    • category_idstringRequired
    • lifecyclepending | active | renewed | archived
    • start_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • end_datestring | nullCalendar date in the organization's timezone (YYYY-MM-DD).
    • reminder_daysarray of integer | nullDays before end_date to remind; replaces the category rule and the default. Null follows them.
    • reference_typeoutlet | product | supplier
    • reference_idstring | null
    • renewal_of_idstring | null
    • tagsarray of string
  • 400Validation failed.
  • 409Version conflict, external_id taken, or a secret that cannot be replayed.
  • 422Semantically invalid, or an Idempotency-Key reused with a different body.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
GET

/documents/{id}/files

List a document's files

Scopes

  • documents:read

Parameters

  • idpathstringRequired
  • cursorquerystring
  • limitqueryinteger

Responses

  • 200OK
    DocumentFilePageFields (2)
    • dataarray of DocumentFileRequired
    • next_cursorstring | nullRequiredPass as cursor for the next page; null on the last page.
  • 404Not found. Records of other companies are also reported as not found.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
POST

/documents/{id}/files

Upload a file (25 MB; scanned before it is stored)

Scopes

  • documents:write

Parameters

  • idpathstringRequired
  • Idempotency-KeyheaderstringRequiredStored 24 h per company and key. Same key with a different body returns 422.

Request body

multipart/form-data

Responses

  • 201Stored after a clean scan
    DocumentFileFields (7)
    • idstringRequired
    • document_idstringRequired
    • original_namestringRequired
    • mime_typestringRequired
    • size_bytesintegerRequired
    • sha256stringRequired
    • created_atstring (date-time)Required
  • 404Not found. Records of other companies are also reported as not found.
  • 422Rejected: malware, type mismatch, or too large.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
DELETE

/documents/{id}/files/{file_id}

Remove a file (soft delete)

Scopes

  • documents:write

Parameters

  • idpathstringRequired
  • file_idpathstringRequired
  • Idempotency-Keyheaderstring

Responses

  • 204Removed
  • 404Not found. Records of other companies are also reported as not found.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
GET

/documents/{id}/files/{file_id}/content

Download the original bytes

Scopes

  • documents:read

Parameters

  • idpathstringRequired
  • file_idpathstringRequired

Responses

  • 200The original file, unmodified
  • 404Not found. Records of other companies are also reported as not found.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.
GET

/document_categories

List document categories (managed in the app)

Scopes

  • documents:read

Responses

  • 200OK
    DocumentCategoryPageFields (2)
    • dataarray of DocumentCategoryRequired
    • next_cursorstring | nullRequiredPass as cursor for the next page; null on the last page.
  • 401Missing, revoked, or expired API key.
  • 403The key lacks the scope.
  • 429Rate limited: 60 requests per minute per key.