integrations.sh
← all integrations

Contract.fit API

OpenAPI apis-guru text

This OpenAPI describes the API exposed by the contract.fit backend.

Security

Authentication

All endpoints are protected: you need to make authenticated calls. There are 3 authentication mechanisms:

  • HTTP Basic (Username + Password)
  • JWT Token
  • API-Key

By default you should have an account allowing you to bootstrap your tenant and create users and roles, using Basic Auth or after creating a Token - see /auth endpoints.

If you are missing credentials or permissions, please .

Authorization

The security system is RBAC based: users must be granted scoped roles, allowing them to access resources. Each role grants a defined set of permissions, which can be restricted to a given inbox or document - see /roles endpoints.

Upload and Processing

Below is a short description of common use cases of the API.

Simple Upload

The easiest and simplest way to get started is to use POST /documents : it will make a synchronous upload of your file and wait for the result.

This is a simplified version of POST /documents/{inbox_id} with less arguments and settings; it may not be suitable for real workload as it offers less capabilities.

Upload to Inbox

The favored endpoint to upload files is POST /documents/{inbox_id}: it is also highly recommended to make async call using sync=false.

Sync / Async

For convenience uploads can be synchronous: it will make the request blocks until the document is processed.

It is however discouraged to rely on sync requests, as our service is designed to process documents asynchronously. You might run into timeouts and unprocessed document depending on factors such as server load and number of pending documents.

Asynchronous calls will only schedule the processing and directly return the document ID without waiting: the document will be processed as soon as possible. You can then wait for the processed result using GET /documents/{document_id}.

Reprocessing

You can reprocess a document using POST /documents/{document_id}/reprocess : it will schedule an async processing of the document (note: it is not possible to make a sync reprocessing)

Homepage
https://api.apis.guru/v2/specs/contract-p.fit/1.0.json
Provider
contract-p.fit
OpenAPI version
3.0.0
Spec (JSON)
https://api.apis.guru/v2/specs/contract-p.fit/1.0/openapi.json
Spec (YAML)
https://api.apis.guru/v2/specs/contract-p.fit/1.0/openapi.yaml

Tools (137)

Extracted live via the executor SDK.

  • about.getReleaseNotes

    GET /about/release_notes

  • about.getVersion

    GET /about/version

  • auth.deleteApiKeyResource

    Completely remove an API Key, thus disabling it. The token won't be recoverable

    Permission required: edit_backend_settings

  • auth.getApiKeyResource

    Permission required: view_api_keys

  • auth.getApiKeysInboxResource

    Permission required: view_api_keys

  • auth.getApiKeysResource

    Permission required: view_api_keys

  • auth.patchApiKeyResource

    roles can't be modified after creation: you need to create a new token if you want other roles.

    Permission required: edit_backend_settings

  • auth.postApiKeysInboxResource

    The requesting user needs to have inbox level permissions

    API Keys are simple randomly generated strings bound to roles that grant access to resources.

    Every API Key maps to attributes defining its validity and can be revoked at any time.

    API Key can be passed in the X-API-Key HTTP Header and in the querystring &api_key=

    Permission required: edit_backend_settings

  • auth.postApiKeysResource

    API Keys are simple randomly generated strings bound to roles that grant access to resources.

    Every API Key maps to attributes defining its validity and can be revoked at any time.

    API Key can be passed in the X-API-Key HTTP Header and in the querystring &api_key=

    Permission required: edit_backend_settings

  • auth.postAuth

    Login with the provided credentials (POST data) and return a JWT Token for this user.

  • auth.postEphemeralTokenResource

    Ephemeral tokens are short lived tokens that can be used to temporary grant access to resources.

  • auth.postGetJwtResource

    This endpoint is deprecated : use /auth/ephemeral and /auth/token instead

    This endpoint requires authentication and requires the user to have the role edit_users: you can then request a JWT on behalf of another user, specified in the request username attribute.

    This endpoint has 2 modes depending on the presence or absence of the roles attribute in the request data:

    Regular token

    When sending only a username: a regular JWT Token bound to the given user is created and returned.

    Temporary token

    When sending username AND a list roles of role (defined by the UID, optional the inbox to restrict access to): a temporary token is created that will behave like a regular user with the given roles until the access token expires.

    Permission required: edit_users

  • auth.postResetPassword

    Reset the user password

  • auth.postTokenResource

    Bearer tokens can be used to authenticated without session or without sending credentials.

    If the user making the request has sufficient privileges, he is allowed to create a token on behalf of another user. Otherwise only a token for the request current user is allowed.

    Permission required: edit_users

  • connections.deleteConnectionResource

    Delete the given connection.

    WARNING This will completely remove the connection, this is not recoverable

    Permission required: edit_integrations

  • connections.getConnectionResource

    Return the connection attributes

    Permission required: edit_integrations

  • connections.getConnectionsResource

    Return the list of set up connections

    Permission required: edit_integrations

  • connections.patchConnectionResource

    attributes

    Permission required: edit_integrations

  • connections.postConnectionsResource

    Create a new connection bound to the given scope (can be a project or inbox)

    Permission required: edit_integrations

  • dataRetentionSettings.deleteDataRetentionResource

    Permission required: edit_data_retention_settings

  • dataRetentionSettings.getDataRetentionResource

    Permission required: read_data_retention_settings

  • dataRetentionSettings.getDataRetentionSettingsLevelId

    Permission required: read_data_retention_settings

  • dataRetentionSettings.patchDataRetentionResource

    Permission required: edit_data_retention_settings

  • documents.deleteDocumentDeleteResource

    how parameter: if how == "FULL", we delete the entire document, including its source files if how == "SOURCE_FILES", we only remove the (source) files and we set the archived flag. In practice this means all information in the database (json) remains available, but you can no longer download / visualise the original document.

    WARNING The removal (of source files and in the database) is permanent

    Permission required: review

  • documents.getDocumentDeleteResource

    Simple endpoint that will fetch the given document

    Permission required: review

  • documents.getDocumentLastVersionResource

    Get the latest possible version for this document, optionally with constraints on the source or name

    Permission required: review

  • documents.getDocumentOriginalFileResource

    Return the document original file, as attachment.

    Permission required: review

  • documents.getDocumentPageImageResource

    GET /documents/{document_id}/page/{page_range}

  • documents.getDocumentPageImageThumbnailResource

    GET /documents/{document_id}/page_thumbnail/{page_range}

  • documents.getDocumentReverseResource

    GET /documents/{document_id}/reverse/{page_range}

  • documents.getDocumentTextResource

    Return the optimal text for the document; will either be the OCR text, the native text, the raw text or a translated version.

    To ease the data volume from the DB, we lazy load only the relevant text for the document.

    Permission required: review

  • documents.getDocumentTransformResource

    If you have a custom output configured (this is set by contract.fit team), This allows you to get the custom output formatted document.

    Permission required: review

  • documents.getDocumentWorkflowResource

    WARNING experimental use only

    Permission required: upload

  • documents.patchDocumentCopyResource

    Copy documents in the provided list to another inbox.

    If the destination inbox is the same as the original inbox, the request will be aborted, no duplicates will be created

    Permission required: review

  • documents.patchDocumentMoveResource

    Move documents in the provided list to another inbox.

    If the destination inbox is the same as the original inbox, the request will be aborted.

    Permission required: review

  • documents.postDocumentCompareVersionsResource

    POST /documents/{document_id}/compare_versions

  • documents.postDocumentCustomOutputResource

    Using the provided filter on documents, will generate a custom output.

    Note: only excel output is supported at the moment.

    Permission required: review

  • documents.postDocumentDataResource

    POST /documents/file_query/{data_type}

  • documents.postDocumentProcessTableAnnotation

    A fast and convenient annotation tool that converts a table-level annotation to cell-level feedback.

    Permission required: review

  • documents.postDocumentQuery

    POST /documents/query/{query_type}

  • documents.postDocumentsResource

    This endpoint uploads a new file to the given inbox and will process the file.

    Upload mode: sync

    When sync=true (default), the call will block and wait for the processing to complete.

    If you have a custom output configured (this is set by contract.fit team), passing mimetype application/vnd.cf.custom will allow you to get the custom output formatted result

    Since it might yield inconsistent results if a timeout is raised while waiting, it is recommended to use the async mode.

    Upload mode: async

    When sync=false, the call will schedule the processing and return without waiting for completion. It will return the document ID, so that the processed document can be retrieved at a later date.

    Permission required: upload

  • documents.postDocumentStatusDataResource

    Update the given document status data with the request user and date.

    Each document defines some status:

    • lock
    • escalate
    • reject
    • delete
    • archive
    • submitted

    These fields have 3 attributes:

    • status true / false
    • since: datetime (UTC)
    • by: user ID

    By calling this endpoint you can update the given status data with the request user (the one authenticated) and the current datetime. Note : You cannot pass a user in the request nor a datetime

    Permission required: review

  • documents.postDocumentSubmitEvalResource

    Send a feedback for the given document and optionally evaluate.

    When a document is to be reviewed, this endpoint is used to send the user feedback.

    Permission required: submit

  • documents.postEnrichmentResource

    POST /documents/enrich

  • documents.postReprocessDocumentResource

    This endpoint schedules (async) reprocessing for the given document; it will call the async processing with the given desired version name, similar to the async document upload but skipping OCR. It works asynchronously, so results need to be consulted by a separate call (or webhook)

    Permission required: upload

  • documents.postSimpleDocumentsResource

    This endpoint is a simplified version of the upload document to inbox one - synchronous mode.

    The upload file will be upload to the given inbox if provided, else fallback to the invoice inbox. The file will be processed synchronously, ie the request will blocks until the document was processed or until it timeout; in this case the document might not be correctly processed.

    For a more reliable processing use the /documents/{inbox_id} endpoint in async mode

    Permission required: upload

  • formats.deleteFormatResource

    WARNING This will completely remove the documents, this is not recoverable

    Permission required: edit_format_settings

  • formats.getFormatResource

    Return the given format attributes

    Deprecated: display_name Deprecated: default_format

    Permission required: edit_format_settings / review

  • formats.getFormatsDocTypesResource

    Permission required: edit_format_settings

  • formats.getFormatsResource

    Return the formats

    Deprecated: display_name Deprecated: default_format

  • formats.getFormatTagFieldsResource

    Get the tag fields values bound to the given scope.

    Scope can be an inbox or a project

    Permission required: edit_format_settings / review

  • formats.patchFormatResource

    settings with the given attributes

    Deprecated: display_name Deprecated: default_format

    Permission required: edit_format_settings

  • formats.postFormatsResource

    Create an new format

    Deprecated: display_name Deprecated: default_format

    Permission required: edit_format_settings

  • inboxes.deleteInboxDocumentResource

    in the given inbox.

    how parameter: if how == "FULL", we delete the entire document, including its source files if how == "SOURCE_FILES", we only remove the (source) files and we set the archived flag. In practice this means all information in the database (json) remains available, but you can no longer download / visualise the original document.

    what parameter: if what == "DONE", we will only delete files which have status_data.feedback == True if what == "ALL" we will delete all files

    Start_date and end_date: when specified we will only delete files which are received after (respectively before) the timestamp

    WARNING This will completely remove the documents, this is not recoverable

  • inboxes.deleteInboxResource

    Delete the given inbox.

    WARNING This will completely remove the inbox, this is not recoverable

  • inboxes.getInboxDocumentResource

    Permission required: view_list

  • inboxes.getInboxDocumentVersionsResource

    GET /inboxes/{inbox_id}/document_versions

  • inboxes.getInboxesResource

    Simply return the list of inboxes

  • inboxes.getInboxPaginatedResource

    Permission required: view_list

  • inboxes.getInboxResource

    Get the given inbox attributes

    Permission required: view_list

  • inboxes.patchInboxResource

    Update the given inbox with the provided arguments

    Permission required: view_list

  • inboxes.postInboxesResource

    Create a new inbox in the given project

    Permission required: create_inbox

  • inboxes.postInboxReprocessResource

    This endpoint schedule reprocessing for documents in the given inbox; this will call the async processing, just like async document upload

    Permission required: upload

  • integrations.deleteIntegrationResource

    Delete the given integration.

    WARNING This will completely remove the integration, this is not recoverable

    Permission required: edit_integrations

  • integrations.getEmailIntegrationActivationResource

    GET /integrations/{integration_id}/activate

  • integrations.getIntegrationResource

    Return the given integration attributes

    Permission required: read_integrations

  • integrations.getIntegrationResources

    Return the list of set up integrations

    Permission required: read_integrations

  • integrations.patchIntegrationResource

    Update the given integration attributes

    Permission required: edit_integrations

  • integrations.postIntegrationResources

    Create a new integration. Each type of integration has its own initialization logic and thus may yield suitable error codes depending on the underlying issue, such as credentials or connectivity issue.

    Permission required: edit_integrations

  • predictorSettings.deletePredictorSettingResource

    Permission required: edit_predictor_settings

  • predictorSettings.getPredictorSettingResource

    Permission required: edit_predictor_settings

  • predictorSettings.getPredictorSettingsResource

    Permission required: edit_predictor_settings

  • predictorSettings.patchPredictorSettingResource

    Permission required: edit_predictor_settings

  • projects.deleteProjectResource

    Delete the given project.

    WARNING This will completely remove the project, this is not recoverable

    Permission required: edit_format_settings

  • projects.getProjectResource

    Get the attributes of the given project

    Deprecated: default_format

  • projects.getProjectsResource

    Return the list of projects in the organization

    Deprecated: default_format

  • projects.patchProjectResource

    Update the project attributes with the provided arguments

    Deprecated: default_format

    Permission required: edit_format_settings

  • projects.postProjectsResource

    Simply create a new project

    Deprecated: default_format

    Permission required: create_inbox

  • reports.deleteReportResource

    Delete the given report.

    WARNING This will completely remove the report, this is not recoverable

    Permission required: edit_reports

  • reports.getReportResource

    Return report attributes

    Permission required: read_reports

  • reports.getReportsResource

    Return the list of reports

    Permission required: read_reports

  • reports.patchReportResource

    Modify the report with the given arguments

    Permission required: edit_reports

  • reports.postGenerateReportIdResource

    Note: start_date and end_date filter on status update

    Permission required: read_reports

  • reports.postGenerateReportResource

    Note: start_date and end_date filter on status update

    Permission required: read_reports

  • reports.postReportsResource

    Create a new report

    Permission required: edit_reports

  • roles.deleteRoleResource

    Delete the given role.

    WARNING This will completely remove the role, this is not recoverable

    Permission required: edit_users

  • roles.getRoleResource

    Return role attributes

  • roles.getRolesResource

    Return the list of roles

  • roles.patchRoleResource

    Modify the role with the given arguments

    Permission required: edit_users

  • roles.postRolesResource

    Create a new role

    Permission required: edit_users

  • ruleConfig.deleteRuleConfigResource

    Permission required: edit_predictor_settings

  • ruleConfig.getRuleConfigResource

    Permission required: edit_predictor_settings

  • ruleConfig.getRuleConfigsResource

    Permission required: edit_predictor_settings

  • ruleConfig.patchRuleConfigResource

    Permission required: edit_predictor_settings

  • ruleConfig.postDebugRuleEntityDocumentResource

    Permission required: edit_predictor_settings

  • ruleConfig.postDebugRuleEntityResource

    Permission required: edit_predictor_settings

  • ruleConfig.postDebugWhereToSearch

    Returns a list of strings per granularity. If no granularity is specified. It is considered to be the whole document

    Permission required: edit_predictor_settings

  • samplingSettings.deleteSettingSamplingResource

    Permission required: edit_sampling_settings

  • samplingSettings.getSettingSamplingResource

    Permission required: edit_sampling_settings / review

  • samplingSettings.getSettingSamplingsResource

    Permission required: edit_sampling_settings / review

  • samplingSettings.patchSettingSamplingResource

    Permission required: edit_sampling_settings

  • settings.getDashboardSettingsAtomicResource

    Get the dashboard settings for the given scope (project or inbox)

  • settings.getReviewSettingsAtomicResource

    Get the review settings for the given scope (project or inbox)

  • settings.patchDashboardSettingsAtomicResource

    Update the dashboard settings for the given scope (project or inbox)

    Permission required: edit_dashboard_settings

  • settings.patchReviewSettingsAtomicResource

    Update the review settings for the given scope (project or inbox)

    Permission required: edit_review_settings

  • sso.deleteSsoConfigResources

    Return the given integration attributes

    Permission required: edit_integrations

  • sso.getSsoConfigResources

    GET /sso/config

  • sso.postOauthLoginResource

    POST /sso/login

  • sso.postSsoConfigResources

    POST /sso/config

  • stats.getAccuracyResource

    Permission required: view_statistics

  • stats.getAutomationBlockersStats

    Permission required: view_statistics

  • stats.getEvaluatedVersions

    If filter_on_version_date is True, the document versions are filtered by timestamp, otherwise, documents are filtered by receive_time.

    Permission required: view_statistics

  • stats.getProcessingStats

    This endpoint is in preview and its interface may change.

    Compute statistics over the documents in the inbox. These stats include:

    • mean
    • min
    • max
    • standard deviation
    • 50th percentile
    • 95th percentile
    • 99th percentile

    Documents are grouped by their page count: this is currently the only supported group by attribute.

    Documents can be further filter by any given start or end date: the filter will apply to the start processing date, and not to the done date.

    Permission required: view_statistics

  • stats.getStatsResource

    Compute and return statistics on the given inbox, optionally restricted to a date range and a field.

    Stats will return per field:

    • accuracy
    • precision
    • f1 score
    • recall

    Note Depending on the date range and fields, computation might be intensive

    Permission required: view_statistics

  • stats.getStpResource

    Permission required: view_statistics

  • stats.getUsageStatsResource

    GET /stats/usage

  • stats.getVolumeStats

    Permission required: view_statistics

  • stats.postBlueDotsResource

    Compute and return the blue dots statistics, optionally restricted to date range, fields and versions

    Permission required: submit

  • style.getStyleLogoResource

    Get the custom logo

  • style.getStyleSheetResource

    Get the custom CSS file

  • style.postStyleLogoResource

    Permission required: edit_dashboard_settings

  • style.postStyleSheetResource

    Permission required: edit_dashboard_settings

  • tenant.deleteTenantResource

    DELETE /tenant

  • tenant.patchActivateTenantResource

    PATCH /tenant/activate

  • thresholdSettings.deleteSettingThresholdResource

    Permission required: edit_thresholds_settings

  • thresholdSettings.getSettingsThresholdResource

    Permission required: read_thresholds_settings / review

  • thresholdSettings.getSettingThresholdResource

    Permission required: read_thresholds_settings / review

  • thresholdSettings.patchSettingThresholdResource

    Permission required: edit_thresholds_settings

  • users.deleteUserResource

    Delete the given user.

    WARNING This will completely remove the user, this is not recoverable

  • users.getMe

    Return user info of the authenticated used making the call

  • users.getUserResource

    Return user attribute

    Permission required: edit_users

  • users.getUsersResource

    Return the list of users

    Permission required: edit_users

  • users.patchUserResource

    Update the given user with the provided attributes

    Permission required: edit_users

  • users.postChangePassword

    Update the current authenticated user password

  • users.postUsersResource

    Create a new user with the provided attributes and roles

    Permission required: edit_users

  • openapi.previewSpec

    Preview an OpenAPI document before adding it as a source

  • openapi.addSource

    Add an OpenAPI source and register its operations as tools