Download OpenAPI specification:Download
Hiveo document verification API.
Through this API you can: * Classify and extract data for a given document * Classify, extract data and validate a given document against Hiveo validation rules
This Hiveo API is organised around REST and JSON, and uses standard HTTP response codes, verbs and authentication.
The Hiveo API is accessed through an generic URL. If you want to call a specific version of the Hiveo API, use the x-version HTTP header to specify it. For example:
x-version:1.0
Any breaking changes to the API will be introduced through a new version number.
Non-breaking changes may be introduced without changing version. These may include additional fields to JSON data structures, optional parameters to API calls, new features that can be exposed through existing API calls, or new API calls.
Our API versioning uses 2 digits, such as major.minor (1.0, 1.1…). An increment in the major digit means that ground-breaking changes have been introduced (ex: rework on entire resources, major changes in the authentication system…).
To access to the documentation of a specific version, use /version/v<version number>.html.
For example, for version 1.0: #tag/v1.0.
All endpoints require authentication. We use the Client Credentials Grant type.
To authenticate API requests, you must provide a valid bearer token in an HTTP header:
Authorization: Bearer {bearer_token}
Here is an example authentication request for the Client Credentials Grant type:
POST /auth/realms/hiveo/protocol/openid-connect/token HTTP/1.1
Host: https://authstaging.hiveo.fr
Content-Type: application/x-www-form-urlencoded
Authorization: Basic c3ViY2xpYzpjZDg5ZjM1OC1iMjhiLTRiMjktYjBhZC0wNWEzYjcxMWFjZDc=
Content-Type: application/x-www-form-urlencoded
client_secret=<your client secret>&client_id=<your client id>&grant_type=client_credentials&scope=openid
Hiveo uses conventional HTTP response codes to indicate the success or failure of an API request.
In general:
| HTTP code | Label | Meaning |
|---|---|---|
| 200 | OK | Success |
| 206 | OK | Not exactly one resulting prediction (you should ask user advice) |
| 400 | Bad Request | The request was unacceptable, often due to missing a required parameter |
| 401 | Unauthorized | No valid API key provided |
| 402 | Request Failed | The parameters were valid but the request failed |
| 403 | Forbidden | The API key doesn’t have permissions to perform the request |
| 404 | Not Found | The requested resource doesn’t exist |
| 415 | Unsupported Media Type | The request does not support this type of media |
| 429 | Too Many Requests | Too many requests hit the API too quickly |
| 500, 502, 503, 504 | Server Errors | Something went wrong on Hiveo’s side |
Try to classify and then extract data of a document.
An extraction query requires:
| organisationId required | string [ 1 .. 1024 ] characters The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash. |
| classificationId | string 36 characters the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type |
object (Document) The input document as base64-encoded bytes. Currently only "application/pdf" are supported. | |
| knownDocumentType | string Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard The Hiveo document type. |
required | object (ClassificationResult) The result of a classification request. Each result has its own id for future reference. You can store the file informations if you need to extract data or validate the document in a sequential call. |
object (extractions) The extraction results for a given file (and possibly multiple document types). |
required | object (ClassificationResult) The result of a classification request. Each result has its own id for future reference. You can store the file informations if you need to extract data or validate the document in a sequential call. |
{- "document": {
- "bytes": "string"
}, - "organisationId": "FR-84122605300012",
- "knownDocumentType": "fr_kbis",
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
}{- "classification": {
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "documentTypes": [
- "fr_kbis"
], - "rawPrediction": "[fr_kbis:0.7916]"
}, - "extractions": {
- "extractions": [
- {
- "data": [
- {
- "field": "organisation_national_id",
- "value": "841226053",
- "accuracy": 0.99
}, - {
- "field": "verification_code",
- "value": "3fkzBAiPQZ",
- "accuracy": 0.99
}
], - "documentType": "fr_kbis",
- "extractionId": "63404f92-12b3-45b5-8d5f-4b6a41df3466"
}
]
}
}Try to classify and then extract data of a document on asynchronous way.
An extraction query requires:
| organisationId required | string [ 1 .. 1024 ] characters The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash. |
| classificationId | string 36 characters the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type |
object (Document) The input document as base64-encoded bytes. Currently only "application/pdf" are supported. | |
| knownDocumentType | string Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard The Hiveo document type. |
| jobId required | string 36 characters UUID of the created job |
| startDate | string [ 10 .. 24 ] characters Creation date job |
| status | string Status of the job at starting |
{- "document": {
- "bytes": "string"
}, - "organisationId": "FR-84122605300012",
- "knownDocumentType": "fr_kbis",
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
}{- "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "startDate": "2022-05-20T13:34:07.150Z",
- "status": "IN PROGRESS"
}Try to classify the document, then extract data and use them to validate the document against Hiveo rules.
An analysis query requires:
| organisationId required | string [ 1 .. 1024 ] characters The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash. |
| classificationId | string 36 characters the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type |
object (Document) The input document as base64-encoded bytes. Currently only "application/pdf" are supported. | |
| knownDocumentType | string Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard The Hiveo document type. |
required | object (ClassificationResult) The result of a classification request. Each result has its own id for future reference. You can store the file informations if you need to extract data or validate the document in a sequential call. |
object (extractions) The extraction results for a given file (and possibly multiple document types). | |
object (validations) The validation results contain:
|
required | object (ClassificationResult) The result of a classification request. Each result has its own id for future reference. You can store the file informations if you need to extract data or validate the document in a sequential call. |
{- "document": {
- "bytes": "string"
}, - "organisationId": "FR-84122605300012",
- "knownDocumentType": "fr_kbis",
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
}{- "classification": {
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "documentTypes": [
- "fr_kbis"
], - "rawPrediction": "[fr_kbis:0.7916]"
}, - "extractions": {
- "extractions": [
- {
- "data": [
- {
- "field": "organisation_national_id",
- "value": "841226053",
- "accuracy": 0.99
}, - {
- "field": "verification_code",
- "value": "3fkzBAiPQZ",
- "accuracy": 0.99
}
], - "documentType": "fr_kbis",
- "extractionId": "63404f92-12b3-45b5-8d5f-4b6a41df3466"
}
]
}, - "validations": {
- "validations": {
- "validationId": "aa09c02a-52d9-4792-b5e1-0312808d9bde",
- "documentType": "fr_kbis",
- "usable": true,
- "valid": true,
- "validations": [
- {
- "valid": true,
- "blocking": false,
- "field": "issue_date",
- "value": "01/03/2021",
- "name": "validity-start",
- "version": "1.0",
- "labelCode": "validity-start",
- "fieldReadOnly": true
}
], - "data": [
- {
- "field": "organisation_national_id",
- "value": "841226053",
- "accuracy": 0.99
}, - {
- "field": "verification_code",
- "value": "3fkzBAiPQZ",
- "accuracy": 0.99
}
]
}, - "usable": true,
- "valid": true
}
}Try to classify the document, then extract data and use them to validate the document against Hiveo rules. Async job is launched.
An analysis query requires:
| organisationId required | string [ 1 .. 1024 ] characters The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash. |
| classificationId | string 36 characters the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type |
object (Document) The input document as base64-encoded bytes. Currently only "application/pdf" are supported. | |
| knownDocumentType | string Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard The Hiveo document type. |
| jobId required | string 36 characters UUID of the created job |
| startDate | string [ 10 .. 24 ] characters Creation date job |
| status | string Status of the job at starting |
{- "document": {
- "bytes": "string"
}, - "organisationId": "FR-84122605300012",
- "knownDocumentType": "fr_kbis",
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
}{- "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "startDate": "2022-05-20T13:34:07.150Z",
- "status": "IN PROGRESS"
}Get the result of an asynchronous job
| jobId required | string Example: 205e5851-f8b1-41ab-84e0-ee9bba7ad0b6 The Hiveo ID of the job |
| endDate | string [ 10 .. 24 ] characters End date of the job |
| jobId | string 36 characters UUID of the job |
object (Analysis result sample) The results contain the unitary results of each step:
| |
| startDate | string [ 10 .. 24 ] characters Requested date of the job |
| status | string Current status of the job |
var axios = require('axios'); var config = { method: 'get', url: 'https://apistaging.hiveo.fr/documents/jobs/39f12476-8125-4dc5-b4ec-c2b49b9b77e1', headers: { 'x-version': '1.0', 'Authorization': 'Bearer {{access_token}}' } }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
{- "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "startDate": "2022-05-20T13:34:07.150Z",
- "status": "SUCCEEDED",
- "endDate": "2022-05-20T13:39:21.627Z",
- "result": {
- "classification": {
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "documentTypes": [
- "fr_kbis"
], - "rawPrediction": "[fr_kbis:0.7916]"
}, - "extractions": {
- "extractions": [
- {
- "data": [
- {
- "field": "organisation_national_id",
- "value": "841226053",
- "accuracy": 0.99
}, - {
- "field": "verification_code",
- "value": "3fkzBAiPQZ",
- "accuracy": 0.99
}
], - "documentType": "fr_kbis",
- "extractionId": "63404f92-12b3-45b5-8d5f-4b6a41df3466"
}
]
}
}
}Try to classify and then extract data of a document.
An extraction query requires:
| organisationId required | string [ 1 .. 1024 ] characters The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash. |
| classificationId | string 36 characters the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type |
object (Document) The input document as base64-encoded bytes. Currently only "application/pdf" are supported. | |
| knownDocumentType | string Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard The Hiveo document type. |
required | object (ClassificationResult) The result of a classification request. Each result has its own id for future reference. You can store the file informations if you need to extract data or validate the document in a sequential call. |
object (extractions) The extraction results for a given file (and possibly multiple document types). |
required | object (ClassificationResult) The result of a classification request. Each result has its own id for future reference. You can store the file informations if you need to extract data or validate the document in a sequential call. |
{- "document": {
- "bytes": "string"
}, - "organisationId": "FR-84122605300012",
- "knownDocumentType": "fr_kbis",
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
}{- "classification": {
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "documentTypes": [
- "fr_kbis"
], - "rawPrediction": "[fr_kbis:0.7916]"
}, - "extractions": {
- "extractions": [
- {
- "data": [
- {
- "field": "organisation_national_id",
- "value": "841226053",
- "accuracy": 0.99
}, - {
- "field": "verification_code",
- "value": "3fkzBAiPQZ",
- "accuracy": 0.99
}
], - "documentType": "fr_kbis",
- "extractionId": "63404f92-12b3-45b5-8d5f-4b6a41df3466"
}
]
}
}Try to classify the document, then extract data and use them to validate the document against Hiveo rules.
An analysis query requires:
| organisationId required | string [ 1 .. 1024 ] characters The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash. |
| classificationId | string 36 characters the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type |
object (Document) The input document as base64-encoded bytes. Currently only "application/pdf" are supported. | |
| knownDocumentType | string Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard The Hiveo document type. |
required | object (ClassificationResult) The result of a classification request. Each result has its own id for future reference. You can store the file informations if you need to extract data or validate the document in a sequential call. |
object (extractions) The extraction results for a given file (and possibly multiple document types). | |
object (validations) The validation results contain:
|
required | object (ClassificationResult) The result of a classification request. Each result has its own id for future reference. You can store the file informations if you need to extract data or validate the document in a sequential call. |
{- "document": {
- "bytes": "string"
}, - "organisationId": "FR-84122605300012",
- "knownDocumentType": "fr_kbis",
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
}{- "classification": {
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "documentTypes": [
- "fr_kbis"
], - "rawPrediction": "[fr_kbis:0.7916]"
}, - "extractions": {
- "extractions": [
- {
- "data": [
- {
- "field": "organisation_national_id",
- "value": "841226053",
- "accuracy": 0.99
}, - {
- "field": "verification_code",
- "value": "3fkzBAiPQZ",
- "accuracy": 0.99
}
], - "documentType": "fr_kbis",
- "extractionId": "63404f92-12b3-45b5-8d5f-4b6a41df3466"
}
]
}, - "validations": {
- "validations": {
- "validationId": "aa09c02a-52d9-4792-b5e1-0312808d9bde",
- "documentType": "fr_kbis",
- "usable": true,
- "valid": true,
- "validations": [
- {
- "valid": true,
- "blocking": false,
- "field": "issue_date",
- "value": "01/03/2021",
- "name": "validity-start",
- "version": "1.0",
- "labelCode": "validity-start",
- "fieldReadOnly": true
}
], - "data": [
- {
- "field": "organisation_national_id",
- "value": "841226053",
- "accuracy": 0.99
}, - {
- "field": "verification_code",
- "value": "3fkzBAiPQZ",
- "accuracy": 0.99
}
]
}, - "usable": true,
- "valid": true
}
}Try to classify and then extract data of a document on asynchronous way.
An extraction query requires:
| organisationId required | string [ 1 .. 1024 ] characters The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash. |
| classificationId | string 36 characters the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type |
object (Document) The input document as base64-encoded bytes. Currently only "application/pdf" are supported. | |
| knownDocumentType | string Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard The Hiveo document type. |
| jobId required | string 36 characters UUID of the created job |
| startDate | string [ 10 .. 24 ] characters Creation date job |
| status | string Status of the job at starting |
{- "document": {
- "bytes": "string"
}, - "organisationId": "FR-84122605300012",
- "knownDocumentType": "fr_kbis",
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
}{- "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "startDate": "2022-05-20T13:34:07.150Z",
- "status": "IN PROGRESS"
}Try to classify the document, then extract data and use them to validate the document against Hiveo rules. Async job is launched.
An analysis query requires:
| organisationId required | string [ 1 .. 1024 ] characters The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash. |
| classificationId | string 36 characters the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type |
object (Document) The input document as base64-encoded bytes. Currently only "application/pdf" are supported. | |
| knownDocumentType | string Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard The Hiveo document type. |
| jobId required | string 36 characters UUID of the created job |
| startDate | string [ 10 .. 24 ] characters Creation date job |
| status | string Status of the job at starting |
{- "document": {
- "bytes": "string"
}, - "organisationId": "FR-84122605300012",
- "knownDocumentType": "fr_kbis",
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
}{- "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "startDate": "2022-05-20T13:34:07.150Z",
- "status": "IN PROGRESS"
}Get the result of an asynchronous job
| jobId required | string Example: 205e5851-f8b1-41ab-84e0-ee9bba7ad0b6 The Hiveo ID of the job |
| endDate | string [ 10 .. 24 ] characters End date of the job |
| jobId | string 36 characters UUID of the job |
object (Analysis result sample) The results contain the unitary results of each step:
| |
| startDate | string [ 10 .. 24 ] characters Requested date of the job |
| status | string Current status of the job |
var axios = require('axios'); var config = { method: 'get', url: 'https://apistaging.hiveo.fr/documents/jobs/39f12476-8125-4dc5-b4ec-c2b49b9b77e1', headers: { 'x-version': '1.0', 'Authorization': 'Bearer {{access_token}}' } }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
{- "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "startDate": "2022-05-20T13:34:07.150Z",
- "status": "SUCCEEDED",
- "endDate": "2022-05-20T13:39:21.627Z",
- "result": {
- "classification": {
- "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
- "documentTypes": [
- "fr_kbis"
], - "rawPrediction": "[fr_kbis:0.7916]"
}, - "extractions": {
- "extractions": [
- {
- "data": [
- {
- "field": "organisation_national_id",
- "value": "841226053",
- "accuracy": 0.99
}, - {
- "field": "verification_code",
- "value": "3fkzBAiPQZ",
- "accuracy": 0.99
}
], - "documentType": "fr_kbis",
- "extractionId": "63404f92-12b3-45b5-8d5f-4b6a41df3466"
}
]
}
}
}