UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 120 kB
{"openapi":"3.0.0","servers":[{"url":"//cfportal.contract-p.fit/api"}],"x-hasEquivalentPaths":true,"info":{"description":"This OpenAPI describes the API exposed by the contract.fit backend.\n\n## Security\n\n### Authentication\n\nAll endpoints are protected: you need to make authenticated calls. There are 3 authentication mechanisms:\n- HTTP Basic (Username + Password)\n- JWT Token\n- API-Key\n\nBy 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.\n\nIf you are missing credentials or permissions, please [contact us](https://contract.fit/contact-us).\n\n### Authorization\n\nThe security system is RBAC based: users must be granted scoped roles, allowing them to access resources.\nEach role grants a defined set of permissions, which can be restricted to a given inbox or document - see */roles* endpoints.\n\n## Upload and Processing\n\nBelow is a short description of common use cases of the API.\n\n### Simple Upload\n\nThe 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.\n\nThis 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.\n\n### Upload to Inbox\n\nThe favored endpoint to upload files is POST /documents/{inbox_id}: it is also highly recommended to make async call using sync=false.\n\n**Sync / Async**\n\nFor convenience uploads can be synchronous: it will make the request blocks until the document is processed.\n\nIt 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.\n\nAsynchronous 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}*.\n\n### Reprocessing\n\nYou 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)\n","title":"Contract.fit API","version":"1.0","x-apisguru-categories":["text"],"x-origin":[{"format":"openapi","url":"https://cfportal.contract-p.fit/swagger.json","version":"3.0"}],"x-providerName":"contract-p.fit"},"security":[{"basic":[]},{"token":[]}],"tags":[{"description":"File manipulation endpoint","name":"documents"},{"description":"Inbox manipulation endpoint","name":"inboxes"},{"description":"Project manipulation endpoint","name":"projects"},{"description":"Format manipulation endpoint","name":"formats"},{"description":"Integrations manipulation endpoint","name":"integrations"},{"description":"Connection manipulation endpoint","name":"connections"},{"description":"User manipulation endpoint","name":"auth"},{"description":"various endpoints to manage third party credentials","name":"sso"},{"description":"User manipulation endpoint","name":"users"},{"description":"Role manipulation endpoint","name":"roles"},{"description":"Settings endpoint","name":"settings"},{"description":"SettingThreshold manipulation endpoint","name":"threshold_settings"},{"description":"Style endpoint","name":"style"},{"description":"stats manipulation endpoint","name":"stats"},{"description":"SettingSampling manipulation endpoint","name":"sampling_settings"},{"description":"Predictor settings manipulation endpoint","name":"predictor_settings"},{"description":"Rule config manipulation endpoint","name":"rule_config"},{"description":"Data Retention Settings manipulation endpoint","name":"data_retention_settings"},{"description":"Report manipulation endpoint","name":"reports"},{"description":"About the contract.fit solution","name":"about"},{"description":"tenant manipulation endpoints","name":"tenant"}],"paths":{"/about/release_notes":{"get":{"operationId":"get_release_notes","responses":{"200":{"description":"Success"}},"tags":["about"]}},"/about/version":{"get":{"operationId":"get_version","responses":{"200":{"description":"Success"}},"tags":["about"]}},"/auth":{"post":{"description":"Login with the provided credentials (POST data) and return a JWT Token for this user.","operationId":"post_auth","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthModel"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenReplyModel"}}},"description":"Success"},"401":{"description":"Wrong credentials"}},"summary":"Login and retrieve a JWT Token","tags":["auth"]}},"/auth/api-key":{"get":{"description":"**Permission required:** view_api_keys","operationId":"get_api_keys_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/APIKeyModel"},"type":"array"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"API-Key not found"}},"summary":"Get all API-Key","tags":["auth"]},"post":{"description":"API Keys are simple randomly generated strings bound to roles that grant access to resources.\n\nEvery API Key maps to attributes defining its validity and can be revoked at any time.\n\nAPI Key can be passed in the **X-API-Key** HTTP Header and in the querystring **&api_key=**\n\n\n**Permission required:** edit_backend_settings","operationId":"post_api_keys_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/APIKeyRequest"},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Role not found"}},"summary":"Create a new API Key","tags":["auth"]}},"/auth/api-key/inbox/{inbox_id}":{"get":{"description":"**Permission required:** view_api_keys","operationId":"get_api_keys_inbox_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/APIKeyModel"},"type":"array"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"API-Key not found"}},"summary":"Get all API-Keys for this inbox","tags":["auth"]},"parameters":[{"in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}],"post":{"description":"The requesting user needs to have inbox level permissions\n\nAPI Keys are simple randomly generated strings bound to roles that grant access to resources.\n\nEvery API Key maps to attributes defining its validity and can be revoked at any time.\n\nAPI Key can be passed in the **X-API-Key** HTTP Header and in the querystring **&api_key=**\n\n\n**Permission required:** edit_backend_settings","operationId":"post_api_keys_inbox_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/APIKeyRequest"},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Role not found"}},"summary":"Create a new API Key on inbox level","tags":["auth"]}},"/auth/api-key/{key}":{"delete":{"description":"Completely remove an API Key, thus disabling it. The token won't be recoverable\n\n**Permission required:** edit_backend_settings","operationId":"delete_api_key_resource","responses":{"204":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Delete an API Key","tags":["auth"]},"get":{"description":"**Permission required:** view_api_keys","operationId":"get_api_key_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get details of an API-Key","tags":["auth"]},"parameters":[{"in":"path","name":"key","required":true,"schema":{"type":"string"}}],"patch":{"description":"**roles** can't be modified after creation: you need to create a new token if you want other roles.\n\n**Permission required:** edit_backend_settings","operationId":"patch_api_key_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Edit an API-Key","tags":["auth"]}},"/auth/ephemeral":{"post":{"description":"Ephemeral tokens are short lived tokens that can be used to temporary grant access to resources.","operationId":"post_ephemeral_token_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenReplyModel"}}},"description":"Success"},"404":{"description":"User not found"}},"summary":"Create a new ephemeral token","tags":["auth"]}},"/auth/get_JWT":{"post":{"deprecated":true,"description":"## This endpoint is *deprecated* : use /auth/ephemeral and /auth/token instead\n\nThis endpoint requires authentication and requires the user to have the role **edit_users**: you can\nthen request a JWT on behalf of another user, specified in the request **username** attribute.\n\nThis endpoint has 2 modes depending on the presence or absence of the *roles* attribute in the request\ndata:\n\n## Regular token\n\nWhen sending only a **username**: a regular JWT Token bound to the given user is created and returned.\n\n## Temporary token\n\nWhen sending **username** AND a list **roles** of **role** (defined by the UID, optional the inbox to restrict access to):\na temporary token is created that will behave like a regular user with the given roles until the access token expires.\n\n**Permission required:** edit_users","operationId":"post_get_jwt_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/TokenModelBase"},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenReplyModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Create a new JWT Token","tags":["auth"]}},"/auth/logout":{"post":{"operationId":"post_logout_resource","responses":{"204":{"description":"Success"},"400":{"description":"Logout impossible"}},"summary":"Revoke the current token, effectively logging out the user","tags":["auth"]}},"/auth/reset_password":{"post":{"operationId":"post_reset_password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordModelPost"}}},"required":true},"responses":{"204":{"description":"No Content"},"403":{"description":"Reset Denied"}},"summary":"Reset the user password","tags":["auth"]}},"/auth/token":{"post":{"description":"Bearer tokens can be used to authenticated without session or without sending credentials.\n\nIf the user making the request has sufficient privileges, he is allowed to create a token on behalf of another user.\nOtherwise only a token for the request current user is allowed.\n\n\n**Permission required:** edit_users","operationId":"post_token_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/TokenModelBase"},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenReplyModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Create a new token","tags":["auth"]}},"/connections":{"get":{"description":"Return the list of set up connections\n\n**Permission required:** edit_integrations","operationId":"get_connections_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ConnectionModelGet"},"type":"array"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get all Connections","tags":["connections"]},"post":{"description":"Create a new connection bound to the given scope (can be a project or inbox)\n\n**Permission required:** edit_integrations","operationId":"post_connections_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/ConnectionModelPost"},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Create connection","tags":["connections"]}},"/connections/{connection_id}":{"delete":{"description":"Delete the given connection.\n\n**WARNING** This will completely remove the connection, this is not recoverable\n\n**Permission required:** edit_integrations","operationId":"delete_connection_resource","responses":{"204":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Delete a connection","tags":["connections"]},"get":{"description":"Return the connection attributes\n\n**Permission required:** edit_integrations","operationId":"get_connection_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get connection","tags":["connections"]},"parameters":[{"in":"path","name":"connection_id","required":true,"schema":{"type":"string"}}],"patch":{"description":"attributes\n\n**Permission required:** edit_integrations","operationId":"patch_connection_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/ConnectionModelPost"},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Update connection","tags":["connections"]}},"/data_retention_settings":{"get":{"description":"**Permission required:** read_data_retention_settings","operationId":"get_data_retention_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DataRetentionModel"},"type":"array"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get all data retention settings","tags":["data_retention_settings"]}},"/data_retention_settings/{level}/{id}":{"delete":{"description":"**Permission required:** edit_data_retention_settings","operationId":"delete_data_retention_resource","responses":{"204":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Delete scoped sampling settings","tags":["data_retention_settings"]},"get":{"description":"**Permission required:** read_data_retention_settings","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRetentionModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get scoped data retention settings","tags":["data_retention_settings"]},"parameters":[{"in":"path","name":"level","required":true,"schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"patch":{"description":"**Permission required:** edit_data_retention_settings","operationId":"patch_data_retention_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRetentionModelPatch"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRetentionModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Update scoped data retention settings","tags":["data_retention_settings"]}},"/documents/":{"post":{"description":"This endpoint is a simplified version of the upload document to inbox one - synchronous mode.\n\nThe upload file will be upload to the given inbox if provided, else fallback to the **invoice** inbox.\nThe file will be processed synchronously, ie the request will blocks until the document was processed\n*or* until it timeout; in this case the document might **not** be correctly processed.\n\n\nFor a more reliable processing use the /documents/{inbox_id} endpoint in async mode\n\n\n**Permission required:** upload","operationId":"post_simple_documents_resource","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"experimental":{"description":"Use the experimental processing workflow","type":"boolean"},"file":{"description":"File to process","format":"binary","type":"string"},"inbox_id":{"description":"Inbox to use. Default to the **invoice** inbox","type":"string"},"key_value_flag":{"default":true,"description":"If true the result will only contain a mapping of prediction = value","type":"boolean"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Upload a new document","tags":["documents"]}},"/documents/custom_output":{"post":{"description":"Using the provided filter on documents, will generate a custom output.\n\n**Note:** only excel output is supported at the moment.\n\n**Permission required:** review","operationId":"post_document_custom_output_resource","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomOutputPost"}}},"required":true},"responses":{"200":{"description":"File Attached"},"403":{"description":"Permission insufficient"}},"summary":"Generate custom output for documents","tags":["documents"]}},"/documents/enrich":{"post":{"operationId":"post_enrichment_resource","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentModelPost"}}},"required":true},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"tags":["documents"]}},"/documents/file_query/{data_type}":{"parameters":[{"description":"Define the data that you want to get out. Possible options: ['document', 'reverse', 'text']","in":"path","name":"data_type","required":true,"schema":{"default":"document","type":"string"}}],"post":{"operationId":"post_document_data_resource","requestBody":{"$ref":"#/components/requestBodies/DocumentIds"},"responses":{"200":{"description":"Success"},"400":{"description":"Unsupported argument"},"403":{"description":"Permission insufficient"},"422":{"description":"Document list invalid"}},"tags":["documents"]}},"/documents/query/{query_type}":{"parameters":[{"in":"path","name":"query_type","required":true,"schema":{"type":"string"}}],"post":{"operationId":"post_document_query","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregationPipelinePost"}}},"required":true},"responses":{"200":{"description":"Success"}},"tags":["documents"]}},"/documents/{document_id}":{"delete":{"description":"how parameter: if how == \"FULL\", we delete the entire document, including its source files\nif how == \"SOURCE_FILES\", we only remove the (source) files and we set the archived flag. In practice this means\nall information in the database (json) remains available, but you can no longer download / visualise the original document.\n\n**WARNING** The removal (of source files and in the database) is permanent\n\n\n**Permission required:** review","operationId":"delete_document_delete_resource","parameters":[{"in":"query","name":"how","schema":{"default":"predicted","enum":["FULL","SOURCE_FILES"],"type":"string"}}],"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Delete the document","tags":["documents"]},"get":{"description":"Simple endpoint that will fetch the given document\n\n**Permission required:** review","operationId":"get_document_delete_resource","responses":{"403":{"description":"Permission insufficient"}},"summary":"Get the document","tags":["documents"]},"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}]},"/documents/{document_id}/custom_output":{"get":{"description":"If you have a custom output configured (this is set by contract.fit team), This allows you to\nget the custom output formatted document.\n\n\n**Permission required:** review","operationId":"get_document_transform_resource","responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"No custom output"}},"summary":"Get custom output formatted document","tags":["documents"]},"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}]},"/documents/{document_id}/feedback":{"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}],"post":{"description":"Send a feedback for the given document and optionally evaluate.\n\nWhen a document is to be reviewed, this endpoint is used to send the user feedback.\n\n**Permission required:** submit","operationId":"post_document_submit_eval_resource","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionPost"}}},"required":true},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Submit a feedback","tags":["documents"]}},"/documents/{document_id}/last_version":{"get":{"description":"Get the latest possible version for this document, optionally with constraints on the source or name\n\n**Permission required:** review","operationId":"get_document_last_version_resource","parameters":[{"description":"Return a specific named version, default is latest","in":"query","name":"name","schema":{"type":"string"}},{"description":"human or machine (default either)","in":"query","name":"source","schema":{"type":"string"}},{"description":"Do you want to receive unevaluated version (for display, default) or evaluated (for stats)","in":"query","name":"is_evaluated","schema":{"default":false,"type":"boolean"}}],"responses":{"403":{"description":"Permission insufficient"}},"summary":"Get latest version","tags":["documents"]},"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}]},"/documents/{document_id}/original_file":{"get":{"description":"Return the document original file, as attachment.\n\n**Permission required:** review","operationId":"get_document_original_file_resource","responses":{"200":{"description":"File attached"},"403":{"description":"Permission insufficient"}},"summary":"Get document original file","tags":["documents"]},"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}]},"/documents/{document_id}/page/{page_range}":{"get":{"operationId":"get_document_page_image_resource","responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"tags":["documents"]},"parameters":[{"description":"The number of the page, starting from 0. A range of pages, separated by \":\" is also allowed to return a zip file.","in":"path","name":"page_range","required":true,"schema":{"type":"string"}},{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}]},"/documents/{document_id}/page_thumbnail/{page_range}":{"get":{"operationId":"get_document_page_image_thumbnail_resource","responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"tags":["documents"]},"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}},{"in":"path","name":"page_range","required":true,"schema":{"type":"string"}}]},"/documents/{document_id}/process_table_annotation":{"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}],"post":{"description":"A fast and convenient annotation tool that converts a table-level annotation to cell-level feedback.\n\n**Permission required:** review","operationId":"post_document_process_table_annotation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableAnnotationPost"}}},"required":true},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Process a table-level annotation","tags":["documents"]}},"/documents/{document_id}/reprocess":{"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}],"post":{"description":"This endpoint schedules (async) reprocessing for the given document;\nit will call the async processing with the given desired version name,\nsimilar to the async document upload but skipping OCR.\nIt works asynchronously, so results need to be consulted by a separate call (or webhook)\n\n\n**Permission required:** upload","operationId":"post_reprocess_document_resource","parameters":[{"in":"query","name":"name","schema":{"default":"reprocessed","type":"string"}},{"description":"If human repcrocessing is triggered, the last version will become the passed version. No processing is done.","in":"query","name":"reviewer","schema":{"default":"Machine","enum":["Human","Machine"],"type":"string"}},{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Schedule document reprocessing","tags":["documents"]}},"/documents/{document_id}/reverse/{page_range}":{"get":{"operationId":"get_document_reverse_resource","responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"tags":["documents"]},"parameters":[{"description":"The number of the page, starting from 0. A range of pages, separated by \":\" is also allowed to return a zip file.","in":"path","name":"page_range","required":true,"schema":{"type":"string"}},{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}]},"/documents/{document_id}/status_data":{"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}],"post":{"description":"Update the given document status data with the request user and date.\n\nEach document defines some status:\n- lock\n- escalate\n- reject\n- delete\n- archive\n- submitted\n\nThese fields have 3 attributes:\n- status true / false\n- since: datetime (UTC)\n- by: user ID\n\nBy calling this endpoint you can update the given status data with the request user\n(the one authenticated) and the current datetime.\n**Note** : You cannot pass a user in the request nor a datetime\n\n**Permission required:** review","operationId":"post_document_status_data_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusDataPost"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Update document status","tags":["documents"]}},"/documents/{document_id}/text":{"get":{"description":"Return the optimal text for the document; will either be the OCR text, the native text,\nthe raw text or a translated version.\n\nTo ease the data volume from the DB, we lazy load only the relevant text for the document.\n\n**Permission required:** review","operationId":"get_document_text_resource","responses":{"403":{"description":"Permission insufficient"}},"summary":"Get the document text","tags":["documents"]},"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}]},"/documents/{document_id}/workflow":{"get":{"description":"**WARNING experimental use only**\n\n\n**Permission required:** upload","operationId":"get_document_workflow_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowModel"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get the document Workflow","tags":["documents"]},"parameters":[{"in":"path","name":"document_id","required":true,"schema":{"type":"string"}}]},"/documents/{inbox_id}":{"parameters":[{"in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}],"post":{"description":"This endpoint uploads a new file to the given inbox and will process the file.\n\n## Upload mode: sync\n\nWhen sync=true (default), the call will block and wait for the processing to complete.\n\nIf you have a custom output configured (this is set by contract.fit team),\npassing mimetype *application/vnd.cf.custom* will allow you to get the custom output formatted result\n\nSince it might yield inconsistent results if a timeout is raised while waiting,\nit is recommended to use the **async** mode.\n\n## Upload mode: async\n\nWhen sync=false, the call will schedule the processing and return without waiting for completion.\nIt will return the document ID, so that the processed document can be retrieved at a later date.\n\n**Permission required:** upload","operationId":"post_documents_resource","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"experimental":{"description":"Use the experimental processing workflow","type":"boolean"},"file":{"description":"File to process","format":"binary","type":"string"},"key_value_flag":{"default":false,"description":"If true the result will only contain a mapping of prediction = value","type":"boolean"},"sync":{"default":true,"description":"Flag enable sync or async processing","type":"boolean"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"},"415":{"description":"Image Recognition Error"}},"summary":"Upload a new doc to the inbox","tags":["documents"]}},"/documents/{inbox_id}/copy_inbox":{"parameters":[{"description":"The uuid of the inbox where the document(s) should be copied to","in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}],"patch":{"description":"Copy documents in the provided list to another inbox.\n\nIf the destination inbox is the same as the original inbox, the request will be aborted, no duplicates\nwill be created\n\n\n**Permission required:** review","operationId":"patch_document_copy_resource","requestBody":{"$ref":"#/components/requestBodies/DocumentIds"},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Copy documents to another inbox","tags":["documents"]}},"/documents/{inbox_id}/move_inbox":{"parameters":[{"description":"The uuid of the inbox where the document(s) have to be moved","in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}],"patch":{"description":"Move documents in the provided list to another inbox.\n\nIf the destination inbox is the same as the original inbox, the request will be aborted.\n\n\n**Permission required:** review","operationId":"patch_document_move_resource","requestBody":{"$ref":"#/components/requestBodies/DocumentIds"},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Move documents to another inbox","tags":["documents"]}},"/formats":{"get":{"description":"Return the formats\n\n**Deprecated**: display_name\n**Deprecated**: default_format","operationId":"get_formats_resource","responses":{"200":{"description":"Success"}},"summary":"Get lists of format","tags":["formats"]},"post":{"description":"Create an new format\n\n**Deprecated**: display_name\n**Deprecated**: default_format\n\n**Permission required:** edit_format_settings","operationId":"post_formats_resource","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormatModelPost"}}},"required":true},"responses":{"403":{"description":"Permission insufficient"}},"summary":"Create format","tags":["formats"]}},"/formats/document_types":{"get":{"description":"**Permission required:** edit_format_settings","operationId":"get_formats_doc_types_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTypeModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get supported document_types","tags":["formats"]}},"/formats/{format_id}":{"delete":{"description":"**WARNING** This will completely remove the documents, this is **not recoverable**\n\n**Permission required:** edit_format_settings","operationId":"delete_format_resource","responses":{"204":{"description":"No Content"},"403":{"description":"Permission insufficient"}},"summary":"Delete the format","tags":["formats"]},"get":{"description":"Return the given format attributes\n\n**Deprecated**: display_name\n**Deprecated**: default_format\n\n**Permission required:** edit_format_settings / review","operationId":"get_format_resource","responses":{"403":{"description":"Permission insufficient"}},"summary":"Get format attributes","tags":["formats"]},"parameters":[{"in":"path","name":"format_id","required":true,"schema":{"type":"string"}}],"patch":{"description":"settings with the given attributes\n\n**Deprecated**: display_name\n**Deprecated**: default_format\n\n**Permission required:** edit_format_settings","operationId":"patch_format_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormatModelPatch"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormatModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Update the format","tags":["formats"]}},"/formats/{scope}/tag_fields":{"get":{"description":"Get the tag fields values bound to the given scope.\n\nScope can be an inbox or a project\n\n\n**Permission required:** edit_format_settings / review","operationId":"get_format_tag_fields_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagFieldModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get tags values","tags":["formats"]},"parameters":[{"in":"path","name":"scope","required":true,"schema":{"type":"string"}}]},"/inboxes":{"get":{"description":"Simply return the list of inboxes","operationId":"get_inboxes_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InboxModelGet"},"type":"array"}}},"description":"Success"}},"summary":"Get list of inboxes","tags":["inboxes"]},"post":{"description":"Create a new inbox in the given **project**\n\n**Permission required:** create_inbox","operationId":"post_inboxes_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxModelPost"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Project Not Found"}},"summary":"Create an inbox","tags":["inboxes"]}},"/inboxes/{inbox_id}":{"delete":{"description":"Delete the given inbox.\n\n**WARNING** This will completely remove the inbox, this is not recoverable","operationId":"delete_inbox_resource","responses":{"204":{"description":"Success"},"404":{"description":"Not Found"}},"summary":"Delete an inbox","tags":["inboxes"]},"get":{"description":"Get the given inbox attributes\n\n**Permission required:** view_list","operationId":"get_inbox_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Get Inbox attributes","tags":["inboxes"]},"parameters":[{"in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}],"patch":{"description":"Update the given inbox with the provided arguments\n\n**Permission required:** view_list","operationId":"patch_inbox_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxModelPatch"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Update inbox","tags":["inboxes"]}},"/inboxes/{inbox_id}/compare_versions":{"parameters":[{"in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}],"post":{"operationId":"post_inbox_compare_resource","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionCompare"}}},"required":true},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"tags":["inboxes"]}},"/inboxes/{inbox_id}/document_versions":{"get":{"operationId":"get_inbox_document_versions_resource","responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"tags":["inboxes"]},"parameters":[{"in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}]},"/inboxes/{inbox_id}/documents":{"delete":{"description":"in the given inbox.\n\nhow parameter: if how == \"FULL\", we delete the entire document, including its source files\nif how == \"SOURCE_FILES\", we only remove the (source) files and we set the archived flag. In practice this means\nall information in the database (json) remains available, but you can no longer download / visualise the original document.\n\nwhat parameter: if what == \"DONE\", we will only delete files which have status_data.feedback == True\nif what == \"ALL\" we will delete all files\n\nStart_date and end_date: when specified we will only delete files which are received after (respectively before) the timestamp\n\n**WARNING** This will completely remove the documents, this is **not recoverable**","operationId":"delete_inbox_document_resource","parameters":[{"in":"query","name":"how","schema":{"default":"FULL","enum":["FULL","SOURCE_FILES"],"type":"string"}},{"in":"query","name":"what","schema":{"default":"ALL","enum":["ALL","DONE"],"type":"string"}},{"in":"query","name":"start_date","schema":{"format":"date-time","type":"string"}},{"in":"query","name":"end_date","schema":{"format":"date-time","type":"string"}}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found"}},"summary":"Delete documents","tags":["inboxes"]},"get":{"description":"**Permission required:** view_list","operationId":"get_inbox_document_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DocumentModelGet"},"type":"array"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Get documents in the inbox","tags":["inboxes"]},"parameters":[{"in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}]},"/inboxes/{inbox_id}/paginated":{"get":{"description":"**Permission required:** view_list","operationId":"get_inbox_paginated_resource","parameters":[{"description":"Page number to fetch","in":"query","name":"page","schema":{"default":1,"type":"integer"}},{"description":"Results per page","in":"query","name":"per_page","schema":{"default":20,"type":"integer"}},{"in":"query","name":"start_receive_date","schema":{"format":"date-time","type":"string"}},{"in":"query","name":"end_receive_date","schema":{"format":"date-time","type":"string"}},{"description":"comma seperated list of fields to order by","in":"query","name":"order_by","schema":{"type":"string"}},{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DocumentModelPaginated"},"type":"array"}}},"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Get paginated list of documents in the inbox","tags":["inboxes"]},"parameters":[{"in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}]},"/inboxes/{inbox_id}/reprocess":{"parameters":[{"in":"path","name":"inbox_id","required":true,"schema":{"type":"string"}}],"post":{"description":"This endpoint schedule reprocessing for documents in the given inbox; this will call the async processing,\njust like async document upload\n\n\n**Permission required:** upload","operationId":"post_inbox_reprocess_resource","parameters":[{"in":"query","name":"name","schema":{"default":"predicted","type":"string"}},{"description":"If human repcrocessing is triggered, the last version will become the passed version. No processing is done.","in":"query","name":"reviewer","schema":{"default":"Machine","enum":["Human","Machine"],"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"hints":{"description":"Additional hints as a dictionary. Example: {\"VAT_number\":{\"blacklist\":\"XXXX.XXX.XXX\", \"whitelist\": [\"YYYY.YYY.YYY\", \"ZZZZ.ZZZ.ZZZ\"]}}","type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Schedule inbox reprocessing","tags":["inboxes"]}},"/integrations/":{"get":{"description":"Return the list of set up integrations\n\n**Permission required:** read_integrations","operationId":"get_integration_resources","responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get all integrations","tags":["integrations"]},"post":{"description":"Create a new integration. Each type of integration has its own initialization logic and thus may\nyield suitable error codes depending on the underlying issue, such as credentials or connectivity issue.\n\n**Permission required:** edit_integrations","operationId":"post_integration_resources","requestBody":{"$ref":"#/components/requestBodies/IntegrationModelGet"},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Create integration","tags":["integrations"]}},"/integrations/{integration_id}":{"delete":{"description":"Delete the given integration.\n\n**WARNING** This will completely remove the integration, this is not recoverable\n\n**Permission required:** edit_integrations","operationId":"delete_integration_resource","responses":{"204":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Delete an integration","tags":["integrations"]},"get":{"description":"Return the given integration attributes\n\n**Permission required:** read_integrations","operationId":"get_integration_resource","responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Get integration attributes","tags":["integrations"]},"parameters":[{"in":"path","name":"integration_id","required":true,"schema":{"type":"string"}}],"patch":{"description":"Update the given integration attributes\n\n**Permission required:** edit_integrations","operationId":"patch_integration_resource","requestBody":{"$ref":"#/components/requestBodies/IntegrationModelGet"},"responses":{"200":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Update integration","tags":["integrations"]}},"/integrations/{integration_id}/activate":{"get":{"operationId":"get_email_integration_activation_resource","parameters":[{"in":"query","name":"secret","required":true,"schema":{"type":"string"}}],"responses":{"302":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"tags":["integrations"]},"parameters":[{"in":"path","name":"integration_id","required":true,"schema":{"type":"string"}}]},"/predictor_settings":{"get":{"description":"**Permission required:** edit_predictor_settings","operationId":"get_predictor_settings_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PredictorModelGet"},"type":"array"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get all predictor settings","tags":["predictor_settings"]}},"/predictor_settings/{scope}":{"delete":{"description":"**Permission required:** edit_predictor_settings","operationId":"delete_predictor_setting_resource","responses":{"204":{"description":"Success"},"403":{"description":"Permission insufficient"},"404":{"description":"Not Found"}},"summary":"Delete scoped predictor settings","tags":["predictor_settings"]},"get":{"description":"**Permission required:** edit_predictor_settings","operationId":"get_predictor_setting_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictorModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Get scoped predictor settings","tags":["predictor_settings"]},"parameters":[{"in":"path","name":"scope","required":true,"schema":{"type":"string"}}],"patch":{"description":"**Permission required:** edit_predictor_settings","operationId":"patch_predictor_setting_resource","parameters":[{"description":"An optional fields mask","in":"header","name":"X-Fields","schema":{"format":"mask","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictorSettingModel"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictorModelGet"}}},"description":"Success"},"403":{"description":"Permission insufficient"}},"summary":"Update scoped predictor settings","tags":["predictor_settings"]}},"/projects":{"get":{"description":"Return the list of projects in the organization\n\n\n**Deprecated**: default_format","operationId":"get_projects_resource","responses":{"200":{"description":"Success"}},"summary":"Get the list of projects","tags":["projects"]},"post":{"description":"Simply create a new project\n\n**Deprecated**: default_format\n\n**Permission required:** create_inbox","operationId":"post_projects_resource","requestBody":{"content":{"application/json":{"schema":{"$ref":"