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
- Category
- Text Analysis
- Version
- 1.0
- Endpoints
- 135
- OpenAPI
- Specification ↗
- Spec updated
- 2023-03-06
Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /about/release_notes | get_release_notes |
| GET | /about/version | get_version |
| POST | /auth | Login and retrieve a JWT Token |
| GET | /auth/api-key | Get all API-Key |
| POST | /auth/api-key | Create 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/ephemeral | Create a new ephemeral token |
| POST | /auth/get_JWTdeprecated | Create a new JWT Token |
| POST | /auth/reset_password | Reset the user password |
| POST | /auth/token | Create a new token |
| GET | /connections | Get all Connections |
| POST | /connections | Create connection |
| GET | /connections/{connection_id} | Get connection |
| PATCH | /connections/{connection_id} | Update connection |
| DELETE | /connections/{connection_id} | Delete a connection |
| GET | /data_retention_settings | Get 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_output | Generate custom output for documents |
| POST | /documents/enrich | post_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_versions | post_document_compare_versions_resource |
| GET | /documents/{document_id}/custom_output | Get custom output formatted document |
| POST | /documents/{document_id}/feedback | Submit a feedback |
| GET | /documents/{document_id}/last_version | Get latest version |
| GET | /documents/{document_id}/original_file | Get 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_annotation | Process a table-level annotation |
| POST | /documents/{document_id}/reprocess | Schedule document reprocessing |
| GET | /documents/{document_id}/reverse/{page_range} | get_document_reverse_resource |
| POST | /documents/{document_id}/status_data | Update document status |
| GET | /documents/{document_id}/text | Get the document text |
| GET | /documents/{document_id}/workflow | Get the document Workflow |
| POST | /documents/{inbox_id} | Upload a new doc to the inbox |
| PATCH | /documents/{inbox_id}/copy_inbox | Copy documents to another inbox |
| PATCH | /documents/{inbox_id}/move_inbox | Move documents to another inbox |
| GET | /formats | Get lists of format |
| POST | /formats | Create format |
| GET | /formats/document_types | Get 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_fields | Get tags values |
| GET | /inboxes | Get list of inboxes |
| POST | /inboxes | Create 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_versions | get_inbox_document_versions_resource |
| GET | /inboxes/{inbox_id}/documents | Get documents in the inbox |
| DELETE | /inboxes/{inbox_id}/documents | Delete documents |
| GET | /inboxes/{inbox_id}/paginated | Get paginated list of documents in the inbox |
| POST | /inboxes/{inbox_id}/reprocess | Schedule 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}/activate | get_email_integration_activation_resource |
| GET | /predictor_settings | Get 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 | /projects | Get the list of projects |
| POST | /projects | Create a project |
| GET | /projects/{project_id} | Get project attributes |
| PATCH | /projects/{project_id} | Update project |
| DELETE | /projects/{project_id} | Delete project |
| GET | /reports | Get all reports |
| POST | /reports | Create report |
| POST | /reports/generate | Generate 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}/generate | Generate report based on report id |
| GET | /roles | Get all roles |
| POST | /roles | Create role |
| GET | /roles/{role_id} | Get role |
| PATCH | /roles/{role_id} | Update role |
| DELETE | /roles/{role_id} | Delete a role |
| GET | /rule_config | Get 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_settings | Get 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.
Similar text analysis APIs
Compare alternatives →Google Cloud Natural
Text AnalysisNatural language understanding technology, including sentiment, entity and syntax analysis
LanguageTool
Text AnalysisStyle and Grammar Checker for 25+ Languages
Tisane
Text AnalysisText Analytics with focus on detection of abusive content and law enforcement applications
LibreTranslate
Text AnalysisTranslation tool with 17 available languages
Asynchronous Speech-To-Text API Documentation
Text AnalysisRev.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
Detect Language
Text AnalysisDetects text language
Listed from APIs.guru (CC0).