Skip to content

Contract.fit API API

by contract-p.fit

API keyHTTPSText Analysis
Open documentation ↗

Overview

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 [contact us](https://contract.fit/contact-us). ### 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)

Contract.fit API is a text analysis API from contract-p.fit. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 135 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Version
1.0
Endpoints
135
Spec updated
2023-03-06

Endpoints

MethodPathWhat it does
GET/about/release_notesget_release_notes
GET/about/versionget_version
POST/authLogin and retrieve a JWT Token
GET/auth/api-keyGet all API-Key
POST/auth/api-keyCreate a new API Key
GET/auth/api-key/inbox/{inbox_id}Get all API-Keys for this inbox
POST/auth/api-key/inbox/{inbox_id}Create a new API Key on inbox level
GET/auth/api-key/{key}Get details of an API-Key
PATCH/auth/api-key/{key}Edit an API-Key
DELETE/auth/api-key/{key}Delete an API Key
POST/auth/ephemeralCreate a new ephemeral token
POST/auth/get_JWTdeprecatedCreate a new JWT Token
POST/auth/reset_passwordReset the user password
POST/auth/tokenCreate a new token
GET/connectionsGet all Connections
POST/connectionsCreate connection
GET/connections/{connection_id}Get connection
PATCH/connections/{connection_id}Update connection
DELETE/connections/{connection_id}Delete a connection
GET/data_retention_settingsGet all data retention settings
GET/data_retention_settings/{level}/{id}Get scoped data retention settings
PATCH/data_retention_settings/{level}/{id}Update scoped data retention settings
DELETE/data_retention_settings/{level}/{id}Delete scoped sampling settings
POST/documents/Upload a new document
POST/documents/custom_outputGenerate custom output for documents
POST/documents/enrichpost_enrichment_resource
POST/documents/file_query/{data_type}post_document_data_resource
POST/documents/query/{query_type}post_document_query
GET/documents/{document_id}Get the document
DELETE/documents/{document_id}Delete the document
POST/documents/{document_id}/compare_versionspost_document_compare_versions_resource
GET/documents/{document_id}/custom_outputGet custom output formatted document
POST/documents/{document_id}/feedbackSubmit a feedback
GET/documents/{document_id}/last_versionGet latest version
GET/documents/{document_id}/original_fileGet document original file
GET/documents/{document_id}/page/{page_range}get_document_page_image_resource
GET/documents/{document_id}/page_thumbnail/{page_range}get_document_page_image_thumbnail_resource
POST/documents/{document_id}/process_table_annotationProcess a table-level annotation
POST/documents/{document_id}/reprocessSchedule document reprocessing
GET/documents/{document_id}/reverse/{page_range}get_document_reverse_resource
POST/documents/{document_id}/status_dataUpdate document status
GET/documents/{document_id}/textGet the document text
GET/documents/{document_id}/workflowGet the document Workflow
POST/documents/{inbox_id}Upload a new doc to the inbox
PATCH/documents/{inbox_id}/copy_inboxCopy documents to another inbox
PATCH/documents/{inbox_id}/move_inboxMove documents to another inbox
GET/formatsGet lists of format
POST/formatsCreate format
GET/formats/document_typesGet supported document_types
GET/formats/{format_id}Get format attributes
PATCH/formats/{format_id}Update the format
DELETE/formats/{format_id}Delete the format
GET/formats/{scope}/tag_fieldsGet tags values
GET/inboxesGet list of inboxes
POST/inboxesCreate an inbox
GET/inboxes/{inbox_id}Get Inbox attributes
PATCH/inboxes/{inbox_id}Update inbox
DELETE/inboxes/{inbox_id}Delete an inbox
GET/inboxes/{inbox_id}/document_versionsget_inbox_document_versions_resource
GET/inboxes/{inbox_id}/documentsGet documents in the inbox
DELETE/inboxes/{inbox_id}/documentsDelete documents
GET/inboxes/{inbox_id}/paginatedGet paginated list of documents in the inbox
POST/inboxes/{inbox_id}/reprocessSchedule inbox reprocessing
GET/integrations/Get all integrations
POST/integrations/Create integration
GET/integrations/{integration_id}Get integration attributes
PATCH/integrations/{integration_id}Update integration
DELETE/integrations/{integration_id}Delete an integration
GET/integrations/{integration_id}/activateget_email_integration_activation_resource
GET/predictor_settingsGet all predictor settings
GET/predictor_settings/{scope}Get scoped predictor settings
PATCH/predictor_settings/{scope}Update scoped predictor settings
DELETE/predictor_settings/{scope}Delete scoped predictor settings
GET/projectsGet the list of projects
POST/projectsCreate a project
GET/projects/{project_id}Get project attributes
PATCH/projects/{project_id}Update project
DELETE/projects/{project_id}Delete project
GET/reportsGet all reports
POST/reportsCreate report
POST/reports/generateGenerate report based on input
GET/reports/{report_id}Get report
PATCH/reports/{report_id}Update report
DELETE/reports/{report_id}Delete a report
POST/reports/{report_id}/generateGenerate report based on report id
GET/rolesGet all roles
POST/rolesCreate role
GET/roles/{role_id}Get role
PATCH/roles/{role_id}Update role
DELETE/roles/{role_id}Delete a role
GET/rule_configGet all rule configs
POST/rule_config/rule_entity/Get the regexes that are generated by the rule
POST/rule_config/rule_entity/{document_id}Evaluate a rule on a document
POST/rule_config/where_to_search/{document_id}Get the text a where_to_search specification will generate
GET/rule_config/{scope}Get scoped rule config
PATCH/rule_config/{scope}Update scoped rule config
DELETE/rule_config/{scope}Delete scoped rule config
GET/sampling_settingsGet all sampling settings
GET/sampling_settings/{scope}Get scoped sampling settings
PATCH/sampling_settings/{scope}Update scoped sampling settings

Showing the first 100 of 135 endpoints; the full list is in the documentation.

Questions

Does the Contract.fit API API need an API key?

Yes. The Contract.fit API API uses API key authentication; the documentation explains how to get credentials.

Does the Contract.fit API API support HTTPS?

Yes, the Contract.fit API API is served over HTTPS.

How many endpoints does the Contract.fit API API have?

Its OpenAPI description lists 135 endpoints in version 1.0. The first 100 are shown on this page.

What are alternatives to the Contract.fit API API?

Other Text Analysis APIs include Google Cloud Natural, LanguageTool, Tisane, LibreTranslate, Asynchronous Speech-To-Text API Documentation.

Compare alternatives →

Google Cloud Natural

Text Analysis

Natural language understanding technology, including sentiment, entity and syntax analysis

API key

LanguageTool

Text Analysis

Style and Grammar Checker for 25+ Languages

No auth5 endpoints

Tisane

Text Analysis

Text Analytics with focus on detection of abusive content and law enforcement applications

OAuthCORS6 endpoints

LibreTranslate

Text Analysis

Translation tool with 17 available languages

No auth

Asynchronous Speech-To-Text API Documentation

Text Analysis

Rev.ai provides quality speech-text recognition via a RESTful API. All public methods and objects are documented here for developer reference. For a real-time speech to text solution, use Rev.ai's [Streaming API](/docs/streaming). # Base Endpoint The base url for this version of the API is > `https://api.rev.ai/speechtotext/v1` All endpoints described in this documentation are relative to this base url. # Quick Start Follow the [getting started checklist](https://www.rev.ai/getting_started) ## Get your Access Token You can generate your [access token](#section/Authentication/Access-Token) on the [settings page](https://www.rev.ai/access_token) of your account. This access token only needs to be generated once and never expires. You can re-generate your token, however this will invalidate the previous token. ## Submit a File To submit an audio file for transcription to Rev.ai: ``` curl -X POST "https://api.rev.ai/speechtotext/v1/jobs" -H "Authorization: Bearer $REV_ACCESS_TOKEN" -H "Content-Type: application/json" -d "{\"media_url\":\"https://www.rev.ai/FTC_Sample_1.mp3\",\"metadata\":\"This is a sample submit jobs option\"}" ``` You’ll receive a response like this: ~~~ { "id": "Umx5c6F7pH7r", "created_on": "2018-09-15T05:14:38.13", "name": "sample.mp3", "metadata": "This is a sample submit jobs option for multipart", "status": "in_progress" } ~~~ The `id` (in this case `Umx5c6F7pH7r`) will allow you to retrieve your transcript. ## Get Your Transcript Once a transcription job's `status` becomes `transcribed`, you can retrieve the transcript in JSON format by running: ``` curl -X GET "https://api.rev.ai/speechtotext/v1/jobs/{id}/transcript" -H "Authorization: Bearer $REV_ACCESS_TOKEN" -H "Accept: application/vnd.rev.transcript.v1.0+json" ``` Alternatively you can get the plain text version by running: ``` curl -X GET "https://api.rev.ai/speechtotext/v1/jobs/{id}/transcript" -H "Authorization: Bearer $REV_ACCESS_TOKEN" -H "Accept: text/plain" ``` You can poll for the `status` of your job by querying for the job periodically: ``` curl -X GET https://api.rev.ai/speechtotext/v1/jobs/{id} -H "Authorization: Bearer $REV_ACCESS_TOKEN" ``` **Note:** Polling is NOT recommended in a production server. Rather, use [webhooks](#section/Webhooks) to asynchronously receive notifications once the transcription job completes If you have any further questions, contact us at <[email protected]> # Submitting Files Two `POST` request formats can be used to submit a file: `application/json` or `multipart/form-data`. ## JSON This is the preferred method of file submission. Uses the `media_url` property to provide a direct download URL to the Rev.ai server. This method supports the use of pre-signed URLs. Links to videos hosted on platforms like Youtube are not valid because they are not direct download links. **Important note on presigned URLs:** Signed URLs usually have an expiration time which is configurable. To ensure the Rev.ai server can access the link, make sure the expiration time is set to 2 hours or more. In the event you plan on resending the same file, make sure to generate a new presigned URL. ## FormData Used to send a local file to the Rev.ai server. This allows the customer to send the file directly from the host machine. Certain limits apply to this format, see the [Async API Limits section](#section/Async-API-Limits) for more detals. # Turnaround Time and Chunking Often, especially for shorter files, your transcript will be ready in 5 minutes or less. It generally takes no longer than 15 minutes to return longer audios. If you require faster turn around time please contact <[email protected]> Chunking is the act of breaking audio files into smaller segments. Rev.ai uses this method to decrease turnaround time of audios greater than 3 minutes in length. # Webhooks If the optional `callback_url` is provided, the API will make an HTTP POST request to the `callback_url` with the following request body when the job either completes successfull

Bearer token7 endpoints

Detect Language

Text Analysis

Detects text language

API key

Listed from APIs.guru (CC0).